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?
Code
- '##############
- 'Atron no RBL
- '##############
- ' 2015 Darius Bode
- ' 2019 Matthias M
- '----------------------
- ' Trigger
- '----------------------
- {trigger:checkdisplay_toggle}
- (L.L.elec_busbar_main) {if}
- (L.L.checkdisplay_enabled) ! (S.L.checkdisplay_enabled)
- {end}
- {trigger:atron_display_1_B_start}
- 0 (S.L.Verkauf)
- 0 (S.L.Ticket)
- 0 (S.L.Fahrtdisplay)
- 0 (S.L.tickets_all)
- 0 (s.L.atron_ideingabe)
- "" (S.$.string_keypad)
- 1 (S.L.atron_ideingabe)
- {endif}
- {trigger:atron_keypad_enter}
- (L.L.atron_ideingabe)
- {if}
- (L.$.string_keypad) $StrToFloat (C.L.driver) =
- {if}
- 0 (S.L.atron_start)
- 0 (S.L.Verkauf)
- 0 (S.L.Ticket)
- 0 (S.L.Fahrtdisplay)
- 0 (S.L.tickets_all)
- 0 (s.L.atron_ideingabe)
- "" (S.$.string_keypad)
- 1 (S.L.atron_pineingabe)
- {endif}
- {endif}
- (L.L.atron_pineingabe)
- {if}
- (L.$.string_pin) $StrToFloat (C.L.pin) =
- {if}
- 0 (S.L.atron_start)
- 0 (S.L.Verkauf)
- 0 (S.L.Ticket)
- 0 (S.L.Fahrtdisplay)
- 0 (S.L.tickets_all)
- 0 (S.L.atron_pineingabe)
- "" (S.$.string_keypad)
- 1 (S.L.Fahrt)
- {endif}
- {endif}
- (L.L.Fahrt)
- {if}
- 0 (S.L.atron_start)
- 0 (S.L.atron_pineingabe) (S.L.atron_ideingabe)
- 0 (S.L.ticketprinter_stop_manu) (S.L.ticketprinter_stop) (S.L.ticketprinter_laststop)
- 1 (S.L.Fahrtdisplay)
- {endif}
- {endif}
- {trigger:atron_keypad_F}
- ' Druck
- (L.L.Ticket)
- {if}
- 1 (S.L.print)
- {end}
- {trigger:atron_keypad_abbr}
- (L.L.atron_ideingabe)
- {if}
- (L.$.string_keypad) 1 $cutEnd (S.$.string_keypad)
- {endif}
- (L.L.atron_pineingabe)
- {if}
- (L.$.string_keypad) 1 $cutEnd (S.$.string_keypad)
- (L.$.string_pin) 1 $cutEnd (S.$.string_pin)
- {endif}
- {end}
- {trigger:atron_keypad_0}
- 0 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_1}
- 1 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_2}
- 2 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_3}
- 3 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_4}
- 4 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_5}
- 5 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_6}
- 6 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_7}
- 7 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_8}
- 8 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_keypad_9}
- 9 s0 (M.L.atron_keypad)
- {end}
- {trigger:atron_display_1_B_start}
- (L.L.elec_busbar_main)
- {if}
- 0 (S.L.Verkauf)
- 0 (S.L.Ticket)
- 0 (S.L.Fahrtdisplay)
- 0 (S.L.tickets_all)
- "" (S.$.string_keypad)
- 1 (S.L.atron_ideingabe)
- {end}
- {macro:atron_keypad}
- (L.L.atron_ideingabe)
- (L.$.string_keypad) $length 4 < &&
- {if}
- (L.$.string_keypad) l0 $IntToStr $+ (S.$.string_keypad)
- {endif}
- (L.L.atron_Pineingabe)
- (L.$.string_pin) $length 4 < &&
- {if}
- (L.$.string_pin) l0 $IntToStr $+ (S.$.string_pin)
- (L.$.string_pin) $length 1 < {if} "" (S.$.string_keypad) {endif}
- (L.$.string_pin) $length 1 = {if} "[" (S.$.string_keypad) {endif}
- (L.$.string_pin) $length 2 = {if} "[[" (S.$.string_keypad) {endif}
- (L.$.string_pin) $length 3 = {if} "[[[" (S.$.string_keypad) {endif}
- (L.$.string_pin) $length 3 > {if} "[[[[" (S.$.string_keypad) {endif}
- {endif}
- {end}
- {trigger:atron_display_B_L1}
- ' Druck Ticket 1
- (L.L.Verkauf)
- {if}
- 0 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_L2}
- ' Druck Ticket 2
- (L.L.Verkauf)
- {if}
- 1 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_L3}
- ' Druck Ticket 3
- (L.L.Verkauf)
- {if}
- 2 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_L4}
- ' Druck Ticket 4
- (L.L.Verkauf)
- {if}
- 3 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_R1}
- ' Druck Ticket 5
- (L.L.Verkauf)
- {if}
- 4 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_R2}
- ' Druck Ticket 6
- (L.L.Verkauf) (L.$.Yard) "Gladbeck" $= ! &&
- {if}
- 5 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_R3}
- ' Druck Ticket 7
- (L.L.Verkauf) (L.$.Yard) "Gladbeck" $= ! &&
- {if}
- 6 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:atron_display_B_R4}
- ' Druck Ticket 8
- (L.L.Verkauf) (L.$.Yard) "Gladbeck" $= ! &&
- {if}
- 7 (S.L.tickettyp)
- 1 (S.L.Ticket)
- {endif}
- {end}
- {trigger:ticket_toggle}
- (L.L.print) !
- {if}
- 0 (S.L.anim_ticket)
- -1 (S.L.GivenTicket)
- (T.L.ev_ticketsale_giveticket)
- {end}
- {macro:ticketprinter_init}
- -1 (S.L.tickettyp) (S.L.GivenTicket)
- 1 (S.L.checkdisplay_enabled)
- {end}
- {macro:ticketprinter_frame}
- ' Timer fuer alle zeitbezogenen Bedingungen
- (L.L.globaltimer) (L.S.Timegap) + (S.L.globaltimer)
- ' Wenn die Elektrik aus ist, Standbymodus aktivieren
- (L.L.elec_busbar_main_sw) ! (C.L.elec_busbar_minV) 0.3 < ||
- {if}
- 1 (S.L.ticketprinter_absch)
- {endif}
- ' Abschaltung wenn Standbyzeit überschritten
- (L.L.globaltimer) (L.L.ticketprinter_absch) (C.L.ticketprinter_standby_sec) + > &&
- {if}
- 0 (s.L.atron_ideingabe)
- 0 (S.L.atron_pineingabe)
- 0 (S.L.Fahrt)
- 0 (S.L.Verkauf)
- 0 (S.L.Fahrtdisplay)
- 0 (S.L.Ticket)
- 0 (S.L.print)
- 0 (S.L.ticketprinter_on) (S.L.ticketprinter_absch) (S.L.atron_start)
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- {endif}
- (L.L.elec_busbar_main) (C.L.elec_busbar_minV) > (L.L.ticketprinter_standby) || (L.L.ticketprinter_on) ||
- {if}
- ' Hochfahren nach Verzögerung
- (L.L.vdv_display_startuptime) 3.1 >
- (L.L.vdv_display_startuptime) 3.9 < &&
- {if}
- 1 (S.L.ticketprinter_on) (S.L.checkdisplay_boot) (S.L.atron_start)
- {endif}
- {endif}
- (L.L.Fahrt)
- {if}
- ' Nächsten Halt anzeigen
- (L.L.IBIS_RouteIndex) (M.V.GetBusstopCount) 1 - (L.L.IBIS_busstop) >=
- (L.L.IBIS_Route) 0 = ! &&
- {if}
- (L.L.IBIS_RouteIndex) (L.L.IBIS_busstop) (M.V.GetRouteBusstopIdent)
- (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString)
- (S.$.string_stop1)
- {else}
- "" (S.$.string_stop1)
- {endif}
- ' Zweiten Halt anzeigen
- (L.L.IBIS_RouteIndex) (M.V.GetBusstopCount) 1 - (L.L.IBIS_busstop) 1 + >=
- (L.L.IBIS_Route) 0 = ! &&
- {if}
- (L.L.IBIS_RouteIndex) (L.L.IBIS_busstop) 1 + (M.V.GetRouteBusstopIdent)
- (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString)
- (S.$.string_stop2)
- {else}
- "" (S.$.string_stop2)
- {endif}
- ' Dritten Halt anzeigen
- (L.L.IBIS_RouteIndex) (M.V.GetBusstopCount) 1 - (L.L.IBIS_busstop) 2 + >=
- (L.L.IBIS_Route) 0 = ! &&
- {if}
- (L.L.IBIS_RouteIndex) (L.L.IBIS_busstop) 2 + (M.V.GetRouteBusstopIdent)
- (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString)
- (S.$.string_stop3)
- {else}
- "" (S.$.string_stop3)
- {endif}
- ' Vierten Halt anzeigen
- (L.L.IBIS_RouteIndex) (M.V.GetBusstopCount) 1 - (L.L.IBIS_busstop) 2 + >=
- (L.L.IBIS_Route) 0 = ! &&
- {if}
- (L.L.IBIS_RouteIndex) (L.L.IBIS_busstop) 2 + (M.V.GetRouteBusstopIdent)
- (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString)
- (S.$.string_stop4)
- {else}
- "" (S.$.string_stop4)
- {endif}
- ' Linie anzeigen
- (L.L.IBIS_Route) s0
- {if}
- (L.$.Matrix_Nr) (S.$.string_zeile)
- {else}
- "" (S.$.string_zeile)
- {endif}
- ' Endhaltestelle anzeigen
- "-" (S.$.string_dest)
- {endif}
- ' Uhrzeit in der unteren rechten Ecke anzeigen
- (L.S.Time) 3600 / s3 trunc s4 "02" $IntToStrEnh ":" $+ l3 l4 - 60 * trunc "02" $IntToStrEnh $+ (S.$.string_clock)
- {endif}
- 'Automatisches Wechseln zwischen ITCS & Verkauf:
- (L.L.door_0) 0.1 >
- (L.L.ticketprinter_standby) 0 = &&
- (L.L.Velocity) 20 < &&
- (L.L.atron_start) 0 = &&
- (L.L.atron_pineingabe) 0 = &&
- (L.L.atron_ideingabe) 0 = &&
- {if}
- 1 (S.L.verkauf)
- 0 (S.L.Fahrtdisplay) (S.L.ticketprinter_standby)
- {endif}
- (L.L.door_0) 0 =
- (L.L.Velocity) 20 >
- {if}
- 0 (S.L.verkauf)
- 1 (S.L.Fahrtdisplay)
- {else}
- 0 (S.L.ticketprinter_standby)
- {endif}
- (L.L.Velocity) 20 >
- {if}
- 0 (S.L.ticketprinter_standby)
- {endif}
- (L.L.Ticket)
- {if}
- 0 (S.L.verkauf) (S.L.atron_start) (S.L.ticketprinter_standby)
- {endif}
- ' Tickets
- (L.L.Verkauf)
- {if}
- (M.L.ticketpack)
- (L.$.string_stop1) $length 0 > (S.L.atron_display_T1_vis)
- (L.$.string_stop2) $length 0 > (S.L.atron_display_T2_vis)
- (L.$.string_stop3) $length 0 > (S.L.atron_display_T3_vis)
- (L.$.string_stop4) $length 0 > (S.L.atron_display_T4_vis)
- {else}
- 0 (S.L.atron_display_B_runter_vis) (S.L.atron_display_B_hoch_vis)
- 0 (S.L.atron_display_T1_vis)
- 0 (S.L.atron_display_T2_vis)
- 0 (S.L.atron_display_T3_vis)
- 0 (S.L.atron_display_T4_vis)
- {endif}
- {endif}
- (L.L.Ticket)
- {if}
- " Drucken? "
- (L.L.tickettyp) (M.V.GetTicketName) $+
- " " $+
- (L.L.tickettyp) (M.V.GetTicketValue) 100 * $IntToStr 2 $cutEnd $+ "." $+
- (L.L.tickettyp) (M.V.GetTicketValue) 100 * $IntToStr 2 $SetLengthR $+
- " EUR" $+
- (S.$.string_info)
- {endif}
- {endif}
- ' Druck
- (L.L.print)
- {if}
- (L.L.anim_ticket) 0 =
- {if}
- (T.L.ev_print)
- (L.L.tickettyp) (M.V.GetTicketValue) s0 (S.L.int_lastsold)
- (L.L.int_income) l0 + (S.L.int_income)
- {endif}
- (L.L.anim_ticket) (L.S.Timegap) + 0 max 1 min (S.L.anim_ticket)
- 1 >=
- {if}
- (L.L.tickettyp) (S.L.GivenTicket)
- -1 (S.L.tickettyp)
- 0 (S.L.print)
- 0 (S.L.Ticket)
- 0 (S.L.atron_start)
- "" (S.$.string_info)
- 1 (S.L.Verkauf)
- {endif}
- {endif}
- (L.L.GivenTicket) -1 = (L.L.print) ! && (L.L.Ticket) ! &&
- {if}
- -1 (S.L.tickettyp)
- 0 (S.L.anim_ticket)
- {endif}
- {end}
- {macro:ticketpack}
- (L.L.tickets_all) !
- {if}
- (L.L.ticketcount) s0
- l0 8 =
- {if}
- 8 (S.L.ticketcount)
- 1 (S.L.tickets_all)
- {endif}
- l0 0 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket1)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 1 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket2)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 2 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket3)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 3 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket4)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 4 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket5)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 5 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket6)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 6 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket7)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- l0 7 =
- {if}
- (L.L.ticketcount) (M.V.GetTicketName) $length 0 = !
- {if}
- " " (L.L.ticketcount) (M.V.GetTicketName)
- (S.$.string_ticket8)
- (L.L.ticketcount) 1 + (S.L.ticketcount)
- {else}
- 1 (S.L.tickets_all)
- {endif}
- {endif}
- {else}
- (L.$.string_ticket1) $length 0 > {if} (L.$.string_ticket1) (S.$.string_button1) 1 (S.L.atron_display_B_L1_vis) {else} 0 (S.L.atron_display_B_L1_vis) {endif}
- (L.$.string_ticket2) $length 0 > {if} (L.$.string_ticket2) (S.$.string_button2) 1 (S.L.atron_display_B_L2_vis) {else} 0 (S.L.atron_display_B_L2_vis) {endif}
- (L.$.string_ticket3) $length 0 > {if} (L.$.string_ticket3) (S.$.string_button3) 1 (S.L.atron_display_B_L3_vis) {else} 0 (S.L.atron_display_B_L3_vis) {endif}
- (L.$.string_ticket4) $length 0 > {if} (L.$.string_ticket4) (S.$.string_button4) 1 (S.L.atron_display_B_L4_vis) {else} 0 (S.L.atron_display_B_L4_vis) {endif}
- (L.$.string_ticket5) $length 0 > {if} (L.$.string_ticket5) (S.$.string_button5) 1 (S.L.atron_display_B_R1_vis) {else} 0 (S.L.atron_display_B_R1_vis) {endif}
- (L.$.string_ticket6) $length 0 > {if} (L.$.string_ticket6) (S.$.string_button6) 1 (S.L.atron_display_B_R2_vis) {else} 0 (S.L.atron_display_B_R2_vis) {endif}
- (L.$.string_ticket7) $length 0 > {if} (L.$.string_ticket7) (S.$.string_button7) 1 (S.L.atron_display_B_R3_vis) {else} 0 (S.L.atron_display_B_R3_vis) {endif}
- (L.$.string_ticket8) $length 0 > {if} (L.$.string_ticket8) (S.$.string_button8) 1 (S.L.atron_display_B_R4_vis) {else} 0 (S.L.atron_display_B_R4_vis) {endif}
- {endif}
- {macro:Elec_Init}
- 'At the beginning, battery has enough voltage:
- 1.0 (S.L.elec_V_battery) (L.L.elec_busbar_avail)
- {end}
- 'If the battery or generator has voltage and if the switch is on and if there is no electricity failure,
- 'the main busbar will become active:
- (L.L.elec_busbar_avail)
- (L.L.elec_busbar_main_sw) &&
- (L.L.elec_failure_general) ! &&
- (S.L.elec_busbar_main)
- {end}
- 'But battery's voltage instantly grows up to the level of the generator voltage
- (L.L.generator_failure) !
- {if}
- (L.L.elec_V_battery) (L.L.elec_V_generator) max (S.L.elec_V_battery)
- {endif}
- 'If the battery or generator has voltage and if the switch is on and if there is no electricity failure,
- 'the main busbar will become active:
- (L.L.elec_busbar_avail)
- (L.L.elec_busbar_main_sw) &&
- (L.L.elec_failure_general) ! &&
- (S.L.elec_busbar_main)
- {end}