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

Ge fix in command and popupmenu dynamics reference object syntax

parent 3f40979f
......@@ -2676,8 +2676,8 @@ Format <t>Format in c syntax of written values.
Dynamic <t>Not implemented.
<b>Dynamic Axis
Axis.MinValueAttr <t>Min value signal.
Axis.MaxValueAttr <t>Max value signal.
Axis.MinValueAttr <t>Min value signal of type Float32 or Int32.
Axis.MaxValueAttr <t>Max value signal of type Float32 of Int32.
</topic>
<topic>geref_windowobject <style>function
......@@ -3559,7 +3559,7 @@ With the command
the object graph is opened for the object in the first element. It is also
possible to state double steps of attribute references with the syntax
'&&(attribute-reference)'.
'&(&(attribute-reference))'.
</topic>
<topic>GeDynCommandDoubleClick <style>function
......
......@@ -2657,8 +2657,8 @@ Format <t>Format i c-syntax f
Dynamic <t>Ej implementerat.
<b>Dynamisk Axis
Axis.MinValueAttr <t>Signal för minvärde.
Axis.MaxValueAttr <t>Signal för maxvärde.
Axis.MinValueAttr <t>Signal för minvärde av typ Float32 eller Int32.
Axis.MaxValueAttr <t>Signal för maxvärde av typ Float32 eller Int32.
</topic>
......@@ -3519,7 +3519,7 @@ Med kommandot
> open graph /class /instance=&(H1-ObjectList.ObjArray[0])
öppnas objektgrafen för objektet i första elementet. Man kan även age dubbla led av
attributreferenser med syntaxen &&(attribut-referens).
attributreferenser med syntaxen &(&(attribut-referens)).
</topic>
......
......@@ -10343,9 +10343,11 @@ int GePopupMenu::action( grow_tObject object, glow_tEvent event)
if ( ref_object[0] == '&') {
// Refobject starting with '&' indicates reference
dyn->parse_attr_name( &ref_object[1], parsed_name, &inverted,
&attr_type, &attr_size);
reference = 1;
pwr_tAName refname;
dyn->parse_attr_name( ref_object, refname, &inverted,
&attr_type, &attr_size);
dyn->graph->get_reference_name( refname, parsed_name);
// reference = 1;
}
else {
dyn->parse_attr_name( ref_object, parsed_name, &inverted,
......
......@@ -4274,58 +4274,66 @@ void Graph::get_command( char *in, char *out, GeDyn *dyn)
t0 = out;
}
if ( (s = strchr( out, '&'))) {
if ( *(s+1) == '(') {
if ( (s = strchr( out, '&')) && *(s+1) == '(') {
// Replace attribute in parenthesis with its value
if ( *(s+2) == '&' && *(s+3) == '(') {
pwr_tAName refname;
pwr_sAttrRef aref;
pwr_tStatus sts;
char *start, *end;
char *start, *end, *start2;
start = s;
strcpy( refname, s+2);
strcpy( refname, s+4);
if ( (s = strchr( refname, ')')) == 0)
return;
*s = 0;
end = start + strlen(refname) + 3;
end = start + strlen(refname) + 5;
start2 = s + 1;
sts = gdh_GetObjectInfo( refname, &aref, sizeof(aref));
if ( EVEN(sts)) return;
sts = gdh_AttrrefToName( &aref, str, sizeof(str), cdh_mName_volumeStrict);
if ( EVEN(sts)) return;
if ( (s = strchr( start2, ')')) == 0)
return;
*s = 0;
end = start2 + strlen(start2) + 1;
strncat( str, start2, sizeof(str));
sts = gdh_GetObjectInfo( str, &aref, sizeof(aref));
if ( EVEN(sts)) return;
sts = gdh_AttrrefToName( &aref, str, sizeof(str), cdh_mName_volumeStrict);
if ( EVEN(sts)) return;
strcat( str, end);
strcpy( start, str);
}
else if ( *(s+1) == '&' && *(s+2) == '(') {
else {
pwr_tAName refname;
pwr_sAttrRef aref;
pwr_tStatus sts;
char *start, *end;
start = s;
strcpy( refname, s+3);
strcpy( refname, s+2);
if ( (s = strchr( refname, ')')) == 0)
return;
*s = 0;
end = start + strlen(refname) + 4;
end = start + strlen(refname) + 3;
sts = gdh_GetObjectInfo( refname, &aref, sizeof(aref));
if ( EVEN(sts)) return;
sts = gdh_AttrrefToName( &aref, str, sizeof(str), cdh_mName_volumeStrict);
if ( EVEN(sts)) return;
sts = gdh_GetObjectInfo( str, &aref, sizeof(aref));
if ( EVEN(sts)) return;
sts = gdh_AttrrefToName( &aref, str, sizeof(str), cdh_mName_volumeStrict);
if ( EVEN(sts)) return;
strcat( str, end);
strcpy( start, str);
}
}
}
}
......
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