Exemplo n.º 1
0
def papirus(config, layout):
    fonts.setup(10, 8, 10, 23)

    layout['width'] = 200
    layout['height'] = 96
    layout['face'] = (0, int(layout['height'] / 4))
    layout['name'] = (5, int(layout['height'] * .15))
    layout['channel'] = (0, 0)
    layout['aps'] = (25, 0)
    layout['uptime'] = (layout['width'] - 65, 0)
    layout['line1'] = [
        0,
        int(layout['height'] * .12), layout['width'],
        int(layout['height'] * .12)
    ]
    layout['line2'] = [
        0, layout['height'] - int(layout['height'] * .12), layout['width'],
        layout['height'] - int(layout['height'] * .12)
    ]
    layout['friend_face'] = (0, (layout['height'] * 0.88) - 15)
    layout['friend_name'] = (40, (layout['height'] * 0.88) - 13)
    layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1)
    layout['mode'] = (layout['width'] - 25,
                      layout['height'] - int(layout['height'] * .12) + 1)
    layout['status'] = {
        'pos': (85, int(layout['height'] * .15)),
        'font': fonts.Medium,
        'max': (layout['width'] - 100) // 6
    }
    return layout
Exemplo n.º 2
0
def setup_display_specifics(config):
    width = 0
    height = 0
    face_pos = (0, 0)
    name_pos = (0, 0)
    status_pos = (0, 0)

    if config['ui']['display']['type'] in ('inky', 'inkyphat'):
        fonts.setup(10, 8, 10, 25)

        width = 212
        height = 104
        face_pos = (0, int(height / 4))
        name_pos = (int(width / 2) - 15, int(height * .15))
        status_pos = (int(width / 2) - 15, int(height * .30))
    elif config['ui']['display']['type'] in ('ws_1', 'ws1', 'waveshare_1', 'waveshare1', 
                                             'ws_2', 'ws2', 'waveshare_2', 'waveshare2'):
        fonts.setup(10, 9, 10, 35)

        width = 250
        height = 122
        face_pos = (0, 40)
        name_pos = (125, 20)
        status_pos = (125, 35)

    return width, height, face_pos, name_pos, status_pos
Exemplo n.º 3
0
def inkyphat(config, layout):
    fonts.setup(10, 8, 10, 28)

    layout['width'] = 212
    layout['height'] = 104
    layout['face'] = (0, 37)
    layout['name'] = (5, 18)
    layout['channel'] = (0, 0)
    layout['aps'] = (25, 0)
    layout['uptime'] = (layout['width'] - 65, 0)
    layout['line1'] = [
        0,
        int(layout['height'] * .12), layout['width'],
        int(layout['height'] * .12)
    ]
    layout['line2'] = [
        0, layout['height'] - int(layout['height'] * .12), layout['width'],
        layout['height'] - int(layout['height'] * .12)
    ]
    layout['friend_face'] = (0, (layout['height'] * 0.88) - 15)
    layout['friend_name'] = (40, (layout['height'] * 0.88) - 13)
    layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1)
    layout['mode'] = (layout['width'] - 25,
                      layout['height'] - int(layout['height'] * .12) + 1)
    layout['status'] = {'pos': (102, 18), 'font': fonts.Small, 'max': 20}
    return layout
Exemplo n.º 4
0
def setup_display_specifics(config):
    width = 0
    height = 0
    face_pos = (0, 0)
    name_pos = (0, 0)
    status_pos = (0, 0)
    status_font = fonts.Medium
    status_max_length = None

    if config['ui']['display']['type'] in ('inky', 'inkyphat'):
        fonts.setup(10, 8, 10, 28)

        width = 212
        height = 104
        face_pos = (0, 37)
        name_pos = (5, 18)
        status_pos = (102, 18)
        status_font = fonts.Small
        status_max_length = 20

    elif config['ui']['display']['type'] in ('papirus', 'papi'):
        fonts.setup(10, 8, 10, 23)

        width = 200
        height = 96
        face_pos = (0, int(height / 4))
        name_pos = (5, int(height * .15))
        status_pos = (int(width / 2) - 15, int(height * .15))
        status_font = fonts.Medium
        status_max_length = (width - status_pos[0]) // 6

    elif config['ui']['display']['type'] in ('ws_1', 'ws1', 'waveshare_1',
                                             'waveshare1', 'ws_2', 'ws2',
                                             'waveshare_2', 'waveshare2'):
        if config['ui']['display']['color'] == 'black':
            fonts.setup(10, 9, 10, 35)

            width = 250
            height = 122
            face_pos = (0, 40)
            name_pos = (5, 20)
            status_pos = (125, 20)
            status_font = fonts.Medium
        else:
            fonts.setup(10, 8, 10, 25)

            width = 212
            height = 104
            face_pos = (0, int(height / 4))
            name_pos = (5, int(height * .15))
            status_pos = (int(width / 2) - 15, int(height * .15))
            status_font = fonts.Medium
        status_max_length = (width - status_pos[0]) // 6

    return width, height, face_pos, name_pos, status_pos, status_font, status_max_length
Exemplo n.º 5
0
 def layout(self):
     if self.config['color'] == 'black':
         fonts.setup(10, 9, 10, 35, 25, 9)
         self._layout['width'] = 250
         self._layout['height'] = 122
         self._layout['face'] = (0, 40)
         self._layout['name'] = (5, 20)
         self._layout['channel'] = (0, 0)
         self._layout['aps'] = (38, 0)
         self._layout['uptime'] = (185, 0)
         self._layout['line1'] = [0, 14, 250, 14]
         self._layout['line2'] = [0, 108, 250, 108]
         self._layout['friend_face'] = (0, 92)
         self._layout['friend_name'] = (40, 94)
         self._layout['shakes'] = (0, 109)
         self._layout['mode'] = (225, 109)
         self._layout['status'] = {
             'pos': (125, 20),
             'font': fonts.status_font(fonts.Medium),
             'max': 20
         }
     else:
         fonts.setup(10, 8, 10, 25, 25, 9)
         self._layout['width'] = 212
         self._layout['height'] = 104
         self._layout['face'] = (0, 26)
         self._layout['name'] = (5, 15)
         self._layout['channel'] = (0, 0)
         self._layout['aps'] = (38, 0)
         self._layout['status'] = (91, 15)
         self._layout['uptime'] = (147, 0)
         self._layout['line1'] = [0, 12, 212, 12]
         self._layout['line2'] = [0, 92, 212, 92]
         self._layout['friend_face'] = (0, 76)
         self._layout['friend_name'] = (40, 78)
         self._layout['shakes'] = (0, 93)
         self._layout['mode'] = (187, 93)
         self._layout['status'] = {
             'pos': (125, 20),
             'font': fonts.status_font(fonts.Medium),
             'max': 14
         }
     return self._layout
Exemplo n.º 6
0
 def layout(self):
     fonts.setup(10, 8, 10, 28)
     self._layout['width'] = 212
     self._layout['height'] = 104
     self._layout['face'] = (0, 37)
     self._layout['name'] = (5, 18)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (25, 0)
     self._layout['uptime'] = (147, 0)
     self._layout['line1'] = [0, 12, 212, 12]
     self._layout['line2'] = [0, 92, 212, 92]
     self._layout['friend_face'] = (0, 76)
     self._layout['friend_name'] = (40, 78)
     self._layout['shakes'] = (0, 93)
     self._layout['mode'] = (187, 93)
     self._layout['status'] = {
         'pos': (102, 18),
         'font': fonts.Small,
         'max': 20
     }
     return self._layout
Exemplo n.º 7
0
 def layout(self):
     fonts.setup(10, 8, 10, 18, 25, 9)
     self._layout['width'] = 128
     self._layout['height'] = 128
     self._layout['face'] = (0, 43)
     self._layout['name'] = (0, 14)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (0, 71)
     self._layout['uptime'] = (0, 25)
     self._layout['line1'] = [0, 12, 127, 12]
     self._layout['line2'] = [0, 116, 127, 116]
     self._layout['friend_face'] = (12, 88)
     self._layout['friend_name'] = (1, 103)
     self._layout['shakes'] = (26, 117)
     self._layout['mode'] = (0, 117)
     self._layout['status'] = {
         'pos': (65, 26),
         'font': fonts.status_font(fonts.Small),
         'max': 12
     }
     return self._layout
Exemplo n.º 8
0
 def layout(self):
     fonts.setup(8, 8, 8, 8)
     self._layout['width'] = 128
     self._layout['height'] = 64
     self._layout['face'] = (0, 32)
     self._layout['name'] = (0, 10)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (25, 0)
     self._layout['uptime'] = (65, 0)
     self._layout['line1'] = [0, 9, 128, 9]
     self._layout['line2'] = [0, 53, 128, 53]
     self._layout['friend_face'] = (0, 41)
     self._layout['friend_name'] = (40, 43)
     self._layout['shakes'] = (0, 53)
     self._layout['mode'] = (103, 10)
     self._layout['status'] = {
         'pos': (30, 18),
         'font': fonts.Small,
         'max': 18
     }
     return self._layout
