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