コード例 #1
0
  //  @Test
  public void testReadEquipmentParametersF3() throws Exception {
    CommandItem commandItem = new CommandItem();
    commandItem.setIdentifier("10040003");

    CollectObject obj = new CollectObject();
    obj.setLogicalAddr("96123456");
    obj.setMpSn(new int[] {0});
    obj.AddCommandItem(commandItem);

    MTO_376 MTO3 = new MTO_376();
    MTO3.addCollectObject(obj);

    RealTimeProxy376 instance = proxy;
    long SequenceCode = instance.readParameters(MTO3);

    this.taskService.insertRecvMsg(
        SequenceCode,
        "96123456",
        "55 68 A2 00 A2 00 68 98 12 96 56 34 00 0A 60 00 00 04 00 C0 A8 00 01 90 1F C0 A8 00 02 90 1F 5A 4A 44 4C 2E 5A 4A 00 00 00 00 00 00 00 00 00 6F 16 55 ");

    Map<String, Map<String, String>> expResult = new HashMap();
    Map<String, String> MapDataItem = new HashMap();

    MapDataItem.put("1004000301", "192.168.0.1:8080"); // 主用IP地址和端口
    MapDataItem.put("1004000302", "192.168.0.2:8080"); // 备用IP地址和端口
    MapDataItem.put("1004000303", "ZJDL.ZJ"); // APN

    expResult.put("96123456#0#10040003", MapDataItem);
    Map result = instance.getReturnByReadParameter(SequenceCode);
    assertEquals(expResult, result);
  }
コード例 #2
0
  //  @Test
  public void testReadEquipmentParametersF9() throws Exception {
    CommandItem commandItem = new CommandItem();
    commandItem.setIdentifier("10040009");

    CollectObject obj = new CollectObject();
    obj.setLogicalAddr("96123456");
    obj.setMpSn(new int[] {0});
    obj.AddCommandItem(commandItem);

    MTO_376 MTO3 = new MTO_376();
    MTO3.addCollectObject(obj);

    RealTimeProxy376 instance = proxy;
    long SequenceCode = instance.readParameters(MTO3);

    this.taskService.insertRecvMsg(
        SequenceCode,
        "96123456",
        "55 68 72 00 72 00 68 98 12 96 56 34 00 0A 60 00 00 01 01 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 26 16 55 ");

    Map<String, Map<String, String>> expResult = new HashMap();
    Map<String, String> MapDataItem = new HashMap();

    MapDataItem.put(
        "1004000901",
        "1111111111111111111111111111111111111111111111111111111111111111"); // 主用IP地址和端口
    MapDataItem.put(
        "1004000902",
        "1111111111111111111111111111111111111111111111111111111111111111"); // 事件重要性等级标志位

    expResult.put("96123456#0#10040009", MapDataItem);
    Map result = instance.getReturnByReadParameter(SequenceCode);
    assertEquals(expResult, result);
  }
コード例 #3
0
  //  @Test
  public void testReadEquipmentParametersF1() throws Exception {
    CommandItem commandItem = new CommandItem();
    commandItem.setIdentifier("10040001");

    CollectObject obj = new CollectObject();
    obj.setLogicalAddr("96123456");
    obj.setMpSn(new int[] {0});
    obj.AddCommandItem(commandItem);

    MTO_376 MTO3 = new MTO_376();
    MTO3.addCollectObject(obj);

    RealTimeProxy376 instance = proxy;
    long SequenceCode = instance.readParameters(MTO3);

    this.taskService.insertRecvMsg(
        SequenceCode,
        "96123456",
        "55 68 4A 00 4A 00 68 98 12 96 56 34 00 0A 60 00 00 01 00 0A 14 1E 03 07 0F 8A 16 55  ");

    Map<String, Map<String, String>> expResult = new HashMap();
    Map<String, String> MapDataItem = new HashMap();

    MapDataItem.put("1004000101", "10"); // 终端数传机延时时间RTS
    MapDataItem.put("1004000102", "20"); // 终端作为启动站允许发送传输延时时间
    MapDataItem.put("1004000103", "30"); // 终端等待从动站响应的超时时间
    MapDataItem.put("1004000104", "3"); // 终端等待从动站响应的重发次数
    MapDataItem.put("1004000106", "11100000"); // 需要主站确认的通信服务(CON=1)的标志
    MapDataItem.put("1004000107", "15"); // 心跳周期

    expResult.put("96123456#0#10040001", MapDataItem);
    Map result = instance.getReturnByReadParameter(SequenceCode);
    assertEquals(expResult, result);
  }
