I am trying to figure out if there is a way to add to the Axis Assignments of an ISimObject.
I am trying to work on the implementation of a new axis (Elevator trim Axis) for an IsimObject, however I cannot figure out how to add this axis to the Axis Assignments in controls. I have already tried explicitly changing the DefaultControlMap.xml and adding the axis as well as the what I want the axis to be assigned to, but when I reload the IsimObject and check the controls axis assignment, I do not see the axis and assignment I have added to the DefaultControlMap.xml. Does anyone have any ideas?
Adding to Axis Assignments.
Re: Adding to Axis Assignments.
This is the new axis that I am trying to add to the DefaultConrtolMap.xml
<Axis>
<AxName>Slider</AxName>
<Index>7</Index>
<AxEvent>AXIS_ELEV_TRIM_SET</AxEvent>
<AxScale>127</AxScale>
<AxNull>1</AxNull>
</Axis>
I picked the Index based on the other indexes; I just added one. Is there any other place I need to define these values?
<Axis>
<AxName>Slider</AxName>
<Index>7</Index>
<AxEvent>AXIS_ELEV_TRIM_SET</AxEvent>
<AxScale>127</AxScale>
<AxNull>1</AxNull>
</Axis>
I picked the Index based on the other indexes; I just added one. Is there any other place I need to define these values?
-
- Lockheed Martin
- Posts: 1207
- Joined: Tue Sep 25, 2012 2:34 pm
Re: Adding to Axis Assignments.
Hi keilyn6,
ISimObject properties can be added using the RegisterProperty function in the C++ DLL. These properties can be registered in different ways, one of them being an axis type property. These custom properties can be accessed similar to native simulation variables and key events.
Regards,
Clifton
ISimObject properties can be added using the RegisterProperty function in the C++ DLL. These properties can be registered in different ways, one of them being an axis type property. These custom properties can be accessed similar to native simulation variables and key events.
Regards,
Clifton
Clifton Crane
Prepar3D® Software Engineer Sr.
Prepar3D® Software Engineer Sr.
Re: Adding to Axis Assignments.
Thank you for that clarification. I was confused on how everything worked.
adding this line:
"pSimObjectMgr->RegisterProperty(CLSID_Airplane, TEXT("ElevatorTrim"), TEXT("percent over 100"), T38::ElevatorTrim, EVENTTYPE_AXIS);"
in the .cpp indicating that I wanted to register a new axis. As well as adding the subsequent getters and setters allowed for this to work.
The Axis was then able to be set in p3d "under control" and "Axis assignment".
adding this line:
"pSimObjectMgr->RegisterProperty(CLSID_Airplane, TEXT("ElevatorTrim"), TEXT("percent over 100"), T38::ElevatorTrim, EVENTTYPE_AXIS);"
in the .cpp indicating that I wanted to register a new axis. As well as adding the subsequent getters and setters allowed for this to work.
The Axis was then able to be set in p3d "under control" and "Axis assignment".