pub enum Command {
Show 29 variants
Show,
New {
kind: String,
},
NewIn {
kind: String,
placed: String,
},
Open {
id: String,
placed: Option<String>,
},
Event {
event: StepEditEvent,
},
Commit,
Cancel,
Preview {
preview: bool,
},
Remove {
id: String,
},
Move {
id: String,
index: usize,
},
Copy {
id: String,
},
Paste {
text: String,
},
Seek {
marker: Option<usize>,
},
Load {
program: Program,
path: Option<String>,
},
Files {
files: BTreeMap<String, Option<String>>,
},
LoadExample {
name: String,
},
LoadWorkspaceExample {
name: String,
folder: Option<String>,
},
Undo,
Redo,
Panel {
key: String,
payload: Value,
},
Visibility {
name: String,
visible: bool,
},
Appearance {
name: String,
color: Option<String>,
},
Isolate {
names: Vec<String>,
},
Tool {
key: Option<String>,
},
Inspect {
inspector: String,
options: Value,
picked: Vec<PickedElement>,
},
Export {
exporter: String,
format: Option<String>,
options: Value,
date: String,
},
Light {
elements: Vec<PickedElement>,
},
Report,
Crash,
}Expand description
Something the user did.
Variants§
Show
Nothing: only what to show, all of it — how an editor starts.
New
Start a new step of the operation kind, where the program runs to.
NewIn
Start a new step of the operation kind after the steps of the
part placed at placed — neck, or neck/head for one placed in a
placed part, however deep — edited where it is placed: built against
the parts placed beside it, which it reads in context (see
geop_core_program::placed::OUTSIDE). Committed, it is written to
that part’s file.
Open
Start editing the step id — of the program, or, given placed,
of the part placed at that path, however deep, where it is placed (see
StepInfo::placed).
Event
Something the user did to the step being edited — or, with none, with the tool in hand.
Fields
event: StepEditEventCommit
Put the step being edited into the program — refused, unless it builds.
Cancel
Stop editing the step, leaving the program as it was.
Preview
Whether the step being edited is shown as it builds, or the part before it.
Remove
Move
Move the step id to index among the other steps.
Copy
The step id as text to paste (Program::excerpt), in the
update’s export.
Paste
Insert the steps of the program text — what Command::Copy
gave, in this program or another — where new steps go
(Program::paste).
Seek
Run only the first marker steps — all of them, if None — and put
new steps there.
Load
Replace the program, e.g. with one read from a file — path, if
given, which the files it places are named relative to.
Files
The other program files are now these, by path: each set to its
program’s text, or — None — gone. What the program places from
them is built anew.
LoadExample
Load the example program name (see
crate::registry::ExampleSet).
LoadWorkspaceExample
Add the files of the example of several files name — put in
folder, if given — replacing any of the same path, and edit the
first of them. The update says what they are (Update::files):
the front end keeps them.
Undo
Go back one edit — while a step is edited, one edit of the step — or forward again.
Redo
Panel
Something the user did in the panel key (see
crate::registry::Panel), which the panel reads payload as.
Visibility
Show the datum, sketch, solid or placed part name of the part
drawn, or hide it — whatever the editor would do by itself: a
display setting, saved with the program
(geop_core_program::program::Display), not a step.
Appearance
Draw the placed part name — bolt, asm/bolt — in the colour
color, #rrggbb, over its own, or — None — in its own again:
a display setting, saved with the program, not a step.
Isolate
Show only the placed parts names — with the parts placed in them
and those they are placed in — of the parts placed, or every one
again for none: a display setting, saved with the program.
Tool
Take the tool key in hand (see crate::tools::Tool), or —
None — put the one in hand down. With no step being edited, the
events of the viewport are the tool’s. pick:<inspector> is the
pick tool of an inspector that picks (see
crate::tools::pick::PickTool): every update carries its answer
about the picks (Update::inspection).
Inspect
Ask the inspector inspector about the part as drawn — of the
elements picked, for one that picks — told options (its own,
see crate::output::Inspector::Options): answered once, in
Update::inspection. Changes nothing.
Export
Write what the program builds — as far as it runs, the parts it
places included — with the exporter exporter, in format (its
first, if not given), told options (its own, see
crate::output::Exporter::Options) and dated date
(YYYY-MM-DD): the update’s Update::export. Changes nothing.
Light
Light elements too, beside what the step or the tool lights — what
an item of the structure or a row of an answer points at, while the
pointer is on it — until lit otherwise: none, once it leaves.
Changes nothing else (see Update::lit).
Fields
elements: Vec<PickedElement>Report
What a bug report attaches of the session: the program, the step
being edited as it stands and the kernel’s version, in the update’s
Update::report. Changes nothing.
Crash
Panic, on purpose: how the front ends’ recovery from a kernel that
crashed is checked (web/e2e/). A panic anywhere else is a bug;
this one stands in for it.