66from PyQt6 import QtCore , QtGui , QtWidgets
77from helper_methods import normalize
88
9-
109class TuneWidget (QtWidgets .QWidget ):
1110 request_back : typing .ClassVar [QtCore .pyqtSignal ] = QtCore .pyqtSignal (
1211 name = "request_back_page"
@@ -110,17 +109,26 @@ def on_fan_object_update(
110109 field (str): field name
111110 new_value (int | float): New value for field name
112111 """
112+
113+ fields = name .split ()
114+ first_field = fields [0 ]
115+ second_field = fields [1 ] if len (fields ) > 1 else None
116+
113117 if "speed" in field :
114- if not self .tune_display_buttons .get (name , None ):
118+ if not self .tune_display_buttons .get (name , None ) and first_field in ( "fan" , "fan_generic" , "blower" ) :
115119 _new_display_button = self .create_display_button (name )
116120 _new_display_button .setParent (self )
117- if "blower" in name :
121+ if "blower" == first_field or second_field == "Auxiliary_Cooling_Fans" :
122+ _new_display_button .icon_pixmap = QtGui .QPixmap (
123+ ":/fan_related/media/btn_icons/blower.svg"
124+ )
125+ elif "CHAMBER_EXHAUST" == second_field :
118126 _new_display_button .icon_pixmap = QtGui .QPixmap (
119- ":/temperature_related /media/btn_icons/blower .svg"
127+ ":/fan_related /media/btn_icons/fan_cage .svg"
120128 )
121129 else :
122130 _new_display_button .icon_pixmap = QtGui .QPixmap (
123- ":/temperature_related /media/btn_icons/fan.svg"
131+ ":/fan_related /media/btn_icons/fan.svg"
124132 )
125133 self .tune_display_buttons .update (
126134 {
@@ -130,26 +138,21 @@ def on_fan_object_update(
130138 }
131139 }
132140 )
133- if name in ("fan" , "fan_generic" ):
134- _new_display_button .clicked .connect (
135- lambda : self .request_sliderPage [
136- str , int , "PyQt_PyObject" , int , int
137- ].emit (
138- str (name ),
139- int (
140- round (
141- self .tune_display_buttons .get (name ).get ( # type:ignore
142- "speed" , 0
143- )
144- )
145- ),
146- self .on_slider_change ,
147- 0 ,
148- 100 ,
149- )
150- )
151- else :
152- _new_display_button .setDisabled (True )
141+ _new_display_button .clicked .connect (
142+ lambda : self .request_sliderPage [
143+ str , int , "PyQt_PyObject" , int , int
144+ ].emit (
145+ str (name ),
146+ int (
147+ round (
148+ self .tune_display_buttons .get (name ).get ("speed" , 0 )
149+ )
150+ ),
151+ self .on_slider_change ,
152+ 0 ,
153+ 100 ,
154+ )
155+ )
153156 self .tune_display_vertical_child_layout_2 .addWidget (_new_display_button )
154157 _display_button = self .tune_display_buttons .get (name )
155158 if not _display_button :
0 commit comments