PDA

View Full Version : Building buttons and rotary knobs first time



baw536
12-28-2009, 06:04 PM
Is there any way to remove or reprograming the Multi Panel to work as a generic device that can be 'seen' by FSUIPC?

The Pro Flight Yoke system works with FSUIPC and so does the Pro Flight Rudder pedals.

Can the Multi Panel be programmed to send a letter or number when a button is pressed, so they could be then used with PMDG aircraft. The multi panel is a USB HID device and it does not send a signal to FSUIPC, so I am unable to programme a key press or anything else.

I understand that the Multi Panel won't fully work but as intended but it will at least provide some enjoyment with other better third party aircraft, rather then the rubbish default aircraft.

When the sim is started the Multi panel is off, I then start the FS 2004 plug in and it comes to life, but when used in payware aircraft it does nothing when you press the buttons or turn the altitude knobs. FSUIPC does not register anything, why?

The Saitek Yoke works as a joystick device, how do I make the Multi panel work with FSUIPC

Thanks

Steven Higa

Oxford England

HoustonFirefox
01-21-2010, 09:35 AM
Steven,

I'm in the process of writing an "interpreter" that will create a "virtual joystick/HID" device for the Saitek products that will read thier inputs and output the results to the Virtual Joystick. This *should* allow any software (including FSUIPC) which can sense a joystick button press to respond to it in turn.

Saitek uses a propriety piece of software to receive the inputs and send them to either FS or FSX, but not other products. Why they did this I have no idea. It would have been very easy for them to simulate a generic HID device with standard buttons.

I have the Saitek switch panel (which acts much like your multi-panel) as well as the Radio Panel. I don't have the Multi Panel and as such, can't analyse the outputs from it in order to translate them into virtual joystick button presses. If anyone wants to donate one to the project then please PM me.

Neil Hewitt
01-21-2010, 11:01 AM
HoustonFirefox - I also have a Saitek switch panel I am planning to take apart and use the guts of for a project, albeit to perform the same functions - hence it ought to work in stock FSX without needing to interface it via FSUIPC - but if your project lets people do that, it'll be a great thing; IIRC it doesn't work as-is with PMDG et al, so that would be a giant leap forwards.

If I can get technical for a moment, what are you writing the interpreter in - given it's a HID driver I'm assuming C++ against the DDK, but I thought I'd ask. Are you planning to release or dual-license the source?

NH

HoustonFirefox
01-21-2010, 12:27 PM
I am writing the software in Borland's Delphi 7 and will probably sell it at a very cheap price (about $9.95?). Each successive version (free upgrades for life) will add new simulated "buttons" as new Saitek devices are released. This would allow one Virtual HID device to interpret the output from multiple panels and present them as joystick buttons.

Multiples of a given device (i.e; dual switch panels) would be presented as the same virtual device, albeit with more buttons.

Until this is complete, it just occurred to me that it would be simple to rip the electronic guts out of the panel and, using an old multi-button joystick, simply interface the switches to the joystick electronics.

This would Immediately (i.e; TODAY) make the device appear as a regular joystick with the buttons ready to be assigned! :-D

I'll keep everyone updated on the progress of the software.

Neil Hewitt
01-21-2010, 12:55 PM
I am writing the software in Borland's Delphi 7

Wow - I haven't touched Delphi in an age. Still has a very loyal following, though, I know (I used to be an IT journalist before returning to software development full time). Do you write a lot of sim-related code?. I'm going to be doing a fair bit of custom development for my project but this will be primarily in C# and Silverlight. It's always handy to know the other coders out there.


I'll keep everyone updated on the progress of the software.

Yes please. I'll certainly be a customer.

NH

gpawood
02-21-2010, 07:27 AM
Definitely interested in the progress, and will also be a customer.
thanks
tcw

huanter
11-16-2010, 12:17 AM
This my code,wrong or right?

