Jump to content

test Component packet


photo

Recommended Posts

The component packet does not seem to be working properly.

image.thumb.png.fbd78320f21f14eb78b760128a4a3ce8.png

image.png.2aa2e8191157bc9efef520e88b349b7b.png

image.png.c6a090c638f5cdb5c93df72d28756936.png

 

ig_config ↓

image.png.dc95dd28eff97dbc44d35f1b2807ea15.png

 

 

Setting the component ID to 1 showed the same problem too.

 

 

and what is parallelupdate ?? 

Registering a function does not seem to execute the loop.

image.png.a8760d302880d727c2e717c034f20c4f.png

Edited by dongju.jeong
Link to comment

Hello! 
what is the name of the component in you code? 

I checked your example - everything seems to work. 

#include "ComponentSystem/ComponentSystem.h"

class K1A1_Cockpit : public ComponentBase
{
public:
	COMPONENT(K1A1_Cockpit, ComponentBase);
	COMPONENT_INIT(init);
	COMPONENT_UPDATE(update);

	PROP_NAME("K1A1_Cockpit");
	PROP_PARAM(Int, tankclass, -1)
	PROP_PARAM(Int, position, -1)

protected:
		void init()
		{
			getProperty()->addCallback(
						Property::CALLBACK_PARAMETER_CHANGED,
						MakeCallback(this, &K1A1_Cockpit::parameter_changed));
		}
		
		void update()
		{
			Log::message("%s %d %d\n", __FUNCTION__, tankclass.get(), position.get());
		}
		
		void parameter_changed(Unigine::PropertyPtr property, int num)
		{
			Log::message("%s %d %d\n", __FUNCTION__, tankclass.get(), position.get());
		}
};


output
 

K1A1_Cockpit::update -1 -1
K1A1_Cockpit::update -1 -1
K1A1_Cockpit::update -1 -1
K1A1_Cockpit::parameter_changed 1 -1
K1A1_Cockpit::parameter_changed 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5
K1A1_Cockpit::update 1 5

image.png

 

HEMU:

entity
{
	name = "K1A1";
	type = 4;
	class = fixedwing;

	component
	{
		name = "ClassPos";
		id = 0;
	}
}
ig.config.xml
    <entity_types>
		<entity id="4" name="K1A1">
			<path>ig/entities/aircrafts/be-200/K1A1.node</path> <!-- just rename be200 for test -->
			<component id="0" name="ClassPos">
				<property>K1A1_Cockpit</property>
				<parameter name="data1">tankclass</parameter>
				<parameter name="data2">position</parameter>
			</component>
		</entity>
	</entity_types>

image.png

 

  • Like 1
Link to comment
On 3/9/2020 at 1:12 PM, dongju.jeong said:

and what is parallelupdate ?? 

Registering a function does not seem to execute the loop.

This feature is malfunctioning in some cases, and we recommend do not use it.

Our team will revamp parallel update it in the future releases.

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

image.png.7babe24170d0001d1bda441d8b915d04.png

 

component name is "K1A1_Cockpit".

 

image.thumb.png.fbd78320f21f14eb78b760128a4a3ce8.png

this message is appeared when same component packet value receive.

 

Edited by dongju.jeong
Link to comment
Quote

cant create 0 host packet 

This is an error only when working with HEMU with component control packet. seems like HEMU bug.
СomponentСontrol and ShortComponentControl should work fine. You can verify this by adding callbacks to receive packages. All data comes correctly.
 

  • Like 1
Link to comment
×
×
  • Create New...