Jump to content

Gadroc

Members
  • Posts

    1060
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Gadroc

  1. That would be very funny.... if I didn't have the same thing. I've spent way more time programming touch buddy, building controls and pit than I have flying. I'm hoping to have my current programing project ready for release in January so I can fly again :) Nice. I'm sure it makes a big difference while flying as well. Moving up to the big screen on mine was like night and day. I haven't tried yet. I'm a real newbie when it actually comes to aviation, and I've been spending most of my time building. I haven't even booted the multiplayer version (need to get my software setup with it though), but would be interested in trying. Send me PM if you want to try and hook up.
  2. Thanks, It was a late night but I got everything working. I just need to order a few cables so I can position the control box where I want it. Did a quick flight and it was awesome!!! Having the analog stick actually work for the shkval is great, and travel seemed about perfect for the controls. I added two inches to the length of the collective and now I need to go back and add move up the stop for collective travel. Otherwise everything turned out good. I did get a working collective brake switch hooked up. It doesn't affect travel of the actual collective but does trigger a joystick button when pressed for the game. In my rush to fly again (was really frustrated with my G940 so had not been flying) I didn't take any pictures. I'll rectify that this weekend.
  3. Yea! The first batch of electronics is here today. I will finish wiring the collective tonight!
  4. Yea the whole point of shared memory is to not do that from the scripting language. You can render the image straight from the shared memory. The memory mapping features are standard Win32API calls so any language which can call them can do this. You just need to make sure close the shared memory as appropriate, via IDispose or finalizers. The above code was proof of concept type code for TouchPal and was never included in the source tree or official releases. The shared memory does export the entire Shkval texture, but does not export the full ABRIS texture.
  5. If you crash to desktop when you set you resolution higher than your primary display you need to turn off full screen mode.
  6. Did you have create that servo gauge?
  7. To give credit where it is due the graphical design and layout are all DickDastardly's! I just wired up all the pretty stuff to the messy geeky stuff :book:. @KPaw - I haven't had a chance to boot up DCS to see if I can get the HUD switch figured out. I've been heads down coding and waiting for the electronics for my collective & cyclic, but I haven't forgot. @ady1966uk - Your screen shot looks correct for multi-screen. If you setup TouchPal to run on the right hand side it will cover the "stretched" logos and random graphics that DCS draws there and just let the ABRIS and shkval show through.
  8. Here is the C# code I used to decode the shared memory locations. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Runtime.InteropServices; using System.IO; namespace TouchPal { class SharedMemoryBitmap { private string _sharedMemoryName; private IntPtr _fileHandle = IntPtr.Zero; private IntPtr _startAddress = IntPtr.Zero; private IntPtr _bitmapInfoAddress = IntPtr.Zero; private IntPtr _bitmapDataAddress = IntPtr.Zero; private const UInt32 SECTION_MAP_READ = 0x0004; [structLayout(LayoutKind.Sequential, Pack = 1)] public struct BITMAPINFOHEADER { public uint biSize; public int biWidth; public int biHeight; public ushort biPlanes; public ushort biBitCount; public uint biCompression; public uint biSizeImage; public int biXPelsPerMeter; public int biYPelsPerMeter; public uint biClrUsed; public uint biClrImportant; public void Init() { biSize = (uint)Marshal.SizeOf(this); } } [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr OpenFileMapping( uint dwDesiredAccess, bool bInheritHandle, string lpName); [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr MapViewOfFile( IntPtr hFileMappingObject, uint dwDesiredAccess, uint dwFileOffsetHigh, uint dwFileOffsetLow, uint dwNumberOfBytesToMap); [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool UnmapViewOfFile(IntPtr lpBaseAddress); [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool CloseHandle(IntPtr hObject); public SharedMemoryBitmap(string sharedMemoryName) { TouchPal.Debug("Shared Memory Bitmap for " + sharedMemoryName + " created"); _sharedMemoryName = sharedMemoryName; } public bool IsDataAvailable { get { bool dataAvailable = true; if (_fileHandle.Equals(IntPtr.Zero)) { Open(); } if (_fileHandle.Equals(IntPtr.Zero)) { dataAvailable = false; } else if (_startAddress.Equals(IntPtr.Zero)) { dataAvailable = false; Close(); } return dataAvailable; } } public Image GetImage() { if (IsDataAvailable) { Bitmap bitmap = null; Int16 identifier = Marshal.ReadInt16(_startAddress); if (identifier == 0x4D42) { BITMAPINFOHEADER header = (BITMAPINFOHEADER)Marshal.PtrToStructure(_bitmapInfoAddress, typeof(BITMAPINFOHEADER)); PixelFormat fmt; switch (header.biBitCount) { case 32: fmt = PixelFormat.Format32bppRgb; break; case 24: fmt = PixelFormat.Format24bppRgb; break; case 16: fmt = PixelFormat.Format16bppRgb555; break; default: TouchPal.Error("Invlaid pixel format for " + _sharedMemoryName); return null; } bitmap = new Bitmap(header.biWidth, header.biHeight, ((int)(header.biWidth/8) * header.biBitCount), fmt, _bitmapDataAddress); } else { TouchPal.Debug("Invalid bitmap type identifier (" + identifier + ") for " + _sharedMemoryName); } return bitmap; } TouchPal.Debug("No sharmed memory data avaliable for " + _sharedMemoryName); return null; } private void Open() { Close(); _fileHandle = OpenFileMapping(SECTION_MAP_READ, false, _sharedMemoryName); if (_fileHandle.Equals(IntPtr.Zero)) { int lastError = Marshal.GetLastWin32Error(); if (lastError != 2) { TouchPal.Debug("Error opening file mapping " + lastError); } } _startAddress = MapViewOfFile(_fileHandle, SECTION_MAP_READ, 0, 0, 0); _bitmapInfoAddress = new IntPtr(_startAddress.ToInt64() + 4); _bitmapDataAddress = new IntPtr(_startAddress.ToInt64() + 44); } private void Close() { if (!_fileHandle.Equals(IntPtr.Zero)) { UnmapViewOfFile(_startAddress); CloseHandle(_fileHandle); } } } }
  9. Forgot to say the panels look great there Kpaw! Let me know if you need any other help figuring out the profile syntax.
  10. You almost have the change panel buttons correct. First give each panel button the same networkid. Second when you push in state 0 you need the action to set the state to 1 and vice versa. This will cause the states to toggle. Third only toggle visibility on each button when it is clicked in it's off state. Last add both controls to each panel. Also make sure your default panel is defined last. Here are the button options I used to get it working. <Button Name="Mainpanel"> <NetworkID>5012</NetworkID> <Width>40</Width> <Height>100</Height> <DefaultValue>1</DefaultValue> <State> <StateValue>0</StateValue> <PushedAction>CV:5012=1</PushedAction> <PushedAction>PS:MP</PushedAction> <PushedAction>PH:SP</PushedAction> <Image>pictKpaw\A075p2.png</Image> </State> <State> <StateValue>1</StateValue> <Image>pictKpaw\A075p1.png</Image> </State> </Button> <Button Name="Secondarypanel"> <NetworkID>5012</NetworkID> <Width>40</Width> <Height>100</Height> <DefaultValue>1</DefaultValue> <State> <StateValue>1</StateValue> <PushedAction>CV:5012=0</PushedAction> <PushedAction>PS:SP</PushedAction> <PushedAction>PH:MP</PushedAction> <Image>pictKpaw\A076p1.png</Image> </State> <State> <StateValue>0</StateValue> <Image>pictKpaw\A076p2.png</Image> </State> </Button> Not sure why one doesn't work. I have had problems with my G940 sending keys to fast and Black Shark not recognizing it.
  11. Very nice! That is an incredible good looking panel.
  12. I'll try and dig up the code I used to do this over the weekend.
  13. There is something wrong with your multi-screen config in Black Shark. I strongly suspect something is syntactically wrong with Touchpal doesn't do anything except leave a space to see through to them. You might want to check the error logs for black shark and see if it complains about anything in the config files. To troubleshoot this you should run with out touchpal until you can successfully get the monitor config the way you want it. Also make sure you are running with the latest patch. The multi-monitor behavior changed in it and TouchPal requires the changes for it in networking.
  14. I suspect you will have problems with the USB monitors for Black Shark. In my testing putting the ABRIS display on anything except for the primary video card kills your framerate. I successfully run a four monitor (40" main display and 3 15" touch screens) setup off of one computer, but I do it through all VGA/DVI connections with a secondary video card. I obviously run TouchPal on that. I have successfully run BSVP on it as well in regards to frame rate, but it causes problems with my G940. I have not had a chance to try out the shkval on a USB monitor. I have a 8" LCD which I will drive via TV out for my shkval in the new pit I'm building.
  15. Setting fullscreen to false and width to 2048 should be the correct settings. It sounds like it's not correctly reading your dd_touchpal_2mon.lua file. Make sure it is in the same directory as the defualt monitor files and has a lua extension. Edit: actually if you are in XP and using identical resolution you should be able to do full screen with monitor span setup correctly in the nvidia/ati drivers.
  16. That error is usually caused by not having the touchpal.XML file in the right location. Double check under your my documents directory that you have a Touchpal folder and in that folder you have a touchpal.XML file.
  17. I think it really depends on your environment. I started with a trackclip pro, but it broke. In the mean time I started using the basic trackclip with a hat and realized it seemed to work better for me. As a bonus I don't have to wear a headset (have surround speakers on the pit). A couple things I've found over the last few months of having the TrackIR. 1) Make sure you open up the TrackIR software and open camera view. Always easiest to maximize the view removing the options dialogs while doing this. 2) Move the camera around until your green dots from the trackclip are in the center. 3) If you have lots of red or green dot's that are not your trackclip look for the source of them and eliminate them if possible (aka the xmas lights). 4) If other things are reflecting the IR you can adjust the intensity of the ir transmitters on the camera (not at pit computer so I don't remember exactly how). 5) Check in camera view how far you can tilt and turn your head before the dots turn from green to red. When the dot's turn red is when the TrackIR goes wonky. 6) Adjust the tilt (by moving the little legs in and out) or move the TrackIR camera until you get the best range of movement with out one of your tracking dot's going red. After doing this mine works great! A also find coping the smooth or one to one profiles works best with flying. Just move the line up on the one to one so you can turn farther. I did need to add some dead zone to the roll axis or the view tilted to much. Hope that helps!
  18. Not upset at all. Just wanting to understand if there where issues I didn't know about. All is good my friend! Fear not cause I can't read a lick of tax code. My wife was an accountant pre kids and we definitely didn't talk about work with each other. Instant glazed eyed look on both sides. Ironically I know a lot of IT folks who are married to accountants.
  19. LOL. Sorry, I should know better than respond after coding for several hours. As a clarification TouchPal does nothing for the actual Shkval and ABRIS displays. It merely overlays graphics over top of the existing Black Shark screens. Both TouchPal and BSVP require data sent back and forth between them and Black Shark. In order to support these they both have modified Export.lua files. This file tells Black Shark how to talk to these applications. The only thing that prevented BSVP and TouchPal from running together was that they had conflicting Export.lua files. If you look through the threads I merged the Export.lua files and then DickDastardly fixed a problem with the Export.lua that existing only in one language. I personally don't run with both BSVP and TouchPal as I run my whole pit off of one computer with multiple video cards. BSVP due to it being a 3D engine in itself messes up joystick input for my G940. I am working on a project which is much more consumable and more capable. You should see some announcements in the next month or so.
  20. What do you mean by work with BSVP. They have been able to work together for a while. Check this thread and the BSVP thread for the Export.lua which will allow both of them to work at the same time.
  21. @ddahlstrom if you send me a PM with a patch set against the svn on google code I can get these changes checked in.
  22. The display will not turn on until you have your inverters are turned on and the throttle is moved to auto.
  23. The existing touchpal can do "tabs" now. Check out how the shkval button toggles the Shkval panel off and on. If you create a series of buttons that toggle visibility of panels you can in effect create your own tabs.
  24. I did get it partially functioning, in the fact that I could get an image from the shared memory and display it. The graphics did have some wrong colors (which could be coding error on my part.) But notice it says "ABRIS map screen", it literally is just the map and none of the textual information. I abandoned working on this as just enabling the shared memory dropped 15-20 off the fps. It turned out I could get much better performance using multiple video cards on the same computer.
  25. Awesome. I'm still noodling around how I'm going to do mine. I didn't even think to put it on the brake lever itself. That will be less risky for the grip! Have to see if I can't find some parts to do that with.
×
×
  • Create New...