示例#1
0
def init_alarm_app(alarm_list=None, button_control=None):
    """
    Inits an alarm app.

    void -> AlarmApplication
    AlarmList -> ButtonControl -> AlarmApplication
    """
    if alarm_list is None:
        _, alarm_list = create_alarm_list_and_test_alarm()
    display_ = display.Display()
    led_control = ledcontrol.LEDControl()
    if button_control is None:
        button_control = buttons.ButtonControl()
    return alarm_app.AlarmApplication(display_, led_control, alarm_list,
                                      button_control)
示例#2
0
import ledcontrol
import faultmanagerscreen
import configloader


# first
gatewayconfig = configloader.ConfigLoader("/etc/gatewayconfig.json") # any exception this function throws should kill the program


'''
LED setup
'''

GPIO.setmode(GPIO.BCM)

lc = ledcontrol.LEDControl(gatewayconfig.getLedconfig(), ledcontrol.LEDAnimationOff(), gatewayconfig.getLedInversion())
lc.start()

'''
Fault manager thingy setup
'''

fm = faultmanagerscreen.FaultManagerScreen()






#Jo csunya, majd szepre atirni
last_time = time.time()
示例#3
0
from RPi import GPIO
import ledcontrol
from bottleledcontrol import BottleLedControl
import configloader

# first

carconfig = configloader.ConfigLoader(
    "/etc/carconfig.json"
)  # any exception this function throws should kill the program

#init / setup metodusba
GPIO.setmode(GPIO.BCM)

lc = ledcontrol.LEDControl(
    carconfig.getLedconfig(), ledcontrol.LEDAnimationGood(),
    carconfig.getLedInversion(
    ))  # inicializaljuk a ledvezerlot a car descriptionnak megfeleloen
lc.start()

blc = BottleLedControl(12, BottleLedControl.ANIMATION_OFF)
blc.start()

carManagement = "carManagement"
carStatus = "carStatus"  # uj
moving = "car_moving"  # uj
stopped = "car_stopped"  # uj
carFlag = 0  # uj , 0: stopped; 1: moving
publish_no_trigger = 0  # uj , forklift_power_error publish skip

stop_active = True
reset_active = False  # csak arra van hasznalva, hogy skippelje a vonalakat