Commit 7343f776 authored by claes's avatar claes

Show remnode modifed for new remnode classes

parent d1ac4e94
...@@ -1213,12 +1213,13 @@ int XNav::show_remnode() ...@@ -1213,12 +1213,13 @@ int XNav::show_remnode()
item_sTable t; item_sTable t;
item_sTableSubid ts; item_sTableSubid ts;
char object_name[120]; char object_name[120];
char id[40];
char description[80];
int sts; int sts;
pwr_tObjid objid; pwr_tObjid objid;
pwr_sClass_RemNode *object_ptr;
char address[80];
char transport_type[80];
char namebuf[80]; char namebuf[80];
pwr_tCid cid;
void *object_ptr;
brow_pop(); brow_pop();
brow_SetNodraw( brow->ctx); brow_SetNodraw( brow->ctx);
...@@ -1228,15 +1229,20 @@ int XNav::show_remnode() ...@@ -1228,15 +1229,20 @@ int XNav::show_remnode()
strcpy( th.title[th.table_cnt++], ""); strcpy( th.title[th.table_cnt++], "");
strcpy( th.title[th.table_cnt++], "Type"); strcpy( th.title[th.table_cnt++], "Type");
strcpy( th.title[th.table_cnt++], "Description"); strcpy( th.title[th.table_cnt++], "Description");
strcpy( th.title[th.table_cnt++], "");
strcpy( th.title[th.table_cnt++], "");
strcpy( th.title[th.table_cnt++], "");
strcpy( th.title[th.table_cnt++], "Address");
new ItemTableHeader( brow, this, "Title", &th, NULL, flow_eDest_IntoLast); new ItemTableHeader( brow, this, "Title", &th, NULL, flow_eDest_IntoLast);
sts = gdh_GetClassList ( pwr_cClass_RemNode, &objid); for ( int i = 0; i < 6; i++) {
while ( ODD(sts)) switch ( i) {
{ case 0: cid = pwr_cClass_RemnodeUDP; break;
case 1: cid = pwr_cClass_RemnodeTCP; break;
case 2: cid = pwr_cClass_Remnode3964R; break;
case 3: cid = pwr_cClass_RemnodeALCM; break;
case 4: cid = pwr_cClass_RemnodeSerial; break;
case 5: cid = pwr_cClass_RemnodeModbus; break;
}
sts = gdh_GetClassList( cid, &objid);
while ( ODD(sts)) {
sts = gdh_ObjidToPointer( objid, (void **) &object_ptr); sts = gdh_ObjidToPointer( objid, (void **) &object_ptr);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -1244,66 +1250,55 @@ int XNav::show_remnode() ...@@ -1244,66 +1250,55 @@ int XNav::show_remnode()
sizeof(object_name), cdh_mName_volumeStrict); sizeof(object_name), cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
t.elem_cnt = 0; switch ( i) {
case 0:
// Object name strncpy( id, ((pwr_sClass_RemnodeUDP *)object_ptr)->Id, sizeof(id));
xnav_cut_segments( namebuf, object_name, 2); strncpy( description, ((pwr_sClass_RemnodeUDP *)object_ptr)->Description,
sizeof(description));
strcpy( t.elem[t.elem_cnt].fix_str, namebuf); break;
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
t.elem[t.elem_cnt++].type_id = xnav_eType_Empty;
// Type
switch( object_ptr->TransportType)
{
case 1: case 1:
strcpy( transport_type, "ALCM"); strncpy( id, ((pwr_sClass_RemnodeTCP *)object_ptr)->Id, sizeof(id));
sprintf( address, "%5d (Area) %5d (Node)", strncpy( description, ((pwr_sClass_RemnodeTCP *)object_ptr)->Description,
object_ptr->Address[0], object_ptr->Address[1]); sizeof(description));
break; break;
case 2: case 2:
strcpy( transport_type, "PAMS/DMQ"); strncpy( id, ((pwr_sClass_Remnode3964R *)object_ptr)->Id, sizeof(id));
sprintf( address, "%5d (Group) %5d (Host Proc)", strncpy( description, ((pwr_sClass_Remnode3964R *)object_ptr)->Description,
object_ptr->Address[0], object_ptr->Address[1]); sizeof(description));
break; break;
case 3: case 3:
strcpy( transport_type, "3964R VNET"); strncpy( id, ((pwr_sClass_RemnodeALCM *)object_ptr)->Id, sizeof(id));
strcpy( address, ""); strncpy( description, ((pwr_sClass_RemnodeALCM *)object_ptr)->Description,
sizeof(description));
break; break;
case 5: case 4:
strcpy( transport_type, "RK512"); strncpy( id, ((pwr_sClass_RemnodeSerial *)object_ptr)->Id, sizeof(id));
strcpy( address, ""); strncpy( description, ((pwr_sClass_RemnodeSerial *)object_ptr)->Description,
break; sizeof(description));
case 6:
strcpy( transport_type, "TCP/IP Client");
sprintf( address, "%5d (Remote)%5d (Host Port)",
object_ptr->Address[0], object_ptr->Address[1]);
break;
case 7:
strcpy( transport_type, "TCP/IP Server");
sprintf( address, "%5d (Remote)%5d (Host Port)",
object_ptr->Address[0], object_ptr->Address[1]);
break; break;
default: case 5:
strcpy( transport_type, "Unknown"); strncpy( id, ((pwr_sClass_RemnodeModbus *)object_ptr)->Id, sizeof(id));
strcpy( address, ""); strncpy( description, ((pwr_sClass_RemnodeModbus *)object_ptr)->Description,
sizeof(description));
break; break;
} }
// Transport type t.elem_cnt = 0;
strcpy( t.elem[t.elem_cnt].fix_str, transport_type);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
// Description // Object name
strcpy( t.elem[t.elem_cnt].fix_str, object_ptr->Description); xnav_cut_segments( namebuf, object_name, 2);
strcpy( t.elem[t.elem_cnt].fix_str, namebuf);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr; t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
// Address
t.elem[t.elem_cnt++].type_id = xnav_eType_Empty;
t.elem[t.elem_cnt++].type_id = xnav_eType_Empty; t.elem[t.elem_cnt++].type_id = xnav_eType_Empty;
t.elem[t.elem_cnt++].type_id = xnav_eType_Empty;
strcpy( t.elem[t.elem_cnt].fix_str, address); // Type
strcpy( t.elem[t.elem_cnt].fix_str, id);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
// Description
strcpy( t.elem[t.elem_cnt].fix_str, description);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr; t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
ts.subid_cnt = 0; ts.subid_cnt = 0;
...@@ -1311,6 +1306,7 @@ int XNav::show_remnode() ...@@ -1311,6 +1306,7 @@ int XNav::show_remnode()
sts = gdh_GetNextObject ( objid, &objid); sts = gdh_GetNextObject ( objid, &objid);
} }
}
brow_ResetNodraw( brow->ctx); brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0); brow_Redraw( brow->ctx, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment