Commit d895d85a authored by Claes Sjofors's avatar Claes Sjofors

Bugfix in connect for AnalogColor with more than one instance

parent 21151f2d
...@@ -4642,23 +4642,33 @@ void GeAnalogColor::set_attribute( grow_tObject object, const char *attr_name, i ...@@ -4642,23 +4642,33 @@ void GeAnalogColor::set_attribute( grow_tObject object, const char *attr_name, i
{ {
(*cnt)--; (*cnt)--;
if ( *cnt == 0) { if ( *cnt == 0) {
char msg[200]; GeDynElem *elem;
GeAnalogColor *e;
bool found = false;
strncpy( attribute, attr_name, sizeof( attribute)); // Set attribute for instance 1
if ( instance == ge_mInstance_1) { if ( instance == ge_mInstance_1)
if ( dyn->total_dyn_type & ge_mDynType_Tone) e = this;
sprintf( msg, "AnalogTone.Attribute = %s", attr_name);
else
sprintf( msg, "AnalogColor.Attribute = %s", attr_name);
}
else { else {
if ( dyn->total_dyn_type & ge_mDynType_Tone) for ( elem = dyn->elements; elem; elem = elem->next) {
sprintf( msg, "AnalogTone%d.Attribute = %s", GeDyn::instance_to_number( instance), if ( elem->dyn_type == ge_mDynType_AnalogColor &&
attr_name); elem->instance == ge_mInstance_1) {
else found = true;
sprintf( msg, "AnalogColor%d.Attribute = %s", GeDyn::instance_to_number( instance), break;
attr_name); }
}
if ( !found)
return;
e = (GeAnalogColor *)elem;
} }
char msg[200];
strncpy( e->attribute, attr_name, sizeof( attribute));
if ( dyn->total_dyn_type & ge_mDynType_Tone)
sprintf( msg, "AnalogTone.Attribute = %s", attr_name);
else
sprintf( msg, "AnalogColor.Attribute = %s", attr_name);
dyn->graph->message( 'I', msg); dyn->graph->message( 'I', msg);
} }
} }
......
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