コード例 #1
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
  public void jButton4_actionPerformed(ActionEvent e) {
    if (rtc != null) {
      boolean b =
          rtc.SendSelfDefinedMsg(
              Integer.parseInt(txt_AppID.getText()),
              txt_zdljdz.getText().toCharArray(),
              Integer.parseInt(txt_gyh.getText()),
              Integer.parseInt(txt_txfs.getText()),
              Integer.parseInt(txt_mlxh.getText()),
              txt_content.getText().length(),
              txt_content.getText().toCharArray(),
              0);
      try {
        Thread.sleep(1000);
      } catch (InterruptedException ex) {
      }
      rtc.SendSelfDefinedMsg(
          Integer.parseInt(txt_AppID.getText()) + 100,
          txt_zdljdz.getText().toCharArray(),
          Integer.parseInt(txt_gyh.getText()),
          Integer.parseInt(txt_txfs.getText()),
          Integer.parseInt(txt_mlxh.getText()),
          txt_content.getText().length(),
          txt_content.getText().toCharArray(),
          0);

      if (b) {
        System.out.println("send success!");
      } else {
        System.out.println("send fail!");
      }
    } else {
      System.out.println("no object,create it first");
    }
  }
コード例 #2
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton12_actionPerformed(ActionEvent e) {
   List<TerminalInfoStruct> TerminalInfo = new LinkedList<TerminalInfoStruct>();
   List<DataContentStruct> DataContentInfo = new LinkedList<DataContentStruct>();
   for (int i = 0; i < 50; i++) {
     TerminalInfo.clear();
     DataContentInfo.clear();
     TerminalInfoStruct tis = new TerminalInfoStruct();
     int l = 91010001 + i;
     String s = Integer.toString(l);
     tis.TerminalAddress =
         ("" + s.substring(0, 4) + s.substring(6, 8) + s.substring(4, 6)).toCharArray();
     tis.TerminalCommType = 40;
     tis.TerminalProtocol = 80;
     TerminalInfo.add(tis);
     DataContentStruct dcs = new DataContentStruct();
     dcs.DataContentLength = txt_content.getText().length();
     dcs.DataContent = txt_content.getText().toCharArray();
     DataContentInfo.add(dcs);
     rtc.SendBatchToFep(
         Integer.parseInt(txt_AppID.getText()),
         TerminalInfo.size(),
         TerminalInfo,
         DataContentInfo,
         txt_gnm.getText().toCharArray(),
         0,
         0,
         0,
         0);
     try {
       Thread.sleep(1000);
     } catch (InterruptedException ex) {
     }
   }
 }
コード例 #3
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton6_actionPerformed(ActionEvent e) {
   if (rtc != null) {
     rtc.DisConnect();
   } else {
     System.out.println("no object,create it first");
   }
 }
コード例 #4
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton7_actionPerformed(ActionEvent e) {
   if (rtc != null) {
     if (rtc.SetTerminalOnLineStatus(TerminalInfoList)) {
       memo1.append("Terminal OffLine Command Send Success!" + "\r\n");
     }
   } else {
     System.out.println("no object,create it first");
   }
 }
コード例 #5
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton3_actionPerformed(ActionEvent e) {
   if (rtc != null) {
     rtc.SendShortMsg(
         txt_content.getText().toCharArray(),
         txt_content.getText().length(),
         txt_sjhm.getText().toCharArray(),
         10,
         30);
   } else {
     System.out.println("no object,create it first");
   }
 }
コード例 #6
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton9_actionPerformed(ActionEvent e) {
   java.util.List OutList = new LinkedList();
   if (rtc != null) {
     OutList = rtc.GetTerminalOnLineStatus(TerminalInfoList);
   } else {
     System.out.println("no object,create it first");
   }
   if (OutList != null) {
     for (int i = 0; i < OutList.size(); i++) {
       TerminalOnLineStatus to = (TerminalOnLineStatus) OutList.get(i);
       memo1.append(to.TerminalAddress + " OnLineStatus is " + to.OnLineStatus + "\r\n");
     }
   }
 }
