|
| 1 | +############################ |
| 2 | +# **** IMPORT SECTION **** # |
| 3 | +############################ |
| 4 | +from qtvcp.core import Status, Action |
| 5 | + |
| 6 | +# Set up logging |
| 7 | +from qtvcp import logger |
| 8 | + |
| 9 | +########################################### |
| 10 | +# **** instantiate libraries section **** # |
| 11 | +########################################### |
| 12 | + |
| 13 | +STATUS = Status() |
| 14 | +ACTION = Action() |
| 15 | +LOG = logger.getLogger(__name__) |
| 16 | +# Set the log level for this module |
| 17 | +#LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL |
| 18 | + |
| 19 | +################################### |
| 20 | +# **** HANDLER CLASS SECTION **** # |
| 21 | +################################### |
| 22 | + |
| 23 | +class HandlerClass: |
| 24 | + |
| 25 | + ######################## |
| 26 | + # **** INITIALIZE **** # |
| 27 | + ######################## |
| 28 | + # widgets allows access to widgets from the qtvcp files |
| 29 | + # at this point the widgets and hal pins are not instantiated |
| 30 | + def __init__(self, halcomp,widgets,paths): |
| 31 | + self.hal = halcomp |
| 32 | + self.w = widgets |
| 33 | + self.PATHS = paths |
| 34 | + ########################################## |
| 35 | + # Special Functions called from QTVCP |
| 36 | + ########################################## |
| 37 | + |
| 38 | + # at this point: |
| 39 | + # the widgets are instantiated. |
| 40 | + # the HAL pins are built but HAL is not set ready |
| 41 | + def initialized__(self): |
| 42 | + pass |
| 43 | + |
| 44 | + ######################## |
| 45 | + # callbacks from STATUS # |
| 46 | + ######################## |
| 47 | + |
| 48 | + ####################### |
| 49 | + # callbacks from form # |
| 50 | + ####################### |
| 51 | + |
| 52 | + ##################### |
| 53 | + # general functions # |
| 54 | + ##################### |
| 55 | + |
| 56 | + ##################### |
| 57 | + # KEY BINDING CALLS # |
| 58 | + ##################### |
| 59 | + |
| 60 | + ########################### |
| 61 | + # **** closing event **** # |
| 62 | + ########################### |
| 63 | + |
| 64 | + ############################## |
| 65 | + # required class boiler code # |
| 66 | + ############################## |
| 67 | + |
| 68 | + def __getitem__(self, item): |
| 69 | + return getattr(self, item) |
| 70 | + def __setitem__(self, item, value): |
| 71 | + return setattr(self, item, value) |
| 72 | + |
| 73 | +################################ |
| 74 | +# required handler boiler code # |
| 75 | +################################ |
| 76 | + |
| 77 | +def get_handlers(halcomp,widgets,paths): |
| 78 | + return [HandlerClass(halcomp,widgets,paths)] |
0 commit comments