Пример #1
0
    def __init__(self, parent, options):
        wx.Dialog.__init__(self, None)
        self.parent = parent
        set_icon(self)

        self.text_ctrl = {
            "scan": wx.TextCtrl(self, wx.ID_ANY, ""),
            "output": wx.TextCtrl(self, wx.ID_ANY, ""),
        }

        self.button = {
            "scan": wx.Button(self, wx.ID_ANY, "Browse"),
            "output": wx.Button(self, wx.ID_ANY, "Browse"),
            "exec": wx.Button(self, wx.ID_ANY, "Start"),
        }
        self.button["exec"].Disable()

        self.iqdm_pdf_kwargs = {
            "ignore_extension": options.PDF_IGNORE_EXT,
            "processes": options.PDF_N_JOBS,
        }

        self.gauge = wx.Gauge(self, wx.ID_ANY, 100)
        # self.gauge.Hide()
        self.label_progress = wx.StaticText(self, wx.ID_ANY, "")
        self.label_elapsed = wx.StaticText(self, wx.ID_ANY, "")
        self.label_remaining = wx.StaticText(self, wx.ID_ANY, "")

        self.__set_properties()
        self.__do_bind()
        self.__do_layout()
        self.__do_subscribe()

        self.Show()
Пример #2
0
    def __init__(self, *evt):
        wx.Dialog.__init__(self, None, title="About IQDM Analytics")
        set_icon(self)

        scrolled_window = wx.ScrolledWindow(self, wx.ID_ANY)

        with open(LICENSE_PATH, "r", encoding="utf8") as license_file:
            license_text = "".join([line for line in license_file])

        license_text = (
            "IQDM Analytics v%s\nhttps://github.com/IQDM/IQDM-Analytics\n\n%s"
            % (
                DefaultOptions().VERSION,
                license_text,
            )
        )

        sizer_wrapper = wx.BoxSizer(wx.VERTICAL)
        sizer_text = wx.BoxSizer(wx.VERTICAL)

        scrolled_window.SetScrollRate(20, 20)

        license_text = wx.StaticText(scrolled_window, wx.ID_ANY, license_text)
        sizer_text.Add(license_text, 0, wx.EXPAND | wx.ALL, 5)
        scrolled_window.SetSizer(sizer_text)
        sizer_wrapper.Add(scrolled_window, 1, wx.EXPAND, 0)

        self.SetBackgroundColour(wx.WHITE)

        self.SetSizer(sizer_wrapper)
        self.SetSize((750, 900))
        self.Center()

        self.ShowModal()
        self.Destroy()
Пример #3
0
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          style=wx.SYSTEM_MENU | wx.CLOSE_BOX | wx.CAPTION)

        self.parent = parent
        self.options = parent.options
        self.plots = {
            "Control Chart": parent.plot,
        }

        button_keys = {"Export": wx.ID_ANY, "Dismiss": wx.ID_CANCEL}
        self.button = {
            key: wx.Button(self, button_id, key)
            for key, button_id in button_keys.items()
        }

        self.__set_input_widgets()
        self.__set_properties()
        self.__do_bind()
        self.__do_layout()

        self.getter = {
            int: self.get_text_ctrl_int,
            float: self.get_text_ctrl_float,
            str: self.get_combo_box,
        }

        set_msw_background_color(self)
        set_icon(self)
Пример #4
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent, title="Import CSV Data")
        set_icon(self)
        self.parent = parent
        self.place_holder = "--- Select One ---"

        create_default_parsers()
        self.parsers = import_csv_templates()

        self.__add_layout_object()
        self.__do_bind()
        self.__do_layout()
        self.__set_properties()
Пример #5
0
    def OnInit(self):
        if is_windows():
            from iqdma.windows_reg_edit import (
                set_ie_emulation_level,
                set_ie_lockdown_level,
            )

            set_ie_emulation_level()
            set_ie_lockdown_level()
        initialize_directories()
        create_default_parsers()
        self.SetAppName("IQDM Analytics")
        self.frame = MainFrame(None, wx.ID_ANY, "")
        set_icon(self.frame, icon=WIN_APP_ICON)
        self.SetTopWindow(self.frame)
        self.frame.Show()
        return True