procedure TFormMain.BBCNClick(Sender: TObject);
var
dwResult : DWORD;
dwResult1 : DWORD;
Light : Byte;
AllLight : SmallInt;
begin
//BCN灯开关
if FSUIPC_Read($0281, 1, @Light, dwResult) and FSUIPC_Read($0D0C, 2, @AllLight, dwResult1)then begin
if FSUIPC_Process(dwResult) and FSUIPC_Process(dwResult1) then begin
if ByteToBool(Light) then begin//这个变量将来要跟单片机的状态相连
Light:=0;
end else begin
Light:=1;
end;
end;
end;
AllLight:=2;//1=Nav, 2=Bcn, 4=Land, 8=Taxi, 16=Strobe,
//32=Panel, 64=Recognition, 128=Wing, 256=Logo, 512=Cabin
//$0D0C(see also $0280, $0281 and $028C)
if FSUIPC_Write($0281, 1, @Light, dwResult) and FSUIPC_Write($0D0C, 2, @AllLight, dwResult1)then begin
if FSUIPC_Process(dwResult1) then begin
//for i:=1 to 2 do cLight[i]:=0;
//cLight[1] := 1;
//cLight[2] := 1;
//cLight[3] := 1;
end else begin
// Unable to "Process"
BBCN.Caption := 'Processing: ' + ResultText[dwResult];
end;
end else begin
// Unable to "Read"
BBCN.Caption := 'Reading: ' + ResultText[dwResult];
end;
end;

Wendy
11-16-2010, 03:05 AM
This is a some Delphi code that is connecting to FSUIPC .
unfortunately the formatting of the code is lost by pasting it in this reply.


Regards, Wendy



Const
ResultText : Array[0..15] of String = ('Okay',
'Attempt to Open when already Open',
'Cannot link to FSUIPC or WideClient',
'Failed to Register common message with Windows',
'Failed to create Atom for mapping filename',
'Failed to create a file mapping object',
'Failed to open a view to the file map',
'Incorrect version of FSUIPC, or not FSUIPC',
'Sim is not version requested',
'Call cannot execute, link not Open',
'Call cannot execute: no requests accumulated',
'IPC timed out all retries',
'IPC sendmessage failed all retries',
'IPC request contains bad data',
'Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC',
'Read or Write request cannot be added, memory for Process is full');
SimulationText : Array[0..6] of String = ('Any', 'FS98', 'FS2K', 'CFS2', 'CFS1', 'FLY', 'FS2002');



procedure TFormMain.FormCreate(Sender: TObject);
var
dwResult : DWORD;
begin
// Try to connect to FSUIPC (or WideFS)
if FSUIPC_Open(SIM_ANY, dwResult) then begin
// Connected to simulator (visible in the form's caption)
FormMain.Caption := FormMain.Caption + ResultText[dwResult];
// Show what simulator we are connected to
LabelSim.Caption := SimulationText[FSUIPC_FS_Version];
// Show version of FSUIPC
LabelFSUIPCversion.Caption := Char(Ord('0') + ($0F and (FSUIPC_Version SHR 28))) +
'.' +
Char(Ord('0') + ($0F and (FSUIPC_Version SHR 24))) +
Char(Ord('0') + ($0F and (FSUIPC_Version SHR 20))) +
Char(Ord('0') + ($0F and (FSUIPC_Version SHR 16)));
if (FSUIPC_Version and $FFFF) <> 0 then begin
LabelFSUIPCversion.Caption := LabelFSUIPCversion.Caption +
Char(Ord('a') + (FSUIPC_Version and $FF) - 1);
end;
// Enable the timer which is reading the variables
TimerUpdateTime.Enabled := True;
end else begin
// Unable to "Connect"
FormMain.Caption := FormMain.Caption + ResultText[dwResult];
end;
end;


procedure TFormMain.TimerUpdateTimeTimer(Sender: TObject);
var
dwResult : DWORD;
begin
////////////trim motors
if FSUIPC_READ($0BC0, 2, @TrimMotor, dwResult) then
begin
if FSUIPC_Process(dwResult) then
begin
//code to execute - this one is for a Velleman card
LTrimMotor.Caption := IntToStr(Trimmotor);
if TrimMotorLast > TrimMotor then SetDigitalChannel(8) else ClearDigitalChannel(8);
if TrimMotorLast < TrimMotor then SetDigitalChannel(7) else ClearDigitalChannel(7);

TrimMotorLast := TrimMotor;

end else LTrimMotor.Caption := 'Processing: ' + ResultText[dwResult];

end else
begin

// Unable to "Read"
LTrimMotor.Caption := 'Reading: ' + ResultText[dwResult];
end;
end;

procedure TFormMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
FSUIPC_Close; //FSUIPC
end;

huanter
11-16-2010, 04:41 AM
can post some code about "light"???