コード例 #4
0
  //  @Test
  public void testReadEquipmentParametersF10() throws Exception {
    Map datacellParams10 = new TreeMap();
    datacellParams10.put("1004001001", "1"); // 主用IP地址和端口

    CircleDataItems circleDataItems = new CircleDataItems();
    for (int i = 1; i <= 3; i++) {
      DataItemGroup group = new DataItemGroup();
      group.AddDataItem(
          new DataItem("1004001002000" + i, String.valueOf(i))); // 本次配置第0001块电能表/交流采样装置序号
      circleDataItems.AddDataItemGroup(group);
    }

    CommandItem commandItem = new CommandItem();
    commandItem.setIdentifier("10040010");
    commandItem.setDatacellParam(datacellParams10);
    commandItem.setCircleDataItems(circleDataItems);

    CollectObject obj = new CollectObject();
    obj.setLogicalAddr("96123456");
    obj.setMpSn(new int[] {0});
    obj.AddCommandItem(commandItem);

    MTO_376 MTO3 = new MTO_376();
    MTO3.addCollectObject(obj);

    RealTimeProxy376 instance = proxy;
    long SequenceCode = instance.readParameters(MTO3);

    //        this.taskService.insertRecvMsg(SequenceCode, "96123456", "55 68 A2 00 A2 00 68 98 12
    // 96 56 34 00 0A 60 00 00 04 00 C0 A8 00 01 90 1F C0 A8 00 02 90 1F 5A 4A 44 4C 2E 5A 4A 00 00
    // 00 00 00 00 00 00 00 6F 16 55 ");
    //        this.taskService.insertRecvMsg(SequenceCode, "96123456", "55 68 A2 00 A2 00 68 98 12
    // 96 56 34 00 0A 60 00 00 04 00 C0 A8 00 01 90 1F C0 A8 00 02 90 1F 5A 4A 44 4C 2E 5A 4A 00 00
    // 00 00 00 00 00 00 00 6F 16 55 ");

    //        Map datacellParams10 = new TreeMap();
    //        datacellParams10.put("1004001001","1");//本次电能表/交流采样装置配置数量
    //        CircleDataItems circleDataItems = new CircleDataItems();
    //        DataItemGroup diGroup1 = new DataItemGroup();
    //        diGroup1.AddDataItem(new DataItem("10040010020001","1"));//本次配置第0001块电能表/交流采样装置序号
    //        diGroup1.AddDataItem(new DataItem("10040010030001","1"));//本次配置第0001块电能表/交流采样装置所属测量点号
    //        diGroup1.AddDataItem(new DataItem("10040010040001","6"));//本次配置第0001块电能表/交流采样装置通信波特率
    //        diGroup1.AddDataItem(new DataItem("10040010050001","1"));//本次配置第0001块电能表/交流采样装置通信端口号
    //        diGroup1.AddDataItem(new
    // DataItem("10040010060001","100"));//本次配置第0001块电能表/交流采样装置通信协议类型
    //        diGroup1.AddDataItem(new DataItem("10040010070001","0"));//本次配置第0001块电能表/交流采样装置通信地址
    //        diGroup1.AddDataItem(new DataItem("10040010080001","0"));//本次配置第0001块电能表/交流采样装置通信密码
    //        diGroup1.AddDataItem(new
    // DataItem("10040010100001","000001"));//本次配置第0001块电能表/交流采样装置电能费率个数
    //        diGroup1.AddDataItem(new
    // DataItem("10040010120001","00"));//本次配置第0001块电能表/交流采样装置有功电能示值的整数位个数
    //        diGroup1.AddDataItem(new
    // DataItem("10040010130001","00"));//本次配置第0001块电能表/交流采样装置有功电能示值的小数位个数
    //        diGroup1.AddDataItem(new
    // DataItem("10040010140001","999999999999"));//本次配置第0001块电能表/交流采样装置所属采集器通信地址
    //        diGroup1.AddDataItem(new
    // DataItem("10040010150001","0000"));//本次配置第0001块电能表/交流采样装置所属的用户大类号
    //        diGroup1.AddDataItem(new
    // DataItem("10040010160001","0000"));//本次配置第0001块电能表/交流采样装置所属的用户小类号

    //        expResult.put("96123456#0#10040010",MapDataItem);
    //        Map result = instance.getReturnByREP(SequenceCode);
    //        assertEquals(expResult, result);
  }