Commit c949de84 authored by Marcus Nordenberg's avatar Marcus Nordenberg

Profinet Configurator: Add more help text for ModuleTypes, fix some typos

parent 628630f9
...@@ -116,8 +116,8 @@ void GsdmlAttrNavGtk::display_attr_help_text() ...@@ -116,8 +116,8 @@ void GsdmlAttrNavGtk::display_attr_help_text()
switch( base_item->type) { switch( base_item->type) {
/* /*
* The following two item types could make use if the same info_text in the base class as PnEnumValue does * The following two item types could make use of the same info_text that the the base class does,
* but since they already contained references to they were used instead... * but since they already contained references they were used instead...
*/ */
case attrnav_eItemType_PnParValue: case attrnav_eItemType_PnParValue:
case attrnav_eItemType_PnParEnum: { case attrnav_eItemType_PnParEnum: {
...@@ -130,18 +130,17 @@ void GsdmlAttrNavGtk::display_attr_help_text() ...@@ -130,18 +130,17 @@ void GsdmlAttrNavGtk::display_attr_help_text()
//If we do have help available show it //If we do have help available show it
if (vi && vi->Body.Help.p) if (vi && vi->Body.Help.p)
((GsdmlAttrGtk*)parent_ctx)->attr_help_text((char*)vi->Body.Help.p); ((GsdmlAttrGtk*)parent_ctx)->attr_help_text((char*)vi->Body.Help.p);
else
((GsdmlAttrGtk*)parent_ctx)->attr_help_text("");
break; break;
} }
case attrnav_eItemType_PnEnumValue: { default: {
// Do we have an associated info text string to show the user some more info? // Do we have an associated info text string to show the user some more info?
if (base_item->info_text) if (base_item->info_text)
((GsdmlAttrGtk*)parent_ctx)->attr_help_text(base_item->info_text); ((GsdmlAttrGtk*)parent_ctx)->attr_help_text(base_item->info_text);
else
break; ((GsdmlAttrGtk*)parent_ctx)->attr_help_text("");
} }
default:
((GsdmlAttrGtk*)parent_ctx)->attr_help_text("");
} }
} }
...@@ -2095,8 +2095,7 @@ int ItemPnEnumValue::scan( GsdmlAttrNav *attrnav, void *p) ...@@ -2095,8 +2095,7 @@ int ItemPnEnumValue::scan( GsdmlAttrNav *attrnav, void *p)
ItemPnEnumValueMType::ItemPnEnumValueMType( GsdmlAttrNav *attrnav, const char *item_name, ItemPnEnumValueMType::ItemPnEnumValueMType( GsdmlAttrNav *attrnav, const char *item_name,
const char *item_number, int item_num, const char *item_number, int item_num,
int item_type_id, void *attr_value_p, int item_type_id, void *attr_value_p,
brow_tNode dest, flow_eDest dest_code) : brow_tNode dest, flow_eDest dest_code, const char *info_text) : ItemPn(info_text), num(item_num), type_id(item_type_id), value_p(attr_value_p), first_scan(1)
num(item_num), type_id(item_type_id), value_p(attr_value_p), first_scan(1)
{ {
type = attrnav_eItemType_PnEnumValueMType; type = attrnav_eItemType_PnEnumValueMType;
...@@ -2238,9 +2237,8 @@ int ItemPnDevice::scan( GsdmlAttrNav *attrnav, void *p) ...@@ -2238,9 +2237,8 @@ int ItemPnDevice::scan( GsdmlAttrNav *attrnav, void *p)
if ( attrnav->device_num == 0) if ( attrnav->device_num == 0)
strcpy( buf, "No"); strcpy( buf, "No");
else { else {
strncpy( buf, (char *)attrnav->gsdml->ApplicationProcess->DeviceAccessPointList-> gsdml_DeviceAccessPointItem *item = attrnav->gsdml->ApplicationProcess->DeviceAccessPointList->DeviceAccessPointItem[attrnav->device_num-1];
DeviceAccessPointItem[attrnav->device_num-1]->ModuleInfo->Body.Name.p, snprintf(buf, sizeof(buf), "%s (%s)", (char*)item->ModuleInfo->Body.Name.p, item->ModuleInfo->Body.OrderNumber);
sizeof(buf));
} }
} }
brow_SetAnnotation( node, 1, buf, strlen(buf)); brow_SetAnnotation( node, 1, buf, strlen(buf));
...@@ -2540,7 +2538,8 @@ int ItemPnSlot::scan( GsdmlAttrNav *attrnav, void *p) ...@@ -2540,7 +2538,8 @@ int ItemPnSlot::scan( GsdmlAttrNav *attrnav, void *p)
ModuleItemRef[slotdata->module_enum_number-1]->Body.ModuleItemTarget.p; ModuleItemRef[slotdata->module_enum_number-1]->Body.ModuleItemTarget.p;
if ( !mi || !mi->ModuleInfo->Body.Name.p) if ( !mi || !mi->ModuleInfo->Body.Name.p)
return 1; return 1;
strncpy( buf, (char *) mi->ModuleInfo->Body.Name.p, sizeof(buf));
snprintf(buf, sizeof(buf), "%s (%s)", (char *)mi->ModuleInfo->Body.Name.p, mi->ModuleInfo->Body.OrderNumber);
} }
brow_SetAnnotation( node, 1, buf, strlen(buf)); brow_SetAnnotation( node, 1, buf, strlen(buf));
old_value = *(int *)p; old_value = *(int *)p;
...@@ -3480,7 +3479,7 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y) ...@@ -3480,7 +3479,7 @@ int ItemPnModuleType::open_children( GsdmlAttrNav *attrnav, double x, double y)
new ItemPnEnumValueMType( attrnav, mname, mi->ModuleInfo->Body.OrderNumber, idx, new ItemPnEnumValueMType( attrnav, mname, mi->ModuleInfo->Body.OrderNumber, idx,
pwr_eType_UInt32, 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, (char *)mi->ModuleInfo->Body.InfoText.p);
} }
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)) {
......
...@@ -286,9 +286,7 @@ class ItemPnEnumValue : public ItemPn { ...@@ -286,9 +286,7 @@ class ItemPnEnumValue : public ItemPn {
class ItemPnEnumValueMType : public ItemPn { class ItemPnEnumValueMType : public ItemPn {
public: public:
ItemPnEnumValueMType( GsdmlAttrNav *attrnav, const char *item_name, const char *item_number, ItemPnEnumValueMType( GsdmlAttrNav *attrnav, const char *item_name, const char *item_number,
int item_num, int item_num, int item_type_id, void *attr_value_p, brow_tNode dest, flow_eDest dest_code, const char *info_text = 0);
int item_type_id,
void *attr_value_p, brow_tNode dest, flow_eDest dest_code);
int num; int num;
int type_id; int type_id;
void *value_p; void *value_p;
......
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