- 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>
90 lines
3.2 KiB
Python
90 lines
3.2 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Debug the multi-series configuration flow
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
def test_full_flow():
|
|
"""Test the complete multi-series configuration flow"""
|
|
print("=== Testing Multi-Series Configuration Flow ===")
|
|
|
|
# Simulate node properties as they would appear in the UI
|
|
mock_node_properties = {
|
|
'multi_series_mode': True,
|
|
'enabled_series': ['520', '720'],
|
|
'kl520_port_ids': '28,32',
|
|
'kl720_port_ids': '4',
|
|
'assets_folder': '',
|
|
'max_queue_size': 100
|
|
}
|
|
|
|
print(f"1. Mock node properties: {mock_node_properties}")
|
|
|
|
# Test the mflow converter building multi-series config
|
|
try:
|
|
from core.functions.mflow_converter import MFlowConverter
|
|
converter = MFlowConverter(default_fw_path='.')
|
|
|
|
config = converter._build_multi_series_config_from_properties(mock_node_properties)
|
|
print(f"2. Multi-series config built: {config}")
|
|
|
|
if config:
|
|
print(" [OK] Multi-series config successfully built")
|
|
|
|
# Test StageConfig creation
|
|
from core.functions.InferencePipeline import StageConfig
|
|
|
|
stage_config = StageConfig(
|
|
stage_id="test_stage",
|
|
port_ids=[], # Not used in multi-series
|
|
scpu_fw_path='',
|
|
ncpu_fw_path='',
|
|
model_path='',
|
|
upload_fw=False,
|
|
multi_series_mode=True,
|
|
multi_series_config=config
|
|
)
|
|
|
|
print(f"3. StageConfig created with multi_series_mode: {stage_config.multi_series_mode}")
|
|
print(f" Multi-series config: {stage_config.multi_series_config}")
|
|
|
|
# Test what would happen in PipelineStage initialization
|
|
print("4. Testing PipelineStage initialization logic:")
|
|
if stage_config.multi_series_mode and stage_config.multi_series_config:
|
|
print(" [OK] Would initialize MultiDongle with multi_series_config")
|
|
print(f" MultiDongle(multi_series_config={stage_config.multi_series_config})")
|
|
else:
|
|
print(" [ERROR] Would fall back to single-series mode")
|
|
|
|
else:
|
|
print(" [ERROR] Multi-series config is None - this is the problem!")
|
|
|
|
except Exception as e:
|
|
print(f"Error in flow test: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
|
|
def test_node_direct():
|
|
"""Test creating a node directly and getting its inference config"""
|
|
print("\n=== Testing Node Direct Configuration ===")
|
|
|
|
try:
|
|
from core.nodes.exact_nodes import ExactModelNode
|
|
|
|
# This won't work without NodeGraphQt, but let's see what happens
|
|
node = ExactModelNode()
|
|
print("Node created (mock mode)")
|
|
|
|
# Test the get_business_properties method that would be called during export
|
|
props = node.get_business_properties()
|
|
print(f"Business properties: {props}")
|
|
|
|
except Exception as e:
|
|
print(f"Error in node test: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
test_full_flow()
|
|
test_node_direct() |