feat(count): prompt COUNT for the tally mode
Bare COUNT now offers [All (by type) / By layer] as buttons instead of immediately dumping the by-type tally. "All" dispatches COUNT TYPE, whose output is identical to the old bare COUNT; "By layer" dispatches COUNT LAYER. Counting a specific layer (COUNT <layer>) stays typeable. Finishes bucket B.
This commit is contained in:
parent
7195e1e8fb
commit
cf5362aeab
1 changed files with 11 additions and 1 deletions
|
|
@ -875,7 +875,17 @@ impl OpenCADStudio {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── COUNT — entity statistics ─────────────────────────────────────
|
// ── COUNT — entity statistics ─────────────────────────────────────
|
||||||
cmd if cmd == "COUNT" || cmd.starts_with("COUNT ") => {
|
"COUNT" => {
|
||||||
|
use crate::command::KeywordCommand;
|
||||||
|
let c = KeywordCommand::new(
|
||||||
|
"COUNT",
|
||||||
|
"COUNT tally [All (by type) / by Layer]:",
|
||||||
|
vec![("All", "TYPE", None), ("By layer", "LAYER", None)],
|
||||||
|
);
|
||||||
|
self.command_line.push_info(&c.prompt());
|
||||||
|
self.tabs[self.active_tab].active_cmd = Some(Box::new(c));
|
||||||
|
}
|
||||||
|
cmd if cmd.starts_with("COUNT ") => {
|
||||||
let filter = cmd.split_once(' ').map(|(_, r)| r.trim().to_uppercase());
|
let filter = cmd.split_once(' ').map(|(_, r)| r.trim().to_uppercase());
|
||||||
let mut counts: std::collections::BTreeMap<String, usize> = Default::default();
|
let mut counts: std::collections::BTreeMap<String, usize> = Default::default();
|
||||||
for e in self.tabs[i].scene.document.entities() {
|
for e in self.tabs[i].scene.document.entities() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue