Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pyx2cscope"
version = "0.4.2"
version = "0.4.3"
description = "python implementation of X2Cscope"
authors = [
"Yash Agarwal <[email protected]>",
"Edras Pacola",
"Yash Agarwal",
"Edras Pacola <[email protected]>",
"Christoph Baumgartner",
"Mark Wendler",
]
Expand All @@ -28,6 +28,7 @@ pyx2cscope = 'pyx2cscope.__main__:main'
python = "^3.10"
pyserial = "^3.5"
pyelftools = "^0.31"
pyyaml ="^6.0.1"
numpy = "^1.26.0"
matplotlib = "^3.7.2"
PyQt5 = "^5.15.9"
Expand Down
4 changes: 2 additions & 2 deletions pyx2cscope/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""This module contains the pyx2cscope package.

Version: 0.4.2
Version: 0.4.3
"""

import logging

__version__ = "0.4.2"
__version__ = "0.4.3"


def set_logger(
Expand Down
2 changes: 1 addition & 1 deletion pyx2cscope/examples/demo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Demo scripting for user to get started."""
from pyx2cscope.x2cscope import X2CScope

elf_file =r"C:\Users\m67250\OneDrive - Microchip Technology Inc\Desktop\Training_Domel\motorbench_demo_domel.X\dist\default\production\motorbench_demo_domel.X.production.elf"
elf_file =r"path to your elf file.elf"

x2cscope = X2CScope(port="COM39", elf_file=elf_file)

Expand Down
19 changes: 10 additions & 9 deletions pyx2cscope/gui/generic_gui/detachable_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from pyx2cscope.gui import img as img_src
from pyx2cscope.x2cscope import TriggerConfig, X2CScope

logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.ERROR)

matplotlib.use("QtAgg")

Expand Down Expand Up @@ -100,9 +100,9 @@ def initialize_variables(self):
self.plot_window_open = False
self.settings = QSettings("MyCompany", "MyApp")
self.file_path: str = self.settings.value("file_path", "", type=str)
self.initi_variables()
self.init_variables()

def initi_variables(self):
def init_variables(self):
"""Some extra variables define."""
self.selected_var_indices = [
0,
Expand Down Expand Up @@ -355,11 +355,12 @@ def create_variable_selection_group(self):

grid_layout_variable = QGridLayout()
variable_layout.addLayout(grid_layout_variable)
number_of_variables = 8

self.scope_var_lines = [QLineEdit() for _ in range(7)]
self.trigger_var_checkbox = [QCheckBox() for _ in range(7)]
self.scope_channel_checkboxes = [QCheckBox() for _ in range(7)]
self.scope_scaling_boxes = [QLineEdit("1") for _ in range(7)]
self.scope_var_lines = [QLineEdit() for _ in range(number_of_variables)]
self.trigger_var_checkbox = [QCheckBox() for _ in range(number_of_variables)]
self.scope_channel_checkboxes = [QCheckBox() for _ in range(number_of_variables)]
self.scope_scaling_boxes = [QLineEdit("1") for _ in range(number_of_variables)]

for checkbox in self.scope_channel_checkboxes:
checkbox.setChecked(True)
Expand Down Expand Up @@ -434,7 +435,7 @@ def handle_scope_checkbox_change(self, state, index):
if i != index:
checkbox.setChecked(False)
self.triggerVariable = self.scope_var_combos[index].currentText()
print(f"Checked variable: {self.scope_var_combos[index].currentText()}")
logging.debug(f"Checked variable: {self.scope_var_combos[index].currentText()}")
else:
self.triggerVariable = None

Expand Down Expand Up @@ -1309,7 +1310,7 @@ def configure_trigger(self):
else:
try:
trigger_level = float(trigger_level_text)
print(trigger_level)
logging.debug(trigger_level)
except ValueError:
logging.error(
f"Invalid trigger level value: {trigger_level_text}"
Expand Down
24 changes: 11 additions & 13 deletions pyx2cscope/gui/generic_gui/generic_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging

logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.ERROR)
import json
import os
import sys
Expand Down Expand Up @@ -487,11 +487,11 @@ def create_variable_selection_group(self):

grid_layout_variable = QGridLayout()
variable_layout.addLayout(grid_layout_variable)

self.scope_var_lines = [QLineEdit() for _ in range(7)]
self.trigger_var_checkbox = [QCheckBox() for _ in range(7)]
self.scope_channel_checkboxes = [QCheckBox() for _ in range(7)]
self.scope_scaling_boxes = [QLineEdit("1") for _ in range(7)]
number_of_variables = 8
self.scope_var_lines = [QLineEdit() for _ in range(number_of_variables)]
self.trigger_var_checkbox = [QCheckBox() for _ in range(number_of_variables)]
self.scope_channel_checkboxes = [QCheckBox() for _ in range(number_of_variables)]
self.scope_scaling_boxes = [QLineEdit("1") for _ in range(number_of_variables)]

for checkbox in self.scope_channel_checkboxes:
checkbox.setChecked(True)
Expand Down Expand Up @@ -568,7 +568,7 @@ def handle_scope_checkbox_change(self, state, index):
if i != index:
checkbox.setChecked(False)
self.triggerVariable = self.scope_var_lines[index].text()
print(f"Checked variable: {self.scope_var_lines[index].text()}")
logging.debug(f"Checked variable: {self.scope_var_lines[index].text()}")
else:
self.triggerVariable = None

Expand Down Expand Up @@ -1563,9 +1563,7 @@ def start_sampling(self):
self.real_sampletime = self.x2cscope.scope_sample_time(
scope_sample_time_us
)
print(
f"Real sample time: {self.real_sampletime} µs"
) # Check this value
logging.debug(f"Real sample time: {self.real_sampletime} µs") # Check this value

# Update the Total Time display
self.total_time_value.setText(str(self.real_sampletime))
Expand All @@ -1579,7 +1577,7 @@ def start_sampling(self):
single_shot=self.single_shot_checkbox.isChecked()
)
b = time.time()
print("time execution", b - a)
logging.debug(f"time execution '{b - a}'")
except Exception as e:
error_message = f"Error starting sampling: {e}"
logging.error(error_message)
Expand All @@ -1603,7 +1601,7 @@ def configure_trigger(self):
else:
try:
trigger_level = int(trigger_level_text) # YA
print(trigger_level)
logging.debug(trigger_level)
except ValueError:
logging.error(
f"Invalid trigger level value: {trigger_level_text}"
Expand Down Expand Up @@ -2287,7 +2285,7 @@ def eventFilter(self, source, event): # noqa: N802 #Overriding 3rd party functi
],
)
except Exception as e:
print(e)
logging.debug(e)

return super().eventFilter(source, event)

Expand Down
4 changes: 2 additions & 2 deletions pyx2cscope/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
get_elf_file_path(key="path") -> str: Gets the path to the ELF file from the configuration.
get_com_port(key="com_port") -> str: Gets the COM port from the configuration.
"""

import logging
import os
from configparser import ConfigParser

Expand All @@ -28,7 +28,7 @@ def get_config_file() -> ConfigParser:
config["COM_PORT"] = default_com
with open(config_file, "w") as configfile:
config.write(configfile)
print(f"Config file '{config_file}' created with default values")
logging.debug(f"Config file '{config_file}' created with default values")
return config


Expand Down
Loading