Esempio n. 1
0
 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) {
     }
   }
 }
Esempio n. 2
0
  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");
    }
  }