[gme-users] Interpreter (Add-On) problem setting registry value
Florian Kraus
florian.kraus at ils.uni-stuttgart.de
Mon Feb 9 07:16:45 CST 2015
Thank you Kevin,
the bugfix in version 14.10.29 solved our issue. It’s working fine now!
We were using GME 14.10.10. Sorry for any inconvenience.
Florian
Von: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-bounces at list.isis.vanderbilt.edu] Im Auftrag von Kevin Smyth
Gesendet: Mittwoch, 4. Februar 2015 22:47
An: A list for GME users to share thoughts and discuss bugs and fixes.
Betreff: Re: [gme-users] Interpreter (Add-On) problem setting registry value
What version of GME are you using? There was a bug fixed in 14.10.29 that prevented addons from getting some events.
Kevin
On Fri, Jan 23, 2015 at 6:32 AM, Florian Kraus <florian.kraus at ils.uni-stuttgart.de> wrote:
Hello everyone,
We have an issue with GME-Interpreter working as Add-On.
What we want to do:
Set an Objects Registry-Value “nameColor” according to this Objects Attribute named “Color”.
Problem:
It works fine for the FIRST time, but when we change the Attribute a second time, nothing happens (the Interpreter doesn’t start at all).
After restarting GME it works, but again just for one time.
You’ll find our Interpreter-Code attached.
Note:
If we comment the lines where Registry is set, the Interpreter works even several times (but nothing happens in the model for sure).
otherFCO->getRegistry()->setValueByPath("/nameColor" , "0xff0000");
Any idea?
Thanks in advance.
Florian
---------
Dipl.-Ing. Florian Kraus
Institut für Luftfahrtsysteme (ILS)
Universität Stuttgart
Pfaffenwaldring 31
70569 Stuttgart (Vaihingen)
Tel.: +49 (0)711 685-67004 <tel:%2B49%20%280%29711%20685-67004>
Fax: +49 (0)711 685-63591 <tel:%2B49%20%280%29711%20685-63591>
Email: <mailto:florian.kraus at ils.uni-stuttgart.de> florian.kraus at ils.uni-stuttgart.de
URL: <http://www.ils.uni-stuttgart.de> http://www.ils.uni-stuttgart.de
___________________________________________________________________________________
Code:
// ====================================================
// If the component is an Add-On, then this method is called for every Object Event
void Component::objectEventPerformed( Object& object, unsigned long event, VARIANT v )
{
// ======================
// Insert application specific code here
std::string MetaName;
std::string InterfaceColor;
char anyChar[65];
_itoa(event, anyChar, 16);
using namespace GMEConsole;
Console::Out::WriteLine(CString("Interpreter startet") + CString(" - event:") + CString(anyChar));
if(event == 0x00000001){
ObjectStatus Status;
Status = object->getStatus();
if (Status == OST_Deleted){
goto cancel;
}
if (event == MON::OET_AttributeChanged){
MetaName = object->getObjectMeta().name();
Console::Out::WriteLine(MetaName.c_str());
if (MetaName == "MyAtom" ) {
BON::FCO otherFCO(object);
InterfaceColor = otherFCO->getAttribute("Color")->getStringValue();
if (InterfaceColor == "RED") {
otherFCO->getRegistry()->setValueByPath("/nameColor" , "0xff0000");
}
if (InterfaceColor == "YELLOW") {
otherFCO->getRegistry()->setValueByPath("/nameColor" , "0xffff00");
}
if (InterfaceColor == "BLUE") {
otherFCO->getRegistry()->setValueByPath("/nameColor" , "0x0000ff");
}
}
}
cancel:
Console::Out::WriteLine(CString("Interpreter stopped"));
}
}
_______________________________________________
gme-users mailing list
gme-users at list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20150209/1806e0bb/attachment.html
More information about the gme-users
mailing list