|
|
@@ -6401,50 +6401,47 @@ static void equipmentMintenance(void *conn)
|
|
|
cmd.obj = OBJ_OVERALL;
|
|
|
cascade_request(&cmd);
|
|
|
ack_str=ctrl_sts_ack_to_json();
|
|
|
- // GlobalBreakerManager *temp = NULL;
|
|
|
- // GlobalDeviceManager *dm = &__globalDeviceManage2;
|
|
|
- // lock_s_hold(LOCK_ID_BREAKER);
|
|
|
- // list_for_each_entry(temp, &dm->g_new_global_breaker.list, list)
|
|
|
- // {
|
|
|
- // char buff[120];
|
|
|
- // printf("get listSwitchtatusQuery infomation!!!\n");
|
|
|
- // _OverBreakerSwitchInfo *info = (_OverBreakerSwitchInfo *)
|
|
|
- // malloc(sizeof(_OverBreakerSwitchInfo));
|
|
|
- // memset(info,0,sizeof(_OverBreakerSwitchInfo));
|
|
|
- // info->product_id = temp->product_id;
|
|
|
- // sprintf(buff,"Breaker %d",temp->breaker_id);
|
|
|
- // strcpy(info->product_ch_name,buff);
|
|
|
- // sprintf(buff,"%s %d",__globalDeviceManage._globalDevInfo.product.name,temp->breaker_id);
|
|
|
- // strcpy(info->productName,buff);
|
|
|
- // strcpy(info->product_number,__globalDeviceManage._globalDevInfo.product.number);
|
|
|
- // strcpy(info->productChids,temp->breaker_chns_name);
|
|
|
- // info->switch_id = temp->breaker_id;
|
|
|
- // info->status = temp->breaker_status;
|
|
|
- // strcpy(info->cjfs,temp->breaker_gather_type);
|
|
|
- // strcpy(info->switch_name,temp->breaker_switch_name);
|
|
|
- // strcpy(info->comkh,temp->breaker_com);
|
|
|
- // sprintf(buff,"%d",temp->breaker_gather_addr);
|
|
|
- // strcpy(info->cjdz,buff);
|
|
|
- // sprintf(buff,"%d",temp->breaker_chn);
|
|
|
- // strcpy(info->jdh,buff);
|
|
|
- // printf("%s %s %s %s %d %d %s %s %s %s\n",
|
|
|
- // info->product_ch_name,info->productName,info->product_number,info->productChids,info->switch_id,
|
|
|
- // info->status,info->cjfs,info->comkh,info->cjdz,info->jdh);
|
|
|
- // list_add_tail(&info->list,&_over_breaker_switch_info.list);
|
|
|
- // }
|
|
|
- // lock_s_release(LOCK_ID_BREAKER);
|
|
|
- // ack_str = over_all_breaker_switch_info_to_json(&_over_breaker_switch_info,0);
|
|
|
- // _OverBreakerSwitchInfo* node;
|
|
|
- // _OverBreakerSwitchInfo* next;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ GlobalBreakerManager *temp = NULL;
|
|
|
+ GlobalDeviceManager *dm = &__globalDeviceManage2;
|
|
|
+ lock_s_hold(LOCK_ID_BREAKER);
|
|
|
+ list_for_each_entry(temp, &dm->g_new_global_breaker.list, list)
|
|
|
+ {
|
|
|
+ char buff[120];
|
|
|
+ printf("get listSwitchtatusQuery infomation!!!\n");
|
|
|
+ _OverBreakerSwitchInfo *info = (_OverBreakerSwitchInfo *)
|
|
|
+ malloc(sizeof(_OverBreakerSwitchInfo));
|
|
|
+ memset(info,0,sizeof(_OverBreakerSwitchInfo));
|
|
|
+ info->product_id = temp->product_id;
|
|
|
+ sprintf(buff,"Breaker %d",temp->breaker_id);
|
|
|
+ strcpy(info->product_ch_name,buff);
|
|
|
+ sprintf(buff,"%s %d",__globalDeviceManage._globalDevInfo.product.name,temp->breaker_id);
|
|
|
+ strcpy(info->productName,buff);
|
|
|
+ strcpy(info->product_number,__globalDeviceManage._globalDevInfo.product.number);
|
|
|
+ strcpy(info->productChids,temp->breaker_chns_name);
|
|
|
+ info->switch_id = temp->breaker_id;
|
|
|
+ info->status = temp->breaker_status;
|
|
|
+ strcpy(info->cjfs,temp->breaker_gather_type);
|
|
|
+ strcpy(info->switch_name,temp->breaker_switch_name);
|
|
|
+ strcpy(info->comkh,temp->breaker_com);
|
|
|
+ sprintf(buff,"%d",temp->breaker_gather_addr);
|
|
|
+ strcpy(info->cjdz,buff);
|
|
|
+ sprintf(buff,"%d",temp->breaker_chn);
|
|
|
+ strcpy(info->jdh,buff);
|
|
|
+ printf("%s %s %s %s %d %d %s %s %s %s\n",
|
|
|
+ info->product_ch_name,info->productName,info->product_number,info->productChids,info->switch_id,
|
|
|
+ info->status,info->cjfs,info->comkh,info->cjdz,info->jdh);
|
|
|
+ list_add_tail(&info->list,&_over_breaker_switch_info.list);
|
|
|
+ }
|
|
|
+ lock_s_release(LOCK_ID_BREAKER);
|
|
|
+ ack_str = over_all_breaker_switch_info_to_json(&_over_breaker_switch_info,0);
|
|
|
+ _OverBreakerSwitchInfo* node;
|
|
|
+ _OverBreakerSwitchInfo* next;
|
|
|
|
|
|
- // list_for_each_entry_safe(node, next, &_over_breaker_switch_info.list, list)
|
|
|
- // {
|
|
|
- // list_del(&node->list);
|
|
|
- // free(node);
|
|
|
- //}
|
|
|
+ list_for_each_entry_safe(node, next, &_over_breaker_switch_info.list, list)
|
|
|
+ {
|
|
|
+ list_del(&node->list);
|
|
|
+ free(node);
|
|
|
+ }
|
|
|
}else //current
|
|
|
{
|
|
|
GlobalBreakerManager *temp = NULL;
|
|
|
@@ -6723,9 +6720,10 @@ static void equipmentMintenance(void *conn)
|
|
|
cmd.cmd = CASCADE_CMD_BREAKER_SAVE_DELETE;
|
|
|
cmd.obj = OBJ_OVERALL;
|
|
|
cascade_request(&cmd);
|
|
|
+#if 0
|
|
|
GlobalBreakerManager* node = NULL;
|
|
|
GlobalBreakerManager* next = NULL;
|
|
|
-
|
|
|
+
|
|
|
lock_s_hold(LOCK_ID_BREAKER);
|
|
|
list_for_each_entry_safe(node,next,&__globalDeviceManage2.g_new_global_breaker.list, list)
|
|
|
{
|
|
|
@@ -6740,7 +6738,7 @@ static void equipmentMintenance(void *conn)
|
|
|
}
|
|
|
}
|
|
|
lock_s_release(LOCK_ID_BREAKER);
|
|
|
-
|
|
|
+#endif
|
|
|
ack_str=ctrl_sts_ack_to_json();
|
|
|
}else
|
|
|
{
|