Jump to content

tacno

Members
  • Posts

    154
  • Joined

  • Last visited

Everything posted by tacno

  1. I'm interested by the answer too. I can not access to the memory mapped "mfd0" According to -- you can export render targets via shared memory interface -- using next functions -- LoSetSharedTexture(name) -- register texture with name "name" to export -- LoRemoveSharedTexture(name) -- copy texture with name "name" to named shared memory area "name" -- LoUpdateSharedTexture(name) -- unregister texture -- texture exported like Windows BMP file -- -------------------------------- -- |BITMAPFILEHEADER | -- |BITMAPINFOHEADER | -- |bits | -- -------------------------------- -- sample textures : "mfd0" - full SHKVAL screen -- "mfd1" - ABRIS map screen -- "mfd2" - not used -- "mfd3" - not used -- "mirrors" - mirrors sMyFunction= { UpdatePeriod = 5; UpdateTime = 0; -- ------------------- -- S T A R T PROCEDURE StartProc=function(self) LoSetSharedTexture("mfd0") end, -- -------------- -- U P D A T E UpdateProc=function(self) local CurrentTime=LoGetModelTime() if CurrentTime >= self.UpdateTime then self.UpdateTime = CurrentTime + self.UpdatePeriod; LoUpdateSharedTexture("mfd0") end end, -- ----------------------------- -- S T O P EndProc=function(self) LoRemoveSharedTexture("mfd0") end, } -- ****************************************************************************************************** -- Works once just before mission start. do local PrevLuaExportStart=LuaExportStart; LuaExportStart=function() sMyFunction:StartProc(); if PrevLuaExportStart then PrevLuaExportStart(); end end end -- Works just after every simulation frame. do local PrevLuaExportAfterNextFrame=LuaExportAfterNextFrame; LuaExportAfterNextFrame=function() sMyFunction:UpdateProc() if PrevLuaExportAfterNextFrame then PrevLuaExportAfterNextFrame() end end end -- Works once just after mission stop. do local PrevLuaExportStop=LuaExportStop; LuaExportStop=function() sMyFunction:EndProc() if PrevLuaExportStop then PrevLuaExportStop() end end end
  2. tacno

    Mirage Congrats

    Thanks you to have released the M-2000C so early. You made lot of pre-buyers happy. When I read M-2000C exports, I can write M-2000C has a serious team. Keep up the excellent work :thumbup:
  3. To kill my OCR program, Last month I modified export.lua script with this : Goal is format 2 lines of text to send them to LCD 20x2 or what you want. --CMSP local CMSP = list_indication (7) if ( string.len ( CMSP ) > 100 ) then --TEXT TOP local indexStart = string.find ( CMSP , "txt_TOP" , 1 ) local indexEnd = string.find ( CMSP , "txt_BOTTON1" , indexStart ) local textTOP = string.sub ( CMSP, indexStart +7 , indexEnd - 41 -3 ) local TEXT_TOP1 = string.sub ( textTOP, 1 , 4 ) local TEXT_TOP2 = string.sub ( textTOP, 5 , 8 ) local TEXT_TOP3 = string.sub ( textTOP, 9 , 12 ) local TEXT_TOP4 = string.sub ( textTOP, 13 , 15 ) local TEXT_TOP = string.format ( "%s %s %s %s" , TEXT_TOP1 , TEXT_TOP2, TEXT_TOP3, TEXT_TOP4 ); --DN1 indexStart = indexEnd indexEnd = string.find ( CMSP , "txt_BOTTON2" , indexStart ) local textDN1 = string.sub ( CMSP, indexStart +10 , indexEnd - 41 -3 ) --DN2 indexStart = indexEnd indexEnd = string.find ( CMSP , "txt_BOTTON3" , indexStart ) local textDN2 = string.sub ( CMSP, indexStart +10 , indexEnd - 41 -3 ) --DN3 indexStart = indexEnd indexEnd = string.find ( CMSP , "txt_BOTTON4" , indexStart ) local textDN3 = string.sub ( CMSP, indexStart +10 , indexEnd - 41 -3 ) --DN4 indexStart = indexEnd indexEnd = string.len ( CMSP ) local textDN4 = string.sub ( CMSP, indexStart +10 , indexEnd ) local TEXT_BOTTON = string.format ( "%s %s %s %s" , textDN1 , textDN2, textDN3, textDN4 ); --CHECK BOTTOM LINE local TEXT_BOTTON_ID = "0" if ( textDN3 == "INTV" ) then TEXT_BOTTON_ID = "1" end if ( textDN3 == "RWR" ) then TEXT_BOTTON_ID = "2" end if ( textDN3 == "OTR1" ) then TEXT_BOTTON_ID = "3" end --At this point according to TEXT_BOTTON_ID, you can manage sending of data --TEXT_BOTTON_ID = 0 ===> CSMP OFF (no text) --TEXT_BOTTON_ID = 1 ===> "CHAF FLAR INTV CYCL " --TEXT_BOTTON_ID = 2 ===> "MWS JMR RWR DISP " --TEXT_BOTTON_ID = 3 ===> "CHAF FLAR OTR1 PROG " --SEND TEXT_BOTTON if ( TEXT_BOTTON_ID ~= "0" ) then --SEND TEXT_TOP else --SEND TEXT_TOP AS VIRGIN TEXT " " end else -- SEND VIRGIN TEXT_TOP -- SEND VIRGIN TEXT_BOTTON end --CMSP
  4. See this link : http://www.simplugins.com/html/dcs_p51d.html
  5. tacno

    My TARDIS

    Hi MacFevre, I saw your canopy swicth panel and seat switch panel are missing. I wrote article, perhaps, help you or motivate you :smilewink: Too, I saw your pipe of the stike. How did you do ? Thanks.
  6. Canopy and Ladder Panel
  7. Extinguisher T-handles
  8. Fuel Panel. The handle of lever can be interesting. Fuel Panel :
  9. I updated my website with Enviroment Panel. A part of text is in English. Don't hesitate to contact me for any question or translation. Today I can't build front panel, rest I can.
  10. @The_soupdragon You wrote "button/rotary" What did you said about rotary ? For example, as Yaw trim or as frequency selector or radio mode. Yaw trim = dimmer (10k ohms)(310°) : all USB joystick cards are compatible. radio mode = rotary switch = buttons: all USB joystick cards are compatible. But if you want a rotary function as frequency selector, with infinity turns, you must use a "rotary encoder" to get the direction : clock wise / counter clock wise. http://www.leobodnar.com/shop/ builds USB joystick cards work with rotary encoder and buttons and dimmers.
  11. Of course. My reply is public, for sharing, not only and directly to you. And this can complete TigersharkBAS sticky thread.
  12. ? I didn't read any words as ungracious ;) Just to be sharp about udp/tcp IP ports : To choice a fixed port is a good idea to configure a firewall as you wrote. However, IP Windows clients seem take ports from the bottom 65535 to 1024 for connections. Often around 65000-40000 are used and released after, or not. The risk is here, because LAU script can't generate a direct alert for user, as a dialog box. This risk is very small of course. To be sure to take a good server free port, no clients IP will take a UDP/TCP port below 1024. Some are free yet... Also and generally ports near 1024-10000 are selected by unofficial server programs. http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
  13. Sure, It does. I included codes for this.
  14. I think your code seems this (with a base af Helios' Gadroc) : With minimum functions function LuaExportStart() function LuaExportBeforeNextFrame() function LuaExportStop() Use : C,12,3001 Where 12 is device cockpit Where 3001, is the button 1 + 3000 [b]function LuaExportStart()[/b] package.path = package.path..";.\\LuaSocket\\?.lua" package.cpath = package.cpath..";.\\LuaSocket\\?.dll" socket = require("socket") c = socket.udp() c:setsockname("*", 65001) c:setoption('broadcast', true) c:settimeout(.001) end [b]function LuaExportBeforeNextFrame()[/b] local lInput = c:receive() local lCommand, lCommandArgs, lDevice, lArgument, lLastValue if lInput then lCommand = string.sub(lInput,1,1) if (lCommand == "C") then lCommandArgs = StrSplit(string.sub(lInput,2),",") lDevice = GetDevice(lCommandArgs[1]) if type(lDevice) == "table" then lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) end end end end [b]function LuaExportStop()[/b] c:close() end It is possible to get an error with using c:setsockname("*", 65001) ; if port 65001 is already used. With c:setsockname("*", 0 ) , DCS will create a free port, but unkown in lua code. You can use c:setsockname("*", 0 ) if you can get server udp port of DCS export. For example, Send a frame to your "input progame" a text to get the server udp port. Send "keep alive" frame every seconds to a owned "input program" at udp port 10410 : function LuaExportAfterNextFrame() local tsend = LoGetModelTime() if ( tsend > (LOtm+1) ) then socket.try(c:sendto("KEEPALIVE\0", "127.0.0.1", 10410)) tsend = LOtm end end You can get udp port of the sender (iLUASourcePort) in this C code (after create a listener socket "Socket" on 10410 udp port) : recvfrom ( Socket , (char *) szBuffer , 576 , 0 , (SOCKADDR *)&LUAClientSocket_in, &ptSocketBase->iSINsize); iLUASourcePort = ntohs ( LUAClientSocket_in.sin_port );
  15. The used sheet is transparency film for laser printer (polyester film of high resistance). Thinness of sheet does flexibility (not elasticity). A pressure of 0.2mm is needed to activate microswitch. It works well with my keyboards of CDU, CSMP, CMSC, NMSP and UFC. Bottom of buttons must be sanded down, cleaned before to put tape. Fisrt, I put tape onto bottom button, then I cut exceeded tape and finally, top frame onto transparency film, I put and fix each buttons. For me, it's simple, effective and cheap. I use my homepit more than 6 hours by week and I haven't problem with keyboards.
  16. I updated the CDU page with English comments and more picts : CDU of A-10C Tacno's homepit
  17. What a good idea to build a homepit...to do nothing else :) ! VHF : watchful spacing between channels' wheel and load push button. (Do the good choice of push button, if possible) CMSP : watchful about LCD right size and rocker. LCD electronic board is larger than display. Check spacing. Keep the heading and finish your pit :thumbup:
  18. Actualy I think your stick will be stronger. You are a talended person to jump technical obstacles and to find solutions, then why to build other than "Made by Jaroslay" :)
  19. Good jod ! This bottom one is more expencive : ~ $27 I bought one for my Emergency panel : http://www.digikey.com/product-search/en?x=12&y=14&lang=en&site=us&KeyWords=679-2289-ND
  20. @Jaroslav I like your job and ways, solutions you find and take. Great collective and panels ! And what about cyclic ? Will be a base of Thrusmaster "TopGun" without automatic return to centre (no springs) ? And pedals... Keep your courage and finish your project...
  21. Exactly : > 10" 16:9 to display : left MFCD, RWR and IAS > 19" 4:3 to display : right MFCD, all engines, HSI, ADI, alti and VVI Great thanks to Gadroc and his HELIOS : http://www.gadrocsworkshop.com/helios/ Specialy for you : http://tacnoworld.fr/?p=929
  22. Many thanks MacFevre. Yours words go to my heart. ---- All photo are there to motivate homepit-builders. ---- Too, my homepit is mounted and unmounted 50 times by year. This action takes 10 min. I put myself constraints for tidying up and LAN party transport. In my "gameroom", the pit is placed under the desk. Theses following pictures show the room in "normal" configuration :
  23. Some pictures of my homepit in april 2013 Day environment... Night environment... All lights are on, except flood >>>Larger pictures here<<<
  24. Good job :thumbup:
  25. Have a good adventure, don't change heading....
×
×
  • Create New...