Hi.
SpacePilot & my own APP (non ATL)
How to receive the greatest possible value for parametre
SiSpwEvent.u.spwData.mData[...]
for SI_MOTION_EVENT type of event?
Need help
P.S. Sorry for my English
Greatest possible value
Moderator: Moderators
Hello Bardack,
The maximum value that you can get from a device axis is determined by the config file used by your application. The device will only generate up to about 500, but the user can scale this value using the GUI. It can become any long, but is generally clipped to +/- 2000 in the config files that we ship.
If your software has issues with large numbers, it should clip the data at the maximum value it can handle.
Jim
3Dx Software Development
The maximum value that you can get from a device axis is determined by the config file used by your application. The device will only generate up to about 500, but the user can scale this value using the GUI. It can become any long, but is generally clipped to +/- 2000 in the config files that we ship.
If your software has issues with large numbers, it should clip the data at the maximum value it can handle.
Jim
3Dx Software Development
Yes, you can use those functions to get most of the transformations that are being applied to the data. The Set functions allow you to set these scale factors to 1.0.
There can also be some small amount of scaling that is applied as a result of how slow or fast your application runs. If you want completely raw data, the best API to use is HID.
Jim
3Dx Software Development
There can also be some small amount of scaling that is applied as a result of how slow or fast your application runs. If you want completely raw data, the best API to use is HID.
Jim
3Dx Software Development
For some reason all these functions return value 21 - "Wrong hash code sent to a Sync function". But all the rest works.
My code:
Where I am mistaken?
My code:
Code: Select all
//Initialisation
SiHdl HID3DCHandle;
SiOpenData oData;
SiOpenWinInit (&oData, this->Handle);
SiSetUiMode(HID3DCHandle, SI_UI_ALL_CONTROLS);
HID3DCHandle = SiOpen("Project1", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &oData);
if (HID3DCHandle == NULL)
{
SiTerminate();
}
//AppMessageHandler
SiSpwEvent Event;
SiGetEventData EventData;
SiGetEventWinInit(&EventData, Msg.message, Msg.wParam, Msg.lParam);
if (SiGetEvent(HID3DCHandle, 0, &EventData, &Event) == SI_IS_EVENT)
{
if (Event.type == SI_MOTION_EVENT)
{
SPWfloat32 ScaleOvr;
SPWfloat32 ScaleTy;
SPWfloat32 ScaleRz;
SPWfloat32 ScaleTz;
SpwRetVal Result = SiSyncGetScaleOverall(HID3DCHandle, &ScaleOvr);
//Here Result value is 21 and not write ScaleOvr variable
//And so on...
//...
}
}
Before you can call an SiSync function you have to respond to a Sync Query event. The driver sends you one of these when it finds APP_CONTROLS_BUTTONS = TRUE in the config file for your application. It won't try to sync with you or respond to syncing calls if your config file is not setup for synching (defines the variable). Take a look at the solidworks config file.