mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-02 01:43:36 -05:00
The MCP command descriptions, docs and code called an entry of the app's menus a "row", the word they also use for the rows of the object list and the app's other lists. They now say "menu item", so a row is only ever a row of a list or table. Command names, arguments and Speed Dial tile ids are unchanged.
67 lines
4.9 KiB
JSON
67 lines
4.9 KiB
JSON
// Runs the plate commands made from menu items 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/menu_items_plates.json --out <dir>
|
|
{
|
|
"orca_replay_version": "0.2.0",
|
|
"name": "menu items 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}}
|
|
]
|
|
}
|