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()
item_sTable t;
item_sTableSubid ts;
char object_name[120];
char id[40];
char description[80];
int sts;
pwr_tObjid objid;
pwr_sClass_RemNode *object_ptr;
char address[80];
char transport_type[80];
char namebuf[80];
pwr_tCid cid;
void *object_ptr;
brow_pop();
brow_SetNodraw( brow->ctx);
......@@ -1228,15 +1229,20 @@ int XNav::show_remnode()
strcpy( th.title[th.table_cnt++], "");
strcpy( th.title[th.table_cnt++], "Type");
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);
sts = gdh_GetClassList ( pwr_cClass_RemNode, &objid);
while ( ODD(sts))
{
for ( int i = 0; i < 6; i++) {
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);
if ( EVEN(sts)) return sts;
......@@ -1244,66 +1250,55 @@ int XNav::show_remnode()
sizeof(object_name), cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
t.elem_cnt = 0;
// Object name
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_Empty;
// Type
switch( object_ptr->TransportType)
{
switch ( i) {
case 0:
strncpy( id, ((pwr_sClass_RemnodeUDP *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_RemnodeUDP *)object_ptr)->Description,
sizeof(description));
break;
case 1:
strcpy( transport_type, "ALCM");
sprintf( address, "%5d (Area) %5d (Node)",
object_ptr->Address[0], object_ptr->Address[1]);
strncpy( id, ((pwr_sClass_RemnodeTCP *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_RemnodeTCP *)object_ptr)->Description,
sizeof(description));
break;
case 2:
strcpy( transport_type, "PAMS/DMQ");
sprintf( address, "%5d (Group) %5d (Host Proc)",
object_ptr->Address[0], object_ptr->Address[1]);
strncpy( id, ((pwr_sClass_Remnode3964R *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_Remnode3964R *)object_ptr)->Description,
sizeof(description));
break;
case 3:
strcpy( transport_type, "3964R VNET");
strcpy( address, "");
strncpy( id, ((pwr_sClass_RemnodeALCM *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_RemnodeALCM *)object_ptr)->Description,
sizeof(description));
break;
case 5:
strcpy( transport_type, "RK512");
strcpy( address, "");
break;
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]);
case 4:
strncpy( id, ((pwr_sClass_RemnodeSerial *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_RemnodeSerial *)object_ptr)->Description,
sizeof(description));
break;
default:
strcpy( transport_type, "Unknown");
strcpy( address, "");
case 5:
strncpy( id, ((pwr_sClass_RemnodeModbus *)object_ptr)->Id, sizeof(id));
strncpy( description, ((pwr_sClass_RemnodeModbus *)object_ptr)->Description,
sizeof(description));
break;
}
// Transport type
strcpy( t.elem[t.elem_cnt].fix_str, transport_type);
t.elem[t.elem_cnt++].type_id = xnav_eType_FixStr;
t.elem_cnt = 0;
// Description
strcpy( t.elem[t.elem_cnt].fix_str, object_ptr->Description);
// Object name
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;
// 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;
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;
ts.subid_cnt = 0;
......@@ -1311,6 +1306,7 @@ int XNav::show_remnode()
sts = gdh_GetNextObject ( objid, &objid);
}
}
brow_ResetNodraw( brow->ctx);
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