{ "version": "2.0.0", "tasks": [ { "label": "wago-sim: pytest suite", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest full", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest full2", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest full3", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: serve with webui", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8080" ], "isBackground": true, "problemMatcher": [] }, { "label": "wago-sim: serve help", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--help" ], "isBackground": false, "problemMatcher": [] }, { "label": "argparse probe", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import argparse; p=argparse.ArgumentParser(); p.add_argument('--web/--no-web', default=True); p.add_argument('--web-port', type=int, default=8080); a=p.parse_args(['--web-port','8080']); print('web=', a.web, 'web_port=', a.web_port)" ], "isBackground": false, "problemMatcher": [] }, { "label": "argparse probe2", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import argparse; p=argparse.ArgumentParser(); p.add_argument('--web/--no-web', default=True); a=p.parse_args([]); print(a)" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: serve with webui v2", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8080" ], "isBackground": true, "problemMatcher": [] }, { "label": "wago-sim: serve with webui v3", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8080" ], "isBackground": true, "problemMatcher": [] }, { "label": "wago-sim: serve webui 8088", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8088" ], "isBackground": true, "problemMatcher": [] }, { "label": "pip list", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pip", "list" ], "isBackground": false, "problemMatcher": [] }, { "label": "kill old serve", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import subprocess, sys; r = subprocess.run('powershell -Command \\\"Get-NetTCPConnection -LocalPort 5020,8088 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force }\\\"', shell=True, capture_output=True, text=True); print('killed:', r.stdout, r.stderr)" ], "isBackground": false, "problemMatcher": [] }, { "label": "kill old serve v2", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import subprocess; r = subprocess.run(['powershell', '-NoProfile', '-Command', 'Get-NetTCPConnection -LocalPort 5020,8088 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force }'], capture_output=True, text=True); print('out:', r.stdout); print('err:', r.stderr[:200] if r.stderr else '')" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: serve final", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8088" ], "isBackground": true, "problemMatcher": [] }, { "label": "wago-sim: serve final2", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8088" ], "isBackground": true, "problemMatcher": [] }, { "label": "modbus roundtrip vs UI", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import asyncio; from pymodbus.client import AsyncModbusTcpClient\n\nasync def main():\n c = AsyncModbusTcpClient('127.0.0.1', port=5020)\n assert await c.connect()\n rr = await c.read_discrete_inputs(0, count=3, device_id=1)\n print('DI bits 0-2 via Modbus FC2:', rr.bits[:3])\n rr2 = await c.write_coil(0, True, device_id=1)\n print('FC5 write coil 0 (DO1) response ok:', not rr2.isError())\n c.close(); await c.wait_closed()\n\nasyncio.run(main())" ], "isBackground": false, "problemMatcher": [] }, { "label": "noop probe", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.examples.modbus_probe" ], "isBackground": false, "problemMatcher": [] }, { "label": "live probe run", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "scripts\\live_probe.py" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest final", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "remove probe", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import pathlib; p = pathlib.Path('scripts/live_probe.py'); p.unlink(); print('removed' if not p.exists() else 'still there')" ], "isBackground": false, "problemMatcher": [] }, { "label": "stop serve", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import subprocess; r = subprocess.run(['powershell', '-NoProfile', '-Command', 'Get-NetTCPConnection -LocalPort 5020,8088 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force }'], capture_output=True, text=True); print('stopped')" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest m5", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest m5b", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "debug desc", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "from wago_sim.app import build_app, rebuild_node; from wago_sim.modules import DI_16, DO_8; app = build_app(modules=[DI_16, DI_16, DO_8]); rebuild_node(app, [DI_16, DI_16, DO_8]); print('desc words:', app.registers.read_config(0x2030, 8)); print('description:', app.node.description())" ], "isBackground": false, "problemMatcher": [] }, { "label": "debug string pack", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "from wago_sim.registers import _string_to_words; w = _string_to_words('0:750-1405, 1:750-1405, 2:750-530', 65); print(w[:8]); print([hex(x) for x in w[:4]])" ], "isBackground": false, "problemMatcher": [] }, { "label": "debug rebuild desc", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "from wago_sim.app import build_app; from wago_sim.modules import DI_16, DO_8; app = build_app(modules=[DI_16, DO_8]); print('after build:', app.registers.read_config(0x2030, 4)); from wago_sim.app import rebuild_node; rebuild_node(app, [DI_16, DI_16, DO_8]); print('after rebuild:', app.registers.read_config(0x2030, 4)); print('desc attr len:', len(app.registers._module_desc))" ], "isBackground": false, "problemMatcher": [] }, { "label": "manual loader lookup", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import pymupdf, re; doc = pymupdf.open(r'docs/m07500362_xxxxxxxx_0en.pdf'); text = ''.join(p.get_text() for p in doc); hits = [m.start() for m in re.finditer('[Ll]oader', text)][:4]; [print('---'); print(text[max(0,i-150):i+250].replace(chr(10), ' | ')) for i in hits]" ], "isBackground": false, "problemMatcher": [] }, { "label": "manual check run", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "scripts\\manual_check.py" ], "isBackground": false, "problemMatcher": [] }, { "label": "manual check run2", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "scripts\\manual_check.py" ], "isBackground": false, "problemMatcher": [] }, { "label": "manual check run3", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "scripts\\manual_check.py" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest m5c", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "cleanup probe", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import pathlib; pathlib.Path('scripts/manual_check.py').unlink(); print('ok')" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: serve m5", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8088" ], "isBackground": true, "problemMatcher": [] }, { "label": "modbus desc probe", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "scripts\\live_probe.py" ], "isBackground": false, "problemMatcher": [] }, { "label": "cleanup + stop", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import pathlib, subprocess; pathlib.Path('scripts/live_probe.py').unlink(missing_ok=True); pathlib.Path('scripts').rmdir() if not list(pathlib.Path('scripts').iterdir()) else None; subprocess.run(['powershell','-NoProfile','-Command','Get-NetTCPConnection -LocalPort 5020,8088 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force }'], capture_output=True); print('cleaned')" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: pytest m5a", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "pytest", "tests", "-q", "--tb=short" ], "isBackground": false, "problemMatcher": [] }, { "label": "wago-sim: serve m5a", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-m", "wago_sim.cli", "serve", "--node", "config/pump_node.yaml", "--host", "127.0.0.1", "--port", "5020", "--web-port", "8088" ], "isBackground": true, "problemMatcher": [] }, { "label": "modbus after import probe", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "scripts\\live_probe.py" ], "isBackground": false, "problemMatcher": [] }, { "label": "cleanup m5a", "type": "shell", "command": ".venv\\Scripts\\python.exe", "args": [ "-c", "import pathlib, subprocess; pathlib.Path('scripts/live_probe.py').unlink(missing_ok=True); subprocess.run(['powershell','-NoProfile','-Command','Get-NetTCPConnection -LocalPort 5020,8088 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force }'], capture_output=True); print('cleaned')" ], "isBackground": false, "problemMatcher": [] } ] }