Files
OrcaSlicer/tools/mcp/tests/rows_plates.json
T
SoftFever d64e10f4dd Regroup the slicer's MCP commands and let each run from its arguments
Outside the Design tab an agent had 175 commands, 50 of them in the tool
list. There are now 118, named by what they act on (`object_`, `plate_`,
`preset_`, `filament_`, `plugin_` and so on), and 115 are listed. Each takes
its target and values in the call, acts on the selection when it names no
target and says what it acted on; an old name is refused. Printers and
system filaments install and uninstall, preferences read and write, plugins
enable, reload, uninstall and refresh, and objects reorder, with no dialog
to drive.

The Speed Dial keeps its 129 tiles under the same ids. Eight defects in the
rows these commands share with the menus are fixed. For a person: an object
row that cannot run says why instead of "Select an object first.", rows
that failed no longer claim success, Duplicate Plate can be undone, and
Refresh Plugins picked while a refresh runs now runs after it instead of
beside it.
2026-11-18 16:50:32 +08:00

67 lines
4.9 KiB
JSON

// Runs the plate commands made from menu rows by index, as a call gives them, and reads each back from plate_list:
// plate_duplicate copies plate 1 while plate 0 is current, plate_rename names plate 2 (which its name icon makes
// current), plate_lock locks plate 3 and toggles it back, plate_select makes plate 2 current, and plate_delete
// deletes plate 1 while plate 2 is current, whose index drops to 1, leaving the objects of the deleted plate outside
// the plates. Each is called once with no plate too, and its reply names the current plate. Last, undo gives back the
// plate the last delete took. The project starts with a cube on each of two plates. Run it with
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/rows_plates.json --out <dir>
{
"orca_replay_version": "0.2.0",
"name": "rows plates",
"steps": [
{"tool": "app_wait", "args": {"for": "ready"}},
{"tool": "project_new", "args": {"discard_changes": true, "preset_changes": "discard"}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20], "name": "first"}},
{"tool": "plate_add"},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20], "name": "second", "plate": 1}},
{"tool": "plate_select", "args": {"plate": 0}, "expect": {"/plate": {"eq": 0}}},
{"tool": "plate_list", "expect": {"/total": {"eq": 2}, "/items/0/current": {"eq": true}, "/items/1/objects": {"eq": 1}}},
// ---- Duplicate: plate 1 by index while plate 0 is current, then the current plate ----
{"tool": "plate_duplicate", "args": {"plate": 1},
"expect": {"/plate": {"eq": 1}, "/new_plate": {"eq": 2}, "/current": {"eq": 0}, "/plates/2/objects": {"eq": 1}}},
{"tool": "plate_list", "expect": {"/total": {"eq": 3}, "/items/2/objects": {"eq": 1}, "/items/0/current": {"eq": true}}},
{"tool": "object_list", "expect": {"/plates/2/objects/0/name": {"eq": "second"}}},
{"tool": "plate_duplicate", "expect": {"/plate": {"eq": 0}, "/new_plate": {"eq": 3}, "/current": {"eq": 0}}},
{"tool": "object_list", "expect": {"/plates/3/objects/0/name": {"eq": "first"}}},
// ---- Rename: plate 2 by index, made current as its name icon makes it, then the current plate ----
{"tool": "plate_rename", "args": {"plate": 2, "name": "Copy"}, "expect": {"/plate": {"eq": 2}, "/name": {"eq": "Copy"}}},
{"tool": "plate_list", "expect": {"/items/2/name": {"eq": "Copy"}, "/items/2/current": {"eq": true}, "/items/1/name": {"eq": ""}}},
{"tool": "plate_select", "args": {"plate": 1}},
{"tool": "plate_rename", "args": {"name": "Second"}, "expect": {"/plate": {"eq": 1}, "/name": {"eq": "Second"}}},
{"tool": "plate_list", "expect": {"/items/1/name": {"eq": "Second"}, "/items/2/name": {"eq": "Copy"}}},
// ---- Lock: plate 3 by index, locked and then toggled, and the current plate ----
{"tool": "plate_lock", "args": {"plate": 3, "locked": true},
"expect": {"/plate": {"eq": 3}, "/locked": {"eq": true}, "/changed": {"eq": true}}},
{"tool": "plate_list", "expect": {"/items/3/locked": {"eq": true}, "/items/1/locked": {"eq": false}, "/items/1/current": {"eq": true}}},
{"tool": "plate_lock", "args": {"plate": 3}, "expect": {"/plate": {"eq": 3}, "/locked": {"eq": false}, "/changed": {"eq": true}}},
{"tool": "plate_lock", "expect": {"/plate": {"eq": 1}, "/locked": {"eq": true}}},
{"tool": "plate_list", "expect": {"/items/1/locked": {"eq": true}, "/items/3/locked": {"eq": false}}},
{"tool": "plate_lock", "args": {"locked": false}, "expect": {"/plate": {"eq": 1}, "/locked": {"eq": false}}},
{"tool": "plate_list", "expect": {"/items/1/locked": {"eq": false}}},
// ---- Select: plate 2 by index; with no plate the current plate stays current ----
{"tool": "plate_select", "args": {"plate": 2}, "expect": {"/plate": {"eq": 2}}},
{"tool": "plate_list", "expect": {"/items/2/current": {"eq": true}}},
{"tool": "plate_select", "expect": {"/plate": {"eq": 2}}},
{"tool": "plate_list", "expect": {"/items/2/current": {"eq": true}}},
// ---- Delete: plate 1 by index while plate 2 is current, then the current plate ----
{"tool": "plate_delete", "args": {"plate": 1},
"expect": {"/plate": {"eq": 1}, "/current": {"eq": 1}, "/plates/1/name": {"eq": "Copy"}}},
{"tool": "plate_list", "expect": {"/total": {"eq": 3}, "/items/1/name": {"eq": "Copy"}, "/items/1/current": {"eq": true}}},
{"tool": "object_list", "expect": {"/outside/0/name": {"eq": "second"}}},
{"tool": "plate_delete", "expect": {"/plate": {"eq": 1}, "/current": {"eq": 0}, "/plates/1/objects": {"eq": 1}}},
{"tool": "plate_list", "expect": {"/total": {"eq": 2}, "/items/0/current": {"eq": true}}},
// ---- The delete is one undo step ----
{"tool": "undo", "args": {"history": "project"}},
{"tool": "plate_list", "expect": {"/total": {"eq": 3}}},
{"tool": "project_new", "args": {"discard_changes": true}}
]
}