Drucker in Standby schicken

Das Forum befindet sich im reduzierten Betrieb. Die Addon- und Supportforen bleiben weiterhin verfügbar.
Bitte beachte, dass OMSI nicht mehr weiterentwickelt wird. Ein Teil der Entwickler widmet sich inzwischen der Entwicklung eines neuen Simulators. Weitere Informationen zum LOTUS-Simulator findest Du hier.
  • Ich habe mir vor einiger Zeit mal das AtronAFR4 von Darius umgescriptet.(ID Eingabe, Pin Eingabe, Automatische übernahme der HST aus dem IBIS also keine RBL Funktion mehr umschalten Verkauf, Druck -> Fahrt) Allerdings bekomme ich das mit dem Timer nicht hin. Was braucht man damit der Timer das Atron nach einer gewissen Abschaltzeit in den Standby schickt? Ich habe bei dem Script für den Facelift das Problem das der Timer sich nach Abschaltung nicht wiederholt.


    Kann mir jemand mal den globaltimer genauer erklären?



  • I don't know what (L.L.ticketprinter_absch) is for, but if I understood your problem correctly it should work now

  • I haven't tested any of that, but from just glancing over I believe TheFMrr is on the right track (absch == abschalten == switch off).


    That being said, when a timer gets incremented in the classic way via Timegap (e.g. (L.L.some_timer) (L.S.Timegap) + (S.L.some_timer) ), the end condition should always check whether the timer is _greater_ or equal, or _less_ or equal than whatever max/min bound is being tested for (the standby delay in this case), rather than just strictly equal. Why? Bcause Timegap is obviously not a constant value (Timegap == 1/fps), hence one cannot anticipate that the timer will ever exactly reach the threshold. In other words, (L.L.globaltimer) (C.L.ticketprinter_standby_sec) = should really be (L.L.globaltimer) (C.L.ticketprinter_standby_sec) >= instead.


    Some further notes/questions for Niemand:

    - Is this "global" timer actually used for anything else, besides timing the interval before entering standby mode? If not, then why is it not being reset once standby actually gets entered?

    - Towards the end of the script, you appear to have copied parts of elec.osc. Why?

    - In the beginning of ticketprinter_frame there are a bunch of {endif}s without matching preceding {if}s. Likewise, after the end of ticketprinter_frame, there are {end}s without matching "starts" ({macro}-start declarations). These are all syntax errors, and may confuse the script interpreter.


    As an aside: Reading code that is not properly formatted is just painful. By "properly" I mean having at least a consistent usage of whitespace (either TABS _or_ spaces), and every {if} being indented equally to its corresponding {endif}. Even though I'm sure this is not just your fault, but rather the neglect of everyone who modded that file before you, it's still something worth keeping in mind when submitting code for "bug hunting".

  • Hello,


    Yeah, sorry, I didn't mean to sound pedantic above. It's not like non- or inconsistently formatted code is "bad" code per se -- it just makes it harder than necessary to the reader to quickly scan through and compose a rough picture of what it does.


    Back to globaltimer: The comment above its increase statement says that it's used "fuer alle zeitbezogenen Bedingungen", that's why I asked whether there are other timed events that depend on it, besides delaying the device's shutdown. From the code you posted it appears that it's only used for this one task, but the fact that the timer is never reset, along with that comment, leads me to believe there might be (or used to be?) other code, not included above, maybe residing in a different .osc-file, that uses that same timer variable.


    If, nonetheless, the globaltimer is only used for delayed shutdown, then the desired timing logic could be expressed as follows:


    If on the other hand globaltimer has other purposes, we would also need to take a look at any other dependent code in order to come up with meaningful suggestions.