Commit c9915075 authored by Claes Sjofors's avatar Claes Sjofors

Profinet configurator, ordernumber showed in module enum list

parent 3aa4f974
...@@ -10,101 +10,101 @@ Device "IM151-3 PN HF V5.0" ...@@ -10,101 +10,101 @@ Device "IM151-3 PN HF V5.0"
Device "IM151-3 PN FO V5.0" Device "IM151-3 PN FO V5.0"
Device "IM151-3 PN ST V5.0" Device "IM151-3 PN ST V5.0"
{ {
"2AI U, Standard" Siemens_Ai2_PnModule "2AI U ST" Siemens_Ai2_PnModule
"2AI U, Standard" Siemens_Ai2_PnModule "2AI U ST" Siemens_Ai2_PnModule
"2AI U, High Speed" Siemens_Ai2_PnModule "2AI U HS" Siemens_Ai2_PnModule
"2AI U, High Speed Taktsynchron" Siemens_Ai2_PnModule "2AI U HS Taktsynchron" Siemens_Ai2_PnModule
"2AI U, High Speed Taktsynchron" Siemens_Ai2_PnModule "2AI U HS Taktsynchron" Siemens_Ai2_PnModule
"2AI U, High Feature" Siemens_Ai2_PnModule "2AI U HF" Siemens_Ai2_PnModule
"2AI U, High Feature" Siemens_Ai2_PnModule "2AI U HF" Siemens_Ai2_PnModule
"2AI I, 2WIRE, Standard" Siemens_Ai2_PnModule "2AI I, 2WIRE ST" Siemens_Ai2_PnModule
"2AI I, 2WIRE, Standard" Siemens_Ai2_PnModule "2AI I, 2WIRE ST" Siemens_Ai2_PnModule
"2AI I, 2WIRE, High Speed" Siemens_Ai2_PnModule "2AI I, 2WIRE HS" Siemens_Ai2_PnModule
"2AI I, 2WIRE, High Speed Taktsynchron" Siemens_Ai2_PnModule "2AI I, 2WIRE HS Taktsynchron" Siemens_Ai2_PnModule
"2AI I, 2WIRE, High Speed Taktsynchron" Siemens_Ai2_PnModule "2AI I, 2WIRE HS Taktsynchron" Siemens_Ai2_PnModule
"2AI I, 4WIRE, Standard" Siemens_Ai2_PnModule "2AI I, 4WIRE ST" Siemens_Ai2_PnModule
"2AI I, 4WIRE, Standard" Siemens_Ai2_PnModule "2AI I, 4WIRE ST" Siemens_Ai2_PnModule
"2AI I, 4WIRE, High Speed" Siemens_Ai2_PnModule "2AI I, 4WIRE HS" Siemens_Ai2_PnModule
"2AI I, 4WIRE, High Speed Taktsynchron" Siemens_Ai2_PnModule "2AI I, 4WIRE HS Taktsynchron" Siemens_Ai2_PnModule
"2AI I, 4WIRE, High Speed Taktsynchron" Siemens_Ai2_PnModule "2AI I, 4WIRE HS Taktsynchron" Siemens_Ai2_PnModule
"2AI I, 2/4WIRE, High Feature" Siemens_Ai2_PnModule "2AI I, 2/4WIRE HF" Siemens_Ai2_PnModule
"2AI I, 2/4WIRE, High Feature" Siemens_Ai2_PnModule "2AI I, 2/4WIRE HF" Siemens_Ai2_PnModule
"2AI TC, Standard" Siemens_Ai2_PnModule "2AI TC ST" Siemens_Ai2_PnModule
"2AI TC, High Feature" Siemens_Ai2_PnModule "2AI TC HF" Siemens_Ai2_PnModule
"2AI TC, High Feature" Siemens_Ai2_PnModule "2AI TC HF" Siemens_Ai2_PnModule
"2AI RTD, Standard" Siemens_Ai2_PnModule "2AI RTD ST" Siemens_Ai2_PnModule
"2AI RTD, High Feature" Siemens_Ai2_PnModule "2AI RTD HF" Siemens_Ai2_PnModule
"2AI RTD, High Feature" Siemens_Ai2_PnModule "2AI RTD HF" Siemens_Ai2_PnModule
"4AI I, 2WIRE, Standard" Siemens_Ai4_PnModule "4AI I, 2WIRE ST" Siemens_Ai4_PnModule
"2AO U, Standard" Siemens_Ao2_PnModule "2AO U ST" Siemens_Ao2_PnModule
"2AO U, Standard" Siemens_Ao2_PnModule "2AO U ST" Siemens_Ao2_PnModule
"2AO U, High Feature" Siemens_Ao2_PnModule "2AO U HF" Siemens_Ao2_PnModule
"2AO U, High Feature, isochron mode" Siemens_Ao2_PnModule "2AO U HF, isochron mode" Siemens_Ao2_PnModule
"2AO U, High Feature, isochron mode" Siemens_Ao2_PnModule "2AO U HF, isochron mode" Siemens_Ao2_PnModule
"2AO I, Standard" Siemens_Ao2_PnModule "2AO I ST" Siemens_Ao2_PnModule
"2AO I, Standard" Siemens_Ao2_PnModule "2AO I ST" Siemens_Ao2_PnModule
"2AO I, High Feature" Siemens_Ao2_PnModule "2AO I HF" Siemens_Ao2_PnModule
"2AO I, High Feature, isochron mode" Siemens_Ao2_PnModule "2AO I HF, isochron mode" Siemens_Ao2_PnModule
"2AO I, High Feature, isochron mode" Siemens_Ao2_PnModule "2AO I HF, isochron mode" Siemens_Ao2_PnModule
"2AO U, High Speed Taktsynchron" Siemens_Ao2_PnModule "2AO U HS Taktsynchron" Siemens_Ao2_PnModule
"2AO I, High Speed Taktsynchron" Siemens_Ao2_PnModule "2AO I HS Taktsynchron" Siemens_Ao2_PnModule
"2DI DC24V, High Feature" Siemens_Di2_PnModule "2DI DC24V HF" Siemens_Di2_PnModule
"2DI DC24V, High Feature*" Siemens_Di2_PnModule "2DI DC24V HF*" Siemens_Di2_PnModule
"2DI DC24V, High Feature, 01" Siemens_Di2_PnModule "2DI DC24V HF, 01" Siemens_Di2_PnModule
"2DI DC24V, High Feature, 01*" Siemens_Di2_PnModule "2DI DC24V HF, 01*" Siemens_Di2_PnModule
"2DI DC24V, Standard" Siemens_Di2_PnModule "2DI DC24V ST" Siemens_Di2_PnModule
"2DI DC24V, Standard*" Siemens_Di2_PnModule "2DI DC24V ST*" Siemens_Di2_PnModule
"2DI DC24V, Standard, 01" Siemens_Di2_PnModule "2DI DC24V ST, 01" Siemens_Di2_PnModule
"2DI DC24V, Standard, 01*" Siemens_Di2_PnModule "2DI DC24V ST, 01*" Siemens_Di2_PnModule
"2DI AC120V, Standard" Siemens_Di2_PnModule "2DI AC120V ST" Siemens_Di2_PnModule
"2DI AC120V, Standard*" Siemens_Di2_PnModule "2DI AC120V ST*" Siemens_Di2_PnModule
"2DI AC230V, Standard" Siemens_Di2_PnModule "2DI AC230V ST" Siemens_Di2_PnModule
"2DI AC230V, Standard*" Siemens_Di2_PnModule "2DI AC230V ST*" Siemens_Di2_PnModule
"4DI DC24V, High Feature" Siemens_Di4_PnModule "4DI DC24V HF" Siemens_Di4_PnModule
"4DI DC24V, High Feature*" Siemens_Di4_PnModule "4DI DC24V HF*" Siemens_Di4_PnModule
"4DI DC24V, High Feature, 01" Siemens_Di4_PnModule "4DI DC24V HF, 01" Siemens_Di4_PnModule
"4DI DC24V, High Feature, 01*" Siemens_Di4_PnModule "4DI DC24V HF, 01*" Siemens_Di4_PnModule
"4DI DC24V, Standard" Siemens_Di4_PnModule "4DI DC24V ST" Siemens_Di4_PnModule
"4DI DC24V, Standard*" Siemens_Di4_PnModule "4DI DC24V ST*" Siemens_Di4_PnModule
"4DI DC24V, Standard, 01" Siemens_Di4_PnModule "4DI DC24V ST, 01" Siemens_Di4_PnModule
"4DI DC24V, Standard, 01*" Siemens_Di4_PnModule "4DI DC24V ST, 01*" Siemens_Di4_PnModule
"4DI DC24V/SRC, Standard" Siemens_Di4_PnModule "4DI DC24V/SRC ST" Siemens_Di4_PnModule
"4DI DC24V/SRC, Standard*" Siemens_Di4_PnModule "4DI DC24V/SRC ST*" Siemens_Di4_PnModule
"4DI DC24V/SRC, Standard, 01" Siemens_Di4_PnModule "4DI DC24V/SRC ST, 01" Siemens_Di4_PnModule
"4DI DC24V/SRC, Standard, 01*" Siemens_Di4_PnModule "4DI DC24V/SRC ST, 01*" Siemens_Di4_PnModule
"4DI UC24..48V, High Feature" Siemens_Di4_PnModule "4DI UC24..48V HF" Siemens_Di4_PnModule
"4DI UC24..48V, High Feature*" Siemens_Di4_PnModule "4DI UC24..48V HF*" Siemens_Di4_PnModule
"4DI NAMUR" Siemens_Di4_PnModule "4DI NAMUR" Siemens_Di4_PnModule
"2DO DC24V/0.5A, High Feature" Siemens_Do2_PnModule "2DO DC24V/0.5A HF" Siemens_Do2_PnModule
"2DO DC24V/0.5A, High Feature*" Siemens_Do2_PnModule "2DO DC24V/0.5A HF*" Siemens_Do2_PnModule
"2DO DC24V/0.5A, High Feature, 01" Siemens_Do2_PnModule "2DO DC24V/0.5A HF, 01" Siemens_Do2_PnModule
"2DO DC24V/0.5A, High Feature, 01*" Siemens_Do2_PnModule "2DO DC24V/0.5A HF, 01*" Siemens_Do2_PnModule
"2DO DC24V/0.5A, Standard" Siemens_Do2_PnModule "2DO DC24V/0.5A ST" Siemens_Do2_PnModule
"2DO DC24V/0.5A, Standard*" Siemens_Do2_PnModule "2DO DC24V/0.5A ST*" Siemens_Do2_PnModule
"2DO DC24V/0.5A, Standard, 01" Siemens_Do2_PnModule "2DO DC24V/0.5A ST, 01" Siemens_Do2_PnModule
"2DO DC24V/0.5A, Standard, 01*" Siemens_Do2_PnModule "2DO DC24V/0.5A ST, 01*" Siemens_Do2_PnModule
"2DO DC24V/2A, High Feature" Siemens_Do2_PnModule "2DO DC24V/2A HF" Siemens_Do2_PnModule
"2DO DC24V/2A, High Feature*" Siemens_Do2_PnModule "2DO DC24V/2A HF*" Siemens_Do2_PnModule
"2DO DC24V/2A, High Feature, 01" Siemens_Do2_PnModule "2DO DC24V/2A HF, 01" Siemens_Do2_PnModule
"2DO DC24V/2A, High Feature, 01*" Siemens_Do2_PnModule "2DO DC24V/2A HF, 01*" Siemens_Do2_PnModule
"2DO DC24V/2A, Standard" Siemens_Do2_PnModule "2DO DC24V/2A ST" Siemens_Do2_PnModule
"2DO DC24V/2A, Standard*" Siemens_Do2_PnModule "2DO DC24V/2A ST*" Siemens_Do2_PnModule
"2DO DC24V/2A, Standard, 01" Siemens_Do2_PnModule "2DO DC24V/2A ST, 01" Siemens_Do2_PnModule
"2DO DC24V/2A, Standard, 01*" Siemens_Do2_PnModule "2DO DC24V/2A ST, 01*" Siemens_Do2_PnModule
"2DO AC24..230V/1A" Siemens_Do2_PnModule "2DO AC24..230V/1A" Siemens_Do2_PnModule
"2DO AC24..230V/1A*" Siemens_Do2_PnModule "2DO AC24..230V/1A*" Siemens_Do2_PnModule
"2DO AC24..230V/1A" Siemens_Do2_PnModule "2DO AC24..230V/1A" Siemens_Do2_PnModule
"2DO AC24..230V/1A*" Siemens_Do2_PnModule "2DO AC24..230V/1A*" Siemens_Do2_PnModule
"4DO DC24V/0.5A, Standard" Siemens_Do4_PnModule "4DO DC24V/0.5A ST" Siemens_Do4_PnModule
"4DO DC24V/0.5A, Standard*" Siemens_Do4_PnModule "4DO DC24V/0.5A ST*" Siemens_Do4_PnModule
"4DO DC24V/0.5A, Standard, 01" Siemens_Do4_PnModule "4DO DC24V/0.5A ST, 01" Siemens_Do4_PnModule
"4DO DC24V/0.5A, Standard, 01*" Siemens_Do4_PnModule "4DO DC24V/0.5A ST, 01*" Siemens_Do4_PnModule
"4DO DC24V/2A, Standard" Siemens_Do4_PnModule "4DO DC24V/2A ST" Siemens_Do4_PnModule
"4DO DC24V/2A, Standard*" Siemens_Do4_PnModule "4DO DC24V/2A ST*" Siemens_Do4_PnModule
"4DO DC24V/2A, Standard, 01" Siemens_Do4_PnModule "4DO DC24V/2A ST, 01" Siemens_Do4_PnModule
"4DO DC24V/2A, Standard, 01*" Siemens_Do4_PnModule "4DO DC24V/2A ST, 01*" Siemens_Do4_PnModule
"4DO DC24V/2A, Standard, 02" Siemens_Do4_PnModule "4DO DC24V/2A ST, 02" Siemens_Do4_PnModule
"4DO DC24V/2A, Standard, 02*" Siemens_Do4_PnModule "4DO DC24V/2A ST, 02*" Siemens_Do4_PnModule
"4DO DC24V/0,5A SINK OUT" Siemens_Do4_PnModule "4DO DC24V/0,5A SINK OUT" Siemens_Do4_PnModule
"4DO DC24V/0,5A SINK OUT*" Siemens_Do4_PnModule "4DO DC24V/0,5A SINK OUT*" Siemens_Do4_PnModule
} }
......
...@@ -321,8 +321,8 @@ GsdmlAttrGtk::GsdmlAttrGtk( GtkWidget *a_parent_wid, ...@@ -321,8 +321,8 @@ GsdmlAttrGtk::GsdmlAttrGtk( GtkWidget *a_parent_wid,
int sts; int sts;
toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW, toplevel = (GtkWidget *) g_object_new( GTK_TYPE_WINDOW,
"default-height", 600, "default-height", 700,
"default-width", 500, "default-width", 700,
"title", "profinetConfigurator", "title", "profinetConfigurator",
NULL); NULL);
......
...@@ -1562,7 +1562,7 @@ int GsdAttrNav::search_class( const char *filename, const char *model, ...@@ -1562,7 +1562,7 @@ int GsdAttrNav::search_class( const char *filename, const char *model,
continue; continue;
if ( in_model) if ( in_model)
return 0; continue;
if ( cdh_NoCaseStrcmp( itemv[1], lmodel) == 0) if ( cdh_NoCaseStrcmp( itemv[1], lmodel) == 0)
in_model = 1; in_model = 1;
......
...@@ -888,6 +888,21 @@ int GsdmlAttrNav::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -888,6 +888,21 @@ int GsdmlAttrNav::brow_cb( FlowCtx *ctx, flow_tEvent event)
} }
break; break;
} }
case attrnav_eItemType_PnEnumValueMType: {
int value;
if ( !attrnav->edit_mode) {
attrnav->message('E', "Not in edit mode");
break;
}
brow_GetRadiobutton( node_list[0], 0, &value);
if ( !value) {
brow_SetRadiobutton( node_list[0], 0, 1);
*(int *)((ItemPnEnumValueMType *)item)->value_p = ((ItemPnEnumValueMType *)item)->num;
attrnav->set_modified(1);
}
break;
}
case attrnav_eItemType_PnParEnumBit: case attrnav_eItemType_PnParEnumBit:
if ( !attrnav->edit_mode) { if ( !attrnav->edit_mode) {
attrnav->message('E', "Not in edit mode"); attrnav->message('E', "Not in edit mode");
...@@ -929,6 +944,14 @@ int GsdmlAttrNav::brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -929,6 +944,14 @@ int GsdmlAttrNav::brow_cb( FlowCtx *ctx, flow_tEvent event)
attrnav->set_modified( 1); attrnav->set_modified( 1);
} }
break; break;
case attrnav_eItemType_PnEnumValueMType:
if ( !event->radiobutton.value) {
brow_SetRadiobutton( event->radiobutton.object,
event->radiobutton.number, !event->radiobutton.value);
*(int *)((ItemPnEnumValueMType *)item)->value_p = ((ItemPnEnumValueMType *)item)->num;
attrnav->set_modified( 1);
}
break;
case attrnav_eItemType_PnParEnumBit: case attrnav_eItemType_PnParEnumBit:
item->update( attrnav); item->update( attrnav);
break; break;
...@@ -1074,6 +1097,9 @@ int GsdmlAttrNav::trace_connect_bc( brow_tObject object, char *name, char *attr, ...@@ -1074,6 +1097,9 @@ int GsdmlAttrNav::trace_connect_bc( brow_tObject object, char *name, char *attr,
case attrnav_eItemType_PnEnumValue: case attrnav_eItemType_PnEnumValue:
*p = ((ItemPnEnumValue *)base_item)->value_p; *p = ((ItemPnEnumValue *)base_item)->value_p;
break; break;
case attrnav_eItemType_PnEnumValueMType:
*p = ((ItemPnEnumValueMType *)base_item)->value_p;
break;
case attrnav_eItemType_PnEnumTimeRatio: case attrnav_eItemType_PnEnumTimeRatio:
*p = ((ItemPnEnumTimeRatio *)base_item)->value_p; *p = ((ItemPnEnumTimeRatio *)base_item)->value_p;
break; break;
...@@ -1165,6 +1191,18 @@ void GsdmlAttrNavBrow::create_nodeclasses() ...@@ -1165,6 +1191,18 @@ void GsdmlAttrNavBrow::create_nodeclasses()
0); 0);
brow_AddFrame( nc_enum, 0, 0, 20, 0.83, flow_eDrawType_LineGray, -1, 1); brow_AddFrame( nc_enum, 0, 0, 20, 0.83, flow_eDrawType_LineGray, -1, 1);
brow_CreateNodeClass( ctx, "NavigatorEnumMType",
flow_eNodeGroup_Common, &nc_enum_mtype);
brow_AddRadiobutton( nc_enum_mtype, 24, 0.03, 0.7, 0.7, 0, flow_eDrawType_Line, 1);
brow_AddAnnotPixmap( nc_enum_mtype, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddAnnot( nc_enum_mtype, 2, 0.6, 0,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine,
0);
brow_AddAnnot( nc_enum_mtype, 12, 0.6, 1,
flow_eDrawType_TextHelvetica, 2, flow_eAnnotType_OneLine,
1);
brow_AddFrame( nc_enum_mtype, 0, 0, 20, 0.83, flow_eDrawType_LineGray, -1, 1);
// Create table nodeclass // Create table nodeclass
brow_CreateNodeClass( ctx, "NavigatorTable", brow_CreateNodeClass( ctx, "NavigatorTable",
...@@ -1710,7 +1748,7 @@ int GsdmlAttrNav::search_class( const char *filename, const char *model, ...@@ -1710,7 +1748,7 @@ int GsdmlAttrNav::search_class( const char *filename, const char *model,
continue; continue;
if ( in_model) if ( in_model)
return 0; continue;
if ( cdh_NoCaseStrcmp( itemv[1], lmodel) == 0) if ( cdh_NoCaseStrcmp( itemv[1], lmodel) == 0)
in_model = 1; in_model = 1;
...@@ -1908,6 +1946,49 @@ int ItemPnEnumValue::scan( GsdmlAttrNav *attrnav, void *p) ...@@ -1908,6 +1946,49 @@ int ItemPnEnumValue::scan( GsdmlAttrNav *attrnav, void *p)
return 1; return 1;
} }
ItemPnEnumValueMType::ItemPnEnumValueMType( GsdmlAttrNav *attrnav, const char *item_name,
const char *item_number, int item_num,
int item_type_id, void *attr_value_p,
brow_tNode dest, flow_eDest dest_code) :
num(item_num), type_id(item_type_id), value_p(attr_value_p), first_scan(1)
{
type = attrnav_eItemType_PnEnumValueMType;
strcpy( name, item_name);
brow_CreateNode( attrnav->brow->ctx, item_name, attrnav->brow->nc_enum_mtype,
dest, dest_code, (void *) this, 1, &node);
brow_SetAnnotPixmap( node, 0, attrnav->brow->pixmap_attr);
brow_SetAnnotation( node, 0, item_name, strlen(item_name));
brow_SetAnnotation( node, 1, item_number, strlen(item_number));
if ( *(int *)value_p == num)
brow_SetRadiobutton( node, 0, 1);
else
brow_SetRadiobutton( node, 0, 0);
brow_SetTraceAttr( node, name, "", flow_eTraceType_User);
}
int ItemPnEnumValueMType::scan( GsdmlAttrNav *attrnav, void *p)
{
if ( !first_scan) {
if ( old_value == *(int *)p)
// No change since last time
return 1;
}
else
first_scan = 0;
if ( *(int *)p == num)
brow_SetRadiobutton( node, 0, 1);
else
brow_SetRadiobutton( node, 0, 0);
old_value = *(int *) p;
return 1;
}
ItemPnDevice::ItemPnDevice( GsdmlAttrNav *attrnav, const char *item_name, ItemPnDevice::ItemPnDevice( GsdmlAttrNav *attrnav, const char *item_name,
brow_tNode dest, flow_eDest dest_code): brow_tNode dest, flow_eDest dest_code):
old_value(0), first_scan(1) old_value(0), first_scan(1)
...@@ -2977,8 +3058,8 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y) ...@@ -2977,8 +3058,8 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y)
brow_SetNodraw( attrnav->brow->ctx); brow_SetNodraw( attrnav->brow->ctx);
int idx = 0; int idx = 0;
new ItemPnEnumValue( attrnav, "No", idx++, pwr_eType_UInt32, new ItemPnEnumValueMType( attrnav, "No", "", idx++, pwr_eType_UInt32,
&attrnav->dev_data.slot_data[slot_idx]->module_enum_number, &attrnav->dev_data.slot_data[slot_idx]->module_enum_number,
node, flow_eDest_IntoLast); node, flow_eDest_IntoLast);
gsdml_UseableModules *um = attrnav->gsdml->ApplicationProcess->DeviceAccessPointList->DeviceAccessPointItem[attrnav->device_num-1]->UseableModules; gsdml_UseableModules *um = attrnav->gsdml->ApplicationProcess->DeviceAccessPointList->DeviceAccessPointItem[attrnav->device_num-1]->UseableModules;
...@@ -2992,9 +3073,10 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y) ...@@ -2992,9 +3073,10 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y)
if ( !mi || !mi->ModuleInfo->Body.Name.p) if ( !mi || !mi->ModuleInfo->Body.Name.p)
continue; continue;
strncpy( mname, (char *) mi->ModuleInfo->Body.Name.p, sizeof(mname)); strncpy( mname, (char *) mi->ModuleInfo->Body.Name.p, sizeof(mname));
new ItemPnEnumValue( attrnav, mname, idx, pwr_eType_UInt32, new ItemPnEnumValueMType( attrnav, mname, mi->ModuleInfo->Body.OrderNumber, idx,
&attrnav->dev_data.slot_data[slot_idx]->module_enum_number, pwr_eType_UInt32,
node, flow_eDest_IntoLast); &attrnav->dev_data.slot_data[slot_idx]->module_enum_number,
node, flow_eDest_IntoLast);
} }
else if ( um->ModuleItemRef[i]->Body.FixedInSlots.list && else if ( um->ModuleItemRef[i]->Body.FixedInSlots.list &&
um->ModuleItemRef[i]->Body.FixedInSlots.list->in_list(slot_number)) { um->ModuleItemRef[i]->Body.FixedInSlots.list->in_list(slot_number)) {
...@@ -3003,9 +3085,10 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y) ...@@ -3003,9 +3085,10 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y)
if ( !mi || !mi->ModuleInfo->Body.Name.p) if ( !mi || !mi->ModuleInfo->Body.Name.p)
continue; continue;
strncpy( mname, (char *) mi->ModuleInfo->Body.Name.p, sizeof(mname)); strncpy( mname, (char *) mi->ModuleInfo->Body.Name.p, sizeof(mname));
new ItemPnEnumValue( attrnav, mname, idx, pwr_eType_UInt32, new ItemPnEnumValueMType( attrnav, mname, mi->ModuleInfo->Body.OrderNumber, idx,
&attrnav->dev_data.slot_data[slot_idx]->module_enum_number, pwr_eType_UInt32,
node, flow_eDest_IntoLast); &attrnav->dev_data.slot_data[slot_idx]->module_enum_number,
node, flow_eDest_IntoLast);
} }
idx++; idx++;
} }
......
...@@ -85,7 +85,8 @@ typedef enum { ...@@ -85,7 +85,8 @@ typedef enum {
attrnav_eItemType_PnBitDataItem, attrnav_eItemType_PnBitDataItem,
attrnav_eItemType_PnEnumByteOrder, attrnav_eItemType_PnEnumByteOrder,
attrnav_eItemType_PnEnumTimeRatio, attrnav_eItemType_PnEnumTimeRatio,
attrnav_eItemType_PnEnumSendClock attrnav_eItemType_PnEnumSendClock,
attrnav_eItemType_PnEnumValueMType,
} attrnav_eItemType; } attrnav_eItemType;
typedef enum { typedef enum {
...@@ -111,6 +112,7 @@ class GsdmlAttrNavBrow { ...@@ -111,6 +112,7 @@ class GsdmlAttrNavBrow {
brow_tNodeClass nc_header; brow_tNodeClass nc_header;
brow_tNodeClass nc_table_header; brow_tNodeClass nc_table_header;
brow_tNodeClass nc_enum; brow_tNodeClass nc_enum;
brow_tNodeClass nc_enum_mtype;
flow_sAnnotPixmap *pixmap_leaf; flow_sAnnotPixmap *pixmap_leaf;
flow_sAnnotPixmap *pixmap_map; flow_sAnnotPixmap *pixmap_map;
flow_sAnnotPixmap *pixmap_openmap; flow_sAnnotPixmap *pixmap_openmap;
...@@ -254,6 +256,22 @@ class ItemPnEnumValue : public ItemPn { ...@@ -254,6 +256,22 @@ class ItemPnEnumValue : public ItemPn {
int scan( GsdmlAttrNav *attrnav, void *p); int scan( GsdmlAttrNav *attrnav, void *p);
}; };
//! Item for an enum attribute.
class ItemPnEnumValueMType : public ItemPn {
public:
ItemPnEnumValueMType( GsdmlAttrNav *attrnav, const char *item_name, const char *item_number,
int item_num,
int item_type_id,
void *attr_value_p, brow_tNode dest, flow_eDest dest_code);
int num;
int type_id;
void *value_p;
int old_value;
int first_scan;
int scan( GsdmlAttrNav *attrnav, void *p);
};
//! Item for a device. //! Item for a device.
class ItemPnDevice : public ItemPn { class ItemPnDevice : public ItemPn {
public: public:
......
...@@ -269,8 +269,6 @@ scan ( ...@@ -269,8 +269,6 @@ scan (
/* if (sts == TIME__CLKCHANGE) { /* if (sts == TIME__CLKCHANGE) {
tp->after_scan = tp->before_scan; tp->after_scan = tp->before_scan;
}*/ }*/
//if ( tp->PlcThread->Count % 10000 == 0)
// printf( "ba: %9lld %9lld %9lld %9lld\n", tp->before_scan.tv_sec, tp->before_scan.tv_nsec, tp->after_scan.tv_sec, tp->after_scan.tv_nsec);
time_GetTime(&tp->after_scan_abs); time_GetTime(&tp->after_scan_abs);
if (tp->log) if (tp->log)
pwrb_PlcThread_Exec(tp); pwrb_PlcThread_Exec(tp);
...@@ -281,8 +279,6 @@ scan ( ...@@ -281,8 +279,6 @@ scan (
plc_timerhandler(tp); plc_timerhandler(tp);
time_Aadd(NULL, &tp->sync_time, &tp->scan_time); time_Aadd(NULL, &tp->sync_time, &tp->scan_time);
time_Adiff(&delta, &tp->sync_time, &tp->after_scan); time_Adiff(&delta, &tp->sync_time, &tp->after_scan);
//if ( tp->PlcThread->Count % 10000 == 0)
// printf( "ff: %9lld %9lld %9lld %9lld %9lld %9lld\n", tp->sync_time.tv_sec, tp->sync_time.tv_nsec, tp->after_scan.tv_sec, tp->after_scan.tv_nsec, delta.tv_sec, delta.tv_nsec);
if (time_Dcomp(&delta, NULL) > 0) { if (time_Dcomp(&delta, NULL) > 0) {
pwr_tStatus sts; pwr_tStatus sts;
int phase = 0; int phase = 0;
...@@ -316,22 +312,11 @@ scan ( ...@@ -316,22 +312,11 @@ scan (
* END REMARK * END REMARK
*/ */
// phase = (int)que_Get(&sts, &tp->q_in, &delta, NULL); // phase = (int)que_Get(&sts, &tp->q_in, &delta, NULL);
struct timespec ts; struct timespec ts;
ts.tv_sec = tp->sync_time.tv_sec; ts.tv_sec = tp->sync_time.tv_sec;
ts.tv_nsec = tp->sync_time.tv_nsec; ts.tv_nsec = tp->sync_time.tv_nsec;
//if ( tp->PlcThread->Count % 10000 == 0)
//printf( "st: %9d %9d %9lld %9lld\n", ts.tv_sec, ts.tv_nsec, tp->scan_time.tv_sec, tp->scan_time.tv_nsec);
pwr_tTime sleep1, sleep2;
time_GetTimeMonotonic(&sleep1);
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL); clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL);
time_GetTimeMonotonic(&sleep2);
if ( tp->PlcThread->Count % 10000 == 0)
printf( "st: %9lld %9lld %9lld %9lld %9d %9d %11.9f\n", sleep1.tv_sec, sleep1.tv_nsec, sleep2.tv_sec, sleep2.tv_nsec, ts.tv_sec, ts.tv_nsec, ((float)sleep2.tv_nsec-sleep1.tv_nsec)/1000000000);
#endif #endif
if (phase > 0) { if (phase > 0) {
tp->exit = TRUE; tp->exit = TRUE;
......
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