Commit 768f3377 authored by Claes Sjofors's avatar Claes Sjofors

Wb script create_io_list, signals and channels in libhier omitted

parent b3651991
...@@ -12,6 +12,22 @@ ...@@ -12,6 +12,22 @@
# #
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
function string get_device_name(string object)
string parent;
string class;
parent = GetParent(object);
while(parent != "")
class = GetObjectClass(parent);
if(class == "Pb_Profiboard" || class == "$Node" || class == "Modbus_Master" || class == "PnControllerSoftingPNAK")
return parent;
endif
parent = GetParent(parent);
endwhile
return "";
endfunction
function int print_channels( int fp, string chanclass, string sigclass) function int print_channels( int fp, string chanclass, string sigclass)
string signal; string signal;
string attr; string attr;
...@@ -26,11 +42,17 @@ function int print_channels( int fp, string chanclass, string sigclass) ...@@ -26,11 +42,17 @@ function int print_channels( int fp, string chanclass, string sigclass)
string sdescr; string sdescr;
string cdescr; string cdescr;
int found; int found;
string devname;
sigcnt = 0; sigcnt = 0;
signal = GetClassListAttrRef( sigclass); signal = GetClassListAttrRef( sigclass);
while ( signal != "") while ( signal != "")
if ( InLib( signal))
signal = GetNextAttrRef( sigclass, signal);
continue;
endif
attr = signal + ".SigChanCon"; attr = signal + ".SigChanCon";
sigchancon = GetAttribute( attr); sigchancon = GetAttribute( attr);
...@@ -61,6 +83,13 @@ function int print_channels( int fp, string chanclass, string sigclass) ...@@ -61,6 +83,13 @@ function int print_channels( int fp, string chanclass, string sigclass)
channel = GetClassListAttrRef( chanclass); channel = GetClassListAttrRef( chanclass);
while ( channel != "") while ( channel != "")
if ( InLib( channel))
channel = GetNextAttrRef( chanclass, channel);
continue;
endif
devname = get_device_name( channel);
found = 0; found = 0;
for ( i = 0; i < sigcnt; i++) for ( i = 0; i < sigcnt; i++)
if ( sigchancons[i] == channel) if ( sigchancons[i] == channel)
...@@ -82,7 +111,7 @@ function int print_channels( int fp, string chanclass, string sigclass) ...@@ -82,7 +111,7 @@ function int print_channels( int fp, string chanclass, string sigclass)
cdescr = GetAttribute( attr); cdescr = GetAttribute( attr);
# Write to temporary file # Write to temporary file
fprintf( fp, "%s;%s;\"%s\";\"%s\"\n", channel, signal, sdescr, cdescr); fprintf( fp, "%s;%s;\"%s\";\"%s\";%s;%s\n", channel, signal, sdescr, cdescr, sigclass, devname);
channel = GetNextAttrRef( chanclass, channel); channel = GetNextAttrRef( chanclass, channel);
endwhile endwhile
......
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