Aktuelle Zeit: 18.11.2017 16:54:57

Alle Zeiten sind UTC + 1 Stunde




Ein neues Thema erstellen Auf das Thema antworten  [ 47 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3
Autor Nachricht
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 06.12.2014 04:11:25 
Offline
Benutzeravatar

Registriert: 23.01.2011
Beiträge: 51
Wohnort: England, Nottingham
Aktuelle Projekte: Zusi: Wittenberger Steuerwagen style drivers desk.

Omsi: MAN sd202/D92 dashboard.
Clock is working nicely,
i presume it takes the date from the computer as railworks doesn't output date data.


Nach oben
 Profil  
 
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 06.12.2014 23:15:32 
Offline
Benutzeravatar

Registriert: 23.01.2011
Beiträge: 51
Wohnort: England, Nottingham
Aktuelle Projekte: Zusi: Wittenberger Steuerwagen style drivers desk.

Omsi: MAN sd202/D92 dashboard.
:O i am an idiot,
i've been messing around using TrainSim-Helper to get the data out of Railworks, and when making changes to the code to add new control calls i've been changing them in the trainsim-helper LUA file as well as in the main trainsim-helper program,

this means the new control call's are displayed on the screen.... which is not really something i want anyway, but i thought i had to do that to get the data out so the RWzusiconverter could read the data.

of course, the LUA file in the plugins folder is what gets the data from the sim and writes it to the text file, no need for trainsim-helper to be running to do that :wand

i will still need to use TrainSim-Helper for the joystick part, but i'm sure the program can be stripped right down to only give the joystick functionality,

So now i'm going to concentrate on adding the control calls to the LUA file only as i should have been doing in the beginning.

These are the control calls i've found for the BR 423:
Code:
CONTROL NAME "(Acceleration)",                  MIN VALUE "(-1000)",   MAX VALUE "(1000)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Accelerometer)",                  MIN VALUE "(-320)",      MAX VALUE "(320)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Active)",                            MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Ammeter)",                     MIN VALUE "(-600)",      MAX VALUE "(600)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Amp)",                        MIN VALUE "(-600)",      MAX VALUE "(600)",      DEFAULT VALUE "(0)"
CONTROL NAME "(AWS)",1000hz light               MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(AWSClearCount)",Clear trigger    MIN VALUE "(0)",      MAX VALUE "(2e+009)",   DEFAULT VALUE "(0)"
CONTROL NAME "(AWSReset)",PZB ack. SW            MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(AWSWarnCount)",Danger trigger      MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(BrakePipePressureBAR)",            MIN VALUE "(0)",      MAX VALUE "(12)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Cmd_40)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(Cmd_Free)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(CompressorState)",               MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Current)",                     MIN VALUE "(0)",      MAX VALUE "(100000)",   DEFAULT VALUE "(0)"
CONTROL NAME "(DoorsOpenCloseLeft)",            MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(DoorsOpenCloseRight)",            MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(Dummy)",PZB 55 lamp               MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(LZB_Buzzer)",                  MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(LZB_End)",Ende lamp               MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(LZB_G)",                        MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(LZBActive)",U lamp               MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(LZBEnable)",B lamp               MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(LZBEnding)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(MainReservoirPressureBAR)",         MIN VALUE "(0)",      MAX VALUE "(12)",      DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_1000)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_1000hz_Control)",            MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_2000hz_Control)",            MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_40)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_500)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_500hz_Control)",               MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_70)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_85)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(PZB_Distant_Passed)",            MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(PZBEnable)",                     MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(RawSpeedTarget)",               MIN VALUE "(0)",        MAX VALUE "(300)",      DEFAULT VALUE "(0)"
CONTROL NAME "(RawTargetDistance)",               MIN VALUE "(0)",        MAX VALUE "(9999)",     DEFAULT VALUE "(0)"
CONTROL NAME "(RegulatorSpeed)",               MIN VALUE "(0)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(Reverser)",                     MIN VALUE "(-1)",      MAX VALUE "(1)",      DEFAULT VALUE "(0)"
CONTROL NAME "(ServiceBrake)",                  MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(SpeedometerKPH)",               MIN VALUE "(0)",      MAX VALUE "(180)",      DEFAULT VALUE "(0)"
CONTROL NAME "(TargetDistanceBar)",               MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(TargetDistanceDigits100)",         MIN VALUE "(-1)",       MAX VALUE "(9)",        DEFAULT VALUE "(0)"
CONTROL NAME "(TargetDistanceDigits1000)",         MIN VALUE "(-1)",       MAX VALUE "(9)",        DEFAULT VALUE "(0)"
CONTROL NAME "(TargetSpeed1)",                  MIN VALUE "(-1)",       MAX VALUE "(9)",        DEFAULT VALUE "(0)"
CONTROL NAME "(TargetSpeed10)",                  MIN VALUE "(-1)",       MAX VALUE "(9)",        DEFAULT VALUE "(0)"
CONTROL NAME "(TargetSpeed100)",               MIN VALUE "(-1)",       MAX VALUE "(9)",        DEFAULT VALUE "(0)"
CONTROL NAME "(TractiveEffort)",               MIN VALUE "(-1000)",   MAX VALUE "(1000)",      DEFAULT VALUE "(0)"
CONTROL NAME "(vAccelerometer)",               MIN VALUE "(-320)",      MAX VALUE "(320)",      DEFAULT VALUE "(0)"
CONTROL NAME "(VigilAlarm)",                  MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(VigilEnable)",                  MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(VigilLight)",                  MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(VigilReset)",                  MIN VALUE "(0)",        MAX VALUE "(1)",        DEFAULT VALUE "(0)"
CONTROL NAME "(VSoll)",                        MIN VALUE "(0)",      MAX VALUE "(180)",      DEFAULT VALUE "(0)"


