@@ -167,7 +167,7 @@ def set_velocity(self, v):
167
167
Parameters
168
168
----------
169
169
v: int
170
- The force setting value to send to the device
170
+ velocity in inkcut units/s
171
171
172
172
"""
173
173
@@ -280,12 +280,12 @@ class DeviceConfig(Model):
280
280
#: Time between each path command
281
281
#: Time to wait between each step so we don't get
282
282
#: way ahead of the cutter and fill up it's buffer
283
- step_time = Float (strict = False ).tag (config = True )
283
+ step_time = Float (strict = False ).tag (config = True ) # ms
284
284
custom_rate = Float (- 1 , strict = False ).tag (config = True )
285
285
286
286
#: Distance between each command in user units
287
287
#: this is effectively the resolution the software supplies
288
- step_size = Float (parse_unit ( '1mm ' ), strict = False ).tag (config = True )
288
+ step_size = Float (from_unit ( 1 , 'mm ' ), strict = False ).tag (config = True )
289
289
290
290
#: Interpolate paths breaking them into small sections that
291
291
#: can be sent. This allows pausing mid plot as many devices do not have
@@ -347,9 +347,8 @@ class DeviceConfig(Model):
347
347
#: Defines prescaling before conversion to a polygon
348
348
quality_factor = Float (1 , strict = False ).tag (config = True )
349
349
350
- #: In cm/s
351
- speed = Float (4 , strict = False ).tag (config = True )
352
- speed_units = Enum ('in/s' , 'cm/s' ).tag (config = True )
350
+ speed = Float (4 , strict = False ).tag (config = True ) # in inkcut units/s
351
+ speed_display_units = Enum ('in/s' , 'cm/s' , 'mm/s' , 'mm/min' ).tag (config = True )
353
352
speed_enabled = Bool ().tag (config = True )
354
353
355
354
#: Force in g
@@ -381,10 +380,7 @@ def _default_step_time(self):
381
380
382
381
383
382
"""
384
- #: Convert speed to px/s then to mm/s
385
- units = self .speed_units .split ("/" )[0 ]
386
- speed = parse_unit ('%s%s' % (self .speed , units ))
387
- speed = to_unit (speed , 'mm' )
383
+ speed = self .speed
388
384
if speed == 0 :
389
385
return 0
390
386
@@ -394,7 +390,7 @@ def _default_step_time(self):
394
390
def _default_area (self ):
395
391
return AreaBase ()
396
392
397
- @observe ('speed' , 'speed_units' , ' step_size' )
393
+ @observe ('speed' , 'step_size' )
398
394
def _update_step_time (self , change ):
399
395
if change ['type' ] == 'update' :
400
396
self .step_time = self ._default_step_time ()
@@ -703,9 +699,7 @@ def init(self, job):
703
699
log .debug ("device | init {}" .format (job ))
704
700
config = self .config
705
701
706
- # Set the speed of this device for tracking purposes
707
- units = config .speed_units .split ("/" )[0 ]
708
- job .info .speed = from_unit (config .speed , units )
702
+ job .info .speed = config .speed
709
703
710
704
direction = self .config .expansion_direction
711
705
@@ -865,9 +859,7 @@ def submit(self, job, test=False):
865
859
else :
866
860
rate = 0 # Undefined
867
861
else :
868
- rate = from_unit (
869
- config .speed , # in/s or cm/s
870
- config .speed_units .split ("/" )[0 ])/ 1000.0
862
+ rate = config .speed / 1000.0
871
863
872
864
# Device model is updated in real time
873
865
model = yield defer .maybeDeferred (self .init , job )
0 commit comments