00001
00002
00003
00004
00005
00006 class SampleModule {
00007 private static GModule module;
00008 public static long init(long mod_addr, String mod_name, int argc, String[] argv){
00009 module = new GModule(mod_addr, mod_name);
00010 System.out.println("Hello, world, from Java!");
00011 System.out.println("\tmod_name = "+ mod_name);
00012 System.out.println("\tmod_addr = "+ Long.toHexString(mod_addr));
00013 GridlabD.output("This is our first attempt to use a C callback from Java!");
00014 GridlabD.warning("This is a warning from Java");
00015 GridlabD.error("We really don't like having Java go sideways!");
00016 GridlabD.debug("Squish!");
00017 GridlabD.testmsg("This is only a test...");
00018 GridlabD.output("we can find powerflow.dll at " + GridlabD.findfile("powerflow.dll"));
00019
00020
00021
00022 GClass c1 = GClass.BuildClass("my_java_class", module, 4);
00023 c1.AddProperty("bingo", "char8");
00024 c1.AddProperty("zingo", "int16");
00025 c1.AddProperty("zango", "complex");
00026 c1.AddProperty("zingo", "double");
00027
00028
00029 GClass c2 = GClass.BuildClass("SampleClass", module, 4);
00030 SampleClass.register(c2);
00031 return module.GetFirstClassAddr();
00032 }
00033 public static int do_kill(){
00034
00035 return 0;
00036 }
00037 public static int check(){
00038 return 0;
00039 }
00040 public static int import_file(String filename){
00041 return 0;
00042 }
00043 public static int export_file(String filename){
00044 return 0;
00045 }
00046 public static int setvar(String varname, String value){
00047 return 0;
00048 }
00049 public static int module_test(int argc, String[] argv){
00050 return 0;
00051 }
00052 public static int cmdargs(int argc, String[] argv){
00053 return 0;
00054 }
00055
00056 public static String kmldump(long object_addr){
00057 return "";
00058 }
00059
00060 }