houxiao
2017-03-27 3a1f77898c41a9ad3feaf6f5f03ee34ba61071ea
bug fix

git-svn-id: http://192.168.1.226/svn/proxy@198 454eff88-639b-444f-9e54-f578c98de674
1个文件已添加
2个文件已修改
752 ■■■■ 已修改文件
ProxyConsole/config.json 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ProxyConsole/config.mediaalarm8.json 508 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ProxyConsole/proxyconsole-hc.cpp 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ProxyConsole/config.json
@@ -8,6 +8,7 @@
    "equipments" : [
    
        {
            "id" : 1,
            "type" : 4,
@@ -29,12 +30,41 @@
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 1,
                "dwWinNo" : [1,2],
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 1,
            "id" : 5,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "192.168.1.6",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "192.168.1.101",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "192.168.1.66",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 5,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 3,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "192.168.1.5",
@@ -53,36 +83,14 @@
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 2,
                "dwWinNo" : 1,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 1,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "192.168.1.5",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "192.168.1.101",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "192.168.1.66",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 2,
                "byWallNo" : 1,
                "dwSubWinNo" : 3,
                "dwWinNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : [4,3],
                "lAlarmOutPort" : 1
            }
        }
    
    ]
}
ProxyConsole/config.mediaalarm8.json
New file
@@ -0,0 +1,508 @@
{
    "hcsdk" : {
        "serverIP" : "172.16.23.99",
        "serverport" : 8000,
        "username" : "admin",
        "passwd" : "a1234567"
    },
    "equipments" : [
        {
            "id" : 1,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.151",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 3,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 2,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.151",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 9,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 3,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.152",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 18,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 4,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.152",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 16,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 5,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.153",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 5,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 6,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.153",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 6,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 7,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.154",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 7,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 8,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.154",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 8,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 9,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.155",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 4,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 10,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.155",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 10,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 11,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.156",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 11,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 12,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.156",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 12,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 13,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.157",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 19,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 14,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.157",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 20,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 15,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.158",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 17,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 16,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.158",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 14,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 17,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.158",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 2,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 13,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 18,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.150",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 0,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 1,
                "lAlarmOutPort" : 1
            }
        },
        {
            "id" : 19,
            "type" : 4,
            "type_str" : "ET_HCNET_DECODER_LOGO",
            "ip" : "172.16.23.150",
            "port" : "80",
            "user" : "supervisor",
            "pass" : "supervisor",
            "serverIP" : "172.16.23.99",
            "serverport" : "8000",
            "reboot" : 0,
            "user_config" : {
                "ip" : "127.0.0.1",
                "port" : 8000,
                "username" : "admin",
                "passwd" : "admin12345",
                "channel" : 1,
                "byWallNo" : 1,
                "dwSubWinNo" : 1,
                "dwWinNo" : 2,
                "lAlarmOutPort" : 1
            }
        }
    ]
}
ProxyConsole/proxyconsole-hc.cpp
@@ -37,7 +37,7 @@
#define  HPR_OK 0
#define  HPR_ERROR -1
#define MAX_NUM 16
#define MAX_NUM 32
#define MAX 1024
#define fileread_buf 128
@@ -78,7 +78,7 @@
    int channel;
    uint16_t byWallNo;
    uint16_t dwSubWinNo;
    uint16_t dwWinNo;
    std::vector<uint16_t> dwWinNo;
    uint16_t lAlarmOutPort;
};
@@ -97,14 +97,14 @@
pthread_t thread_no[MAX_NUM];
pthread_t thread_noEQ[MAX_NUM];
pthread_t thread_Real[MAX_NUM];
sockinfo equipments[16];
int sock_upper[16],sock_down[16];
int rsock_down[16];
sockinfo equipments[MAX_NUM];
int sock_upper[MAX_NUM],sock_down[MAX_NUM];
int rsock_down[MAX_NUM];
char byte_array[2600];
int bbbbb=0;
int CommandEquipIdx=0;
int CommandKind[16];
char sessionIDs[16][5];
int CommandKind[MAX_NUM];
char sessionIDs[MAX_NUM][5];
char linkequip_ip[32];
char linkequip_port[10];
@@ -113,8 +113,8 @@
int NUM=0,equip_num=0;
int SupperConnectedflag[16]={0,},EquipConnectedflag[16]={0,},serverflag=0,GPIO_flag=0;
int EquipRealAlarmConnectedflag[16];
int SupperConnectedflag[MAX_NUM]={0,},EquipConnectedflag[MAX_NUM]={0,},serverflag=0,GPIO_flag=0;
int EquipRealAlarmConnectedflag[MAX_NUM];
timer_t* timerID;
std::vector<std::string> SupperConnectedIP;
@@ -139,12 +139,12 @@
int GPIO_READ(int PortNum);
void GPIO_WRITE(int PortNum,unsigned char DATA);
int RealEventStart(int Idx);
int gCapturing[16];
char sessions[16][10];
int gCapturing[MAX_NUM];
char sessions[MAX_NUM][10];
int n=0,m=0,k=0;
unsigned char DownBuffer[16][614000];
int DownCount[16];
unsigned char DownBuffer[MAX_NUM][614000];
int DownCount[MAX_NUM];
int gCount=0;
int gCount30s=0;
int gCount2s=0;
@@ -170,10 +170,10 @@
    gCount2s++;
    if(gCount2s>=8){
        gCount2s=0;
        for(;CommandEquipIdx<16;CommandEquipIdx++){//connected
        for(;CommandEquipIdx<MAX_NUM;CommandEquipIdx++){//connected
            if(EquipConnectedflag[CommandEquipIdx]>0) break;
        }
        if(CommandEquipIdx>=16){
        if(CommandEquipIdx>=MAX_NUM){
            CommandEquipIdx = 0;
        }
    }
@@ -287,11 +287,12 @@
int hcnetsdk_get_userid(const std::string& decode_ip)
{
    hcnetsdk_user_t::const_iterator iter = g_hcnetsdk_user.find(decode_ip);
    if(iter == g_hcnetsdk_user.end())
        return -1;
    else
        return iter->second;
    return hcnetsdk_user;
    //hcnetsdk_user_t::const_iterator iter = g_hcnetsdk_user.find(decode_ip);
    //if(iter == g_hcnetsdk_user.end())
    //    return -1;
    //else
    //    return iter->second;
}
void CALLBACK hcnetsdk_ExceptionCallBack(DWORD dwType, LONG lUserID, LONG lHandle, void *pUser)
@@ -479,7 +480,7 @@
    LONG lUserID;
    NET_DVR_DEVICEINFO_V30 struDeviceInfo;
    lUserID = NET_DVR_Login_V30((char*)g_hcnetsdkconfig.serverIP.c_str(), g_hcnetsdkconfig.serverport,
    hcnetsdk_user = lUserID = NET_DVR_Login_V30((char*)g_hcnetsdkconfig.serverIP.c_str(), g_hcnetsdkconfig.serverport,
        (char*)g_hcnetsdkconfig.username.c_str(), (char*)g_hcnetsdkconfig.passwd.c_str(), &struDeviceInfo);
    if (lUserID < 0) {
        printf("NET_DVR_Login_V30 failed, err: %d\n", NET_DVR_GetLastError());
@@ -494,7 +495,7 @@
    return lUserID;
}
HCNetCameraConfig* hcnetsdk_find_config(const std::string& decoder_ip)
HCNetCameraConfig* hcnetsdk_find_config(const sockinfo& oldEquipConfig, int newChannel)
{
    for (size_t i = 0; i < NUM; i++)
    {
@@ -502,8 +503,11 @@
        if (equip->m_type > ET_HCNET_DECODER__FIRST || equip->m_type < ET_HCNET_DECODER__LAST)
        {
            HCNetCameraConfig* camConfig = (HCNetCameraConfig*)equip->user_config;
            if (camConfig != NULL && equip->serverIP == decoder_ip)
                return camConfig;
            if (camConfig != NULL && strcmp(equip->ip, oldEquipConfig.ip) == 0)
            {
                if (camConfig->channel == newChannel)
                    return camConfig;
            }
        }
    }
    
@@ -544,13 +548,13 @@
int hcnetsdk_alarm_logo(LONG lUserID, const HCNetCameraConfig& _camConfig, const std::string& ip, int channel, bool disalarm)
{
    HCNetCameraConfig camConfig(_camConfig);
    if (camConfig.channel != channel)
    {
        camConfig.channel = -1;
        sockinfo* equipConfig = hcnetsdk_find_equip(ip, channel);
        if (equipConfig != NULL)
            camConfig = *(HCNetCameraConfig*)(equipConfig->user_config);
    }
    //if (camConfig.channel != channel)
    //{
    //    camConfig.channel = -1;
    //    sockinfo* equipConfig = hcnetsdk_find_equip(ip, channel);
    //    if (equipConfig != NULL)
    //        camConfig = *(HCNetCameraConfig*)(equipConfig->user_config);
    //}
    
    printf("hcnetsdk_alarm_logo, channel=%d, matchc=%d\n", channel, camConfig.channel);
    
@@ -571,17 +575,23 @@
    net_dvr_win_logo_cfg.dwSize = sizeof(net_dvr_win_logo_cfg);
    //设置窗口输出logo
    int byWallNo=1,dwSubWinNo=2,dwWinNo=1;
    DWORD dwDecChanNum=(camConfig.byWallNo << 24) | (camConfig.dwSubWinNo << 16) | camConfig.dwWinNo;
    if(!NET_DVR_SetDVRConfig(lUserID,NET_DVR_SET_WIN_LOGO_CFG,dwDecChanNum,&net_dvr_win_logo_cfg,net_dvr_win_logo_cfg.dwSize))
    for (int i= 0; i < camConfig.dwWinNo.size(); i++)
    {
        printf("NET_DVR_SetDVRConfig2 error, err: %d\n", NET_DVR_GetLastError());
        return -1;
        DWORD dwDecChanNum=(camConfig.byWallNo << 24) | (camConfig.dwSubWinNo << 16) | camConfig.dwWinNo[i];
        if(!NET_DVR_SetDVRConfig(lUserID,NET_DVR_SET_WIN_LOGO_CFG,dwDecChanNum,&net_dvr_win_logo_cfg,net_dvr_win_logo_cfg.dwSize))
        {
            printf("NET_DVR_SetDVRConfig2 error, err: %d\n", NET_DVR_GetLastError());
            //return -1;
        }
        else
        {
            printf("NET_DVR_SetDVRConfig2 done.\n");
            //return 0;
        }
    }
    else
    {
        printf("NET_DVR_SetDVRConfig2 done.\n");
        //return 0;
    }
    return 0;
    
    //sleep(3);
    //net_dvr_win_logo_cfg.byEnable = 0;
@@ -809,6 +819,7 @@
void* MyEquipmentthread(void* arg)
 {
   int eidx = (int)arg;   
   const sockinfo& equipConfig(equipments[eidx]);
   printf("Step.3 ===%d=====>RealTimeEvent Thread is strarted......\n",eidx);
   int length=0;
@@ -841,10 +852,35 @@
                }
            }
            
            if (channel==1)
            {
                int aa=1;//#todo break
            }
            if(gCapturing[eidx]==1)
            {
                //add 20170327
                const std::string& ip(equipConfig.ip);
                const HCNetCameraConfig* camConfig =  (HCNetCameraConfig*)equipConfig.user_config;
                camConfig = hcnetsdk_find_config(equipConfig, channel);
                int lUserData = hcnetsdk_get_userid(ip);
                if (camConfig != NULL && hcnetsdk_user >= 0)
                {
                    std::cout << "......alarm begin k=" << k << std::endl;
                    if (equipConfig.m_type == ET_HCNET_DECODER_ALARMOUT && !isDisalarm)
                        hcnetsdk_alarm_alarmout(lUserData, *camConfig);
                    else if (equipConfig.m_type == ET_HCNET_DECODER_LOGO)
                        hcnetsdk_alarm_logo(lUserData, *camConfig, ip, channel, isDisalarm);
                    std::cout << "......alarm end k=" << k << std::endl;
                }
                else
                {
                    std::cout << "alarm lost k=" << k << std::endl;
                }
                int k;
                for(k=0;k<16;k++)
                for(k=0;k<MAX_NUM;k++)
                {
                    //if(SupperConnectedflag[k]==1)
                    //{
@@ -878,28 +914,28 @@
                        //printf("%s",buff);
                    //}
                    //else
                    {
                        if(SupperConnectedIP.size() > k)
                        {
                            const std::string& ip(SupperConnectedIP[k]);
                            sockinfo* equipConfig = hcnetsdk_find_equip(ip);
                            HCNetCameraConfig* camConfig =  hcnetsdk_find_config(ip);
                            int lUserData = hcnetsdk_get_userid(ip);
                            if (camConfig != NULL && equipConfig != NULL && lUserData >= 0)
                            {
                                std::cout << "......alarm begin k=" << k << std::endl;
                                if (equipConfig->m_type == ET_HCNET_DECODER_ALARMOUT && !isDisalarm)
                                    hcnetsdk_alarm_alarmout(lUserData, *camConfig);
                                else if (equipConfig->m_type == ET_HCNET_DECODER_LOGO)
                                    hcnetsdk_alarm_logo(lUserData, *camConfig, ip, channel, isDisalarm);
                                std::cout << "......alarm end k=" << k << std::endl;
                            }
                            else
                            {
                                std::cout << "alarm lost k=" << k << std::endl;
                            }
                        }
                    }
                    //{
                    //    if(SupperConnectedIP.size() > k)
                    //    {
                    //        const std::string& ip(SupperConnectedIP[k]);
                    //        sockinfo* equipConfig = hcnetsdk_find_equip(ip);
                    //        HCNetCameraConfig* camConfig =  hcnetsdk_find_config(ip);
                    //        int lUserData = hcnetsdk_get_userid(ip);
                    //        if (camConfig != NULL && equipConfig != NULL && lUserData >= 0)
                    //        {
                    //            std::cout << "......alarm begin k=" << k << std::endl;
                    //            if (equipConfig->m_type == ET_HCNET_DECODER_ALARMOUT && !isDisalarm)
                    //                hcnetsdk_alarm_alarmout(lUserData, *camConfig);
                    //            else if (equipConfig->m_type == ET_HCNET_DECODER_LOGO)
                    //                hcnetsdk_alarm_logo(lUserData, *camConfig, ip, channel, isDisalarm);
                    //            std::cout << "......alarm end k=" << k << std::endl;
                    //        }
                    //        else
                    //        {
                    //            std::cout << "alarm lost k=" << k << std::endl;
                    //        }
                    //    }
                    //}
                }
                continue;    
            }
@@ -968,7 +1004,21 @@
            camConfig->channel = jsonUserConfig["channel"].asInt();
            camConfig->byWallNo = jsonUserConfig["byWallNo"].asInt();
            camConfig->dwSubWinNo = jsonUserConfig["dwSubWinNo"].asInt();
            camConfig->dwWinNo = jsonUserConfig["dwWinNo"].asInt();
            Json::Value dwWinNoArrays = jsonUserConfig["dwWinNo"];
            if (dwWinNoArrays.isArray())
            {
                const int s = (int)(dwWinNoArrays.size());
                for(int i = 0; i < s; i++)
                {
                    camConfig->dwWinNo.push_back(dwWinNoArrays[i].asInt());
                }
            }
            else
            {
                camConfig->dwWinNo.push_back(dwWinNoArrays.asInt());
            }
            camConfig->lAlarmOutPort = jsonUserConfig["lAlarmOutPort"].asInt();
        }