mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-08-01 08:29:41 +02:00
2020-01-04 Fred Gleason <fredg@paravelsystems.com>
* Added 'Repetitions=' and 'RepetitionDelay=' directive to the configuration of the 'pypad_xds.py' PyPAD script.
This commit is contained in:
parent
0e8234afc6
commit
63949df482
@ -19395,3 +19395,6 @@
|
|||||||
2020-01-04 Fred Gleason <fredg@paravelsystems.com>
|
2020-01-04 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed a bug in the 'pypad_xds.py' PyPAD script that could cause it
|
* Fixed a bug in the 'pypad_xds.py' PyPAD script that could cause it
|
||||||
to emit duplicate CIC updates.
|
to emit duplicate CIC updates.
|
||||||
|
2020-01-04 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added 'Repetitions=' and 'RepetitionDelay=' directive to the
|
||||||
|
configuration of the 'pypad_xds.py' PyPAD script.
|
||||||
|
@ -30,6 +30,16 @@ UdpPort=1234
|
|||||||
;
|
;
|
||||||
IsciPrefix=TEST_
|
IsciPrefix=TEST_
|
||||||
|
|
||||||
|
; Repetitions
|
||||||
|
;
|
||||||
|
; Send each CIC update packet this many times.
|
||||||
|
Repetitions=1
|
||||||
|
|
||||||
|
; Repetition Delay
|
||||||
|
;
|
||||||
|
; Delay this many milliseconds between each repetition.
|
||||||
|
RepetitionDelay=100
|
||||||
|
|
||||||
; Log Selection
|
; Log Selection
|
||||||
;
|
;
|
||||||
; Set the status for each log to 'Yes', 'No' or 'Onair' to indicate whether
|
; Set the status for each log to 'Yes', 'No' or 'Onair' to indicate whether
|
||||||
@ -67,6 +77,8 @@ VLog120=No
|
|||||||
;UdpPort=6789
|
;UdpPort=6789
|
||||||
;TtyDevice=/dev/ttyS1
|
;TtyDevice=/dev/ttyS1
|
||||||
;TtySpeed=19200
|
;TtySpeed=19200
|
||||||
|
;Repetitions=1
|
||||||
|
;RepetitionDelay=100
|
||||||
;MasterLog=Yes
|
;MasterLog=Yes
|
||||||
;Aux1Log=No
|
;Aux1Log=No
|
||||||
;Aux2Log=Onair
|
;Aux2Log=Onair
|
||||||
|
@ -24,6 +24,7 @@ import sys
|
|||||||
import socket
|
import socket
|
||||||
import configparser
|
import configparser
|
||||||
import serial
|
import serial
|
||||||
|
import time
|
||||||
import pypad
|
import pypad
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -76,23 +77,31 @@ def ProcessPad(update):
|
|||||||
if update.shouldBeProcessed(section) and update.hasPadType(pypad.TYPE_NOW) and update.hasService() and (last_updates[update.machine()] != update.startDateTimeString(pypad.TYPE_NOW)):
|
if update.shouldBeProcessed(section) and update.hasPadType(pypad.TYPE_NOW) and update.hasService() and (last_updates[update.machine()] != update.startDateTimeString(pypad.TYPE_NOW)):
|
||||||
last_updates[update.machine()]=update.startDateTimeString(pypad.TYPE_NOW)
|
last_updates[update.machine()]=update.startDateTimeString(pypad.TYPE_NOW)
|
||||||
packet='0:'+update.serviceProgramCode()+':'+update.config().get(section,'IsciPrefix')+FilterField(update.padField(pypad.TYPE_NOW,pypad.FIELD_EXTERNAL_EVENT_ID))+':*'
|
packet='0:'+update.serviceProgramCode()+':'+update.config().get(section,'IsciPrefix')+FilterField(update.padField(pypad.TYPE_NOW,pypad.FIELD_EXTERNAL_EVENT_ID))+':*'
|
||||||
try:
|
reps=range(1)
|
||||||
#
|
if(update.config().has_option(section,'Repetitions')):
|
||||||
# Use serial output
|
reps=range(update.config().getint(section,'Repetitions'))
|
||||||
#
|
delay=0.1
|
||||||
tty_dev=update.config().get(section,'TtyDevice')
|
if(update.config().has_option(section,'RepetitionDelay')):
|
||||||
speed=int(update.config().get(section,'TtySpeed'))
|
delay=update.config().getfloat(section,'RepetitionDelay')/1000.0
|
||||||
parity=serial.PARITY_NONE
|
for r in reps:
|
||||||
dev=serial.Serial(tty_dev,speed,parity=parity,bytesize=8)
|
try:
|
||||||
dev.write(packet.encode('utf-8'))
|
#
|
||||||
dev.close()
|
# Use serial output
|
||||||
|
#
|
||||||
|
tty_dev=update.config().get(section,'TtyDevice')
|
||||||
|
speed=int(update.config().get(section,'TtySpeed'))
|
||||||
|
parity=serial.PARITY_NONE
|
||||||
|
dev=serial.Serial(tty_dev,speed,parity=parity,bytesize=8)
|
||||||
|
dev.write(packet.encode('utf-8'))
|
||||||
|
dev.close()
|
||||||
|
|
||||||
except configparser.NoOptionError:
|
except configparser.NoOptionError:
|
||||||
#
|
#
|
||||||
# Use UDP output
|
# Use UDP output
|
||||||
#
|
#
|
||||||
send_sock.sendto(packet.encode('utf-8'),
|
send_sock.sendto(packet.encode('utf-8'),
|
||||||
(update.config().get(section,'IpAddress'),int(update.config().get(section,'UdpPort'))))
|
(update.config().get(section,'IpAddress'),int(update.config().get(section,'UdpPort'))))
|
||||||
|
time.sleep(delay)
|
||||||
n=n+1
|
n=n+1
|
||||||
section='Udp'+str(n)
|
section='Udp'+str(n)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user