Commit aea3b739 authored by claes's avatar claes

Xtt -s doesn't show OpDefault

parent 0f7df12b
...@@ -556,6 +556,31 @@ Xtt::Xtt( int *argc, char **argv[], int *return_sts) : ...@@ -556,6 +556,31 @@ Xtt::Xtt( int *argc, char **argv[], int *return_sts) :
opplace_found = 1; opplace_found = 1;
} }
else if ( select_opplace) {
// Check if there is only one single opplace
pwr_tOName fullname;
pwr_tObjName name;
pwr_tStatus sts;
pwr_tOid oid;
int i = 0;
for ( sts = gdh_GetClassList( pwr_cClass_OpPlace, &oid);
ODD(sts);
sts = gdh_GetNextObject( oid, &oid)) {
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_object);
if ( EVEN(sts) || cdh_NoCaseStrcmp( name, "opdefault") == 0)
continue;
sts = gdh_ObjidToName( oid, fullname, sizeof(fullname), cdh_mNName);
if ( EVEN(sts)) continue;
i++;
}
if ( i == 1) {
strcpy( opplace_str, fullname);
opplace_found = 1;
}
}
else { else {
// Look for default opplace // Look for default opplace
pwr_tOid oid; pwr_tOid oid;
...@@ -681,10 +706,12 @@ void Xtt::opplace_selected_cb( void *ctx, char *text) ...@@ -681,10 +706,12 @@ void Xtt::opplace_selected_cb( void *ctx, char *text)
void Xtt::list_opplace() void Xtt::list_opplace()
{ {
char texts[20][80]; pwr_tOName texts[20];
pwr_tObjName name;
pwr_tStatus sts; pwr_tStatus sts;
pwr_tOid oid; pwr_tOid oid;
int i = 0; int i = 0;
for ( sts = gdh_GetClassList( pwr_cClass_OpPlace, &oid); for ( sts = gdh_GetClassList( pwr_cClass_OpPlace, &oid);
ODD(sts); ODD(sts);
...@@ -692,6 +719,10 @@ void Xtt::list_opplace() ...@@ -692,6 +719,10 @@ void Xtt::list_opplace()
sts = gdh_ObjidToName( oid, texts[i], sizeof(texts[0]), cdh_mNName); sts = gdh_ObjidToName( oid, texts[i], sizeof(texts[0]), cdh_mNName);
if ( EVEN(sts)) continue; if ( EVEN(sts)) continue;
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_object);
if ( EVEN(sts) || cdh_NoCaseStrcmp( name, "opdefault") == 0)
continue;
i++; i++;
if ( i == (int)(sizeof(texts)/sizeof(texts[0]) - 2)) if ( i == (int)(sizeof(texts)/sizeof(texts[0]) - 2))
break; break;
...@@ -714,7 +745,7 @@ void Xtt::list_opplace() ...@@ -714,7 +745,7 @@ void Xtt::list_opplace()
} }
else else
// Select oplace from list // Select oplace from list
wow->CreateList( "Select Operator Place", (char *)texts, 80, opplace_selected_cb, 0, this); wow->CreateList( "Select Operator Place", (char *)texts, sizeof(pwr_tOName), opplace_selected_cb, 0, this);
} }
int Xtt::xnav_get_select( void *ctx, pwr_tAttrRef *attrref, int *is_attr) int Xtt::xnav_get_select( void *ctx, pwr_tAttrRef *attrref, int *is_attr)
......
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