Exemplo n.º 9
0
 def layout(self):
     fonts.setup(10, 9, 10, 35)
     self._layout['width'] = 250
     self._layout['height'] = 122
     self._layout['face'] = (0, 40)
     self._layout['name'] = (5, 20)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (28, 0)
     self._layout['uptime'] = (185, 0)
     self._layout['line1'] = [0, 14, 250, 14]
     self._layout['line2'] = [0, 108, 250, 108]
     self._layout['friend_face'] = (0, 92)
     self._layout['friend_name'] = (40, 94)
     self._layout['shakes'] = (0, 109)
     self._layout['mode'] = (225, 109)
     self._layout['status'] = {
         'pos': (125, 20),
         'font': fonts.Medium,
         'max': 20
     }
     return self._layout
Exemplo n.º 10
0
 def layout(self):
     fonts.setup(10, 8, 10, 25, 25, 9)
     self._layout['width'] = 212
     self._layout['height'] = 104
     self._layout['face'] = (0, 26)
     self._layout['name'] = (5, 15)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (28, 0)
     self._layout['uptime'] = (147, 0)
     self._layout['line1'] = [0, 12, 212, 12]
     self._layout['line2'] = [0, 92, 212, 92]
     self._layout['friend_face'] = (0, 76)
     self._layout['friend_name'] = (40, 78)
     self._layout['shakes'] = (0, 93)
     self._layout['mode'] = (187, 93)
     self._layout['status'] = {
         'pos': (91, 15),
         'font': fonts.status_font(fonts.Medium),
         'max': 20
     }
     return self._layout
Exemplo n.º 11
0
 def layout(self):
     fonts.setup(10, 9, 10, 35)
     self._layout['width'] = 296
     self._layout['height'] = 128
     self._layout['face'] = (0, 40)
     self._layout['name'] = (5, 25)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (28, 0)
     self._layout['uptime'] = (230, 0)
     self._layout['line1'] = [0, 14, 296, 14]
     self._layout['line2'] = [0, 112, 296, 112]
     self._layout['friend_face'] = (0, 96)
     self._layout['friend_name'] = (40, 96)
     self._layout['shakes'] = (0, 114)
     self._layout['mode'] = (268, 114)
     self._layout['status'] = {
         'pos': (130, 25),
         'font': fonts.Medium,
         'max': 28
     }
     return self._layout
Exemplo n.º 12
0
 def layout(self):
     fonts.setup(8, 8, 8, 12)
     self._layout['width'] = 84
     self._layout['height'] = 48
     self._layout['face'] = (0, 10)
     self._layout['name'] = (0, 30)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (17, 0)
     self._layout['uptime'] = (34, 0)
     self._layout['line1'] = [0, 8, 84, 8]
     self._layout['line2'] = [0, 40, 84, 40]
     self._layout['friend_face'] = (45, 10)
     self._layout['friend_name'] = (45, 30)
     self._layout['shakes'] = (0, 40)
     self._layout['mode'] = (62, 40)
     self._layout['status'] = {
         'pos': (42, 8),
         'font': fonts.Small,
         'max': 10
     }
     return self._layout
Exemplo n.º 13
0
 def layout(self):
     fonts.setup(10, 8, 10, 23)
     self._layout['width'] = 200
     self._layout['height'] = 96
     self._layout['face'] = (0, 24)
     self._layout['name'] = (5, 14)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (25, 0)
     self._layout['uptime'] = (135, 0)
     self._layout['line1'] = [0, 11, 200, 11]
     self._layout['line2'] = [0, 85, 200, 85]
     self._layout['friend_face'] = (0, 69)
     self._layout['friend_name'] = (40, 71)
     self._layout['shakes'] = (0, 86)
     self._layout['mode'] = (175, 86)
     self._layout['status'] = {
         'pos': (85, 14),
         'font': fonts.Medium,
         'max': 16
     }
     return self._layout
Exemplo n.º 14
0
 def layout(self):
     fonts.setup(10, 9, 10, 35, 25, 9)
     self._layout['width'] = 200
     self._layout['height'] = 200
     self._layout['face'] = (0, 40)
     self._layout['name'] = (5, 20)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (28, 0)
     self._layout['uptime'] = (135, 0)
     self._layout['line1'] = [0, 14, 200, 14]
     self._layout['line2'] = [0, 186, 200, 186]
     self._layout['friend_face'] = (0, 92)
     self._layout['friend_name'] = (40, 94)
     self._layout['shakes'] = (0, 187)
     self._layout['mode'] = (170, 187)
     self._layout['status'] = {
         'pos': (5, 90),
         'font': fonts.status_font(fonts.Medium),
         'max': 20
     }
     return self._layout
