Accueil
Accueil

Bienvenue invité ( Connexion | Inscription )

21 Pages V « < 8 9 10 11 12 > »   
Reply to this topicStart new topic
> [LUA] Télécommander son avion
Lynx
post 25 Jan 2007, 23:13
Message #91






Indicatif : BS-05
Messages : 2,453
Inscrit : 23/03/05
Lieu : FONTENAY-SOUS-BOIS
Membre n° 108

@ Tarochi, quand tu écris un script dans le export.lua, où le places tu ? Au début, ou à la fin ? Peux-tu m'envoyer une copie du tiens s'il te plait ? Je vais ainsi pouvoir comparer... gap.gif
Pourrais-tu poser la question au concepteur de GaugeComposer (qui est je crois espagnol ???), pourquoi le soft ne démarre pas chez Lecréole ?
Merci beaucoup. notworthy.gif

--------------------
3rdlynx.ddns.net

Serveur Discord Perso/Mission Editor : 965280400698146836

The agnostic dislexic insomniac: lies awake in bed at night wondering if there really is a dog.

Manche WARTHOG sur Virpil WAR BRD, Throttle et Palo Virpil, Pilotseat GameRacer Pro, HP reverb G2+ Simshaker JETPAD
Toutes cartes sauf South Atlantic et WWII
Config
+ CG MSI 6950XT 16 Go340W
+ be quiet! Pure Rock 2
+ Mushkin Redline 64 Go 2 x 32 Go DDR4 3600 MHz
+ AMD Ryzen 7 5800X3D, 3,4 GHz (4,5 GHz Turbo Boost)
+ be quiet! Pure Power 11 FM 1000W,
+ SAMSUNG 980 PRO, 2 To, SSD
+ ASUS PRIME X570-P,
+ Sharkoon RGB LIT 100.

Image IPB

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Tarochi
post 26 Jan 2007, 00:36
Message #92



 


Messages : 110
Inscrit : 31/12/06
Membre n° 1,234

Aucune probleme:

C'est le memme qui du Lecreole, mais j'ai change quelques choses gap.gif gap.gif

Moi utilisse la function:function LuaExportActivityNextEvent(t)

et encore n'est pas fini.

Et quelques choses ont in espagneul. saianlol.gif

le archive log est active pour la comprobation seulment. quand le script etait fini, on peuve desactiver.

Referent au Gauge Composer, je croix qui c'est un probleme du configuration ou qu'il oublie quelque parametre.





----------------------------------------------------------------------------------
-- Liaisons des variables SIOC et commande Lockon --
----------------------------------------------------------------------------------
t={} -- t[1]=variable/OFFSET 0001 ds SIOC, t[2]=variable 0002/OFFSET ds SIOC,t[n]=variable n ds SIOC,...
t[1] = {LastState=146, Input_On=145, Input_Off=146, Output_Ok=401, Output_Nook=402} -- Cmd des Volets
t[2] = {LastState=431, Input_On=431, Input_Off=430, Output_Ok=0, Output_Nook=0} -- Cmd des Trains
t[3] = {LastState=74, Input_On=74, Input_Off=75, Output_Ok=405} -- Cmd des Freins Roues
t[4] = {LastState=148, Input_On=147, Input_Off=148, Output_Ok=406} -- Cmd des aérofreins
t[5] = {LastState=0, Input_On=71, Input_Off=71, Output_Ok=402} -- Cmd de la verriére

function LuaExportStart()
------------------------------------------------------------------
-- Création du fichier LOG --
------------------------------------------------------------------

dofile "lua.lua"

local file = io.open("./Temp/Log.txt","w");

if file then

io.output(file)
end

------------------------------------------------------------------
-- Création du Serveur-client --
------------------------------------------------------------------

-- Client - Port d'envoi

socket = require("socket")

host = "127.0.0.1"

port = 8091

client = socket.try(socket.connect(host, port))

client:setoption("tcp-nodelay",true)

if client then

log("Connection client réussi sur "..host..":"..port)
end

-- Serveur - Port d'écoute

socket = require("socket")

host = "127.0.0.1"

port = 8092

log("Demande de socket au " ..host.. ":" ..port)

s = socket.try(socket.bind(host, port))

i, p = socket.try(s:getsockname())

log("Attente de connection pendant 5 secondes au " ..i.. ":" ..p)

socket.try(s:settimeout(5))

serveur = socket.try(s:accept())

if serveur ~= nil then

socket.try(serveur:settimeout(0))

log("Connection Serveur réussi sur "..i..":"..p)

end

end

function log(event)

io.write(os.date("%d/%m/%y-%H:%M:%S").." "..event.."\n")

end


