Ejemplo n.º 1
0
 def on_line_added(self, wizard, data=None):
     if wizard == Wizard.ADD_LINE:
         print("Line is added.")
     elif wizard == Wizard.SET_REF_LENGTH:
         axis = self.vp_eng.get_key_from_id()
         text, ok = show_input_dialog(
             self.widget_context, "Reference Length Input",
             "Detected {}-axis: Please input length reference.".format(
                 axis))
         if ok:
             self.vp_eng.set_length(float(text), wizard,
                                    self.handle_on_length_set)
     elif wizard == Wizard.MEASURE_ON_PLANE:
         show_dialog("Length calculated",
                     "The length is approximately {}".format(data))
     elif wizard == Wizard.MEASURE_HEIGHT:
         show_dialog("Length calculated",
                     "The length is approximately {:.1f}".format(data))
Ejemplo n.º 2
0
 def handle_on_length_set(self, wizard):
     if wizard == Wizard.SET_REF_LENGTH:
         axis = self.vp_eng.get_key_from_id()
         show_dialog("Callback",
                     "Reference length in the {}-axis is set.".format(axis))
         print(self.vp_eng.calibration["x"])
Ejemplo n.º 3
0
 def measure_height(self):
     show_dialog(
         "Measure height",
         "Draw a line to measure height with respect to the defined plane.",
         on_button_clicked=self.handle_measure_height)
Ejemplo n.º 4
0
 def wrap_plane(self):
     self.vp_eng.wrap_perspective()
     show_dialog("Callback", "Wrapping done!")
Ejemplo n.º 5
0
 def measure_plane(self):
     show_dialog("Measure length on plane",
                 "Draw a line to measure length on the define plane.",
                 on_button_clicked=self.handle_measure_plane)
Ejemplo n.º 6
0
 def define_height(self):
     show_dialog("Set height reference",
                 "Draw a line and specify height reference.",
                 on_button_clicked=self.handle_define_height)