Gremlin77 Posted August 19, 2013 Posted August 19, 2013 Hi all, two days ago decided to try out the Saitek Instrument panels for my cockpit. Ordered for a hundred bugs an was at first quite disappointed, cause of limitation to MS Flight Simulator. (as expected) But the good thing: Found a SDK folder, where a .dll for the device is included. After fighting night and day, managed to program that little beast. What can it do? Okay it has six switches and two rotaries you can access from software...... Wow....very impressive.....:mad: But the fantastic thing about it? The TFT and the function SetImage. With this little function and a bit of c# code you can copy parts of your desktop to your device. And as we as DCS lovers all know, we can export nearly everything from the game to a screen. So my idea was to just copy for example the RWR or any instruments to the Saitek. And it works fine! So now I have this ugly programed tool for my purpose (RWR) and don't know if it's worth it to make it user friendly for more users. If some people like to have such a tool, I'll start to work on it. Just let me know visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
algerad3 Posted August 19, 2013 Posted August 19, 2013 Hey gremlin, welcome to the club. Yes I would be interested in the tool. My attempts are finally coming together but , I am pretty much learning the ins and outs of lua..( I know , you are using C#) Take a look at this.....http://forums.eagle.ru/showthread.php?t=94174 A few lua scripts in there to get the X52 pro and fips going . [sIGPIC][/sIGPIC] CPIAS FOR Saitek: Saitek Flight instrument panels and X-52 pro mfd scripts for Dcs http://forums.eagle.ru/showthread.php?t=94174
Gremlin77 Posted August 19, 2013 Author Posted August 19, 2013 have my photo in the office. Send some pics tomorrow visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
Gremlin77 Posted August 19, 2013 Author Posted August 19, 2013 I read your thread. But didn't realize that your lua-script is able to export graphics. For me it's more convenient to use a more complex programming lanquage with a debugger and so on. Using lua is not my thing at all. Had hard days writing my export function to connect to my interface software. This was enough lua for the rest of my life!!!! visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
algerad3 Posted August 19, 2013 Posted August 19, 2013 I'ma afraid that I can't export graphics with lua... Gd only works with everything but bmp files. I have to draw my own gauges. I understand what you say about lua...driving me bonkers but, I have to admit I am at the learners stage of programming ... Would you care to share your c# set up , I would like to see how to do it at that level , was trying to create an interface with C++ but they changed the callbacks on one of the functions and it kept me quite confused. [sIGPIC][/sIGPIC] CPIAS FOR Saitek: Saitek Flight instrument panels and X-52 pro mfd scripts for Dcs http://forums.eagle.ru/showthread.php?t=94174
Bedouin Posted August 19, 2013 Posted August 19, 2013 I was sitting today and researching the forums for if there was anybody there got the Saitek or Vrinsight panels/gadgets to Work with DCS.. Was considering ordering some... But didnt find anything until now, will be very interested to see whats possible with Saitek..? So please continue the Work :-) .
Gremlin77 Posted August 21, 2013 Author Posted August 21, 2013 Sorry for delay, always forget my photo in the office. For c# coders: started using the AstroMech (just google) code from Saitek forum and added the SetImage Funtion at the DirectOutputClass: [DllImport("c:\\program files\\saitek\\directoutput\\DIRECTOUTPUT.DLL", EntryPoint = "DirectOutput_SetImage")] unsafe public static extern int DirectOutput_SetImage(void* hDevice, int dwPage, int dwIndex, int cbValue, byte[] pbValue); In project code added something like this: public void button6_Click(object sender, EventArgs e) { int returnvar; returnvar = AstroMech.DirectOutputClass.DirectOutput_AddPage(m_hDevice, 1, "Test", false); Graphics graphics = Graphics.FromImage(img.Image); byte[] buffer = newbyte[320 * 240 * 3]; Point upperLeftSouce = newPoint(100, 100); Size blockRegionSize = newSize(385, 351); Bitmap bitmap = newBitmap(blockRegionSize.Width, blockRegionSize.Height, PixelFormat.Format24bppRgb); using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(upperLeftSouce, newPoint(0, 0), bitmap.Size); } for (int y = 0; y < 240; y++) for (int x = 0; x < 320; x++) { Color color = bitmap.GetPixel(x, 239 - y); buffer[(y * 320 + x) * 3] = color.B; buffer[(y * 320 + x) * 3 + 1] = color.G; buffer[(y * 320 + x) * 3 + 2] = color.R; } AstroMech.DirectOutputClass.DirectOutput_SetImage(m_hDevice, 1, 0, buffer.Length, buffer); button6.Text = CurrentPage.ToString(); } what it does: it creates a new page on the Saitek an copies for demo a screenpart to the device when you hit the button. Also did it with a timer function, so ever 0,01 Seconds a screenpart is copied. Works quite fine. You tune the prog for better user operation. Please give me some time. visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
Succellus Posted August 21, 2013 Posted August 21, 2013 You re really the first guy to do this feat !!!! Many have tryed and until now all had fallen, nice to know someone arise. I always had found the saiteks stuff interesting but the company extremely lazy assed. Depending of what you can do this could maybe a nice "replacement" for real deal stuff (living outside US) and working in tandem with GADROC program it could be very nice becuase you could have more space onto your monitor. (this could interest FLIM also) What have you achieved ? And what do you think you can achieve ? Very interested. HaF 922, Asus rampage extreme 3 gene, I7 950 with Noctua D14, MSI gtx 460 hawk, G skill 1600 8gb, 1.5 giga samsung HD. Track IR 5, Hall sensed Cougar, Hall sensed TM RCS TM Warthog(2283), TM MFD, Saitek pro combat rudder, Cougar MFD.
algerad3 Posted August 21, 2013 Posted August 21, 2013 AH, Liking the concept..Will keep an eye out for this. [sIGPIC][/sIGPIC] CPIAS FOR Saitek: Saitek Flight instrument panels and X-52 pro mfd scripts for Dcs http://forums.eagle.ru/showthread.php?t=94174
Gremlin77 Posted August 23, 2013 Author Posted August 23, 2013 small demo prog So, just made a quick prog for max two Instrument panels. just set your x and y coordinates for screen area you want to copy and click start. Please be aware of pressing stop before changing values. Have fun! publish.rar visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
Gremlin77 Posted August 23, 2013 Author Posted August 23, 2013 okay, better version now: Conversion of Screenshot to byte array much faster without processor power and you can adjust the time for sending pics to the Saitek. If any of you need more Instruments or anything else please let me know! Download link: ScreenToSaitek.rar visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
algerad3 Posted August 23, 2013 Posted August 23, 2013 Cool , Will check it out .. Thanks Gremlin [sIGPIC][/sIGPIC] CPIAS FOR Saitek: Saitek Flight instrument panels and X-52 pro mfd scripts for Dcs http://forums.eagle.ru/showthread.php?t=94174
Gremlin77 Posted August 25, 2013 Author Posted August 25, 2013 So, finished to tool to get nice usability. In this version you have: * 4 instrument panels supported (didn't test yet, panels are still in delivery, but should work) * A preview windows where you can see the captured pic on mouseposition * you can store the preview coordinates to the desired instrument using key 1,2,3 and 4 * A trackbar to adjust export speed (1ms to 2000ms) * A save function, to save coordinates of the four instruments and your Timer settings So, hope you have fun with this little tool. If you like it, please donate on my software page: http://www.737ng-homecockpit.de/ DOWNLOAD HERE: ScreenToSaitek.rar visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
Intrepid1 Posted August 25, 2013 Posted August 25, 2013 Gremlin; Do you have any pic's of the saitek gauges working? I would like to see that or a video. The fact that saitek wouldn't make their stuff usable, and you figured it out really impresses me. :beer: Randy
Gremlin77 Posted August 25, 2013 Author Posted August 25, 2013 (edited) Oh, Saitek makes it useable, but the problem was to use their SDK with .net applications, cause the SDK is for c++, what I am not familiar with. okay here the pics: Software running: and the result (just used MFD and CDU for quick demo) Edited August 25, 2013 by Gremlin77 visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
Intrepid1 Posted August 25, 2013 Posted August 25, 2013 :notworthy:WoW! you are the master Now I can purchase the saitek gauges i was looking at but wouldnt because I thought they were only good for FSX My bank balance is getting smaller by the month lol Randy
jay43 Posted August 26, 2013 Posted August 26, 2013 wow that's cool Gremlin you have cracked the hard boiled egg nice job do you have any plans to get the switch panels to work like the radio panel and the others they do I hate having to look down and fumble for the mouse to change radio frequencys. Eagles may soar high but weasel's don't get sucked into jet engines. System Spec. Monitors: Samsung 570DX & Rift CV1 Mobo: MSI Godlike gaming X-99A CPU: Intel i7 5930K @ 3.50Ghz RAM: 32gb GPU: EVGA Nvidia GTX 980Ti VR Ready Cooling: Predator 360 Power Supply: OCZ ZX Series 80 Plus Gold Drives: Samsung SSD's 1tb, 500g plus others with OS Win10 64 bit
HornetUK Posted August 26, 2013 Posted August 26, 2013 love the tool, know anywhere you can get the panels cheap as the are quite expensive?
Gremlin77 Posted August 26, 2013 Author Posted August 26, 2013 Sorry don't have the switch panels. Just working on the buttons and rotaries of the FIB to get to work properly. I bought my four Panels on ebay for 109€ each. Quite expensive, I know, but just think about buying an USB monitor (130€) or use a graphic card with small hdmi (vga) monitor, it's not so expensive at all. The good thing about the FIPs is the size. Did just find TV screens in that size not very comfortable to use with the PC. visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
HornetUK Posted August 26, 2013 Posted August 26, 2013 (edited) What about these little USB monitors they are about 98 euro here is a link http://www.lilliputdirect.com/usb/7-inch-usb/lilliput-um70 Edited August 26, 2013 by HornetUK
showtime817th Posted August 26, 2013 Posted August 26, 2013 Can this be used for Huey gauges? Showtime [sIGPIC][/sIGPIC]
Gremlin77 Posted August 26, 2013 Author Posted August 26, 2013 I have three of the Lilliput monitors running for both MFDs and ADI. Having quite often difficulties to keep them running. After half an hour or so windows starts "loosing" the monitors....very exhausting.... visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
bnepethomas Posted August 29, 2013 Posted August 29, 2013 Nice work, it was a real tragedy that Saitek never did an SDK, very cool you'd found a way to drive them. cheers Peter
Gremlin77 Posted August 29, 2013 Author Posted August 29, 2013 (edited) Final version: ScreenToSaitekV4.0.rar -supports up to 4 instrument panels - use the two rotaries to adjust screen capture position - use S1 to chose between small and big steps of the rotaries - use S6 to save If you like it, PLEASE donate: http://www.737ng-homecockpit.de/ was a lot of work.....:lol: Edited August 29, 2013 by Gremlin77 visit my build thread Gremlin's A-10 :thumbup: http://forums.eagle.ru/showthread.php?t=86916
Recommended Posts