Hi,
I've got a quick question about the config files used with the Space Pilot. I'm in the middle of creating a control system for PTZ cameras in a video surveillance system. We got a Space Pilot for the project. I've gotten the controls working and the keystrokes captured (nice api, BTW. Very simple to use ). I understand after doing some reading on the forums that you will have a Display object to manipulate the display in a later version, but since it's not here yet, I have to manipulate the button labels via the config file. I've gotten it created, and the text on the header of the lcd is correct. The button labels remain the default, though. Is there a tag somewhere that I'm missing to override the default button setup?
Great application! I've been hoping someone would make use of this technology in video surveillance. You can combine camera zoom and pan, as well as video processing (e.g, rotating the image) all in one intuitive single-handed interface. Hollywood is a bit ahead of you, I did see a clip from a movie that is using a SP for some of this (fake).
It could be that you are editing the wrong place in the config file. All the strings for the possible button targets are in the BUTTON_NUMBERS section (UI_SB_1, UI_SB_2, etc). The [SPACEPILOT] section must then make use of these targets, e.g. BUTTON_1_USER = { UI_SB_1, HOLD }.
The _USER_ entries are used. The _DFLT_ are copied over the _USER_ entries if the user selects "restore defaults".
Start with Any.scg (copy it to a new name), modify the EXECUTABLES entry, the APPLICATION_NAME and change APP_CONTROLS_BUTTONS=TRUE. Then save it in the defaults directory and restart the driver. Finally, choose your config in the 3DxWare GUI combo box.
Please make sure I did this correctly. I have it connected via the "MultiView" config that I created from the Any config. Here's what I did:
1. Shut down driver.
2. Copy any.scg and change name to multiview.vshost.scg (I'm running it in the Visual Studio IDE)
3. Change the app name to MULTIVIEW
4. Change the executable name to multiview.vshost.exe
5. Change the APP_CONTROLS_BUTTONS=TRUE
6. Change the text inside the quotes for Button 1 to "TAG", because I want to use it to tag video clips.
7. Save the profile.
8. Start the driver.
9. Start the app.
10. Choose the config.
During step 10, i noticed the LCD for button 1 does not read TAG. It reads Button 1 instead. TAG doesn't show up in the drop down in the GUI, either. I guess that's what my question is, is how to make the TAG show up in the display rather than the Button 1 text. When I mod the user00.scg to say TAG, it shows up, but I don't want to change that, since this might be used elsewhere by our customers. I' m a little puzzled here.
There is just some small disconnect here. Everything you are doing looks very close to correct.
It seems a bit stange that you are naming the exe and the scg multiview.vshost. How about using multiview_vshost? What does "running it in the VS IDE" mean? Just that you are launching it from the debugger? It runs as a stand alone app, right?
I assume you are using the 3DxInput (TDxInput) COM API.
When you select your configuration, what does the systray icon say if you hover over it?
user00.scg is the configuration that was automatically saved when you made changes to some configuration. The connection between this config and a specific application is saved in the registry. That is how it gets restored when you restart the driver and/or your app. If you select a new configuration in the GUI while your app is running it will save that configuration name in the registry associated with the app.
I'm not sure what the name of the scg file has to do with it. I just named it that since the executable is named that. After changing it, I now get an error saying "Error reading in configuration. Configuration not loaded." I can't select the "Multiview" config. I have to change the registry entry for Multiview to set it to the correct configuration. After doing that, I get the header to say Multiview, but the buttons are still the default.
I am using TDxInput inside a VS2005 C# project, and I'm running this in the debugger. It's not a stand-alone app (yet), but it will be as soon as I check this code into source control. That's not going to happen until I get this part of it figured out
As far as the systray goes, it says "3DxWare for any application (multiview_vshost.exe). Hope this helps
Here's my advise:
0) Stop the 3DxWare driver and your application.
1) Change your executable name to multiview_vshost.exe
2) Change the EXECUTABLES line in Multiview_vshost.scg to "MULTIVIEW_VSHOST.EXE"
3) Assign APPLICATION_NAME = "Multiview"
4) Make sure you save Multiview_vshost.scg in c:\Program files\3Dconnexion\3Dconnexion 3Dxsoftware\3DxWare\en_us\profiles\default.
4) Delete all the saved user config files in %APPDATA%/3Dconnexion/3DxWare/profiles
5) Delete the registry entries in HKCU/Software/3Dconnexion/3DxWare/Applications
6) Start the driver.
7) Start your application (without debugging).
The systray icon should say "3DxWare for Multiview (multiview_vshost.scg)"
The 3DxWare GUI top combo box should say "Multiview"
I went you one better. I created a very simple, single form application called JoystickTest. The only lines of code that were not generated by the IDE are the ones to create the device, keyboard, and sensor, and to connect the device.
I then created a new profile, just in case I had screwed up the old one. Its called JoystickTest.scg. I followed your instructions to the letter. I deleted all the old registry entries and user config files, then restarted the driver. I then installed and ran JoystickTest.
Bottom line, I got the exact same results. The header of the display reads Joystick Test. The buttons remain the default Button 1, even though the text in the config file says it should say Tag. I'm stumped.
Thanks, Jim. That makes it purr like a kitten. That begs another question, though. How is the owner determined? I want to make sure that when we decide to distribute this, we need to make sure everything is correct. Thanks for the tip, though.
The OWNER field was a placeholder for OEM relationships. You own it if you distribute it <G>
Don't get too attached to this config file format. It's getting pretty long in the tooth. I plan on completely replacing it in the future. It is best to not use config files, but we realize you have to since we haven't implemented the Display object yet.
Trust me, I'm definitely ready to have the new Display object. The config file portion of this evolution has definitely not matched up to the ease of using the api for capturing the data. Thanks for all the help.
joe