dongju.jeong Posted February 27, 2019 Share Posted February 27, 2019 (edited) Are all CiGi classes related to CigiHostPacket automatically processed upon receive?I think ComponentControl will be handled differently depending on the data and functions.For example, what should I do when I want to use LandingGears and LandingGearPart of be_200? Or are the things described in the "Setting up properties" tab of Ig documents irrelevant with ComponentControl ? Simply put, I don't understand exactly the mechanism between component elements in the ig_config and setting properties in the nodereference for Entity. Can I ask you to elaborate on that? Edited February 27, 2019 by dongju.jeong Link to comment
cash-metall Posted February 28, 2019 Share Posted February 28, 2019 Quote Are all CiGi classes related to CigiHostPacket automatically processed upon receive? no, not all. list of supported packets. Quote I think ComponentControl will be handled differently depending on the data and functions. components work flow: When the component control packet arrives, IG search component by ID in ig_config.xml. Next, IG search Component with name in <property>. By parameter "state"/"data1"/"data2" in packet IG search corresponding parameter in component (landing/taxi/navigation) and transmit value into component parameter. Сomponent itself decides what to do with the new value. for example: ComponentControl packet received: component_id = 0, instance_id = 0, component_class = 0, component_data_1 = 1. 1. instance_id = 0, component_class = 0 means what packet for entity 0. 2. supposably entity 0 has type 200. In ig_config.xml, for 200 type and component_id = 0 IG gets component LightAircraftController, and for component_data_1 take in LightAircraftController parameter "landing" 3. IG transmit value component_data_1 into parameter "landing" (type of value does not matter). Quote For example, what should I do when I want to use LandingGears and LandingGearPart of be_200? LandingGearPart - it`s part of LandingGears component. It does not work separately. To control the LandingGears, you need to configure the NodeReference. Then you need to specify in the ig_config.xml which host parameters in which IG parameters to transfer. (for testing in HEMU with current configurate be-200 you can use Entities.def in attach) I think, We need to write detailed instructions for creating your own components in the documentation. Entities.def 1 Link to comment
dongju.jeong Posted February 28, 2019 Author Share Posted February 28, 2019 (edited) It is great helpful for me. thank you. I see that properties related to component in Ig template works automatically when recieve component packet. but, if I make custom property and write custom component element in ig_config, Do I need register callback function in "setReceivePacketCallback" for desired work? + I want to know how use EntityCameras.prop and EntityComponent.prop in Ig/properties folder. Edited February 28, 2019 by dongju.jeong Link to comment
cash-metall Posted February 28, 2019 Share Posted February 28, 2019 Quote but, if I make custom property and write custom component element in ig_config, Do I need register callback function in "setReceivePacketCallback" for desired work? No, additional processing is not necessary. advice: you could add callback inside component to know when the values have changed. void YouCustomComponent::init() { getProperty()->addCallback(Property::CALLBACK_PARAMETER_CHANGED, MakeCallback(this,&YouCustomComponent::parameter_changed)); } //method will call, when property changed void YouCustomComponent::parameter_changed(PropertyPtr property, int num) { //TODO smth } Quote + I want to know how use EntityCameras.prop and EntityComponent.prop in Ig/properties folder. its internal property, no useful payload in current realease 1 Link to comment
dongju.jeong Posted March 4, 2019 Author Share Posted March 4, 2019 (edited) On 2/28/2019 at 5:17 PM, cash-metall said: No, additional processing is not necessary. Do these properties(such as landingGears, landingGearsPart etc) also mean that the callback function is set somewhere? On 2/28/2019 at 5:17 PM, cash-metall said: getProperty()->addCallback(Property::CALLBACK_PARAMETER_CHANGED, MakeCallback(this,&YouCustomComponent::parameter_changed)); [+ I was just wondering where is the code that actually rotate the node corresponding to the landingGearPart. Because when I created the new property related to custom component, I want to imitate that way. Just because the property parameter changes, it is unlikely that action will occur automatically.] Edited March 5, 2019 by dongju.jeong Link to comment
silent Posted March 5, 2019 Share Posted March 5, 2019 dongju.jeong This callbacks and methods are defined and executed from IG_double_x64 library. Sources of this plugin are not available to end users. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
dongju.jeong Posted March 5, 2019 Author Share Posted March 5, 2019 (edited) If I have set the callback function for a change in one parameter, is there a problem when the changed value of the other parameter also has to be considered? (For example, when a component packet changes all parameters in the property, If the callback function is executed first before the value of the other parameters that must be considered is changed, the function seems unlikely to be implemented as I intended.) Edited March 6, 2019 by dongju.jeong Link to comment
Recommended Posts