(self, value)
| 356 | self.value = self.min_value |
| 357 | |
| 358 | def set_value(self, value): |
| 359 | if not self.get_app_instance(): |
| 360 | return |
| 361 | with self.get_app_instance().update_lock: |
| 362 | value = float(value) |
| 363 | #min value at left |
| 364 | #max value at right |
| 365 | |
| 366 | #value to radians |
| 367 | scale = self.max_value-self.min_value |
| 368 | if scale==0.0: |
| 369 | return |
| 370 | relative_value = value - self.min_value |
| 371 | angle = relative_value*math.pi/scale |
| 372 | #inversion min at left |
| 373 | angle = math.pi - angle |
| 374 | |
| 375 | radius = 0.5 |
| 376 | self.indicator.add_coord(math.cos(angle)*radius, radius-math.sin(angle)*radius) |
| 377 | self.indicator.add_coord(math.cos(angle+0.5)*0.04, radius-math.sin(angle+0.5)*0.04) #self.indicator.add_coord(0.02,0.4) |
| 378 | self.indicator.add_coord(0,radius) |
| 379 | self.indicator.add_coord(math.cos(angle-0.5)*0.04, radius-math.sin(angle-0.5)*0.04) |
| 380 | |
| 381 | if hasattr(self, "actual_value"): |
| 382 | self.text_actual_value.set_text(str(value)) |
nothing calls this directly
no test coverage detected