Commit 94c4e23a authored by Claes Sjofors's avatar Claes Sjofors

Profinet, Instance (ObjectUUID_LocalIndex) added to xml file, and sendclock...

Profinet, Instance (ObjectUUID_LocalIndex) added to xml file, and sendclock and reduction ratio always configurable
parent 8c7c04be
......@@ -451,7 +451,7 @@ GsdmlAttrNav::GsdmlAttrNav(
parent_ctx(xn_parent_ctx),
gsdml(xn_gsdml), edit_mode(xn_edit_mode), trace_started(0),
message_cb(0), change_value_cb(0), device_num(0), device_item(0),
device_confirm_active(0), device_read(0), viewio(0), time_ratio(1), send_clock(32), phase(0)
device_confirm_active(0), device_read(0), viewio(0), time_ratio(1), send_clock(32), phase(1)
{
strcpy( name, xn_name);
......@@ -1423,6 +1423,7 @@ int GsdmlAttrNav::save( const char *filename)
dev_data.device_id = gsdml->DeviceIdentity->Body.DeviceID;
strncpy( dev_data.version, gsdml->ProfileHeader->Body.ProfileRevision, sizeof(dev_data.version));
dev_data.byte_order = gsdml->byte_order;
dev_data.instance = device_item->Body.ObjectUUID_LocalIndex;
// Store ModuleIdentNumber
gsdml_UseableModules *um = device_item->UseableModules;
......@@ -2484,6 +2485,20 @@ int ItemPnNetwork::open_children( GsdmlAttrNav *attrnav, double x, double y)
pwr_eType_UInt32, sizeof(pwr_tUInt32), 0, 0,
p, 0, node, flow_eDest_IntoLast);
}
else {
p = (void *) &attrnav->send_clock;
new ItemPnEnumSendClock( attrnav, "SendClock",
0, p, node, flow_eDest_IntoLast);
p = (void *) &attrnav->time_ratio;
new ItemPnEnumTimeRatio( attrnav, "ReductionRatio",
0, p, node, flow_eDest_IntoLast);
p = (void *) &attrnav->phase;
new ItemPnBase( attrnav, "Phase", "LocalGsdmlAttr",
pwr_eType_UInt32, sizeof(pwr_tUInt32), 0, 0,
p, 0, node, flow_eDest_IntoLast);
}
brow_SetOpen( node, attrnav_mOpen_Children);
brow_SetAnnotPixmap( node, 0, attrnav->brow->pixmap_openmap);
brow_ResetNodraw( attrnav->brow->ctx);
......@@ -4005,7 +4020,7 @@ ItemPnEnumTimeRatio::ItemPnEnumTimeRatio( GsdmlAttrNav *attrnav, const char *ite
type = attrnav_eItemType_PnEnumTimeRatio;
strcpy( name, item_name);
if ( interfacesubmodule->ApplicationRelations &&
if ( interfacesubmodule && interfacesubmodule->ApplicationRelations &&
interfacesubmodule->ApplicationRelations->TimingProperties &&
strcmp( interfacesubmodule->ApplicationRelations->TimingProperties->Body.ReductionRatio.str,
"") != 0)
......@@ -4106,7 +4121,7 @@ ItemPnEnumSendClock::ItemPnEnumSendClock( GsdmlAttrNav *attrnav, const char *ite
type = attrnav_eItemType_PnEnumSendClock;
strcpy( name, item_name);
if ( interfacesubmodule->ApplicationRelations &&
if ( interfacesubmodule && interfacesubmodule->ApplicationRelations &&
interfacesubmodule->ApplicationRelations->TimingProperties &&
strcmp( interfacesubmodule->ApplicationRelations->TimingProperties->Body.SendClock.str,
"") != 0)
......
......@@ -143,6 +143,7 @@ int GsdmlDeviceData::print( const char *filename)
" DeviceId=\"" << device_id << "\"" << endl <<
" Version=\"" << version << "\"" << endl <<
" ByteOrder=\"" << byte_order << "\">" << endl <<
" Instance=\"" << instance << "\">" << endl <<
" <NetworkSettings " << endl <<
" DeviceName=\"" << device_name << "\"" << endl <<
" IP_Address=\"" << ip_address << "\"" << endl <<
......@@ -409,6 +410,8 @@ int GsdmlDataReader::tag_attribute( const char *name, const char *value)
strncpy( data->version, value, sizeof(data->version));
else if ( strcmp( name, "ByteOrder") == 0)
sscanf( value, "%d", &data->byte_order);
else if ( strcmp( name, "Instance") == 0)
sscanf( value, "%hu", &data->instance);
break;
case gsdmldata_eTag_NetworkSettings:
if ( strcmp( name, "DeviceName") == 0)
......
......@@ -135,7 +135,7 @@ class GsdmlChannelDiag {
class GsdmlDeviceData {
public:
GsdmlDeviceData()
GsdmlDeviceData() : device_num(0), vendor_id(0), device_id(0), byte_order(0), instance(0)
{ device_name[0]=0; ip_address[0]=0; subnet_mask[0]=0; mac_address[0]=0;
device_text[0]=0; version[0]=0; gsdmlfile[0]=0;}
char device_name[80];
......@@ -148,6 +148,7 @@ class GsdmlDeviceData {
unsigned short device_id;
char version[20];
int byte_order;
unsigned short instance;
pwr_tFileName gsdmlfile;
vector<GsdmlSlotData *> slot_data;
vector<GsdmlIOCRData *> iocr_data;
......
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