Пример #6
0
    def __init__(self, parent):
        """
        :param parent: main application frame
        """
        wx.Frame.__init__(self, None, title="User Settings")

        self.is_edge_backend_available = None
        self.reimport_required = False
        try:
            self.is_edge_backend_available = (
                webview.WebView.IsBackendAvailable(webview.WebViewBackendEdge)
            )
        except Exception:
            self.is_edge_backend_available = False

        self.parent = parent
        self.options = parent.options
        self.options.edit_detected = False

        color_variables = self.get_option_choices("COLOR")
        size_variables = self.get_option_choices("SIZE")
        width_variables = self.get_option_choices("LINE_WIDTH")
        line_dash_variables = self.get_option_choices("LINE_DASH")
        alpha_variables = self.get_option_choices("ALPHA")

        line_style_options = [
            "solid",
            "dashed",
            "dotted",
            "dotdash",
            "dashdot",
        ]

        # self.SetSize((500, 580))
        self.combo_box_colors_category = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=color_variables,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.combo_box_colors_selection = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=MATPLOTLIB_COLORS,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.combo_box_sizes_category = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=size_variables,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.spin_ctrl_sizes_input = wx.SpinCtrl(
            self, wx.ID_ANY, "0", min=0, max=20, style=wx.SP_ARROW_KEYS
        )
        self.combo_box_line_widths_category = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=width_variables,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.spin_ctrl_line_widths_input = wx.SpinCtrl(
            self, wx.ID_ANY, "0", min=0, max=10, style=wx.SP_ARROW_KEYS
        )
        self.combo_box_line_styles_category = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=line_dash_variables,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.combo_box_line_styles_selection = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=line_style_options,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.combo_box_alpha_category = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=alpha_variables,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.spin_ctrl_alpha_input = wx.SpinCtrlDouble(
            self,
            wx.ID_ANY,
            "0",
            min=0,
            max=1.0,
            style=wx.SP_ARROW_KEYS,
            inc=0.1,
        )
        self.spin_ctrl_cc_std_dev = wx.SpinCtrlDouble(
            self,
            wx.ID_ANY,
            "0",
            min=0.1,
            max=10.0,
            style=wx.SP_ARROW_KEYS,
            inc=0.1,
        )

        self.spin_ctrl_n_jobs = wx.SpinCtrl(
            self, wx.ID_ANY, "1", min=1, max=16, style=wx.SP_ARROW_KEYS
        )
        self.combo_box_pdf_ext = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=["Yes", "No"],
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.combo_box_duplicates = wx.ComboBox(
            self,
            wx.ID_ANY,
            choices=DefaultOptions().DUPLICATE_VALUE_OPTIONS,
            style=wx.CB_DROPDOWN | wx.CB_READONLY,
        )
        self.checkbox_duplicates = wx.CheckBox(
            self, wx.ID_ANY, "Enable Duplicate Detection"
        )

        if is_windows():
            self.checkbox_edge_backend = wx.CheckBox(
                self, wx.ID_ANY, "Enable Edge WebView Backend"
            )
            if not self.is_edge_backend_available:
                self.checkbox_edge_backend.Disable()

        self.button_restore_defaults = wx.Button(
            self, wx.ID_ANY, "Restore Defaults"
        )
        self.button_ok = wx.Button(self, wx.ID_OK, "OK")
        self.button_cancel = wx.Button(self, wx.ID_CANCEL, "Cancel")
        self.button_apply = wx.Button(self, wx.ID_ANY, "Apply")

        self.__set_properties()
        self.__do_layout()
        self.__do_bind()

        self.refresh_options()

        self.is_edited = False

        set_msw_background_color(self)
        set_icon(self)