Commit 2c0c533d authored by Claes Sjofors's avatar Claes Sjofors

Profinet configurator, submodule selection implemented

parent 207e02cb
......@@ -117,6 +117,7 @@ static gsdml_sTag taglist[] = {
{ "ModuleItemRef", gsdml_eTag_ModuleItemRef, gsdml_eType_, 0, 0, 1},
{ "VirtualSubmoduleList", gsdml_eTag_VirtualSubmoduleList, gsdml_eType_, 0, 0, 1},
{ "VirtualSubmoduleItem", gsdml_eTag_VirtualSubmoduleItem, gsdml_eType_, 0, 0, 1},
{ "SubmoduleItem", gsdml_eTag_VirtualSubmoduleItem, gsdml_eType_, 0, 0, 1},
{ "IOData", gsdml_eTag_IOData, gsdml_eType_, 0, 0, 1},
{ "Input", gsdml_eTag_Input, gsdml_eType_, 0, 0, 1},
{ "Output", gsdml_eTag_Output, gsdml_eType_, 0, 0, 1},
......@@ -2167,6 +2168,20 @@ void *pn_gsdml::object_factory( gsdml_eTag id)
ro = o;
break;
}
case gsdml_eTag_SubmoduleList: {
gsdml_SubmoduleList *o = new gsdml_SubmoduleList( this);
void *p;
if ( (p = get_object_stack( gsdml_eTag_ApplicationProcess)))
((gsdml_ApplicationProcess *)p)->SubmoduleList = o;
else {
error_message_line( "Misplaced SubmoduleList");
return 0;
}
ro = o;
break;
}
case gsdml_eTag_VirtualSubmoduleItem: {
gsdml_VirtualSubmoduleItem *o = new gsdml_VirtualSubmoduleItem( this);
current_body = &o->Body;
......@@ -4968,6 +4983,12 @@ gsdml_ModuleList::~gsdml_ModuleList()
delete ModuleItem[i];
}
void gsdml_SubmoduleList::build()
{
for ( unsigned int i = 0; i < SubmoduleItem.size(); i++)
SubmoduleItem[i]->build();
}
gsdml_SubmoduleList::~gsdml_SubmoduleList()
{
for ( unsigned int i = 0; i < SubmoduleItem.size(); i++)
......@@ -5121,6 +5142,8 @@ void gsdml_ApplicationProcess::build()
DeviceAccessPointList->build();
if ( ModuleList)
ModuleList->build();
if ( SubmoduleList)
SubmoduleList->build();
if ( ValueList)
ValueList->build();
if ( ChannelDiagList)
......
......@@ -850,7 +850,7 @@ typedef struct {
gsdml_tUnsigned16 NumberOfAdditionalOutputCR;
gsdml_tUnsigned16 NumberOfAdditionalMulticastProviderCR;
gsdml_tUnsigned16 NumberOfMulticastConsumerCR;
gsdml_tUnsigned16 PullModuleAlarmSupported;
gsdml_tBoolean PullModuleAlarmSupported;
} gsdml_sInterfaceSubmoduleItem_ApplicationRelations;
class gsdml_InterfaceSubmoduleItem_ApplicationRelations {
......@@ -1143,6 +1143,7 @@ class gsdml_SubmoduleList {
vector<gsdml_VirtualSubmoduleItem *> SubmoduleItem;
pn_gsdml *gsdml;
~gsdml_SubmoduleList();
void build();
void print( int ind);
};
......
......@@ -88,8 +88,10 @@ typedef enum {
attrnav_eItemType_PnPortSubmodule,
attrnav_eItemType_PnSlot,
attrnav_eItemType_PnSubslot,
attrnav_eItemType_PnSubslotPhys,
attrnav_eItemType_PnModuleInfo,
attrnav_eItemType_PnModuleType,
attrnav_eItemType_PnSubmoduleType,
attrnav_eItemType_PnParRecord,
attrnav_eItemType_PnParValue,
attrnav_eItemType_PnParEnum,
......@@ -332,6 +334,23 @@ class ItemPnSubslot : public ItemPn {
int open_children( GsdmlAttrNav *attrnav, double x, double y);
};
//! Item for a physical subslot.
class ItemPnSubslotPhys : public ItemPn {
public:
ItemPnSubslotPhys( GsdmlAttrNav *attrnav, const char *item_name, GsdmlSubslotData *item_subslotdata,
gsdml_VirtualSubmoduleItem *item_virtualsubmodule, int item_slot_idx,
gsdml_UseableSubmodules *item_us,
brow_tNode dest, flow_eDest dest_code);
virtual ~ItemPnSubslotPhys() {}
GsdmlSubslotData *subslotdata;
gsdml_VirtualSubmoduleItem *virtualsubmodule;
gsdml_UseableSubmodules *us;
int slot_idx;
int open_children( GsdmlAttrNav *attrnav, double x, double y);
};
//! Item for the DeviceAccessPoint, slot 0
class ItemPnDAP : public ItemPn {
public:
......@@ -419,6 +438,25 @@ class ItemPnModuleType : public ItemPn {
int scan( GsdmlAttrNav *attrnav, void *p);
};
//! Item for module type selection.
class ItemPnSubmoduleType : public ItemPn {
public:
ItemPnSubmoduleType( GsdmlAttrNav *attrnav, const char *item_name, int item_subslot_number,
int item_slot_idx, int item_subslot_idx, gsdml_UseableSubmodules *item_us,
brow_tNode dest, flow_eDest dest_code);
virtual ~ItemPnSubmoduleType() {}
int subslot_number;
int slot_idx;
int subslot_idx;
gsdml_UseableSubmodules *us;
int old_value;
int first_scan;
int open_children( GsdmlAttrNav *attrnav, double x, double y);
int scan( GsdmlAttrNav *attrnav, void *p);
};
//! Item for module type selection.
class ItemPnParRecord : public ItemPn {
public:
......
......@@ -92,6 +92,7 @@ int GsdmlSubslotData::print( ofstream& fp)
{
fp <<
" <Subslot SubslotNumber=\"" << subslot_number << "\"" << endl <<
" SubmoduleEnumNumber=\"" << submodule_enum_number << "\"" << endl <<
" SubmoduleIdentNumber=\"" << submodule_ident_number << "\"" << endl <<
" IOInputLength=\"" << io_input_length << "\"" << endl <<
" IOOutputLength=\"" << io_output_length << "\" >" << endl;
......@@ -554,6 +555,8 @@ int GsdmlDataReader::tag_attribute( const char *name, const char *value)
sscanf( value, "%u", &sd->subslot_number);
else if ( strcmp( name, "SubmoduleIdentNumber") == 0)
sscanf( value, "%u", &sd->submodule_ident_number);
else if ( strcmp( name, "SubmoduleEnumNumber") == 0)
sscanf( value, "%d", &sd->submodule_enum_number);
else if ( strcmp( name, "IOInputLength") == 0)
sscanf( value, "%u", &sd->io_input_length);
else if ( strcmp( name, "IOOutputLength") == 0)
......
......@@ -82,12 +82,13 @@ class GsdmlIOCRData {
class GsdmlSubslotData {
public:
GsdmlSubslotData() : subslot_number(0), subslot_idx(0), submodule_ident_number(0),
io_input_length(0), io_output_length(0) {}
GsdmlSubslotData() : subslot_number(0), subslot_idx(0), submodule_enum_number(0),
submodule_ident_number(0), io_input_length(0), io_output_length(0) {}
vector<GsdmlDataRecord *> data_record;
unsigned int subslot_number;
unsigned int subslot_idx;
unsigned int submodule_enum_number;
unsigned int submodule_ident_number;
unsigned int io_input_length;
unsigned int io_output_length;
......
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