Skip to content

Commit

Permalink
- removes HUD
Browse files Browse the repository at this point in the history
- improves on Issue #695
  • Loading branch information
MAKOMO committed Sep 24, 2021
1 parent 5ef0ec4 commit d153f25
Show file tree
Hide file tree
Showing 8 changed files with 262 additions and 636 deletions.
2 changes: 1 addition & 1 deletion src/artisanlib/acaia.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def parseWeightEvent(self,payload):
# if value is fresh and reading is stable
if value != self.weight: # and stable:
self.weight = value
_log.debug("new weight: %s", self.weight)
# _log.debug("new weight: %s", self.weight)

return self.EVENT_WEIGHT_LEN

Expand Down
6 changes: 3 additions & 3 deletions src/artisanlib/ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def update_connected(self,connected=bool):

def heartbeat(self):
if self.m_connected:
_log.debug("send heartbeat")
# _log.debug("send heartbeat")
self.sendHeartbeat(self.write)
QtCore.QTimer.singleShot(2000,self.heartbeat)

Expand Down Expand Up @@ -293,9 +293,9 @@ def deviceHasService(device, service_uuid):

@QtCore.pyqtSlot("QBluetoothDeviceInfo")
def addDevice(self, device):
_log.debug("addDevice()")
# _log.debug("addDevice()")
if self.m_device is None and device.coreConfigurations() & QtBluetooth.QBluetoothDeviceInfo.LowEnergyCoreConfiguration:
_log.debug("discovered LE Device name: %s, address: %s", device.name(), device.address().toString())
# _log.debug("discovered LE Device name: %s, address: %s", device.name(), device.address().toString())
m_device = QtBluetooth.QBluetoothDeviceInfo(device)
if self.device_names is None:
_log.debug("check device for matching services")
Expand Down
6 changes: 1 addition & 5 deletions src/artisanlib/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ class roastCompareDlg(ArtisanDialog):

__slots__ = [ 'foreground', 'background', 'maxentries', 'basecolors', 'profiles', 'label_number', 'l_align', 'legend', 'legendloc_pos', 'addButton',
'deleteButton', 'alignnames', 'alignComboBox', 'etypes', 'eventsComboBox', 'cb', 'model', 'button_7_org_state_hidden', 'button_1_org_state_hidden',
'button_2_org_state_hidden', 'button_10_org_state_hidden', 'button_18_org_state_hidden', 'pick_handler_id' ]
'button_2_org_state_hidden', 'button_10_org_state_hidden', 'pick_handler_id' ]

def __init__(self, parent = None, aw = None, foreground = None, background = None):
super().__init__(parent, aw)
Expand Down Expand Up @@ -808,7 +808,6 @@ def __init__(self, parent = None, aw = None, foreground = None, background = Non
self.button_1_org_state_hidden = self.aw.button_1.isHidden() # ON/OFF
self.button_2_org_state_hidden = self.aw.button_2.isHidden() # START/STOP
self.button_10_org_state_hidden = self.aw.button_10.isHidden() # CONTROL
self.button_18_org_state_hidden = self.aw.button_18.isHidden() # HUD

self.disableButtons()
self.aw.disableEditMenus(compare=True)
Expand Down Expand Up @@ -849,15 +848,12 @@ def enableButtons(self):
self.aw.button_2.show() # START/STOP
if not self.button_10_org_state_hidden:
self.aw.button_10.show() # CONTROL
if not self.button_18_org_state_hidden:
self.aw.button_18.show() # HUD

def disableButtons(self):
self.aw.button_7.hide() # RESET
self.aw.button_1.hide() # ON/OFF
self.aw.button_2.hide() # START/STOP
self.aw.button_10.hide() # CONTROL
self.aw.button_18.hide() # HUD

### DRAWING

Expand Down
215 changes: 67 additions & 148 deletions src/artisanlib/curves.py

Large diffs are not rendered by default.

92 changes: 92 additions & 0 deletions src/artisanlib/event_button_style.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# -*- coding: utf-8 -*-

from artisanlib.util import createGradient

artisan_event_button_style = """
QPushButton {{
min-width: {min_width};
font-size: {default_font_size};
font-weight: bold;
padding: 3px;
border-style:solid;
border-radius:4;
border-color:grey;
border-width:0;
color: white;
}}
MajorEventPushButton[Selected=false]:flat {{
color: darkgrey;
background-color: #E0E0E0;
}}
MajorEventPushButton[Selected=false]:flat:!pressed:hover {{
color: #F5F5F5;
background-color: #CDCDCD;
}}
MajorEventPushButton[Selected=false]:flat:pressed {{
color: #EEEEEE;
background-color: #9E9E9E;
}}
MajorEventPushButton[Selected=false]:!flat:pressed {{
color: #EEEEEE;
background-color:""" + createGradient('#116999') + """ ;
}}
MajorEventPushButton[Selected=false]:!pressed:hover {{
background-color:""" + createGradient('#1985ba') + """ ;
}}
MinorEventPushButton[Selected=false]:flat {{
color: #BDBDBD;
background-color: #EEEEEE;
}}
MinorEventPushButton[Selected=false]:flat:!pressed:hover {{
color: #F5F5F5;
background-color: #DDDDDD;
}}
MinorEventPushButton[Selected=false]:flat:pressed {{
color: #EEEEEE;
background-color: #BEBEBE;
}}
MinorEventPushButton[Selected=false]:!flat:pressed {{
color: #EEEEEE;
background-color:""" + createGradient('#147bb3') + """ ;
}}
MinorEventPushButton[Selected=false]:!pressed:hover {{
background-color:""" + createGradient('#43a7cf') + """ ;
}}
QPushButton[Selected=true] {{
font-size: {selected_font_size};
background-color:""" + createGradient('#d4336a') + """ ;
}}
QPushButton[Selected=true]:flat {{
color: darkgrey;
background-color: #f9e2ea;
}}
QPushButton[Selected=true]:flat:!pressed:hover {{
color: #F5F5F5;
background-color: #e687a8;
}}
QPushButton[Selected=true]:flat:pressed {{
color: #EEEEEE;
background-color: #d4336a;
}}
QPushButton[Selected=true]:!flat:pressed {{
color: white;
background-color:""" + createGradient('#A61145') + """ ;
}}
QPushButton[Selected=true]:!pressed:hover {{
color: white;
background-color:""" + createGradient('#cc0f50') + """ ;
}}
AuxEventPushButton[Selected=false]:pressed {{
background-color:""" + createGradient('#757575') + """ ;
}}
AuxEventPushButton[Selected=false]:!pressed:hover {{
background-color:""" + createGradient('#9e9e9e') + """ ;
}}
"""
Loading

0 comments on commit d153f25

Please sign in to comment.