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

Opwindow menu curve/trend also shows DsTrendCurve objects (refs #150)

parent 65cf713f
......@@ -1577,7 +1577,7 @@ show graph <t>Show graph-files <LINK> show graph
show time <t>Show current time <LINK> show time
show default<t>Show default directory <LINK> show default
show children<t>Show the children of an object <LINK> show children
show object<t>Show the content of an object <LINK> show object
show objectlist<t>Show all objects of a specific class<LINK> show objectlist
show objid <t>Show object identity <LINK> show objid
show parameter<t>Show an object attribute <LINK> show parameter
show logging<t>Show a logging entry <LINK> show logging
......@@ -2376,6 +2376,21 @@ Show the current user and his privileges.
<B>xtt> show user
</TOPIC>
<TOPIC> show objectlist <style> function
Command show objectlist
Open a list dialog with all objects of a specific class or
a number of specific classes. When an object in the list is
activated, the object graph for the object is opened.
<B>xtt> show objectlist /class= [/title=] [/sort]
/class <t>The name of a class, or serveral class names
<t>separated by comma.
/title <t>Title of the list dialog.
/sort <t>The objects are sorted in alphabetical order.
</TOPIC>
<TOPIC> sound <style> function
Command sound
......
......@@ -1585,7 +1585,7 @@ show graph <t>Visa graf-filer <LINK> show graph
show time <t>Visa aktuell tid <LINK> show time
show default<t>Visa default katalog <LINK> show default
show children<t>Visa ett objekts barn <LINK> show children
show object<t>Visa innehållet i ett objekt <LINK> show object
show objectlist<t>Visa alla objects av en specifik klass<LINK> show objectlist
show objid <t>Visa ett objekts identitet <LINK> show objid
show parameter<t>Visa ett objektsattribut <LINK> show parameter
show logging<t>Vissa ett loggingentry <LINK> show logging
......@@ -1985,6 +1985,21 @@ logout <LINK> logout
show user <LINK> show user
</TOPIC>
<TOPIC> show objectlist <style> function
Command show objectlist
Öppna ett fönster med en lista på all objekt av en specific klass eller
att antal specifika klasser. När ett objekt i listan aktiveras öppnas
objektsbilden för objektet.
<B>xtt> show objectlist /class= [/title=] [/sort]
/class <t>Namn på en klass, eller flera klasser avgränsade med
<t>komma-tecken.
/title <t>Titel på fönstret.
/sort <t>Objekten sorteras i alfabetisk ordning.
</TOPIC>
<TOPIC> logout <style> function
Kommando logout
......
......@@ -162,7 +162,7 @@ void Op::activate_blocklist()
void Op::activate_trend()
{
char cmd[200] = "show objectlist/class=dstrend/title=\"Trend List\"";
char cmd[200] = "show objectlist/class=dstrend,dstrendcurve/title=\"Trend List\"/sort";
if ( command_cb)
command_cb( parent_ctx, cmd);
......@@ -178,7 +178,7 @@ void Op::activate_fast()
void Op::activate_history()
{
char cmd[200] = "show objectlist/class=sevhist/title=\"Process History List\"";
char cmd[200] = "show objectlist/class=sevhist,sevhistobject/title=\"Process History List\"/sort";
if ( command_cb)
command_cb( parent_ctx, cmd);
}
......
......@@ -259,7 +259,8 @@ dcli_tCmdTable xnav_command_table[] = {
"/FILE", "/LOCAL", "/INITSTEP",
"/MAXOBJECTS", "/VOLUME", "/ALL", "/TYPE",
"/OPTION", "/ENTRY", "/NEW", "/TITLE", "/WINDOW",
"/ALARMVIEW", "/WIDTH", "/HEIGHT", "/XPOSITION", "/YPOSITION", ""}
"/ALARMVIEW", "/WIDTH", "/HEIGHT", "/XPOSITION", "/YPOSITION",
"/SORT", ""}
},
{
"OPEN",
......@@ -2265,56 +2266,86 @@ static int xnav_show_func( void *client_data,
char title_str[80];
pwr_tOName *names;
xnav_sObjectList *ctx;
pwr_tCid cid;
pwr_tCid cid[10];
pwr_tVid root_vid;
pwr_tObjName class_array[10];
int class_num;
int i;
if ( EVEN( dcli_get_qualifier( "/CLASS", class_str, sizeof(class_str)))) {
xnav->message('E', "Class is missing");
return XNAV__HOLDCOMMAND;
}
sts = gdh_ClassNameToId( class_str, &cid);
if ( EVEN(sts)) {
xnav->message('E', "Unknown class");
return XNAV__HOLDCOMMAND;
}
// The class string can contain several classes separated by ','
class_num = dcli_parse( class_str, ",", "",
(char *) class_array, sizeof( class_array)/sizeof( class_array[0]),
sizeof( class_array[0]), 0);
gdh_GetRootVolume( &root_vid);
for ( sts = gdh_GetClassListAttrRef( cid, &aref);
ODD(sts);
sts = gdh_GetNextAttrRef( cid, &aref, &aref)) {
cnt++;
for ( i = 0; i < class_num; i++) {
sts = gdh_ClassNameToId( class_array[i], &cid[i]);
if ( EVEN(sts)) {
xnav->message('E', "Unknown class");
return XNAV__HOLDCOMMAND;
}
for ( sts = gdh_GetClassListAttrRef( cid[i], &aref);
ODD(sts);
sts = gdh_GetNextAttrRef( cid[i], &aref, &aref)) {
cnt++;
}
}
names = (pwr_tOName *)calloc( cnt + 1, sizeof(pwr_tOName));
int idx = 0;
for ( sts = gdh_GetClassListAttrRef( cid, &aref);
ODD(sts);
sts = gdh_GetNextAttrRef( cid, &aref, &aref)) {
if ( aref.Objid.vid == root_vid)
sts = gdh_AttrrefToName( &aref, names[idx], sizeof(names[0]),
cdh_mNName);
else
sts = gdh_AttrrefToName( &aref, names[idx], sizeof(names[0]),
cdh_mName_volumeStrict);
if ( EVEN(sts)) continue;
for ( i = 0; i < class_num; i++) {
for ( sts = gdh_GetClassListAttrRef( cid[i], &aref);
ODD(sts);
sts = gdh_GetNextAttrRef( cid[i], &aref, &aref)) {
if ( aref.Objid.vid == root_vid)
sts = gdh_AttrrefToName( &aref, names[idx], sizeof(names[0]),
cdh_mNName);
else
sts = gdh_AttrrefToName( &aref, names[idx], sizeof(names[0]),
cdh_mName_volumeStrict);
if ( EVEN(sts)) continue;
idx++;
if ( idx > cnt)
break;
idx++;
if ( idx > cnt)
break;
}
}
if ( EVEN( dcli_get_qualifier( "/TITLE", title_str, sizeof(title_str)))) {
sts = gdh_ObjidToName( cdh_ClassIdToObjid( cid), title_str, sizeof(title_str),
sts = gdh_ObjidToName( cdh_ClassIdToObjid( cid[i]), title_str, sizeof(title_str),
cdh_mName_object);
if ( EVEN(sts)) return sts;
strcat( title_str, Lng::translate(" List"));
}
int sort = ODD( dcli_get_qualifier( "/SORT", 0, 0));
if ( sort) {
// Sort
pwr_tOName tmp;
for ( unsigned int i = cnt - 1; i > 0; i--) {
for ( unsigned int j = 0; j < i; j++) {
if ( strcmp(names[j], names[j+1]) > 0) {
strcpy( tmp, names[j+1]);
strcpy( names[j+1], names[j]);
strcpy( names[j], tmp);
}
}
}
}
ctx = (xnav_sObjectList *) calloc( 1, sizeof(xnav_sObjectList));
ctx->cid = cid;
ctx->cid = cid[0];
ctx->xnav = xnav;
xnav->wow->CreateList( title_str, (char *)names, sizeof(names[0]), xnav_show_objectlist_cb,
......@@ -8467,6 +8498,7 @@ static void xnav_show_objectlist_cb( void *ctx, char *text)
sprintf( cmd, "open fast/name=%s/title=\"%s\"", text, text);
break;
case pwr_cClass_SevHist:
case pwr_cClass_SevHistObject:
sprintf( cmd, "open history/name=%s/title=\"%s\"", text, text);
break;
case pwr_cClass_XttGraph:
......
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