The timer.py file can easily be adapted to set a pin high if a lubrication of the spindle is needed or if a machine maintenance is needed. That would only require:
a hal pin to indicate lube needed for spindle and ore machine
a hal pin to indicate machine needs maintenance
a Pin for the time limit to lube
a pin for the time limit for maintenance
a pin to indicate "maintenance done"
a pin to indicate "lube done"
The last two are only needed to ensure the message is not only displayed once and just closed by the operator.
The rest can be done in timer.hal and to display messages use custom messages.
Like the ones I did in sim / gmoccapy / gmoccapy_messages.ini
Code:
[DISPLAY]
# set up 3 user popup message dialogs
# the messages support pango markup language
# detailed information about the markup language can be found at
# https://developer.gnome.org/pango/stable/PangoMarkupFormat.html
# MESSAGE_TEXT = The text to be displayed, may be pango markup formatted
# MESSAGE_TYPE = one of "status" , "okdialog" , "yesnodialog"
# status : Will just display a message as popup window, using the messsaging system of gmoccapy
# okdialog : Will hold focus on the message dialog and will activate a "-waiting" Hal_Pin OUT.
# Closing the message will reset the waiting pin
# yesnodialog : Will hold focus on the message dialog and will activate a "-waiting" Hal_Pin bit OUT
# it will also give access to an "-responce" Hal_Pin Bit Out, this pin will hold 1 if the
# user klicks OK, and in all other states it will be 0
# Closing the message will reset the waiting pin
# The responce Hal Pin will remain 1 until the dialog is called again
# MESSAGE_PINNAME = is the name of the hal pin group to be created
MESSAGE_TEXT = This is a <span background="#ff0000" foreground="#ffffff">info message</span> test
MESSAGE_TYPE = status
MESSAGE_PINNAME = statustest
MESSAGE_TEXT = This is a yes no dialog test
MESSAGE_TYPE = yesnodialog
MESSAGE_PINNAME = yesnodialog
MESSAGE_TEXT = Text can be <small>small</small>, <big>big</big>, <b>bold</b>, <i>italic</i> and even be <span color="red">colored</span>.
MESSAGE_TYPE = okdialog
MESSAGE_PINNAME = okdialog
Norbert