def load_ui_wokspace(self, embed, root, wh, ww):
        self.show_malar_angles_ui = tk.BooleanVar(
            value=cf.get("show_malar_angles", True))
        malar_angles_checkbox = tk.Checkbutton(
            embed,
            text=ms["show_malar_angles"],
            variable=self.show_malar_angles_ui,
            command=self.toggle_visible_angles)

        self.show_interocular_angles_ui = tk.BooleanVar(
            value=cf.get("show_interocular_angles", True))
        interocular_angles_checkbox = tk.Checkbutton(
            embed,
            text=ms["show_interocular_angles"],
            variable=self.show_interocular_angles_ui,
            command=self.toggle_visible_angles)

        self.show_chin_angles_ui = tk.BooleanVar(
            value=cf.get("show_chin_angles", True))
        chin_angles_checkbox = tk.Checkbutton(
            embed,
            text=ms["show_chin_angles"],
            variable=self.show_chin_angles_ui,
            command=self.toggle_visible_angles)
        deleteBtn = tk.Button(embed,
                              text=ms["delete_last"],
                              command=self.delete_mark,
                              width=15)
        propsBtn = tk.Button(embed,
                             text=ms["show_props"],
                             command=self.show_proportions,
                             width=15)
        clearBtn = tk.Button(embed,
                             text=ms["delete_all"],
                             command=self.delete_all,
                             width=15)
        screen = tk.Canvas(root, width=ww, height=wh)
        screen.grid(row=0, column=1, sticky=tk.W + tk.N)
        malar_angles_checkbox.grid(sticky=tk.W, padx=6)
        interocular_angles_checkbox.grid(sticky=tk.W, padx=6)
        chin_angles_checkbox.grid(sticky=tk.W, padx=6)
        propsBtn.grid(sticky=tk.W, padx=6)
        deleteBtn.grid(sticky=tk.W, padx=6)
        clearBtn.grid(sticky=tk.W + tk.S, pady=35, padx=6)
        screen.grid(sticky=tk.W)
        self.toggle_visible_angles()
        return screen
Beispiel #2
0
def _load_select_image():
    img = gui.fileopenbox(ms["select_image"],
                          ms["image_Selection"],
                          default=cf.get("home_file"),
                          filetypes=[[
                              "*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif",
                              "IMAGE files"
                          ]])
    return img
def export_db():
    location = gui.filesavebox(msg=ms["choose_save_location"], title=ms["save"],
                               default=cf.get("home_dir") + os.sep + 'db' + EXTENSION, filetypes=["*" + EXTENSION])
    cf.set("home_dir", os.path.abspath(os.path.dirname(location)))
    if location is not None and not location.endswith(EXTENSION):
        location += EXTENSION
    patients = JsonLoader.get_all_patients()
    excel_builder = excel.ExcelBuilder(patients, file_name=location)
    excel_builder.write_patients()
def _record_image(patient):
    img = fileopenbox(ms["select_image"],
                      ms["image_Selection"],
                      default=cf.get("home_file"),
                      filetypes=[[
                          "*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif",
                          "IMAGE files"
                      ]])
    if img is None:
        raise LeftIncompleteException
    patient.photo = img
def saveImagePathAsHome(patient):
    file = os.path.abspath(patient.photo)
    cf.set("home_file", file)
    if not cf.isIn("home_dir") or not os.path.isdir(cf.get("home_dir")):
        directory = os.path.abspath(os.path.dirname(file)) + os.sep
        cf.set("home_dir", directory)
Beispiel #6
0
def load(language=DEFAULT_LANG):
    global messages
    language = cf.get("language") if cf.isIn("language") else DEFAULT_LANG
    with open("files/lang/%s.json" % language) as f:
        messages = json.load(f)