function LuaExportBeforeNextFrame()

if serveur then

l, e = serveur:receive()

if l then

log("Reçoit:"..l)

TraitementData(l)

end
end


end


function LuaExportAfterNextFrame()


end




function LuaExportStop()

serveur:close()

client:close()

log("Connection fermer")

io.close()

end


function LuaExportActivityNextEvent(t)

local tNext = t

-- Put your event code here and increase tNext for the next event
-- so this function will be called automatically at your custom
-- model times.
-- If tNext == t then the activity will be terminated.
-- For example:

local ErrorGenrl = LoGetMCPState() -- (args - 0, results - 1 (table of key(string).value(boolean))
local Alertas = ""
table.foreach(ErrorGenrl,function(k,v)
if (v) then Alertas=Alertas.."1"
else Alertas=Alertas.."0"
end
end)

local FPlanoDcha = string.byte(Alertas,1)
local FEOS = string.byte(Alertas,2)
local FECM = string.byte(Alertas,3)
local FAleronDcho = string.byte(Alertas,4)
local MasterWarning = string.byte(Alertas,5)
local FMotorDcho = string.byte(Alertas,6)
local FCanon = string.byte(Alertas,7)
local FMLWS = string.byte(Alertas,8)
local FACS = string.byte(Alertas,9)
local FRadar = string.byte(Alertas,10)
local FVisorCasco = string.byte(Alertas,11)
local FHUD = string.byte(Alertas,12)
local FBombaPrincIzq = string.byte(Alertas,13)
local FBombaAlaDcha = string.byte(Alertas,14)
local FBombaAlaIzd = string.byte(Alertas,15)
local FMFD = string.byte(Alertas,16)
local FRWS = string.byte(Alertas,17)
local FTren = string.byte(Alertas,18)
local FHidraulico = string.byte(Alertas,19)
local FPilotoAuto = string.byte(Alertas,20)
local FTanqueComb = string.byte(Alertas,21)
local FAleronIzd = string.byte(Alertas,22)
local CabinaAbierta = string.byte(Alertas,23)
local FBombaPrincDcha = string.byte(Alertas,24)
local AtascoTurbina = string.byte(Alertas,25)
local FMotorIzq = string.byte(Alertas,26)
local PilotoAutoOn = string.byte(Alertas,27)
local FPlanoIzq = string.byte(Alertas,28)
local t = LoGetModelTime()
local name = LoGetPilotName()
local altBar = LoGetAltitudeAboveSeaLevel()
local altRad = LoGetAltitudeAboveGroundLevel()
local pitch, bank, yaw = LoGetADIPitchBankYaw()
local engine = LoGetEngineInfo()
local HSI = LoGetControlPanel_HSI()
local IAS = LoGetIndicatedAirSpeed()
local TAS = LoGetTrueAirSpeed()
local AOA = LoGetAngleOfAttack()
socket.try(client:send(string.format("Arn.Resp:100=%d:101=%d:102=%d:103=%d:104=%d:105=%d:\n",FPlanoDcha,FEOS,FECM,FAleronDcho,MasterWarning,FMotorDcho)))
socket.try(client:send(string.format("Arn.Resp:106=%d:107=%d:108=%d:109=%d:110=%d:\n",FCanon,FMLWS,FACS,FRadar,FVisorCasco)))
socket.try(client:send(string.format("Arn.Resp:111=%d:112=%d:113=%d:114=%d:115=%d:\n",FHUD,FBombaPrincIzq,FBombaAlaDcha,FBombaAlaIzd,FMFD)))
socket.try(client:send(string.format("Arn.Resp:116=%d:117=%d:118=%d:119=%d:120=%d:\n",FRWS,FTren,FHidraulico,FPilotoAuto,FTanqueComb)))
socket.try(client:send(string.format("Arn.Resp:121=%d:122=%d:123=%d:124=%d:125=%d:126=%d:127=%d:\n",FAleronIzd,CabinaAbierta,FBombaPrincDcha,AtascoTurbina,
FMotorIzq,PilotoAutoOn,FPlanoIzq)))

socket.try(client:send(string.format("Arn.Resp:16=%d:17=%d:18=%d:19=%d:20=%d:21=%d:22=%d:23=%d:\n",engine.RPM.left,engine.RPM.right,engine.Temperature.left,engine.Temperature.right,engine.HydraulicPressure.left,engine.HydraulicPressure.right,engine.fuel_internal,engine.fuel_external)))
io.write(string.format("Arn.Resp:16=%d:17=%d:18=%d:19=%d:20=%d:21=%d:22=%d:23=%d:\n",engine.RPM.left,engine.RPM.right,engine.Temperature.left,engine.Temperature.right,engine.HydraulicPressure.left,engine.HydraulicPressure.right,engine.fuel_internal,engine.fuel_external))
io.write(string.format("%s\n",Alertas))
tNext = tNext + 1.0


return tNext
end



function TraitementData(_data)

local cmd -- Commande

local val -- Valeur

local r = ""

for v in string.gfind(_data,"%w+=%w+") do

local i = 0

for d in string.gfind(v,"%w+") do

if i==0 then cmd = tonumber(d) else val=tonumber(d) end

i = i+1

end

if t[cmd].Input_Off==t[cmd].Input_On then

rval=val
rcmd=t[cmd].Input_On

else

if val==0 then rval=t[cmd].Input_Off else rval=t[cmd].Input_On end
rcmd=rval

end

socket.try(client:send(string.format("Val=%s rval=%s state=%s\n",val,rval,t[cmd].LastState)))

if t[cmd].LastState == rval then

-- Actualise l'état

if t[cmd].Output_Ok then r = r..":"..t[cmd].Output_Ok.."="..val end

if t[cmd].Output_NooK then r = r..":"..t[cmd].Output_Nook.."=0" end

--socket.try(client:send(r.."\n"))

else

if EstPossible(cmd,rval) then

socket.try(client:send("Possible\n"))

LoSetCommand(tonumber(rcmd))

if t[cmd].Output_Ok then r = r..":"..t[cmd].Output_Ok.."="..val end

if t[cmd].Output_NooK then r = r..":"..t[cmd].Output_Nook.."=0" end

--if t[cmd].Output_OK then r = r..":"..t[cmd].Output_Ok.."="..val end

--if t[cmd].Output_NooK then r = r..":"..t[cmd].Output_Nook.."=0" end

t[cmd].LastState = rval

else

socket.try(client:send("Impossible\n"))

if t[cmd].Output_OK then r = r..":"..t[cmd].Output_Ok.."=0" end

if t[cmd].Output_NooK then r = r..":"..t[cmd].Output_Nook.."=1" end

end
end

end

if r ~= "" then

socket.try(client:send("Arn.Resp:"..r.."\n"))
end
end

function EstPossible(c,v)

return true

end

Ce message a été modifié par Tarochi - 26 Jan 2007, 14:37.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Maraudeur
post 26 Jan 2007, 15:13
Message #93




Commandant de la 92nd Kodiak AF

Indicatif : JR-22
Messages : 4,232
Inscrit : 4/12/04
Lieu : Monnaie
Membre n° 17

AAArrrrrrgggghhhhhllllll!!!! scratch.gif

Tarochi, tu as lu la Documentation complête du LUA pour faire ça? notworthy.gif

--------------------
Image IPB
Cerbro Tvo Utere! Sin Minvs, Parietes Asperget...

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Tarochi
post 26 Jan 2007, 15:18
Message #94



 


Messages : 110
Inscrit : 31/12/06
Membre n° 1,234

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Tarochi
post 29 Jan 2007, 00:07
Message #95



 


Messages : 110
Inscrit : 31/12/06
Membre n° 1,234

Je vais peu a peu crash.gif joystick.gif

Aucune sait les dimensions reels de les gauges?

Image IPB

Ce message a été modifié par Tarochi - 29 Jan 2007, 00:17.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Maraudeur
post 29 Jan 2007, 19:00
Message #96




Commandant de la 92nd Kodiak AF

Indicatif : JR-22
Messages : 4,232
Inscrit : 4/12/04
Lieu : Monnaie
Membre n° 17

Superbe, je te donne les dimensions ASAP!

En attendant, une nouvelle version du SIOC 3.4 vient de sortir... wavetowel2.gif

ATTENTION: il est plus performant mais le SIOC.INI est différent detective.gif

--------------------
Image IPB
Cerbro Tvo Utere! Sin Minvs, Parietes Asperget...

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Lynx
post 29 Jan 2007, 21:47
Message #97






Indicatif : BS-05
Messages : 2,453
Inscrit : 23/03/05
Lieu : FONTENAY-SOUS-BOIS
Membre n° 108

Bon, alors moi, j'ai finalisé le panel que je veux installer il ne me reste plus qu'à configurer, les aiguilles et les scripts.
Merci à Tarochi pour le Tachymètre et ses aiguilles, et à John pour le vieil écran de sa chérie... cheer.gif Et Hammerli & Maraudeur pour les dessins primaires des instruments, j'ai beaucoup utilisé Paint, the Gimp, et joué sur les transparences dans Gauge-Composer. crash.gif

ICI :
Image IPB
En plus grosse :
Image IPB

La silhouette de l'avion de l'ADI est mobile ainsi que la rose des vents Intérieure du Compas.

Ce message a été modifié par Lynx - 29 Jan 2007, 22:08.

Fichier(s) joint(s)
Fichier joint  Instruments.zip ( 271,91 Ko ) Nombre de téléchargements: 198

--------------------
3rdlynx.ddns.net

Serveur Discord Perso/Mission Editor : 965280400698146836

The agnostic dislexic insomniac: lies awake in bed at night wondering if there really is a dog.

Manche WARTHOG sur Virpil WAR BRD, Throttle et Palo Virpil, Pilotseat GameRacer Pro, HP reverb G2+ Simshaker JETPAD
Toutes cartes sauf South Atlantic et WWII
Config
+ CG MSI 6950XT 16 Go340W
+ be quiet! Pure Rock 2
+ Mushkin Redline 64 Go 2 x 32 Go DDR4 3600 MHz
+ AMD Ryzen 7 5800X3D, 3,4 GHz (4,5 GHz Turbo Boost)
+ be quiet! Pure Power 11 FM 1000W,
+ SAMSUNG 980 PRO, 2 To, SSD
+ ASUS PRIME X570-P,
+ Sharkoon RGB LIT 100.

Image IPB

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Tarochi
post 29 Jan 2007, 22:27
Message #98



 


Messages : 110
Inscrit : 31/12/06
Membre n° 1,234

cheer.gif cheer.gif cheer.gif

Tres Bien¡¡¡¡¡¡¡.

Si je te peuve aider avex les scripts, tu sais.......

Moi je vais suivre avec mes gauges, parce que j'ai une autre concepte:

Je veule les representer a scale reel en deux ecrans TFT et toute ça desous le tablier de mon future cockpit, c'est pour ça que je demande les dimensions reels des gauges, et si on peuve etre les dimensions du tablier du SU-27.

L'idee c'est:

Image IPB
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Lynx
post 29 Jan 2007, 22:47
Message #99






Indicatif : BS-05
Messages : 2,453
Inscrit : 23/03/05
Lieu : FONTENAY-SOUS-BOIS
Membre n° 108

Je veux faire la même chose que toi, mais peut-être en plus simple... innocent.gif
Pour les scripts dis moi si j'ai tout bien compris:
- on modifie le config.lua pour exporter les données vers 127.0.0.1
- on modifie export.lua pour choisir les valeurs et le moyen de les exporter (le socket, la valeur, export after ou before:next frame...)
- dans Gauge Composer, on établit les scripts pour chaque fichier .bmp, avec les calculs pour les aiguilles, le tout dans les sockets qui sont sélectionnés avant.

Si je n'ai pas tout bon, n'hésites pas à me corriger, et merci... thumbsup.gif

--------------------
3rdlynx.ddns.net

Serveur Discord Perso/Mission Editor : 965280400698146836

The agnostic dislexic insomniac: lies awake in bed at night wondering if there really is a dog.

Manche WARTHOG sur Virpil WAR BRD, Throttle et Palo Virpil, Pilotseat GameRacer Pro, HP reverb G2+ Simshaker JETPAD
Toutes cartes sauf South Atlantic et WWII
Config
+ CG MSI 6950XT 16 Go340W
+ be quiet! Pure Rock 2
+ Mushkin Redline 64 Go 2 x 32 Go DDR4 3600 MHz
+ AMD Ryzen 7 5800X3D, 3,4 GHz (4,5 GHz Turbo Boost)
+ be quiet! Pure Power 11 FM 1000W,
+ SAMSUNG 980 PRO, 2 To, SSD
+ ASUS PRIME X570-P,
+ Sharkoon RGB LIT 100.

Image IPB

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Specnaz
post 29 Jan 2007, 22:51
Message #100



 


Messages : 109
Inscrit : 8/05/05
Membre n° 146

CITATION(Tarochi @ 29 Jan 2007, 22:27) *

cheer.gif cheer.gif cheer.gif

Tres Bien¡¡¡¡¡¡¡.

Si je te peuve aider avex les scripts, tu sais.......

Moi je vais suivre avec mes gauges, parce que j'ai une autre concepte:

Je veule les representer a scale reel en deux ecrans TFT et toute ça desous le tablier de mon future cockpit, c'est pour ça que je demande les dimensions reels des gauges, et si on peuve etre les dimensions du tablier du SU-27.

L'idee c'est:

Image IPB



Alors là TAROCHI ! Chapeau bas , trés beau boulot !!! Vivement que je m'y plonge aussi... notworthy.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

21 Pages V « < 8 9 10 11 12 > » 
Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :
 

Haut de page · Retour à l'accueil · Contacter le Webmestre Nous sommes le : 2/05/25 - 11:00