コード例 #7
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton11_actionPerformed(ActionEvent actionEvent) {
   /*StructReturnMessage ci = rtc.GetNewMessage(Integer.parseInt(txt_AppID.
     getText()));
      if (ci != null) {
   memo1.append("AppID:" + ci.AppID + "\r\n");
   String FunctionCode = new String(ci.FunctionCode).trim();
   memo1.append("FunctionCode:" + FunctionCode + "\r\n");
   String ControlConde = new String(ci.ControlConde).trim();
   memo1.append("ControlConde:" + ControlConde + "\r\n");
   String SJQNR = new String(ci.SJQNR).trim();
   memo1.append("SJQNR:" + SJQNR + "\r\n");
      }*/
   List strReturnMessageList = rtc.GetNewListMessage(Integer.parseInt(txt_AppID.getText()));
   if (strReturnMessageList != null) {
     memo1.setEditable(true);
     memo1.append("AppID:" + txt_AppID.getText() + "\r\n");
     memo1.append("GetCount:" + strReturnMessageList.size() + "\r\n");
   }
 }
コード例 #8
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
 public void jButton10_actionPerformed(ActionEvent actionEvent) {
   if (rtc != null) {
     rtc.BuildCertainTerminalInfo(txt_zdljdz.getText());
   }
 }
コード例 #9
0
ファイル: RealTimeTestFrame.java プロジェクト: chooshine/fep
  public void jButton1_actionPerformed(ActionEvent e) {
    if (rtc != null) {
      //      if (!rtc.SendToFep(Integer.parseInt(txt_AppID.getText()),
      //                         txt_zdljdz.getText().toCharArray(),
      //                         Integer.parseInt(txt_gyh.getText()),
      //                         Integer.parseInt(txt_txfs.getText()), 0, 0, 0,
      //                         txt_gnm.getText().toCharArray(),
      //                         txt_content.getText().length(),
      //                         txt_content.getText().toCharArray(),
      //                         Integer.parseInt(txt_yxj.getText()), 128)) {
      //        System.out.println("error");
      //      }
      List<TerminalInfoStruct> TerminalInfo = new LinkedList<TerminalInfoStruct>();
      List<DataContentStruct> DataContentInfo = new LinkedList<DataContentStruct>();

      TerminalInfoStruct tis = new TerminalInfoStruct();
      tis.TerminalAddress =
          txt_zdljdz.getText().toCharArray(); // ("" + (12080101 + i) + "10").toCharArray();
      tis.TerminalCommType = Integer.parseInt(txt_txfs.getText());
      tis.TerminalProtocol = Integer.parseInt(txt_gyh.getText());
      TerminalInfo.add(tis);
      /* tis = new TerminalInfoStruct();
       tis.TerminalAddress = "1208010710".toCharArray(); //("" + (12080101 + i) + "10").toCharArray();
       tis.TerminalCommType = 50;
       tis.TerminalProtocol = 100;
       TerminalInfo.add(tis);
      */
      DataContentStruct dcs = new DataContentStruct();
      dcs.DataContentLength = txt_content.getText().length();
      dcs.DataContent = txt_content.getText().toCharArray();
      DataContentInfo.add(dcs);
      dcs = new DataContentStruct();
      dcs.DataContentLength = txt_content.getText().length();
      dcs.DataContent = txt_content.getText().toCharArray();
      DataContentInfo.add(dcs);

      /*for (int i = 0; i < 10; i++) {
              TerminalInfoStruct tis = new TerminalInfoStruct();
      tis.TerminalAddress = ("1208004" + ("" + i) + "10").toCharArray();
              tis.TerminalCommType = 40;
              tis.TerminalProtocol = 105;
              TerminalInfo.add(tis);
              DataContentStruct dcs = new DataContentStruct();
              dcs.DataContentLength = txt_content.getText().length();
              dcs.DataContent = txt_content.getText().toCharArray();
              DataContentInfo.add(dcs);
          }
      */
      rtc.SendBatchToFep(
          Integer.parseInt(txt_AppID.getText()),
          TerminalInfo.size(),
          TerminalInfo,
          DataContentInfo,
          txt_gnm.getText().toCharArray(),
          0,
          0,
          0,
          0);
    } else {
      System.out.println("no object,create it first");
    }
  }