Nach oben
 Profil  
 
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 08.12.2014 19:06:31 
Offline
Benutzeravatar

Registriert: 23.01.2011
Beiträge: 51
Wohnort: England, Nottingham
Aktuelle Projekte: Zusi: Wittenberger Steuerwagen style drivers desk.

Omsi: MAN sd202/D92 dashboard.
How do i figure out which bits of data need 'singleitems' or 'boolitems' or any other '*items' for the data in the RailworksMaster.cs bit that is adding the zusi command numbers to the railworks data names?

All the lights and gauge readings only work with 'SingleItems' at the moment, but that is because the TrainSim-Helper.LUA puts all calls into floats, but i think that needs changing... as the .LUA file i am modifying seems to have all entries as float formats, i.e. :

Code:
 local LZB_G   
   if Call("*:ControlExists", "LZB_G", 0) == 1 then
      LZB_G = Call("*:GetControlValue", "LZB_G", 0)
   end
   if LZB_G then data = data.."LZB_G: "..string.format(FloatFormat,LZB_G).."\n" end


Every single entry is like that, gauges, lights, digits etc.

I have the global float format set to %.2 to give me 2 digits after the decimal point, that's all the precision needed i think.

am i right in thinking that things like lights that can only be 0 or 1 should not be a float? but what should i change them to in the railworks LUA so they are read properly as 'BoolItems' in the RailworksMaster.cs file.


Nach oben
 Profil  
 
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 08.12.2014 21:03:19 
Offline
Benutzeravatar

Registriert: 24.10.2011
Beiträge: 1813
You figured out the main disadvantage of the software architecture of the RailworksMaster example.

Well, you'll find the data types in the commandset.xml.

All indicator lamps (Leuchtmelder, LM) in Zusi can be either on or off. So there is usually no need to use flotas, so we use bools. And in the RailworksMaster example I did not intent to convert singles to bools.

You see, there are some difficults if you use this kind of converter. Maybe the best solution is stil to use the DLL in Lua using NLua - without using a text file. But I can not test it, so I don't know if it works and how to do it...

The date of the DateTime value is the current date of your computer. This may make problems when you play over midnight or Railworks pass midnight. But I think I can't imagine how to improove it.

Finally: If you want to publish your changes you can sign in github and fork both my and Hanvers project and create pull requests.

_________________
Diese Signatur möchte folgendes bekannter machen: ZusiWiki: Führerstände · ZusiWiki: Fahrzeugprojekte · ZusiSK: Streckenprojekte · YouTube: Objektbau für Zusi · euirc: Zusi-Chat


Nach oben
 Profil  
 
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 08.12.2014 22:49:50 
Offline
Benutzeravatar

Registriert: 23.01.2011
Beiträge: 51
Wohnort: England, Nottingham
Aktuelle Projekte: Zusi: Wittenberger Steuerwagen style drivers desk.

Omsi: MAN sd202/D92 dashboard.
yeah, it would be nice to have the LUA file that sits in the railworks plugins folder send the data directly to zusidisplay,

but whilst it is clunky to operate (start the TCP server, start the railworks-zusi converter, start zusidisplay, start railworks, start trainsim-helper to get the joysticks working) i am very pleased that i am even able to get a semi working MFA on the second monitor actually responding to railworks, something the makers of railworks never intended... they don't care about things like this, their core market is people who just want to play at being a train driver and just want to load a train and drive it with a couple of keyboard presses.

