Skip to content
Open
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenMOTION Test Application
# Open-Motion Test Application

Python example UI for OPEN Motion used for Hardware Testing and Basic Usage

Expand All @@ -12,15 +12,15 @@ Python example UI for OPEN Motion used for Hardware Testing and Basic Usage
### Steps to Set Up the Project
1. **Install OpenLIFU Python**
```bash
https://github.com/OpenwaterHealth/OpenMOTION-Pylib
cd OpenMOTION-Pylib
https://github.com/OpenwaterHealth/openmotion-sdk
cd openmotion-sdk
pip install -r requirements.txt
```

2. **Clone the repository and Install Required Packages**:
```bash
git clone https://github.com/OpenwaterHealth/OpenMOTION-TestAPP.git
cd OpenMOTION-TestAPP
git clone https://github.com/OpenwaterHealth/openmotion-test-app.git
cd openmotion-test-app
pip install -r requirements.txt
```

Expand All @@ -32,10 +32,10 @@ Python example UI for OPEN Motion used for Hardware Testing and Basic Usage
```

3. **Run application**
requires OpenMOTION-Pylib to be installed or referenced prior to running main.py
requires openmotion-sdk to be installed or referenced prior to running main.py

```bash
cd OpenMOTION-TestAPP
cd openmotion-test-app
python main.py
```

Expand Down
2 changes: 1 addition & 1 deletion components/ActionButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Button {

// ——— Public API ———
// Use `text` directly to set the label (standard Button property).
// Bind `enabled` from the outside as usual, e.g. enabled: MOTIONInterface.consoleConnected
// Bind `enabled` from the outside as usual, e.g. enabled: MotionInterface.consoleConnected
signal triggered()
property int cornerRadius: 4
property color textColorEnabled: "#BDC3C7"
Expand Down
2 changes: 1 addition & 1 deletion components/HistogramView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Item {
buttonText: "Export CSV"
onClicked: {
if (histogramWidget.histogramData.length > 0) {
MOTIONConnector.saveHistogramToCSV(histogramWidget.histogramData)
MotionConnector.saveHistogramToCSV(histogramWidget.histogramData)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion fpga_laser_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def get_entry_by_friendly_name(self, friendlyName: str) -> Optional[dict]:
def load_laser_params(config_dir: str) -> list:
"""Load `laser_params.json` from the given config directory.

Mirrors the previous `_load_laser_params` behavior on MOTIONConnector.
Mirrors the previous `_load_laser_params` behavior on MotionConnector.
Returns a list of parameter dicts, or an empty list on any error.
"""
config_path = (
Expand Down
12 changes: 6 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from PyQt6.QtGui import QGuiApplication, QIcon
from PyQt6.QtQml import QQmlApplicationEngine, qmlRegisterSingletonInstance

from motion_connector import MOTIONConnector
from motion_connector import MotionConnector
from motion_singleton import motion_interface
from version import get_version

# set PYTHONPATH=%cd%\..\OpenMOTION-PyLib;%PYTHONPATH%
# set PYTHONPATH=%cd%\..\openmotion-sdk;%PYTHONPATH%
# python main.py

APP_VERSION = get_version()
Expand Down Expand Up @@ -39,7 +39,7 @@ def resource_path(rel: str) -> str:

def main():
# Parse command line arguments
parser = argparse.ArgumentParser(description="OpenMOTION Test Application")
parser = argparse.ArgumentParser(description="Open-Motion Test Application")
parser.add_argument(
"--debug", action="store_true", help="Enable debug logging and console output"
)
Expand Down Expand Up @@ -78,8 +78,8 @@ def main():

# Expose to QML
log_level = logging.DEBUG if args.debug else logging.INFO
connector = MOTIONConnector(log_level=log_level, github_disabled=args.no_github)
qmlRegisterSingletonInstance("OpenMotion", 1, 0, "MOTIONInterface", connector)
connector = MotionConnector(log_level=log_level, github_disabled=args.no_github)
qmlRegisterSingletonInstance("OpenMotion", 1, 0, "MotionInterface", connector)
engine.rootContext().setContextProperty("appVersion", APP_VERSION)
# Also expose app version on the QGuiApplication instance so Python
# modules (not just QML) can read it via QGuiApplication.instance().property()
Expand All @@ -95,7 +95,7 @@ def main():
# The SDK now owns its own daemon connection-monitor thread; no
# asyncio loop required. start() returns once any already-attached
# devices have completed their CONNECTING transition (or wait_timeout).
logger.info("Starting MOTION monitoring...")
logger.info("Starting Open-Motion monitoring...")
motion_interface.start(wait=True, wait_timeout=2.0)

def handle_exit():
Expand Down
6 changes: 3 additions & 3 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ ApplicationWindow {
anchors.right: parent.right

// Set title and logo dynamically
titleText: "Open-MOTION Engineering App"
titleText: "Open-Motion Engineering App"
logoSource: "../assets/images/OpenwaterLogo.png" // Correct relative path
appVerText: "" + appVersion
sdkVerText: "" + MOTIONInterface.get_sdk_version()
sdkVerText: "" + MotionInterface.get_sdk_version()
}

// Layout for Sidebar and Main Content
Expand Down Expand Up @@ -87,6 +87,6 @@ ApplicationWindow {
}

Connections {
target: MOTIONInterface
target: MotionInterface
}
}
16 changes: 8 additions & 8 deletions motion_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class _ConsoleFirmwareDownloadThread(QThread):

def __init__(
self,
connector: "MOTIONConnector",
connector: "MotionConnector",
tag: str,
filename: str,
target: str = "console",
Expand Down Expand Up @@ -314,7 +314,7 @@ class _ConsoleFirmwareFlashThread(QThread):
failed = pyqtSignal(str)
finished_ok = pyqtSignal()

def __init__(self, connector: "MOTIONConnector", bin_path: str):
def __init__(self, connector: "MotionConnector", bin_path: str):
super().__init__()
self._connector = connector
self._bin_path = bin_path
Expand Down Expand Up @@ -394,7 +394,7 @@ class _DeviceFirmwareFlashThread(QThread):
failed = pyqtSignal(str)
finished_ok = pyqtSignal()

def __init__(self, connector: "MOTIONConnector", bin_path: str, target: str):
def __init__(self, connector: "MotionConnector", bin_path: str, target: str):
super().__init__()
self._connector = connector
self._bin_path = bin_path
Expand Down Expand Up @@ -491,7 +491,7 @@ class _ConsoleFpgaUpdateThread(QThread):
finished_ok = pyqtSignal(str)

def __init__(
self, connector: "MOTIONConnector", target: str, tag: str, verify: bool = False,
self, connector: "MotionConnector", target: str, tag: str, verify: bool = False,
local_jed_path: str | None = None,
):
super().__init__()
Expand Down Expand Up @@ -763,7 +763,7 @@ def stop(self):
self.wait(500)


class MOTIONConnector(QObject):
class MotionConnector(QObject):
# Ensure signals are correctly defined
signalConnected = pyqtSignal(str, str) # (descriptor, port)
signalDisconnected = pyqtSignal(str, str) # (descriptor, port)
Expand Down Expand Up @@ -1324,7 +1324,7 @@ def _start_runlog(self):
self._runlog_active = True

# --- Gather version info for header ---
# SDK version (MOTION SDK / sensor SDK)
# SDK version (Motion SDK / sensor SDK)
try:
sdk_ver = (
self._interface.get_sdk_version()
Expand Down Expand Up @@ -3515,7 +3515,7 @@ def pdu_mon(self):

@pyqtSlot()
def shutdown(self):
logger.info("Shutting down MOTIONConnector...")
logger.info("Shutting down MotionConnector...")

if self._capture_thread:
self._capture_thread.stop()
Expand All @@ -3529,7 +3529,7 @@ def shutdown(self):
class ConsoleStatusThread(QThread):
statusUpdate = pyqtSignal(str)

def __init__(self, connector: MOTIONConnector, parent=None):
def __init__(self, connector: MotionConnector, parent=None):
super().__init__(parent)
self.connector = connector
self._running = True
Expand Down
Loading