Exemplo n.º 15
0
 def layout(self):
     fonts.setup(10, 9, 10, 35)
     self._layout['width'] = 264
     self._layout['height'] = 176
     self._layout['face'] = (66, 27)
     self._layout['name'] = (5, 73)
     self._layout['channel'] = (0, 0)
     self._layout['aps'] = (28, 0)
     self._layout['uptime'] = (199, 0)
     self._layout['line1'] = [0, 14, 264, 14]
     self._layout['line2'] = [0, 162, 264, 162]
     self._layout['friend_face'] = (0, 146)
     self._layout['friend_name'] = (40, 146)
     self._layout['shakes'] = (0, 163)
     self._layout['mode'] = (239, 163)
     self._layout['status'] = {
         'pos': (38, 93),
         'font': fonts.Medium,
         'max': 40
     }
     return self._layout
Exemplo n.º 16
0
    def layout(self):
        fonts.setup(12, 10, 12, 70, 25, 9)
        self._layout['width'] = 320
        self._layout['height'] = 240
        self._layout['face'] = (35, 50)
        self._layout['name'] = (5, 20)
        self._layout['channel'] = (0, 0)
        self._layout['aps'] = (40, 0)
        self._layout['uptime'] = (240, 0)
        self._layout['line1'] = [0, 14, 320, 14]
        self._layout['line2'] = [0, 220, 320, 220]
        self._layout['friend_face'] = (0, 130)
        self._layout['friend_name'] = (40, 135)
        self._layout['shakes'] = (0, 220)
        self._layout['mode'] = (280, 220)
        self._layout['status'] = {
            'pos': (80, 160),
            'font': fonts.status_font(fonts.Medium),
            'max': 20
        }

        return self._layout
Exemplo n.º 17
0
def oledhat(config, layout):
    fonts.setup(8, 8, 8, 8)

    layout['width'] = 128
    layout['height'] = 64
    layout['face'] = (0, 32)
    layout['name'] = (0, 10)
    layout['channel'] = (0, 0)
    layout['aps'] = (25, 0)
    layout['uptime'] = (65, 0)
    layout['line1'] = [0, 9, 128, 9]
    layout['line2'] = [0, 53, 128, 53]
    layout['friend_face'] = (0, (layout['height'] * 0.88) - 15)
    layout['friend_name'] = (40, (layout['height'] * 0.88) - 13)
    layout['shakes'] = (0, 53)
    layout['mode'] = (103, 10)
    layout['status'] = {
        'pos': (30, 18),
        'font': fonts.Small,
        'max': (110) // 6
    }
    return layout
Exemplo n.º 18
0
def waveshare(config, layout):
    if config['ui']['display']['color'] == 'black':
        fonts.setup(10, 9, 10, 35)

        layout['width'] = 250
        layout['height'] = 122
        layout['face'] = (0, 40)
        layout['name'] = (5, 20)
        layout['channel'] = (0, 0)
        layout['aps'] = (28, 0)
        layout['uptime'] = (layout['width'] - 65, 0)
        layout['line1'] = [
            0,
            int(layout['height'] * .12), layout['width'],
            int(layout['height'] * .12)
        ]
        layout['line2'] = [
            0, layout['height'] - int(layout['height'] * .12), layout['width'],
            layout['height'] - int(layout['height'] * .12)
        ]
        layout['friend_face'] = (0, (layout['height'] * 0.88) - 15)
        layout['friend_name'] = (40, (layout['height'] * 0.88) - 13)
        layout['shakes'] = (0,
                            layout['height'] - int(layout['height'] * .12) + 1)
        layout['mode'] = (layout['width'] - 25,
                          layout['height'] - int(layout['height'] * .12) + 1)

    else:
        fonts.setup(10, 8, 10, 25)

        layout['width'] = 212
        layout['height'] = 104
        layout['face'] = (0, int(layout['height'] / 4))
        layout['name'] = (5, int(layout['height'] * .15))
        layout['channel'] = (0, 0)
        layout['aps'] = (28, 0)
        layout['status'] = (int(layout['width'] / 2) - 15,
                            int(layout['height'] * .15))
        layout['uptime'] = (layout['width'] - 65, 0)
        layout['line1'] = [
            0,
            int(layout['height'] * .12), layout['width'],
            int(layout['height'] * .12)
        ]
        layout['line2'] = [
            0, layout['height'] - int(layout['height'] * .12), layout['width'],
            layout['height'] - int(layout['height'] * .12)
        ]
        layout['friend_face'] = (0, (layout['height'] * 0.88) - 15)
        layout['friend_name'] = (40, (layout['height'] * 0.88) - 13)
        layout['shakes'] = (0,
                            layout['height'] - int(layout['height'] * .12) + 1)
        layout['mode'] = (layout['width'] - 25,
                          layout['height'] - int(layout['height'] * .12) + 1)

    layout['status'] = {
        'pos': (125, 20),
        'font': fonts.Medium,
        'max': (layout['width'] - 125) // 6
    }
    return layout