- Add comprehensive test scripts for multi-series dongle configuration - Add debugging tools for deployment and flow testing - Add configuration verification and guide utilities - Fix stdout/stderr handling in deployment dialog for PyInstaller builds - Includes port ID configuration tests and multi-series config validation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
110 lines
4.1 KiB
Python
110 lines
4.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Check current multi-series configuration in saved .mflow files
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import glob
|
|
|
|
def check_mflow_files():
|
|
"""Check .mflow files for multi-series configuration"""
|
|
|
|
# Look for .mflow files in common locations
|
|
search_paths = [
|
|
"*.mflow",
|
|
"flows/*.mflow",
|
|
"examples/*.mflow",
|
|
"../*.mflow"
|
|
]
|
|
|
|
mflow_files = []
|
|
for pattern in search_paths:
|
|
mflow_files.extend(glob.glob(pattern))
|
|
|
|
if not mflow_files:
|
|
print("No .mflow files found in current directory")
|
|
return
|
|
|
|
print(f"Found {len(mflow_files)} .mflow file(s):")
|
|
|
|
for mflow_file in mflow_files:
|
|
print(f"\n=== Checking {mflow_file} ===")
|
|
|
|
try:
|
|
with open(mflow_file, 'r') as f:
|
|
data = json.load(f)
|
|
|
|
# Look for nodes with type "Model" or "ExactModelNode"
|
|
nodes = data.get('nodes', [])
|
|
model_nodes = [node for node in nodes if node.get('type') in ['Model', 'ExactModelNode']]
|
|
|
|
if not model_nodes:
|
|
print(" No Model nodes found")
|
|
continue
|
|
|
|
for i, node in enumerate(model_nodes):
|
|
print(f"\n Model Node {i+1}:")
|
|
print(f" Name: {node.get('name', 'Unnamed')}")
|
|
|
|
# Check both custom_properties and properties for multi-series config
|
|
custom_properties = node.get('custom_properties', {})
|
|
properties = node.get('properties', {})
|
|
|
|
# Multi-series config is typically in custom_properties
|
|
config_props = custom_properties if custom_properties else properties
|
|
|
|
# Check multi-series configuration
|
|
multi_series_mode = config_props.get('multi_series_mode', False)
|
|
enabled_series = config_props.get('enabled_series', [])
|
|
|
|
print(f" multi_series_mode: {multi_series_mode}")
|
|
print(f" enabled_series: {enabled_series}")
|
|
|
|
if multi_series_mode:
|
|
print(" Multi-series port configurations:")
|
|
for series in ['520', '720', '630', '730', '540']:
|
|
port_ids = config_props.get(f'kl{series}_port_ids', '')
|
|
if port_ids:
|
|
print(f" kl{series}_port_ids: '{port_ids}'")
|
|
|
|
assets_folder = config_props.get('assets_folder', '')
|
|
if assets_folder:
|
|
print(f" assets_folder: '{assets_folder}'")
|
|
else:
|
|
print(" assets_folder: (not set)")
|
|
else:
|
|
print(" Multi-series mode is DISABLED")
|
|
print(" Current single-series configuration:")
|
|
port_ids = properties.get('port_ids', [])
|
|
model_path = properties.get('model_path', '')
|
|
print(f" port_ids: {port_ids}")
|
|
print(f" model_path: '{model_path}'")
|
|
|
|
except Exception as e:
|
|
print(f" Error reading file: {e}")
|
|
|
|
def print_configuration_guide():
|
|
"""Print guide for setting up multi-series configuration"""
|
|
print("\n" + "="*60)
|
|
print("MULTI-SERIES CONFIGURATION GUIDE")
|
|
print("="*60)
|
|
print()
|
|
print("To enable multi-series inference, set these properties in your Model Node:")
|
|
print()
|
|
print("1. multi_series_mode = True")
|
|
print("2. enabled_series = ['520', '720']")
|
|
print("3. kl520_port_ids = '28,32'")
|
|
print("4. kl720_port_ids = '4'")
|
|
print("5. assets_folder = (optional, for auto model/firmware detection)")
|
|
print()
|
|
print("Expected devices found:")
|
|
print(" KL520 devices on ports: 28, 32")
|
|
print(" KL720 device on port: 4")
|
|
print()
|
|
print("If multi_series_mode is False or not set, the system will use")
|
|
print("single-series mode with only the first available device.")
|
|
|
|
if __name__ == "__main__":
|
|
check_mflow_files()
|
|
print_configuration_guide() |