@@ -100,8 +100,8 @@ class SpeedControl(Gtk.Box, _HalSpeedControlBase):
100100 "%.1f" , GObject .ParamFlags .READWRITE | GObject .ParamFlags .CONSTRUCT ),
101101 'do_hide_button' : ( GObject .TYPE_BOOLEAN , 'Hide the button' , 'Display the button + and - to alter the values' ,
102102 False , GObject .ParamFlags .READWRITE | GObject .ParamFlags .CONSTRUCT ),
103- 'type' : ( GObject .TYPE_INT , 'Type of adjustment' , 'Set to -1 for general, 0 for jograte' ,
104- - 1 , 0 , - 1 , GObject .ParamFlags .READWRITE | GObject .ParamFlags .CONSTRUCT ),
103+ 'type' : ( GObject .TYPE_INT , 'Type of adjustment' , 'Set to -1 for general, 0 for jograte, 1 for angular jograte ' ,
104+ - 1 , 1 , - 1 , GObject .ParamFlags .READWRITE | GObject .ParamFlags .CONSTRUCT ),
105105 }
106106 __gproperties = __gproperties__
107107
@@ -131,6 +131,7 @@ def __init__(self, size = 36, value = 0, min = 0, max = 100, inc_speed = 100, un
131131 self ._template = template
132132 self ._speed = inc_speed
133133 self .type_linear_jog = False
134+ self .type_angular_jog = False
134135
135136 self .adjustment = Gtk .Adjustment (value = self ._value , lower = self ._min , upper = self ._max , step_increment = self ._increment , page_increment = 0 )
136137 self .adjustment .connect ("value_changed" , self ._on_value_changed )
@@ -184,8 +185,11 @@ def _hal_init(self):
184185 self .hal_pin_decrease .connect ("value-changed" , self ._on_minus_changed )
185186
186187 if self .type_linear_jog :
187- print ('->>' ,self .type_linear_jog )
188+ print ('linear jograte ->>' ,self .type_linear_jog )
188189 self ._status .connect ('jograte-changed' , lambda w , data : self .set_value (data ))
190+ elif self .type_angular_jog :
191+ print ('Angular jograte ->>' ,self .type_angular_jog )
192+ self ._status .connect ('jograte-angular-changed' , lambda w , data : self .set_value (data ))
189193
190194 # this draws our widget on the screen
191195 def expose (self , widget , event ):
@@ -472,6 +476,10 @@ def do_set_property(self, property, value):
472476 print (name ,value )
473477 if value == 0 :
474478 self .type_linear_jog = True
479+ self .type_angular_jog = False
480+ elif value == 1 :
481+ self .type_linear_jog = False
482+ self .type_angular_jog = True
475483 self ._draw_widget ()
476484 else :
477485 raise AttributeError ('unknown property %s' % property .name )
0 commit comments