forked from 1b-agent/opencadstudio-upstream
Selection: report what each pick found while a command gathers objects
Every pick during object selection prints the reference's count line: "N found" for the first pick or a pick that adds nothing, "N found, M total" after it, "N found, N removed, M total" when objects leave the set. It is printed before a command's own filtering, so "N were filtered out" follows it. COUNT reports through it and the ad hoc "object(s) found." / "object(s) added to selection." lines are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2c062daa03
commit
1e93b16911
27 files changed
+112
-16
No files matched your search
@@ -158,17 +158,10 @@ impl CadCommand for CountCommand {
|
||||
}
|
||||
|
||||
fn on_selection_complete(&mut self, handles: Vec<Handle>) -> CmdResult {
|
||||
// The selection arrives whole after every pick: `1 found`, then
|
||||
// `1 found, 2 total`.
|
||||
let found = handles.iter().filter(|h| !self.targets.contains(h)).count();
|
||||
let first = self.targets.is_empty();
|
||||
// The selection arrives whole after every pick; the driver reports
|
||||
// what each pick found.
|
||||
self.targets = handles;
|
||||
let total = self.targets.len();
|
||||
CmdResult::ReportMeasurement(if first {
|
||||
crate::tf!("{found} found").into_owned()
|
||||
} else {
|
||||
crate::tf!("{found} found, {total} total").into_owned()
|
||||
})
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
|
||||
fn needs_entity_pick(&self) -> bool {
|
||||
|
||||
Reference in new issue
Block a user