|
22 | 22 | from PyQt5.QtGui import QPixmap |
23 | 23 |
|
24 | 24 | from qtvcp.widgets.widget_baseclass import _HalWidgetBase |
25 | | -from qtvcp.core import Status, Info, Tool |
| 25 | +from qtvcp.core import Status, Info, Tool, Path |
26 | 26 | from qtvcp import logger |
27 | 27 |
|
28 | 28 | # Instantiate the libraries with global reference |
|
31 | 31 | STATUS = Status() |
32 | 32 | INFO = Info() |
33 | 33 | TOOL = Tool() |
| 34 | +PATH = Path() |
34 | 35 | LOG = logger.getLogger(__name__) |
35 | 36 |
|
36 | 37 | # Force the log level for this module |
37 | 38 | # LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL |
38 | 39 |
|
39 | | -if INFO.IMAGE_PATH is not None: |
40 | | - DEFAULTIMAGE = (os.path.join(INFO.IMAGE_PATH,'applet-critical.png')) or '' |
| 40 | +if PATH.IMAGEDIR is not None: |
| 41 | + DEFAULTIMAGE = (os.path.join(PATH.IMAGEDIR,'applet-critical.png')) or '' |
41 | 42 | else: |
42 | | - INFO.IMAGE_PATH = '' |
43 | 43 | DEFAULTIMAGE = '' |
44 | 44 |
|
45 | 45 | class ImageSwitcher(QLabel, _HalWidgetBase): |
@@ -97,7 +97,7 @@ def show_image_by_number(self, number): |
97 | 97 | # if path doesn't exist try referencing |
98 | 98 | # from the built in image folder |
99 | 99 | if not os.path.exists(path): |
100 | | - path = os.path.join(INFO.IMAGE_PATH, path) |
| 100 | + path = os.path.join(PATH.IMAGEDIR, path) |
101 | 101 | if not os.path.exists(path): |
102 | 102 | LOG.debug('No Path: {}'.format(path)) |
103 | 103 | pixmap = QPixmap(path) |
@@ -148,9 +148,9 @@ class StatusImageSwitcher(ImageSwitcher): |
148 | 148 |
|
149 | 149 | def __init__(self, parent=None): |
150 | 150 | super(StatusImageSwitcher, self).__init__(parent) |
151 | | - self._imagePath = [os.path.join(INFO.IMAGE_PATH,'applet-critical.png'), |
152 | | - os.path.join(INFO.IMAGE_PATH,'spindle_ccw.gif'), |
153 | | - os.path.join(INFO.IMAGE_PATH,'spindle_cw.gif')] |
| 151 | + self._imagePath = [os.path.join(PATH.IMAGEDIR,'applet-critical.png'), |
| 152 | + os.path.join(PATH.IMAGEDIR,'spindle_ccw.gif'), |
| 153 | + os.path.join(PATH.IMAGEDIR,'spindle_cw.gif')] |
154 | 154 | self.spindle = True |
155 | 155 | self.all_homed = False |
156 | 156 | self.axis_homed = False |
|
0 commit comments