Drucker in Standby schicken

  • 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?


    Grüße
    Matthias M

    Kein Support via PN, FB und Steam. Ich bitte um Verständnis

    Edited 6 times, last by Matthias M ().


  • 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 Matthias M :

    - 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".

  • Unorthodox Paradox


    Hi. Thank you for your helpful advice. I must confess that I never had to redesign a script completely and I only have some basic knowledge. When I formatted the script (or not :)) I did not think that I would present it to someone, because I need help. I'm sorry, that it looks so bad.

    Grüße
    Matthias M

    Kein Support via PN, FB und Steam. Ich bitte um Verständnis

  • 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.

  • Newly created posts will remain inaccessible for others until approved by a moderator.

    The maximum number of attachments: 10
    Maximum File Size: 100 kB
    Allowed extensions: pdf, txt