public class ttt {
public static void main(String[] args) {
int ret = 0;
int ProgramID = 0;
int AreaID = 0;
int FileID = 0;
String LedSystemIP;
LedSystemIP = "192.168.1.101";
MethodOfLED methodOfLED=new MethodOfLED();
try {
methodOfLED.AddTextArea(ProgramID,
"EX File Program",
30, 1, AreaID, 0, 0, 64, 64,
"FileArea", 0, 0, 0, 0, FileID,
"D:\\testled.rtf", 0, 5, 5, 0, 0, 0, LedSystemIP);
methodOfLED.SendProgram(ret,LedSystemIP,0);
methodOfLED.DeleteTheProgram(ret,ProgramID,LedSystemIP);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/*try {
//******************************************************************************************************
// 实例1: 发送“文本”节目( 一个节目,一个区域,轮播)
Class class1 = Class.forName("JavaLedFun");
Method[] methods = class1.getMethods();
for (Method method : methods) {
System.out.println(method.getName());
Class<?>[] parameterTypes=method.getParameterTypes();
for(Class<?> parameterType:parameterTypes) {
System.out.println(parameterType.getName());
}
}
java.lang.reflect.Method method = class1.getMethod("AddTextArea",
new Class<?>[] {int.class,String.class,
int.class,int.class,int.class,int.class,
int.class,int.class,int.class,String.class,
int.class,int.class,int.class,int.class,
int.class,String.class,int.class,int.class,
int.class,int.class,int.class,int.class,
String.class});
Object class2=class1.newInstance();
method.invoke(class2,
new Object[] {ProgramID,
"EX File Program",
30, 1, AreaID, 0, 0, 64, 64,
"FileArea", 0, 0, 0, 0, FileID,
"D:\\testled.rtf", 0, 5, 5, 0, 0, 0, LedSystemIP});
java.lang.reflect.Method method2=class1.getDeclaredMethod("SendProgram", new Class[] {String.class,int.class});
ret = (Integer)(method2.invoke(class2, LedSystemIP,0));
if(ret == 1)
{
System.out.println("Send Success !\n");
}
else
{
System.out.println("Send Failed !\n");
}
java.lang.reflect.Method method3=class1.getDeclaredMethod("DeleteTheProgram", new Class[] {int.class,String.class});
ret = (Integer)(method3.invoke(class2, ProgramID,LedSystemIP));
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (NoSuchMethodException e1) {
e1.printStackTrace();
}catch(IllegalAccessException e2) {
e2.printStackTrace();
}catch(Exception e3) {
e3.printStackTrace();
}*/
}