From 3b59383bc5106ab0c6ffc42aca10346073392793 Mon Sep 17 00:00:00 2001 From: godax84 Date: Fri, 6 Dec 2024 09:37:17 -0800 Subject: [PATCH] Carregar ficheiros para "/" --- readout.txt | 66 ++++++++++++++++++++++++++++++++++ requirements.txt | 8 +++++ view_parameters.py | 88 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 readout.txt create mode 100644 requirements.txt create mode 100644 view_parameters.py diff --git a/readout.txt b/readout.txt new file mode 100644 index 0000000..644ca2e --- /dev/null +++ b/readout.txt @@ -0,0 +1,66 @@ +Alientech K-TAG Bench +Alientech K-TAG Bootmode +Alientech KESS3 Bench +Alientech KESS3 Bootmode +Alientech KESS3 OBD +Alientech KESSv2 OBD +AMT Cartech Limited MPPS Bench +AMT Cartech Limited MPPS Bootmode +AMT Cartech Limited MPPS OBD +Autotuner Bench +Autotuner Bootmode +Autotuner OBD +bFlash Bench +bFlash Bootmode +bFlash OBD +Bitbox Bench +Bitbox Bootmode +Bitbox OBD +ByteShooter Toolbox Bench +ByteShooter Toolbox Bootmode +ByteShooter Toolbox OBD +CMDFlash Bench +CMDFlash Bootmode +CMDFlash OBD +DFB Technology DFOX Bench +DFB Technology DFOX Bootmode +DFB Technology DFOX OBD +Dimtronic Diamond Bench +Dimtronic Diamond Bootmode +Dimtronic Diamond OBD +EVC Electronic BDM100 Bootmode +EVC Electronic BSL100 Bootmode +Femto OBD Flasher OBD +FG Technology EOBD2 Bench +FG Technology EOBD2 Bootmode +FG Technology EOBD2 OBD +Frieling Racing IBOOT Bootmode +Frieling Racing IFLASH OBD +Frieling Racing SPI Wizard Bench +Frieling Racing SPI Wizard Bootmode +Frieling Racing SPI Wizard OBD +Green Technology Devices VF2 Flasher Bench +Green Technology Devices VF2 Flasher Bootmode +Green Technology Devices VF2 Flasher OBD +HP Tuners MPVI2 Bench +HP Tuners MPVI2 OBD +I/O Terminal Bench +I/O Terminal Bootmode +I/O Terminal OBD +MagicMotorsport Flex Bench +MagicMotorsport Flex Bootmode +MagicMotorsport Flex OBD +MagicMotorsport MAGPro2 Bootmode +MagicMotorsport MAGPro2 OBD +New Genius OBD +New Trasdata Bench +New Trasdata Bootmode +PCM-Flash Bench +PCM-Flash Bootmode +PCM-Flash OBD +Piasini Engineering Serial Suite Bench +Piasini Engineering Serial Suite Bootmode +Piasini Engineering Serial Suite OBD +TGFlash Bench +TGFlash Bootmode +TGFlash OBD \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ac5467b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +numpy>=1.24.0 +struct +plotly +tkinterweb +logging +PyQt6>=6.5.0 +PyQt6-Charts>=6.5.0 +psycopg2-binary>=2.9.9 diff --git a/view_parameters.py b/view_parameters.py new file mode 100644 index 0000000..3a1f57c --- /dev/null +++ b/view_parameters.py @@ -0,0 +1,88 @@ +import tkinter as tk +from tkinter import ttk + +class ViewParametersDialog: + def __init__(self, parent, current_params=None): + self.dialog = tk.Toplevel(parent) + self.dialog.title("Parâmetros de visualização") + self.dialog.geometry("300x400") + self.dialog.resizable(False, False) + + # Make it modal + self.dialog.transient(parent) + self.dialog.grab_set() + + # Use current parameters if provided, otherwise use defaults + if current_params is None: + current_params = { + 'first_cell': '0000F0', + 'offset': 0, + 'columns': 16, + 'hex_view': False, + 'show_diff': True, + 'value_type': '8bit' + } + + # Parameters + self.first_cell = tk.StringVar(value=current_params['first_cell']) + self.offset = tk.StringVar(value=str(current_params['offset'])) + self.columns = tk.StringVar(value=str(current_params['columns'])) + self.hex_view = tk.BooleanVar(value=current_params['hex_view']) + self.show_diff = tk.BooleanVar(value=current_params['show_diff']) + self.value_type = tk.StringVar(value=current_params['value_type']) + + self.create_widgets() + + def create_widgets(self): + # Primeira Célula + ttk.Label(self.dialog, text="Primeira Célula").grid(row=0, column=0, sticky='w', padx=5, pady=2) + ttk.Entry(self.dialog, textvariable=self.first_cell, width=20).grid(row=1, column=0, sticky='w', padx=5) + + # Offset byte num + ttk.Label(self.dialog, text="Offset byte num").grid(row=2, column=0, sticky='w', padx=5, pady=2) + ttk.Spinbox(self.dialog, from_=0, to=1000, textvariable=self.offset, width=5).grid(row=3, column=0, sticky='w', padx=5) + + # Número de colunas + ttk.Label(self.dialog, text="Número de colunas").grid(row=4, column=0, sticky='w', padx=5, pady=2) + column_spin = ttk.Spinbox(self.dialog, from_=1, to=32, textvariable=self.columns, width=5) + column_spin.grid(row=5, column=0, sticky='w', padx=5) + + # Checkboxes + ttk.Checkbutton(self.dialog, text="Mostrar em hexadecimal", variable=self.hex_view).grid(row=6, column=0, sticky='w', padx=5, pady=5) + ttk.Checkbutton(self.dialog, text="Mostrar diferenças", variable=self.show_diff).grid(row=7, column=0, sticky='w', padx=5) + + # Valor Frame + value_frame = ttk.LabelFrame(self.dialog, text="Valor") + value_frame.grid(row=8, column=0, sticky='nsew', padx=5, pady=5) + + # Valor options + ttk.Label(value_frame, text="Valor:").grid(row=0, column=0, sticky='w', padx=5, pady=2) + ttk.Radiobutton(value_frame, text="Valor de 8 bit", variable=self.value_type, value="8bit").grid(row=1, column=0, sticky='w', padx=20) + ttk.Radiobutton(value_frame, text="Valor de 16 bit", variable=self.value_type, value="16bit").grid(row=2, column=0, sticky='w', padx=20) + ttk.Radiobutton(value_frame, text="Valor de 32 bit", variable=self.value_type, value="32bit").grid(row=3, column=0, sticky='w', padx=20) + ttk.Radiobutton(value_frame, text="Valor floating point", variable=self.value_type, value="float").grid(row=4, column=0, sticky='w', padx=20) + + # Buttons + button_frame = ttk.Frame(self.dialog) + button_frame.grid(row=10, column=0, pady=10) + + ttk.Button(button_frame, text="OK", command=self.ok_clicked).pack(side=tk.LEFT, padx=5) + ttk.Button(button_frame, text="Cancelar", command=self.dialog.destroy).pack(side=tk.LEFT, padx=5) + + def ok_clicked(self): + # Return the parameters + self.result = { + 'first_cell': self.first_cell.get(), + 'offset': int(self.offset.get()), + 'columns': int(self.columns.get()), + 'hex_view': self.hex_view.get(), + 'show_diff': self.show_diff.get(), + 'value_type': self.value_type.get() + } + self.dialog.destroy() + + def show(self): + # Center the dialog on parent + self.dialog.focus_set() + self.dialog.wait_window() + return getattr(self, 'result', None)