I am working through my list of railworks control calls and adding the zusi control numbers,
i've found 295 control calls from the trains i have, but a lot of them are just different words for the same data, due to the way loads of companies make the models for railworks, each one is free to put in what ever function and control they want, there is no real set standard like there is in zusi, some cant even use the same keyboard map (Space is used for horn, but a few use it for SiFa reset)
of course the best ones are made by Virtual Railroads, their BR111 has 87 separate control calls, some of them for the levers and switches,


So, as the trainsim-helper LUA file is sending all the control calls as floats, they seem to work with the converter,

However i have found one that does not, if i have the either of the following entries in the RailworksMaster.cs file :

master.SingleItems.Add("VSoll", 2578); //AFB bug
master.SingleItems.Add("TargetSpeed", 2573); //LZB target speed

The program crashes at start up, the target speed ones i figured is down to the LUA combining the 10's,, 100's etc with this code :

Code:
 local TargetSpeed
   if Call("*:ControlExists", "TargetSpeed", 0) == 1 then
      TargetSpeed = Call("*:GetControlValue", "TargetSpeed", 0)
   elseif Call("*:ControlExists", "TargetSpeed100", 0) == 1 or
      Call("*:ControlExists", "TargetSpeed10", 0) == 1 or
      Call("*:ControlExists", "TargetSpeed1", 0) == 1
   then
      local ts = {}
      ts[100] = TryGetControlValue("TargetSpeed100")
      ts[10] = TryGetControlValue("TargetSpeed10")
      ts[1] = TryGetControlValue("TargetSpeed1")
      TargetSpeed = 0
      if ts[100] and ts[100] > 0 then
    TargetSpeed = TargetSpeed + ts[100] * 100
      end
      if ts[10] and ts[10] > 0 then
    TargetSpeed = TargetSpeed + ts[10] * 10
      end
      if ts[1] and ts[1] > 0 then
    TargetSpeed = TargetSpeed + ts[1]
      end
   end
   if TargetSpeed then data = data.."TargetSpeed: "..string.format(FloatFormat,TargetSpeed).."\n" end


But the Vsoll call does not have anything changed about it in the LUA file, am i right in thinking VSoll is for the red triangle 'bug' that moves around the speedometer so show the speed the AFB is set to OR the LZB speed is?


Nach oben
 Profil  
 
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 09.12.2014 21:06:47 
Offline
Benutzeravatar

Registriert: 24.10.2011
Beiträge: 1813
gazz hat geschrieben:
The program crashes at start up

I can imagine only one thing, that might happen, that will cause a crash: If you call master.SingleItems.Add("TargetSpeed", ... ) TWICE .Net will throw an System.ArgumentException, that will cause a crash. (It is not intented to add the same value twice to the dictionary.) Usually you should see the error in the console. If it's not this, I think I need the whole file.

I'm not sure, but I think one is the lever (I think 2578), and the other is the red triangle in the display (I think 2574). 2573 may be the yellow number in the speed display.

_________________
Diese Signatur möchte folgendes bekannter machen: ZusiWiki: Führerstände · ZusiWiki: Fahrzeugprojekte · ZusiSK: Streckenprojekte · YouTube: Objektbau für Zusi · euirc: Zusi-Chat


Zuletzt geändert von F. Schn. am 09.12.2014 21:10:38, insgesamt 1-mal geändert.

Nach oben
 Profil  
 
 Betreff des Beitrags: Re: Zusi Display with Train Simulator 2015??
BeitragVerfasst: 16.02.2015 20:11:10 
Offline
Benutzeravatar

Registriert: 23.01.2011
Beiträge: 51
Wohnort: England, Nottingham
Aktuelle Projekte: Zusi: Wittenberger Steuerwagen style drivers desk.

Omsi: MAN sd202/D92 dashboard.
Sorry i have been quiet on this subject for the past 2 months,

i have had problems with my eyes since the beginning of January, and at one point i could not see much at all and had to go to the emergency eye hospital, a viral eye infection has caused severe dry eye, which they say is for life now,
but it has damaged the surface of my left eyeball, and only time will tell if i can get my proper sight back in that eye.... i can see out of it, but i can not focus on anything, and glasses are unable to help in this situation.

Gradually i am getting used to using one eye, but it is very tiring for me to use a computer for too long, so my concientration is not good enough to be figuring out programming right now.

But i had most of the features of the zusi display program responding to railworks values, just problems with the traction meter i was trying to figure out when my eyes went bad,

Hopefully i can get back to working on this project soon, i wonder if any of the other people who were playing with this made any progress?


Nach oben
 Profil  
 
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 47 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.

Suche nach:
Gehe zu:  
Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.026s | 18 Queries | GZIP : Off ]