diff --git a/.claude/skills/orca-wxwidgets/SKILL.md b/.claude/skills/orca-wxwidgets/SKILL.md index 0e39ce9d24..9bd352039e 100644 --- a/.claude/skills/orca-wxwidgets/SKILL.md +++ b/.claude/skills/orca-wxwidgets/SKILL.md @@ -56,11 +56,12 @@ the source is what runs — the references mark such facts **[source]**. Orca-si ## Golden rules -1. **Interactive controls are Orca widgets** (`Button` + `SetStyle(...)`, `::CheckBox`, `::ComboBox`, - `::TextInput`, `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); the bottom row of every dialog is - `DialogButtons`. Never `wxButton`, `wxSpinCtrl`, `wxCheckBox`, `wxChoice` or a single-line `wxTextCtrl` - in new code; multi-line text is a raw `wxTextCtrl`. Inside `Slic3r::GUI` write `::CheckBox` etc. — - `Field.hpp` has classes with the same names. → `orca-widgets.md` +1. **Interactive controls are Orca widgets** (`Button` + `SetStyle(...)`, `::CheckBox`, `LabeledCheckBox`, + `::ComboBox`, `::TextInput`, `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); the bottom row of every + dialog is `DialogButtons`. Never `wxButton`, `wxSpinCtrl`, `wxCheckBox`, `wxChoice` or a single-line + `wxTextCtrl` in new code; multi-line text is a raw `wxTextCtrl`. When the label is on the right side of the + check box and belongs to it, use a `LabeledCheckBox`, not a `::CheckBox` paired with a label by hand. Inside + `Slic3r::GUI` write `::CheckBox` etc. — `Field.hpp` has classes with the same names. → `orca-widgets.md` 2. **DPI.** Layout pixel values go through `FromDIP(n)` (or `n * em_unit()`); `wxBitmap` constructor sizes, image-list sizes and GL viewports are physical and are not `FromDIP`'d (icon heights passed to `create_scaled_bitmap`/`ScalableBitmap`/`Button` are DIP). Top-level windows are `DPIDialog`/ @@ -171,7 +172,8 @@ if (dlg.ShowModal() == wxID_OK) { /* read results */ } | Orca widget (`src/slic3r/GUI/Widgets/`) | Instead of | Must know | |---|---|---| | `Button` | `wxButton` | ctor `(parent, text, icon_name, style, iconSize, id)` — id is last; style with `SetStyle(ButtonStyle::…, ButtonType::…)`; emits `wxEVT_BUTTON`; not a `wxButton` (no dialog default/escape emulation) | -| `::CheckBox` | `wxCheckBox` | no label parameter — pair with a `wxStaticText`/`Label`; emits `wxEVT_TOGGLEBUTTON` (never `wxEVT_CHECKBOX`), and a handler bound on it must `Skip()` or the bitmap is not refreshed | +| `::CheckBox` | `wxCheckBox` without a label | no label parameter — when the label is on the right side of the check box and belongs to it, use `LabeledCheckBox`; emits `wxEVT_TOGGLEBUTTON` (never `wxEVT_CHECKBOX`), and a handler bound on it must `Skip()` or the bitmap is not refreshed | +| `LabeledCheckBox` | `wxCheckBox` with a label, a `::CheckBox` hand-paired with its own label on the right side | ctor `(parent, label, id)`; a click on the check or the label sends `wxEVT_CHECKBOX` **and** `wxEVT_TOGGLEBUTTON` from the control — bind one; `SetValue` silent; label, font, `Wrap(width)`/`AutoWrap()` and `Enable()` go through the control, not its children | | `::ComboBox` (+ `DropDown`) | `wxComboBox`/`wxChoice` | `wxCB_READONLY` for choices; `SelectAndNotify(n)` fires the event; ignores the ctor id; `void*` client data only | | `::TextInput` | single-line `wxTextCtrl` | text via `GetTextCtrl()`; bind `wxEVT_TEXT_ENTER`/`wxEVT_KILL_FOCUS` on the widget, never on a parent | | `SpinInput` | `wxSpinCtrl` | non-negative integers only (`-` cannot be typed); commits on Enter, kill-focus and arrow steps with `wxEVT_SPINCTRL`, a plain `wxCommandEvent` — bind a `wxCommandEvent&` handler and read `GetValue()` | diff --git a/.claude/skills/orca-wxwidgets/references/controls-dataview.md b/.claude/skills/orca-wxwidgets/references/controls-dataview.md index 3671e05991..a6721f5237 100644 --- a/.claude/skills/orca-wxwidgets/references/controls-dataview.md +++ b/.claude/skills/orca-wxwidgets/references/controls-dataview.md @@ -73,6 +73,7 @@ Contents: [Rules](#rules) · [Native vs generic](#native-vs-generic-and-silent-a constructor, so bind on the combo (or `SetId()` after construction if an id filter is unavoidable). → [Orca widgets](#orca-replacement-widgets-event-contracts) 26. `::CheckBox`/`SwitchButton` emit `wxEVT_TOGGLEBUTTON`, and a handler bound on the widget itself must `Skip()`; + `LabeledCheckBox` sends `wxEVT_CHECKBOX` and `wxEVT_TOGGLEBUTTON` from itself — bind one; `RadioGroup::SetSelection` always emits; `SpinInput`'s `wxEVT_SPINCTRL` is a plain `wxCommandEvent`. → [Orca widgets](#orca-replacement-widgets-event-contracts) 27. Expect Orca's colours on every generic data view and `RenderText` on MSW: `ObjectList` installs a @@ -300,8 +301,8 @@ Contract: - `wxRadioBox::SetSelection(n)` needs a valid `n`, never `wxNOT_FOUND` (`interface/wx/radiobox.h:292-295`), and sends no event. -OrcaSlicer: interactive check boxes are `::CheckBox`/`SwitchButton`, radio rows are `::RadioGroup`; their event -contracts differ from these ([below](#checkbox-and-switchbutton)). +OrcaSlicer: interactive check boxes are `::CheckBox`/`LabeledCheckBox`/`SwitchButton`, radio rows are +`::RadioGroup`; their event contracts differ from these ([below](#checkbox-and-switchbutton)). Pitfalls: - **Rule:** Put `wxRB_GROUP` on the first button of *every* group. @@ -751,6 +752,7 @@ Bind column means an ancestor bound by event type; binding an ancestor by the wi | `::ComboBox` | `wxComboBox`/`wxChoice` | `wxEVT_COMBOBOX` (int = index, string = text); DROPDOWN/CLOSEUP | COMBOBOX: combo's auto-generated id (the ctor `id` is ignored) and object; DROPDOWN/CLOSEUP: id 0, no object | `SetSelection`/`SetValue` → `wxEVT_TEXT` when the text ctrl is shown or `CB_NO_TEXT`; `SelectAndNotify` → `wxEVT_COMBOBOX` | COMBOBOX on the combo (or an ancestor); DROPDOWN/CLOSEUP on the combo without id | | `::SpinInput` | `wxSpinCtrl` | `wxEVT_SPINCTRL` (a `wxCommandEvent`); `EVT_SPINCTRL_TEXT` per parsable keystroke; inner `wxEVT_TEXT` | SPINCTRL / SPINCTRL_TEXT: spinner id/object | `SetValue(int)` → `EVT_SPINCTRL_TEXT` + `wxEVT_TEXT`, no `wxEVT_SPINCTRL` | SPINCTRL on the spinner or an ancestor, handler takes `wxCommandEvent&` | | `::CheckBox`, `SwitchButton` | `wxCheckBox` | `wxEVT_TOGGLEBUTTON` | native | `SetValue` silent | on the widget (with `Skip()`) or an ancestor; never `wxEVT_CHECKBOX` | +| `LabeledCheckBox` | `wxCheckBox` with its own label on the right side | `wxEVT_CHECKBOX`, then `wxEVT_TOGGLEBUTTON` | control id/object | `SetValue` silent | on the control or an ancestor, **one** of the two | | `::RadioGroup` | `wxRadioBox` | `wxEVT_COMMAND_RADIOBOX_SELECTED` | group id, no object | **every** `SetSelection` emits | on the group or an ancestor | | `::TabCtrl` | tab bar | `wxEVT_TAB_SEL_CHANGING` then `wxEVT_TAB_SEL_CHANGED` (plain `wxCommandEvent`) | tab ctrl id/object; CHANGING carries the old index | `SelectItem(i)` emits both when `i` changes | on the ctrl or an ancestor; cannot veto | | `Button` | `wxButton` | `wxEVT_BUTTON` | button id/object | — | on the button or an ancestor | @@ -815,9 +817,10 @@ two arrow `Button`s with key-repeat; `SetValue/GetValue/SetRange/SetStep`. ### CheckBox and SwitchButton -`::CheckBox` (ctor `CheckBox(parent, id = wxID_ANY)`, no label — pair it with a `wxStaticText`/`Label`, as -`CloneDialog` does) and `SwitchButton` are `wxBitmapToggleButton`s. They emit `wxEVT_TOGGLEBUTTON`, never -`wxEVT_CHECKBOX`; `SetValue` sends nothing. The half state is drawn only (`SetHalfChecked`/`IsHalfChecked`); any click +`::CheckBox` (ctor `CheckBox(parent, id = wxID_ANY)`, no label — when the label is on the right side of the check +box and belongs to it, use `LabeledCheckBox`, `references/orca-widgets.md §LabeledCheckBox`) and `SwitchButton` are +`wxBitmapToggleButton`s. They emit `wxEVT_TOGGLEBUTTON`, never `wxEVT_CHECKBOX`; `SetValue` sends nothing. The half +state is drawn only (`SetHalfChecked`/`IsHalfChecked`); any click clears it via the widget's own `wxEVT_TOGGLEBUTTON` handler (bound in the constructor), which also swaps the on/off bitmap. Handlers bound later on the same widget run first, so they must `Skip()`, or the bitmap keeps showing the old state and the half state is never cleared (`PreferencesDialog::create_item_bambu_cloud` marks this with "let diff --git a/.claude/skills/orca-wxwidgets/references/events.md b/.claude/skills/orca-wxwidgets/references/events.md index 98944c9646..f98c21220e 100644 --- a/.claude/skills/orca-wxwidgets/references/events.md +++ b/.claude/skills/orca-wxwidgets/references/events.md @@ -941,6 +941,10 @@ The per-widget table (event types, ids and event objects, which setters emit, wh constructor (clears the half state, refreshes the bitmap, Skips); `TextInput`'s handlers on the inner control run `OnEdit` and the re-dispatch. A user handler bound on the widget (or on `GetTextCtrl()`) for those events must `Skip()`. Capture-lost handling: `references/mouse-keyboard-focus.md`. +- **`LabeledCheckBox` re-emits.** It consumes its inner check's `wxEVT_TOGGLEBUTTON` and sends `wxEVT_CHECKBOX`, then + `wxEVT_TOGGLEBUTTON`, from itself (own id and object), for label clicks too. It has no handler of its own for the + two, so a handler bound on it needs no `Skip()` — but one bound to both runs twice + (`references/orca-widgets.md §LabeledCheckBox`). - **`EVT_ENABLE_CHANGED`** (`StateHandler.hpp`, a `wxCommandEvent` with id 0) comes from the `Enable` overrides of `Button`, `SpinInput`, `RadioGroup` and the other `StateHandler` widgets. `StateHandler` Skips it, so it propagates to ancestors like any command event. diff --git a/.claude/skills/orca-wxwidgets/references/orca-widgets.md b/.claude/skills/orca-wxwidgets/references/orca-widgets.md index 0efc91fb0a..b52cf90a3d 100644 --- a/.claude/skills/orca-wxwidgets/references/orca-widgets.md +++ b/.claude/skills/orca-wxwidgets/references/orca-widgets.md @@ -12,7 +12,8 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists) [Namespaces](#namespaces-and-the-checkbox-clash) · [Catalog](#catalog) · [Event semantics](#event-semantics) · [Custom vs raw](#custom-vs-raw) · [Shared lifecycle rules](#shared-lifecycle-rules) · [Button](#button) · [DialogButtons](#dialogbuttons) · [Label and HyperLink](#label-and-hyperlink) · [CheckBox](#checkbox-and-radiobox) · -[SwitchButton family](#switchbutton-family) · [RadioGroup](#radiogroup) · [TextInput](#textinput) · +[LabeledCheckBox](#labeledcheckbox) · [SwitchButton family](#switchbutton-family) · [RadioGroup](#radiogroup) · +[TextInput](#textinput) · [ComboBox and DropDown](#combobox-and-dropdown) · [SpinInput](#spininput-and-tempinput) · [Tab systems](#tab-systems) · [StaticBox, LabeledStaticBox, StaticLine](#staticbox-labeledstaticbox-staticline) · [ProgressBar](#progressbar) · [ScrolledWindow](#scrolledwindow) · [PopupWindow](#popupwindow) · @@ -21,9 +22,9 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists) ## Rules -1. Interactive controls in new or modified UI are Orca widgets (`Button`, `::CheckBox`, `::ComboBox`, `::TextInput`, - `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); never `wxButton`, `wxSpinCtrl`, `wxCheckBox`, `wxChoice` or - a single-line `wxTextCtrl` in new code. → §Custom vs raw +1. Interactive controls in new or modified UI are Orca widgets (`Button`, `::CheckBox`, `LabeledCheckBox`, + `::ComboBox`, `::TextInput`, `SpinInput`, `SwitchButton`, `RadioGroup`, `TabCtrl`); never `wxButton`, `wxSpinCtrl`, + `wxCheckBox`, `wxChoice` or a single-line `wxTextCtrl` in new code. → §Custom vs raw 2. Every dialog's bottom button row is `DialogButtons`. → §DialogButtons 3. Inside `namespace Slic3r::GUI` write `::CheckBox`, `::TextInput`, `::ComboBox` (also in `dynamic_cast` and forward declarations, which go at global scope). → §Namespaces @@ -38,7 +39,8 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists) 7. Know which setters emit: `RadioGroup::SetSelection`, `MultiSwitchButton::SetSelection`, `TabCtrl::SelectItem`, `Notebook::SetSelection`, an editable `ComboBox::SetSelection` (as `wxEVT_TEXT`) and `SpinInput::SetValue` (as `wxEVT_TEXT` + `EVT_SPINCTRL_TEXT`) do. → §Event semantics -8. `::CheckBox` and `SwitchButton` emit `wxEVT_TOGGLEBUTTON`, never `wxEVT_CHECKBOX`. → §CheckBox and RadioBox +8. `::CheckBox` and `SwitchButton` emit `wxEVT_TOGGLEBUTTON`, never `wxEVT_CHECKBOX`; `LabeledCheckBox` sends both + from itself. → §CheckBox and RadioBox, §LabeledCheckBox 9. Set a container's background colour before creating widgets in it. → §Shared lifecycle rules 10. Enable/disable custom widgets individually; disabling an ancestor leaves them painted enabled (`::CheckBox`, a native button, greys with it). → §Shared lifecycle rules @@ -61,6 +63,9 @@ Contents: [Rules](#rules) · [Why the library exists](#why-the-library-exists) → §StaticBox, LabeledStaticBox, StaticLine 21. Links are `HyperLink`, or a `Label` given `LB_HYPERLINK` through `SetWindowStyleFlag` (the constructor ignores it). → §Label and HyperLink +22. When the label is on the right side of the check box and belongs to it, use a `LabeledCheckBox`, not a + `::CheckBox` paired with a label by hand. Bind **one** of its two events; change its label, font and wrap through + the control; read its enabled state through a `LabeledCheckBox*`. → §LabeledCheckBox ## Why the library exists @@ -134,6 +139,7 @@ class, which is not a `wxWindow`. `TextCtrl` also names the MSW `wxTextCtrl` sub | `Label` | `wxStaticText` | `wxStaticText` | `Label(parent, text = "", style = 0, size)` (font `Body_14`), `Label(parent, font, text, style, size)` | `LB_AUTO_WRAP`, `LB_PROPAGATE_MOUSE_EVENT`, `LB_HYPERLINK` (via `SetWindowStyleFlag`); hosts the font table. §Label | | `HyperLink` (`Slic3r::GUI`) | `wxHyperlinkCtrl` | `wxStaticText` | `HyperLink(parent, label = "", url = "", style = 0)` | opens `url` with `wxLaunchDefaultBrowser` on left-down. §Label | | `::CheckBox` | `wxCheckBox` | `wxBitmapToggleButton` | `CheckBox(parent, id = wxID_ANY)` — **no label** | emits `wxEVT_TOGGLEBUTTON`; `SetHalfChecked`; `Rescale()`. §CheckBox | +| `LabeledCheckBox` | `wxCheckBox` with a label, a `::CheckBox` paired with its own label on the right side | `wxPanel` | `LabeledCheckBox(parent, label = "", id = wxID_ANY)` | clickable label with focus frame; emits `wxEVT_CHECKBOX` **and** `wxEVT_TOGGLEBUTTON`; `Wrap(width)`/`AutoWrap()`; `GetLabelCtrl()`; `Rescale()`. §LabeledCheckBox | | `SwitchButton` | on/off `wxCheckBox`, `wxToggleButton` | `wxBitmapToggleButton` | `SwitchButton(parent = nullptr, id = wxID_ANY)` | `SetLabels(on, off)`; track/thumb/text `StateColor`s; emits `wxEVT_TOGGLEBUTTON`. §SwitchButton family | | `MultiSwitchButton` | segmented `wxRadioBox` | `StaticBox` | `MultiSwitchButton(parent, id, pos, size, style)` | emits `wxCUSTOMEVT_MULTISWITCH_SELECTION`, also from `SetSelection`. §SwitchButton family | | `RadioGroup` | `wxRadioBox`, `wxRadioButton` rows | `wxPanel` | `RadioGroup(parent, std::vector labels, wxHORIZONTAL/wxVERTICAL, row_col_limit = -1)` | emits `wxEVT_RADIOBOX` from **every** `SetSelection`. §RadioGroup | @@ -164,6 +170,7 @@ Field classes (`Field.cpp`) build their editors from these widgets (`TextCtrl` |---|---|---|---|---| | `Button` | `wxEVT_BUTTON` (on release inside, Space/Enter) | button id / button | `SetValue(bool)` (Checked look) silent | on the button (Rule 6) | | `::CheckBox`, `SwitchButton` | `wxEVT_TOGGLEBUTTON` | native id / widget | `SetValue`, `SetHalfChecked` silent (`interface/wx/tglbtn.h:98`) | on the widget; never `wxEVT_CHECKBOX` | +| `LabeledCheckBox` | `wxEVT_CHECKBOX`, then `wxEVT_TOGGLEBUTTON` (int = new value), also from a label click | control id / control | `SetValue`, `SetHalfChecked` silent | on the control, **one** of the two; no `Skip()` needed for the bitmap | | `::ComboBox` | `wxEVT_COMBOBOX` (int = index, string = text) from popup pick, arrow keys (read-only combo), `SelectAndNotify`; `wxEVT_COMBOBOX_DROPDOWN`/`_CLOSEUP` | COMBOBOX: combo's auto id / combo; DROPDOWN/CLOSEUP: **id 0, no object** | `SetSelection`, `SetValue` silent for COMBOBOX; editable or `CB_NO_TEXT`: they send `wxEVT_TEXT` | on the combo | | `::TextInput` | inner `wxEVT_TEXT` (propagates); `wxEVT_TEXT_ENTER`, `wxEVT_KILL_FOCUS` re-sent to the wrapper only | TEXT: **inner** id/object; ENTER/KILL_FOCUS: wrapper id, inner object | `GetTextCtrl()->SetValue` sends `wxEVT_TEXT`; `ChangeValue` silent | TEXT: wrapper, inner, or ancestor by type; ENTER/KILL_FOCUS: wrapper or inner | | `SpinInput` | `wxEVT_SPINCTRL` (a plain `wxCommandEvent`, no int) on commit; `EVT_SPINCTRL_TEXT` (int + string) per parseable keystroke; inner `wxEVT_TEXT` | spinner id / spinner | `SetValue` sends `EVT_SPINCTRL_TEXT` + `wxEVT_TEXT`, no `wxEVT_SPINCTRL` | on the spinner; handler takes `wxCommandEvent&` | @@ -221,7 +228,9 @@ No Orca replacement exists — use raw wx (`references/controls-dataview.md`) fo **Background snapshot.** `StaticBox::Create`, `Label`, `SwitchButton` (through `StaticBox::GetParentBackgroundColor`: a parent `StaticBox`'s default fill — the midpoint for a gradient — else `parent->GetBackgroundColour()`), and -`::CheckBox`, `RadioGroup` (`parent->GetBackgroundColour()`) copy the parent's background colour at construction; +`::CheckBox`, `RadioGroup` (`parent->GetBackgroundColour()`) copy the parent's background colour at construction, and +so does `LabeledCheckBox` (`GetParentBackground` in `LabeledCheckBox.cpp`: the parent's colour, or under a scrolled +window the colour of that window's child on the parent chain); wx itself never inherits a background colour ([source] `src/common/wincmn.cpp:1543-1552`). - **Rule:** Set the container's background before creating widgets in it. ```cpp @@ -242,7 +251,8 @@ its disabled bitmap (`src/msw/window.cpp:576-593`, `src/msw/anybutton.cpp:846-87 button image draws a greyed copy of the current bitmap while `!IsEnabled()` (`src/gtk/image_gtk.cpp:37-42`), though the disabled bitmap itself needs `IsThisEnabled()` false (`src/gtk/anybutton.cpp:140-146`); macOS sends `setEnabled:NO` (`src/osx/cocoa/window.mm:3784-3791`) and AppKit dims the image (`NSButtonCell` -`imageDimsWhenDisabled`, default YES). +`imageDimsWhenDisabled`, default YES). A `LabeledCheckBox` is half of each: its inner check greys with the parent, its +label keeps the enabled colour, which only `LabeledCheckBox::Enable` changes. - **Rule:** Enable/disable each custom widget directly (`RadioGroup::Enable` does this for its own buttons). ```cpp m_options_panel->Enable(on); // Wrong: widgets keep the enabled look @@ -251,8 +261,8 @@ the disabled bitmap itself needs `IsThisEnabled()` false (`src/gtk/anybutton.cpp ``` **DPI.** Widgets size themselves from `FromDIP` values and cached bitmaps; after a DPI change the owning -`DPIDialog::on_dpi_changed` must call `Rescale()` on each (`Button`, `::CheckBox`, `::TextInput`, `::ComboBox` -(also rescales its `DropDown`), `SpinInput`, `SwitchButton`, `MultiSwitchButton`, `TabCtrl`, `StaticLine`, +`DPIDialog::on_dpi_changed` must call `Rescale()` on each (`Button`, `::CheckBox`, `LabeledCheckBox`, `::TextInput`, +`::ComboBox` (also rescales its `DropDown`), `SpinInput`, `SwitchButton`, `MultiSwitchButton`, `TabCtrl`, `StaticLine`, `ModeSwitchButton`). Exceptions: `RadioGroup`, `Label`, `HyperLink` and `LabeledStaticBox` (its scale is fixed in `Create()`) have no `Rescale()`; `ProgressBar::Rescale()` is empty; `DialogButtons` rescales itself. Pass sizes through `FromDIP` (`references/dpi-bitmaps-fonts.md`). @@ -276,7 +286,8 @@ it re-reads colours, e.g. `SwitchButton`), and keep `UpdateDlgDarkUI(this)` as t a label, font, icon, style or DPI changes, and the bitmap toggles (`::CheckBox`, `SwitchButton`) size themselves to their bitmap in `Rescale()`. Nothing re-lays out the parent: call `Layout()` on the container after changing a widget's content at runtime -(`references/sizers-layout.md`). +(`references/sizers-layout.md`). `LabeledCheckBox` is the exception: its setters re-fit it and send the parent a size +event (§LabeledCheckBox). **Mouse capture.** `Button`, `DropDown`, `SpinInput`'s arrows, `ModeSwitchButton`, `MyScrollbar`, `StepCtrl` and the device-page `SideButton`, `ImageSwitchButton` and `AxisCtrlButton` capture the mouse while pressed; a capture leak @@ -461,8 +472,10 @@ Pitfalls: ## CheckBox and RadioBox `::CheckBox` (`Widgets/CheckBox.cpp`) is a `wxBitmapToggleButton` (`wxBORDER_NONE`) showing 18 px SVGs -`check_{on,half,off}`, `…_disabled`, `…_focused`. It has **no label**: pair it with a `wxStaticText`/`Label` -(as `CloneDialog::CloneDialog` does). `GetValue()` is a 2-state `bool`. +`check_{on,half,off}`, `…_disabled`, `…_focused`. It has **no label**: when the label is on the right side of the +check box and belongs to it, use a `LabeledCheckBox` (§LabeledCheckBox); pair a bare `::CheckBox` with a +`wxStaticText`/`Label` only where the label sits elsewhere, such as on the left side in the label column of a form +row (as `CloneDialog::CloneDialog` does). `GetValue()` is a 2-state `bool`. - Emits `wxEVT_TOGGLEBUTTON` on click (native). `SetValue` emits nothing (`interface/wx/tglbtn.h:98`). - `SetHalfChecked(true)` is a drawn-only third state (`IsHalfChecked()` exists for the inspector only); the widget's own toggle handler clears it on any click. `SetValue` does **not** clear it — call `SetHalfChecked(false)` before showing a definite @@ -488,6 +501,94 @@ Pitfalls: cb->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& e) { e.Skip(); apply(); }); // Right ``` +## LabeledCheckBox + +`LabeledCheckBox` (`Widgets/LabeledCheckBox.cpp`, global namespace) is the check box with its own label on the +right side: a `wxPanel` holding a `::CheckBox` and, to its right, a `StaticBox` frame around a `Label`. The label +must belong to the check box, that is, name the option the box switches. Other text that only shares the row (a +value, a unit, a link, the label of the next control) is not its label, however close it sits, and stays a separate +window. The control has no other label position: a label on the left side or in a separate column stays a +`::CheckBox` paired with a label (§CheckBox and RadioBox). Constructor +`LabeledCheckBox(parent, label = "", id = wxID_ANY)`; font `Body_14`, label colour `#363636` (dark-mapped at +construction). An empty label hides the frame and leaves the bare check. + +- **Value.** `SetValue(bool)`, `GetValue()`/`IsChecked()`, `SetHalfChecked(bool = true)`. The half state is + `::CheckBox`'s: drawn only, cleared by any user toggle, not by `SetValue`. No setter emits. +- **Events.** A user toggle — a click on the check, Space on the focused check, a left click on the label or its + frame — sends `wxEVT_CHECKBOX` and then `wxEVT_TOGGLEBUTTON` from the control (`LabeledCheckBox::OnToggled`): the + control's current id (so `SetId()` after construction works), the control as event object, `IsChecked()`/`GetInt()` + = the new value. A double click on the label toggles twice (its second click arrives as `wxEVT_LEFT_DCLICK`). The + inner check's own `wxEVT_TOGGLEBUTTON` is consumed, so an ancestor bound by type gets one event of each type per + toggle. The control has no handler of its own for the two events: a handler bound on it needs no `Skip()` to keep + the bitmap right; `Skip()` only lets ancestors see the event. For a label click both events are sent from inside + the label's `wxEVT_LEFT_DOWN` handler, so a handler that opens a modal dialog defers it with `CallAfter` + (`references/windows-dialogs.md` rule 19). +- **Focus.** The inner check holds the keyboard focus; frame and label never take it, and a label click moves the + focus to the check. `HasFocus()` reports the check's focus. The frame's border is the focus indicator + (`LabeledCheckBox::ShowFocus`): `#009688` when focused, the background colour otherwise. +- **Hover.** While the pointer is on the label or its frame, the check shows its hover bitmap + (`LabeledCheckBox::ShowHover`). +- **Enable.** `Enable(bool)` disables the inner check and greys the label (`#6B6A6A`, dark-mapped); the panel itself + stays enabled. `IsEnabled()` is a non-virtual shadow that returns the check's state. A disabled control ignores + label clicks. +- **Setters go through the control.** `SetLabel`, `SetFont`, `Wrap`, `AutoWrap` and `Rescale` update the label, + re-fit the control (`Fit()`) and send the parent a size event (`LabeledCheckBox::Relayout`), so a sizer-managed + parent lays out again; a top-level window is not re-fitted. `SetForegroundColour` sets the enabled label colour, + `SetBackgroundColour` reaches check, frame and label, and a tooltip set on the control is copied to all three + (`DoSetToolTip`). `GetLabelCtrl()` returns the inner `Label`. +- **Wrapping** is `Label::Wrap` on the stored text. `Wrap(width)` wraps the text to `width` px minus the check and + the padding, so the whole control fits `width`; `width <= 0` unwraps. `AutoWrap(true)` re-wraps to the width the + control is given on every `wxEVT_SIZE`, so it needs a sizer item that gives it a width (`wxEXPAND` in a vertical + sizer, or a proportion) inside a container whose width comes from elsewhere: until the first layout the control + reports its unwrapped width. Each of the two calls cancels the other mode. With a wrapped label the check stays + centred on the first text line. +- **Metrics.** The padding around the text is `FromDIP(wxSize(5, 2))`, the padding of `RadioGroup`'s label buttons + (`RadioGroup::Create`), and both icons are 18 px: a `LabeledCheckBox` and a `RadioGroup` added with the same left + border line up icon under icon and text under text. Unlike `RadioGroup`, which puts `FromDIP(4)` above and below + each row, the control adds no outer margin; row spacing is the sizer's. +- **DPI.** `Rescale()` rescales the check and re-fits; call it from `on_dpi_changed`. +- **[source] Bitmap states on MSW.** Setting the normal bitmap of a bitmap button (`SetBitmapLabel`) deletes the + button's image data, so the bitmaps set for the other states are gone and their getters (`GetBitmapCurrent()`, …) + return a null bitmap until they are set again (`src/msw/anybutton.cpp:770-783`, `:785-796`); a null normal bitmap + then removes the image without a refresh (`:797-812`). wxGTK keeps one bitmap per state + (`src/gtk/anybutton.cpp:198-201`, `:391`). `LabeledCheckBox::ShowHover` shows the hover art by copying the check's + hover bitmap into its normal state, and therefore lets `::CheckBox` set all its bitmaps again first. + +Pitfalls: +- **Rule:** When the label is on the right side of the check box and belongs to it, use one `LabeledCheckBox`; + don't pair a `::CheckBox` with a `wxStaticText`/`Label` and forward the label's clicks by hand. + **Why:** the hand-made pair needs its own sizer, label styling, click and double-click forwarding, disabled + colour and tooltip on both windows, and still shows no focus frame on the label. + ```cpp + auto* cb = new ::CheckBox(this); // Wrong: two windows wired by hand + auto* lbl = new wxStaticText(this, wxID_ANY, _L("Don't show again")); + lbl->Bind(wxEVT_LEFT_DOWN, [cb](wxMouseEvent&) { cb->SetValue(!cb->GetValue()); /* + send the event */ }); + auto* cb = new LabeledCheckBox(this, _L("Don't show again")); // Right + ``` +- **Rule:** Bind **one** of the two events. + **Why:** both are sent for every toggle, so that a handler written for a `wxCheckBox` (`wxEVT_CHECKBOX`) or for a + `::CheckBox` (`wxEVT_TOGGLEBUTTON`) keeps working when the control replaces either; a handler bound to both runs + twice. + ```cpp + cb->Bind(wxEVT_CHECKBOX, h); cb->Bind(wxEVT_TOGGLEBUTTON, h); // Wrong: h runs twice + cb->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent& e) { apply(e.IsChecked()); e.Skip(); }); // Right + ``` +- **Rule:** Change the label, font and wrap through the control, not through `GetLabelCtrl()`. + **Why:** only the control's own setters re-wrap, re-fit and notify the parent. + ```cpp + cb->GetLabelCtrl()->SetLabel(text); // Wrong: the control keeps its old size and wrap + cb->SetLabel(text); // Right + ``` +- **Rule:** Read the enabled state through a `LabeledCheckBox*`. + **Why:** `Enable()` is virtual and works through any pointer, but `IsEnabled()` is not: through a `wxWindow*` it + reports the panel, which stays enabled (`src/common/wincmn.cpp:1142-1145`). The rule of §Shared lifecycle rules + holds too: disabling an ancestor greys the inner check but not the label — call the control's `Enable()`. + ```cpp + wxWindow* w = cb; cb->Enable(false); + if (w->IsEnabled()) { /* Wrong: still true */ } + if (cb->IsEnabled()) { /* Right: false */ } + ``` + ## SwitchButton family All in `Widgets/SwitchButton.hpp/.cpp`: diff --git a/.claude/skills/orca-wxwidgets/references/sizers-layout.md b/.claude/skills/orca-wxwidgets/references/sizers-layout.md index 8f58cac3c8..16b68a3ddf 100644 --- a/.claude/skills/orca-wxwidgets/references/sizers-layout.md +++ b/.claude/skills/orca-wxwidgets/references/sizers-layout.md @@ -636,7 +636,9 @@ single-line `wxST_ELLIPSIZE_END` labels; other modes are generic (`src/msw/statt - the label needs a real width: a ctor size `wxSize(FromDIP(w), -1)`, min = max width, or `wxEXPAND` in a vertical sizer whose container width is fixed; - `Label::split_lines(dc, width, text, out, max_count)` exposes the same wrapper for owner-drawn text. -Orca's wrapping is preferred over `wxST_WRAP` for CJK text. +Orca's wrapping is preferred over `wxST_WRAP` for CJK text. A check box label wraps through +`LabeledCheckBox::Wrap(width)`/`AutoWrap()`, which also re-fit the control (`references/orca-widgets.md +§LabeledCheckBox`). **Pitfalls** - **Rule:** Re-wrapping after `SetLabel` must defeat the wrap cache. diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 3fb204ef42..3f6543f88f 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -291,7 +291,9 @@ jobs: path: test-results # Best-effort: a read-only token (e.g. fork PRs) can't write the check, so # don't let a publish failure fail the run. The test jobs gate correctness. + # Skipped when every build failed: there is nothing to publish. - name: Publish Test Results + if: ${{ hashFiles('test-results/**/*.xml') != '' }} continue-on-error: true uses: EnricoMi/publish-unit-test-result-action@v2 with: diff --git a/.github/workflows/build_optional.yml b/.github/workflows/build_optional.yml index fa2f356999..3e4c1391fc 100644 --- a/.github/workflows/build_optional.yml +++ b/.github/workflows/build_optional.yml @@ -17,12 +17,14 @@ # listed instead. The macOS and the cl.exe builds never start on their own: # what breaks only cl comes from source changes, which no path rule can see. # -# Each label added starts a run of its own, and the pull request's checks show -# the newest run only, so every run builds everything the labels and the -# changed files ask for. Each build keeps its own concurrency group: the newest -# run's build cancels the one an earlier run of the commit started, and a push -# cancels the builds of the commit it replaces. cancel_closed_pr_builds.yml -# joins the groups by name, so update that file with any change here. +# Each build-* or macos-priority label added starts a run of its own, and the +# pull request's checks show the newest run only, so every run builds +# everything the labels and the changed files ask for; any other label builds +# nothing. Each build keeps its own concurrency group: a build entering its +# group cancels the one already in it, so when two runs start together the +# last to enter wins, not necessarily the newest run. A push cancels the +# builds of the commit it replaces. cancel_closed_pr_builds.yml joins the +# groups by name, so update that file with any change here. name: Optional builds on: @@ -60,6 +62,9 @@ on: jobs: select: name: Select builds + # A label that asks for no build must not restart the builds in progress. + # macos-priority restarts them, to move the macOS build to its own line. + if: ${{ github.event.action != 'labeled' || startsWith(github.event.label.name, 'build-') || github.event.label.name == 'macos-priority' }} runs-on: ubuntu-24.04 outputs: flatpak: ${{ steps.select.outputs.flatpak }} @@ -186,7 +191,9 @@ jobs: publish_test_results: name: Publish Test Results needs: [flatpak, unit_tests_windows_arm64] - if: ${{ !cancelled() && (needs.flatpak.result != 'skipped' || needs.unit_tests_windows_arm64.result != 'skipped') }} + # Concurrency cancels the builds of a superseded run, not the run, so + # !cancelled() alone would still publish for it. + if: ${{ !cancelled() && (contains(fromJSON('["success", "failure"]'), needs.flatpak.result) || contains(fromJSON('["success", "failure"]'), needs.unit_tests_windows_arm64.result)) }} runs-on: ubuntu-latest steps: - name: Download Test Results @@ -196,7 +203,10 @@ jobs: path: test-results # Best-effort, as in build_all.yml: a read-only token (e.g. fork PRs) # can't write the check. The test jobs gate correctness. + # A build that failed runs no tests; publishing nothing would post an + # empty result. - name: Publish Test Results + if: ${{ hashFiles('test-results/**/*.xml') != '' }} continue-on-error: true uses: EnricoMi/publish-unit-test-result-action@v2 with: diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index 2b567c1f07..891e984983 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -529,6 +529,9 @@ jobs: "ORCA_SIGN_JSIGN=$jar" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 "ORCA_SIGN_CERTFILE=$cert" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 "ORCA_SIGN_KMS_KEY=$env:KMS_KEY" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 + # Names the certificate in the signed NSIS plugin cache key, so a new certificate re-signs them. + "cert-id=$((Get-FileHash -LiteralPath $cert -Algorithm SHA256).Hash.Substring(0, 16))" | + Out-File -Append -FilePath $env:GITHUB_OUTPUT -Encoding utf8 - name: Set up Java for code signing if: steps.codesign.outcome == 'success' @@ -569,14 +572,25 @@ jobs: token_format: access_token create_credentials_file: false + # The NSIS plugins change only with the NSIS version, so they are signed once per certificate and + # kept; the signing below skips files that are already signed. + - name: Restore signed NSIS plugins + id: nsis-plugins + if: steps.codesign.outcome == 'success' && !vars.SELF_HOSTED + uses: actions/cache/restore@v6 + with: + path: ${{ runner.temp }}/nsis/Plugins + key: nsis-plugins-signed-${{ env.NSIS_VERSION }}-${{ steps.codesign.outputs.cert-id }} + # Signs what the portable zip, the artifact and the MSIX package ship, the profile validator, - # and the NSIS plugins the installer carries. The installer build signs its own copy of the - # app, since cpack installs the files again. + # and the NSIS plugins the installer carries. cpack installs the app again for the installer; + # ORCA_SIGN_REUSE lets its signing hook copy these signed files instead of signing them again. - name: Sign Windows binaries if: steps.codesign.outcome == 'success' shell: pwsh env: ORCA_SIGN_TOKEN: ${{ steps.codesign_auth.outputs.access_token }} + ORCA_SIGN_REUSE: ${{ runner.temp }}/signed-files.json run: | $paths = @("$env:BUILD_DIR/OrcaSlicer") foreach ($extra in 'build/src/Release/OrcaSlicer_profile_validator.exe', "$env:RUNNER_TEMP/nsis/Plugins") { @@ -584,6 +598,13 @@ jobs: } ./scripts/sign_windows.ps1 -Path $paths + - name: Save signed NSIS plugins + if: steps.codesign.outcome == 'success' && !vars.SELF_HOSTED && steps.nsis-plugins.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: ${{ runner.temp }}/nsis/Plugins + key: nsis-plugins-signed-${{ env.NSIS_VERSION }}-${{ steps.codesign.outputs.cert-id }} + - name: Pack unit tests Win if: runner.os == 'Windows' && inputs.compiler == 'clang' working-directory: ${{ github.workspace }} @@ -603,15 +624,58 @@ jobs: # NSIS is x86-only; it runs (and the installer it emits runs) under ARM64's # x86 emulation, packaging the native arm64 payload from build-arm64. - - name: Create installer Win + # makensis compresses on one core and its signing hook waits on the network, so the installer + # builds in the background while the portable zip and the PDB archive are made; "Finish + # installer Win" waits for it. cpack installs its own copy of the app from the build tree, and + # the others only read build/OrcaSlicer and the PDBs. + - name: Start installer Win + id: start_installer if: runner.os == 'Windows' && !vars.SELF_HOSTED working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} # Read by scripts/sign_windows.ps1 when CMake wired signing into the installer. env: ORCA_SIGN_TOKEN: ${{ steps.codesign_auth.outputs.access_token }} + ORCA_SIGN_REUSE: ${{ runner.temp }}/signed-files.json + shell: pwsh run: | - cpack -G NSIS - if ($LASTEXITCODE -ne 0) { + $exit = Join-Path $env:RUNNER_TEMP 'cpack.exit' + $log = Join-Path $env:RUNNER_TEMP 'cpack.log' + # A hidden window of its own, writing its output to a file, holds none of this step's pipes, + # so the step ends without waiting for cpack. The exit code is written under another name + # and renamed, so the wait never reads half of it. + $cpack = Start-Process pwsh -WindowStyle Hidden -PassThru -ArgumentList '-NoProfile', '-Command', + "cpack -G NSIS *> '$log'; Set-Content '$exit.tmp' `$LASTEXITCODE; Move-Item '$exit.tmp' '$exit'" + Set-Content (Join-Path $env:RUNNER_TEMP 'cpack.pid') $cpack.Id + + - name: Pack app + if: runner.os == 'Windows' + working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} + shell: cmd + run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable.zip ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer' + + - name: Pack PDB + if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED + working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}/src/Release + shell: cmd + run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb' + + # Also after a failed pack step, so cpack's log is still shown. + - name: Finish installer Win + if: ${{ !cancelled() && steps.start_installer.outcome == 'success' }} + working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} + timeout-minutes: 30 + shell: pwsh + run: | + $exit = Join-Path $env:RUNNER_TEMP 'cpack.exit' + $cpackId = Get-Content (Join-Path $env:RUNNER_TEMP 'cpack.pid') + while (-not (Test-Path $exit)) { + if (-not (Get-Process -Id $cpackId -ErrorAction SilentlyContinue) -and -not (Test-Path $exit)) { + throw 'cpack stopped without leaving an exit code.' + } + Start-Sleep -Seconds 5 + } + Get-Content (Join-Path $env:RUNNER_TEMP 'cpack.log') + if ((Get-Content $exit) -ne '0') { # makensis writes its errors, and the signing hook's output, only to this log. Get-Content _CPack_Packages/*/NSIS/NSISOutput.log -Tail 80 exit 1 @@ -638,18 +702,6 @@ jobs: } ./scripts/sign_windows.ps1 -Verify -Path $paths - - name: Pack app - if: runner.os == 'Windows' - working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }} - shell: cmd - run: '"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}${{ env.ARCH_SUFFIX }}_portable.zip ${{ github.workspace }}/${{ env.BUILD_DIR }}/OrcaSlicer' - - - name: Pack PDB - if: runner.os == 'Windows' && inputs.arch != 'arm64' && !vars.SELF_HOSTED - working-directory: ${{ github.workspace }}/${{ env.BUILD_DIR }}/src/Release - shell: cmd - run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb' - - name: Upload artifacts Win zip if: runner.os == 'Windows' uses: actions/upload-artifact@v7 @@ -748,7 +800,8 @@ jobs: run: | # Build + tar the unit tests (-t) on both Linux legs so each arch # (x86_64 + aarch64) gets tested by its own unit_tests_linux_* job. - ./build_linux.sh -istrlL + # -P ships the system preset caches into the package before the AppImage is packed from it. + ./build_linux.sh -istrlLP ./scripts/check_appimage_libs.sh ./build/package ./build/package/bin/orca-slicer appimage=./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}${{ env.arch_suffix }}_${{ env.ver }}.AppImage mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage "$appimage" @@ -768,23 +821,6 @@ jobs: retention-days: 5 if-no-files-found: error - - name: Build system preset cache (Linux) - if: runner.os == 'Linux' - shell: bash - run: | - # Both were packed from resources/ before the caches existed, so the - # AppImage is unpacked first and the caches shipped into it and into - # the package tree; the source tree keeps its JSONs for later steps. - appimage=$(find build -maxdepth 1 -name "OrcaSlicer_Linux_AppImage*.AppImage" | head -1) - chmod +x "$appimage" - "$appimage" --appimage-extract - ./scripts/build_preset_cache.sh -b build build/package/resources/profiles squashfs-root/resources/profiles - # The runtime extracts every directory as 0700, and appimagetool (continuous - # build 333 onwards) refuses to pack a tree other users cannot read. - chmod -R a+rX squashfs-root - appimagetool=$(find build -name "appimagetool.AppImage" | head -1) - ARCH=$(uname -m) "$appimagetool" --appimage-extract-and-run squashfs-root "$appimage" - rm -rf squashfs-root # Ship the freshly-built validator so slice_check_linux (build_all.yml) # can slice-sweep the shipped profiles with this PR's engine. Taken from # the aarch64 leg so the sweep also exercises the arm build; x86_64 on @@ -833,8 +869,8 @@ jobs: path: './build/src/Release/OrcaSlicer_profile_validator' # generate_system_cache is what scripts/build_preset_cache.sh bakes the - # .opc caches with; it was already built by the "Build system - # preset cache (Linux)" step above. The .opc format is 64-bit + # .opc caches with; build_linux.sh -P already built it to ship the + # caches in the package. The .opc format is 64-bit # little-endian native, i.e. identical across every platform Orca ships, # so only the Linux binary is published. - name: Upload generate_system_cache Ubuntu diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b4e6ba27a7..9d75d85845 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -10,35 +10,42 @@ permissions: issues: write pull-requests: write +# Overlapping runs would overwrite each other's saved progress. +concurrency: + group: stale + jobs: stale: runs-on: ubuntu-latest steps: - uses: actions/stale@v11 with: - # Each new stale label costs about 2 operations. Runs that stop early - # continue from the same place the next day. - operations-per-run: 300 + # Each stale label or close costs about 2 operations and posts one + # comment, so 800 stays under GitHub's limit of 500 comments an hour. + # Runs that stop early continue from the same place the next day. + operations-per-run: 800 ascending: true stale-issue-label: stale stale-pr-label: stale remove-stale-when-updated: true + # The last step mirrors the exempt and only-labels options below. + # Update its filters when they change. + # Issues days-before-issue-stale: 90 days-before-issue-close: 14 close-issue-reason: not_planned - exempt-issue-labels: enhancement exempt-all-issue-assignees: true exempt-all-issue-milestones: true stale-issue-message: | This issue has had no activity for 90 days, so it will be closed in 14 days. - If it still happens on the latest OrcaSlicer release, please leave a comment with the version you tested and it will stay open. + If it's a bug that still happens on the latest OrcaSlicer release, please leave a comment with the version you tested. If it's a feature request you still want, please leave a comment saying so. Either one keeps it open. close-issue-message: | This issue was closed because there was no activity after the reminder. - If it still happens on the latest release, leave a comment here and a team member can reopen it, or open a new issue with the details. + If it still matters to you, leave a comment here and a team member can reopen it, or open a new issue with the details. # PRs: only PRs where we asked the author for something only-pr-labels: "wait for response" @@ -51,8 +58,29 @@ jobs: stale-pr-message: | We asked for changes or more information on this PR, and there has been no activity for 90 days. It will be closed in 14 days. - To keep it open, leave a comment. If you push new commits, please also leave a short comment, because a push alone does not reset this. If you no longer have time for it, that is fine, just let us know. + To keep it open, leave a comment. If you push new commits, please also leave a short comment so we know it's ready for another look. If you no longer have time for it, that is fine, just let us know. close-pr-message: | This PR was closed because we did not hear back after the reminder. Thank you for the work you put into it. If you want to continue, push your changes and reopen it, or open a new PR. + + # The stale bot checks exemptions before activity, so it never comes back + # to a stale item that became exempt. Remove the label from those here. + - name: Remove stale labels the stale bot will not revisit + if: ${{ !cancelled() }} + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + { + gh issue list -R "$GITHUB_REPOSITORY" --label stale --state open --limit 5000 \ + --json number,assignees,milestone \ + --jq '.[] | select((.assignees | length > 0) or .milestone != null) | .number' + gh pr list -R "$GITHUB_REPOSITORY" --label stale --state open --limit 1000 \ + --json number,isDraft,assignees,milestone,labels \ + --jq '.[] | select(.isDraft or (.assignees | length > 0) or .milestone != null + or ([.labels[].name] | index("wait for response") | not)) | .number' + } | while read -r n; do + gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$n/labels/stale" --silent < /dev/null || + echo "::warning::Could not remove the stale label from #$n" + done diff --git a/.github/workflows/unstale-on-comment.yml b/.github/workflows/unstale-on-comment.yml new file mode 100644 index 0000000000..3c64c3e7b2 --- /dev/null +++ b/.github/workflows/unstale-on-comment.yml @@ -0,0 +1,36 @@ +name: Remove stale label on comment + +# stale.yml only removes the label when its daily run gets back to an item, +# which can take a few days. This removes it as soon as someone comments. +on: + issue_comment: + types: [created] + +permissions: + issues: write + pull-requests: write + +jobs: + unstale: + if: >- + github.repository == 'OrcaSlicer/OrcaSlicer' && + github.event.issue.state == 'open' && + github.event.comment.user.type == 'User' && + contains(github.event.issue.labels.*.name, 'stale') + runs-on: ubuntu-latest + steps: + - name: Remove the stale label + env: + GH_TOKEN: ${{ github.token }} + NUMBER: ${{ github.event.issue.number }} + run: | + # "Close with comment" sends the event while the issue is still open. + state=$(gh api "repos/$GITHUB_REPOSITORY/issues/$NUMBER" --jq .state) + if [ "$state" != open ]; then + exit 0 + fi + # A 404 means another comment or the stale run already removed it. + if ! gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$NUMBER/labels/stale" --silent 2> err.txt; then + cat err.txt >&2 + grep -q "HTTP 404" err.txt + fi diff --git a/CMakeLists.txt b/CMakeLists.txt index a34fd2a9cd..a31ea9237e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -373,6 +373,11 @@ if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) # clang-cl can interpret SYSTEM header paths if -imsvc is used set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-imsvc") + + # Thin archives reference the objects instead of copying them; only lld-link reads them. + if (NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_AR MATCHES "llvm-lib" AND CMAKE_LINKER MATCHES "lld-link") + string(APPEND CMAKE_STATIC_LINKER_FLAGS " /llvmlibthin") + endif () else () set(IS_CLANG_CL FALSE) endif () diff --git a/build_linux.sh b/build_linux.sh index b4c03e52ec..484fbf7ccb 100755 --- a/build_linux.sh +++ b/build_linux.sh @@ -8,7 +8,7 @@ SCRIPT_PATH=$(dirname "$(readlink -f "${0}")") pushd "${SCRIPT_PATH}" > /dev/null function usage() { - echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-J N][-p][-r][-s][-t][-u][-l][-L] [-- CMAKE_ARGS...]" + echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-D][-e][-F][-g][-h][-i][-j N][-J N][-p][-P][-r][-s][-t][-u][-l][-L] [-- CMAKE_ARGS...]" echo " -1: limit builds to one core (where possible)" echo " -j N: limit builds to N cores (where possible)" echo " -J N: build up to N dependencies at a time, each still using -j jobs (default: 1)" @@ -23,6 +23,7 @@ function usage() { echo " -h: prints this help text" echo " -i: build the Orca Slicer AppImage (optional)" echo " -p: disable precompiled headers (on by default): more ccache hits after header changes, slower misses" + echo " -P: ship the system preset caches in the package and AppImage, deleting the preset JSONs they replace (CI packaging)" echo " -r: skip RAM and disk checks (low RAM compiling)" echo " -s: build the Orca Slicer (optional)" echo " -t: build tests (optional), requires -s flag" @@ -47,7 +48,7 @@ unset name BUILD_DIR=build BUILD_CONFIG=Release FORWARDED_ARGS=() -while getopts ":1j:J:bcCdDeFghiprstulL" opt ; do +while getopts ":1j:J:bcCdDeFghipPrstulL" opt ; do case ${opt} in 1 ) export CMAKE_BUILD_PARALLEL_LEVEL=1 @@ -104,6 +105,10 @@ while getopts ":1j:J:bcCdDeFghiprstulL" opt ; do SLIC3R_PRECOMPILED_HEADERS="OFF" FORWARDED_ARGS+=("-p") ;; + P ) + SHIP_PRESET_CACHES="1" + FORWARDED_ARGS+=("-P") + ;; r ) SKIP_RAM_CHECK="1" FORWARDED_ARGS+=("-r") @@ -648,11 +653,14 @@ if [[ -n "${BUILD_IMAGE}" || -n "${BUILD_ORCA}" ]] ; then pushd $BUILD_DIR > /dev/null build_linux_image="./src/build_linux_image.sh" if [[ -e ${build_linux_image} ]] ; then - extra_script_args="" + extra_script_args=() if [[ -n "${BUILD_IMAGE}" ]] ; then - extra_script_args="-i" + extra_script_args+=("-i") fi - print_and_run ${build_linux_image} ${extra_script_args} -R "${BUILD_CONFIG}" + if [[ -n "${SHIP_PRESET_CACHES}" ]] ; then + extra_script_args+=("-c") + fi + print_and_run ${build_linux_image} "${extra_script_args[@]}" -R "${BUILD_CONFIG}" echo "done" fi diff --git a/cmake/modules/StagePythonRuntime.cmake b/cmake/modules/StagePythonRuntime.cmake new file mode 100644 index 0000000000..b48ef9a600 --- /dev/null +++ b/cmake/modules/StagePythonRuntime.cmake @@ -0,0 +1,32 @@ +# cmake -DSOURCE= -DDESTINATION= -DSTAMP= -P StagePythonRuntime.cmake +# Copies only when SOURCE's files or their times changed since the copy STAMP records. +foreach (_var SOURCE DESTINATION STAMP) + if (NOT DEFINED ${_var}) + message(FATAL_ERROR "StagePythonRuntime.cmake: ${_var} is not set") + endif () +endforeach () + +file(GLOB_RECURSE _files LIST_DIRECTORIES false RELATIVE "${SOURCE}" "${SOURCE}/*") +list(SORT _files) +set(_signature "${SOURCE}\n") +foreach (_file IN LISTS _files) + file(TIMESTAMP "${SOURCE}/${_file}" _time "%Y%m%d%H%M%S" UTC) + string(APPEND _signature "${_file} ${_time}\n") +endforeach () +string(SHA256 _signature "${_signature}") + +if (IS_DIRECTORY "${DESTINATION}" AND EXISTS "${STAMP}") + file(READ "${STAMP}" _copied) + if (_copied STREQUAL _signature) + return() + endif () +endif () + +file(REMOVE "${STAMP}") +file(REMOVE_RECURSE "${DESTINATION}") +execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${SOURCE}" "${DESTINATION}" + RESULT_VARIABLE _result) +if (NOT _result EQUAL 0) + message(FATAL_ERROR "Copying ${SOURCE} to ${DESTINATION} failed") +endif () +file(WRITE "${STAMP}" "${_signature}") diff --git a/deps/Boost/Boost.cmake b/deps/Boost/Boost.cmake index 1526928094..80d0620a41 100644 --- a/deps/Boost/Boost.cmake +++ b/deps/Boost/Boost.cmake @@ -43,6 +43,8 @@ orcaslicer_add_cmake_project(Boost URL "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz" URL_HASH SHA256=4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95 LIST_SEPARATOR | + # Lets Boost.Locale configure with CMake 4.5; see the script. + PATCH_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR= -P ${CMAKE_CURRENT_LIST_DIR}/fix_locale_source_group.cmake CMAKE_ARGS -DBOOST_EXCLUDE_LIBRARIES:STRING=contract|fiber|numpy|stacktrace|wave|test -DBOOST_LOCALE_ENABLE_ICU:BOOL=OFF # do not link to libicu, breaks compatibility between distros diff --git a/deps/Boost/fix_locale_source_group.cmake b/deps/Boost/fix_locale_source_group.cmake new file mode 100644 index 0000000000..56f9b401e8 --- /dev/null +++ b/deps/Boost/fix_locale_source_group.cmake @@ -0,0 +1,21 @@ +# Boost.Locale lists include/boost/locale.hpp in a source_group(TREE) rooted at include/boost/locale. +# Before 4.5, CMake compared the two as strings and accepted it. CMake 4.5 reworked source_group() and +# compares path components, so it stops the configure with "is not a prefix of file". locale.hpp gets its own group on the +# following line of that file, so only the headers under include/boost/locale/ go into the tree. +# +# Run as the PATCH_COMMAND with -DSOURCE_DIR=. A second run leaves the file as it is. +set(_file "${SOURCE_DIR}/libs/locale/CMakeLists.txt") +set(_old [[list(FILTER sources_inc EXCLUDE REGEX "^src/")]]) +set(_new [[list(FILTER sources_inc INCLUDE REGEX "^include/boost/locale/")]]) + +file(READ "${_file}" _content) +string(FIND "${_content}" "${_new}" _patched) +if (_patched EQUAL -1) + string(FIND "${_content}" "${_old}" _found) + if (_found EQUAL -1) + message(FATAL_ERROR "${_file} no longer has the line this script replaces. Check whether this Boost " + "version still needs deps/Boost/fix_locale_source_group.cmake.") + endif () + string(REPLACE "${_old}" "${_new}" _content "${_content}") + file(WRITE "${_file}" "${_content}") +endif () diff --git a/deps/EXPAT/EXPAT.cmake b/deps/EXPAT/EXPAT.cmake index 004318a51b..08a3c6668b 100644 --- a/deps/EXPAT/EXPAT.cmake +++ b/deps/EXPAT/EXPAT.cmake @@ -2,10 +2,18 @@ # the parser must not come from a distro or SDK copy that may predate it. # XML_DTD and XML_GE are passed explicitly: 2.4.0 gated the guard behind XML_DTD # and 2.6.0 behind XML_GE, so neither may be left to the default. +set(_expat_c_flags_line "") +if (MSVC) + # UTF-8 quotes in random_rand_s.c comments can swallow a preprocessor line + # when MSVC reads the source using the system's legacy code page. + set(_expat_c_flags_line "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} /utf-8") +endif () + orcaslicer_add_cmake_project(EXPAT URL https://github.com/libexpat/libexpat/releases/download/R_2_10_0/expat-2.10.0.tar.gz URL_HASH SHA256=5466a341f9c692ef7a958a6881311be597f8e1ce345984cf78414f54793dea4c CMAKE_ARGS + "${_expat_c_flags_line}" -DBUILD_SHARED_LIBS=OFF -DEXPAT_SHARED_LIBS=OFF -DEXPAT_DTD=ON diff --git a/deps/NanoSVG/NanoSVG.cmake b/deps/NanoSVG/NanoSVG.cmake deleted file mode 100644 index 5c833e3249..0000000000 --- a/deps/NanoSVG/NanoSVG.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# In PrusaSlicer 2.6.0 we switched from https://github.com/memononen/nanosvg to its fork https://github.com/fltk/nanosvg -# because this last implements the new function nsvgRasterizeXY() which we now use in GLTexture::load_from_svg() -# for rasterizing svg files from their original size to a squared power of two texture on Windows systems using -# AMD Radeon graphics cards - -orcaslicer_add_cmake_project(NanoSVG - DEPENDS dep_Boost - URL https://github.com/SoftFever/nanosvg/archive/863f6aa97ef62028126fa2c19bd4350394c2e15e.zip - URL_HASH SHA256=8d9c1624ad6518dd6dfa31e4f8dc7da9ec243d88bae595c7a037450617fec851 -) \ No newline at end of file diff --git a/deps/OCCT/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch b/deps/OCCT/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch deleted file mode 100644 index 84c599a5f3..0000000000 --- a/deps/OCCT/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx -index 6f63781..9b1c08e 100644 ---- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx -+++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx -@@ -210,10 +210,10 @@ private: - - // Define two pcurves of the seam-edge. - occ::handle aPC1, aPC2; -- double af, al; -+ double af, al, af1, al1; - - aE.Orientation(TopAbs_FORWARD); -- aPC1 = BRep_Tool::CurveOnSurface(aE, aF, af, al); -+ aPC1 = BRep_Tool::CurveOnSurface(aE, aF, af1, al1); - - aE.Orientation(TopAbs_REVERSED); - aPC2 = BRep_Tool::CurveOnSurface(aE, aF, af, al); -@@ -224,7 +224,9 @@ private: - } - - // Select the correct pcurve of the seam-edge. -- const gp_Pnt2d& aFPntOfPC1 = aPC1->Value(aPC1->FirstParameter()); -+ // Use the edge's first parameter. A Geom2d_Line's FirstParameter() is -Precision::Infinite(), -+ // where a direction of (2e-16, -1) from rounding error gives an X far outside the U range. -+ const gp_Pnt2d aFPntOfPC1 = aPC1->Value(af1); - - if (std::abs(aLPntOfIPC1.X() - aFPntOfPC1.X()) > Precision::Confusion()) - { diff --git a/deps/OCCT/0001-BRepMesh-seam-pcurve-selection.patch b/deps/OCCT/0001-BRepMesh-seam-pcurve-selection.patch new file mode 100644 index 0000000000..dc202d1827 --- /dev/null +++ b/deps/OCCT/0001-BRepMesh-seam-pcurve-selection.patch @@ -0,0 +1,25 @@ +diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx +index 6f63781..97a20d3 100644 +--- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx ++++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx +@@ -223,10 +223,16 @@ private: + return false; + } + +- // Select the correct pcurve of the seam-edge. +- const gp_Pnt2d& aFPntOfPC1 = aPC1->Value(aPC1->FirstParameter()); +- +- if (std::abs(aLPntOfIPC1.X() - aFPntOfPC1.X()) > Precision::Confusion()) ++ // Select the correct pcurve of the seam-edge: the one closer to the discrete pcurve. ++ // Both pcurves of a seam share the edge's range, so evaluate them at its start. A ++ // Geom2d_Line's FirstParameter() is -Precision::Infinite(), where a direction of (2e-16, -1) ++ // from rounding error gives an X far outside the U range. A Precision::Confusion() threshold ++ // fails too, because BRepMesh_ModelHealer has already moved the ends of the discrete pcurve ++ // onto those of the neighbouring edges, whose pcurves can end slightly past the seam. ++ const gp_Pnt2d aFPntOfPC1 = aPC1->Value(af); ++ const gp_Pnt2d aFPntOfPC2 = aPC2->Value(af); ++ ++ if (std::abs(aLPntOfIPC1.X() - aFPntOfPC1.X()) > std::abs(aLPntOfIPC1.X() - aFPntOfPC2.X())) + { + std::swap(aPC1, aPC2); + } diff --git a/deps/OCCT/0002-BRepGraph-MSVC-ARM64-ICE-workaround.patch b/deps/OCCT/0002-BRepGraph-MSVC-ARM64-ICE-workaround.patch new file mode 100644 index 0000000000..9b007cd57b --- /dev/null +++ b/deps/OCCT/0002-BRepGraph-MSVC-ARM64-ICE-workaround.patch @@ -0,0 +1,25 @@ +diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx +index 44e59b0..8833fed 100644 +--- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx ++++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx +@@ -21,6 +21,12 @@ + #include + #include + ++// MSVC 14.52 for ARM64 crashes with an internal compiler error (C1001) while ++// optimizing this file, so it is compiled without optimization there. ++#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64) ++ #pragma optimize("", off) ++#endif ++ + IMPLEMENT_STANDARD_RTTIEXT(BRepGraph_LayerTopoSupplement, BRepGraph_Layer) + + namespace +@@ -384,3 +390,7 @@ void BRepGraph_LayerTopoSupplement::removeOwner(const BRepGraph_NodeId theOwner) + myOwnerToUids.UnBind(theOwner); + touch(); + } ++ ++#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64) ++ #pragma optimize("", on) ++#endif diff --git a/deps/OCCT/OCCT.cmake b/deps/OCCT/OCCT.cmake index c0bd0e1608..fed828ad54 100644 --- a/deps/OCCT/OCCT.cmake +++ b/deps/OCCT/OCCT.cmake @@ -48,9 +48,15 @@ endif () orcaslicer_add_cmake_project(OCCT URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V8_0_1.zip URL_HASH SHA256=7c033d917ee8f040c0512d289dcc5f02c148889d5bac17c3e25639accb44f0da - # Makes BRepMesh triangulate cone faces whose seam pcurve is slightly tilted - # (Open-Cascade-SAS/OCCT#572); remove the patch once an OCCT release includes the fix. - PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-BRepMesh-seam-pcurve-at-edge-parameter.patch + # 0001 makes BRepMesh pair each seam pcurve of a cone with the right side of the seam, which + # failed when the seam pcurve is slightly tilted (Open-Cascade-SAS/OCCT#572) or the adjacent + # pcurves end slightly past the seam. Either way the face meshed to a sliver or not at all. + # Remove the patch once an OCCT release includes the fix. + # 0002 compiles one file without optimization under cl for ARM64, where MSVC 14.52 crashes + # on it with an internal compiler error; remove it once the runner image ships a fixed MSVC. + PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix + ${CMAKE_CURRENT_LIST_DIR}/0001-BRepMesh-seam-pcurve-selection.patch + ${CMAKE_CURRENT_LIST_DIR}/0002-BRepGraph-MSVC-ARM64-ICE-workaround.patch #DEPENDS dep_Boost CMAKE_ARGS -DCMAKE_CXX_STANDARD=17 diff --git a/deps/python3/0001-winapi-createprocess-audit-format.patch b/deps/python3/0001-winapi-createprocess-audit-format.patch new file mode 100644 index 0000000000..a081e51164 --- /dev/null +++ b/deps/python3/0001-winapi-createprocess-audit-format.patch @@ -0,0 +1,11 @@ +--- a/Modules/_winapi.c ++++ b/Modules/_winapi.c +@@ -1252,7 +1252,7 @@ _winapi_CreateProcess_impl(PyObject *module, const Py_UNICODE *application_name, + wchar_t *command_line_copy = NULL; + AttributeList attribute_list = {0}; + +- if (PySys_Audit("_winapi.CreateProcess", "uuu", application_name, ++ if (PySys_Audit("_winapi.CreateProcess", "uOu", application_name, + command_line, current_directory) < 0) { + return NULL; + } diff --git a/deps/python3/patch_winapi_audit.cmake b/deps/python3/patch_winapi_audit.cmake new file mode 100644 index 0000000000..85610c0eb3 --- /dev/null +++ b/deps/python3/patch_winapi_audit.cmake @@ -0,0 +1,38 @@ +# Applied as PATCH_COMMAND for CPython on Windows, from the extracted source directory. +# +# CPython 3.12.13 raises the _winapi.CreateProcess audit event with PySys_Audit format "uuu", +# although command_line is a Python object: audit hooks receive garbage instead of the command +# line. PluginAuditManager turns that argument into a process grant's target, so the prompt +# named the wrong executable and the grant it saved could not cover a real call. The patch +# changes the format to "uOu", as upstream does (python/cpython#159237), until the pinned +# CPython release carries the fix. +# +# Applying is idempotent: ExternalProject re-runs the patch step when PATCH_COMMAND changes or +# the patch stamp is missing, which can happen on a source tree that already carries the patch. +# A reverse check recognises that state instead of failing the build on an already patched file. +# When the pinned CPython release carries the fix, drop this script, its patch and PATCH_COMMAND. + +set(_patch "${CMAKE_CURRENT_LIST_DIR}/0001-winapi-createprocess-audit-format.patch") + +if(NOT GIT_EXECUTABLE) + message(FATAL_ERROR "GIT_EXECUTABLE is required") +endif() + +execute_process( + COMMAND "${GIT_EXECUTABLE}" apply --check --reverse --ignore-space-change "${_patch}" + RESULT_VARIABLE _already_applied + OUTPUT_QUIET + ERROR_QUIET +) +if(_already_applied EQUAL 0) + message(STATUS "CPython: _winapi.CreateProcess audit format is already patched") + return() +endif() + +execute_process( + COMMAND "${GIT_EXECUTABLE}" apply --verbose --ignore-space-change --whitespace=fix "${_patch}" + RESULT_VARIABLE _apply_result +) +if(NOT _apply_result EQUAL 0) + message(FATAL_ERROR "CPython: failed to apply ${_patch} (exit ${_apply_result})") +endif() diff --git a/deps/python3/python3.cmake b/deps/python3/python3.cmake index 4f60bb1b14..7e5745af79 100644 --- a/deps/python3/python3.cmake +++ b/deps/python3/python3.cmake @@ -181,6 +181,16 @@ if(WIN32) -DPYTHON_LAYOUT_ARCH=${_python_layout_arch} -P ${CMAKE_CURRENT_LIST_DIR}/stage_windows.cmake ) + # CPython 3.12.13 raises the _winapi.CreateProcess audit event with PySys_Audit's "u" format + # for command_line although it is a Python object, so audit hooks received garbage instead of + # the command line and the plugin audit prompt named the wrong executable. Apply upstream's + # "uOu" fix (python/cpython#159237) until the pinned release carries it. The step tolerates + # an already patched tree, which a re-run after a stamp change can meet. + set(_python_patch_cmd + ${CMAKE_COMMAND} + "-DGIT_EXECUTABLE=${GIT_EXECUTABLE}" + -P "${CMAKE_CURRENT_LIST_DIR}/patch_winapi_audit.cmake" + ) elseif(APPLE) # macOS configuration if(CMAKE_OSX_ARCHITECTURES) @@ -351,6 +361,7 @@ ExternalProject_Add(dep_python3 URL_HASH SHA256=${_python_sha256} DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/python3 BUILD_IN_SOURCE ON + PATCH_COMMAND ${_python_patch_cmd} CONFIGURE_COMMAND ${_conf_cmd} BUILD_COMMAND ${_build_cmd} INSTALL_COMMAND ${_install_cmd} diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake index 38713da9e1..fd29a63bf6 100644 --- a/deps/wxWidgets/wxWidgets.cmake +++ b/deps/wxWidgets/wxWidgets.cmake @@ -45,7 +45,9 @@ orcaslicer_add_cmake_project( wxWidgets GIT_REPOSITORY "https://github.com/OrcaSlicer/Orca-deps-wxWidgets" GIT_TAG 89844cb1f80b17a5916d5274cd88317cac3e2a3c - GIT_SHALLOW ON + # A shallow clone fetches only the branch head, so checking out a pinned commit fails once the + # branch moves past it. + GIT_SHALLOW OFF GIT_SUBMODULES 3rdparty/catch 3rdparty/pcre 3rdparty/libwebp DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG} CMAKE_ARGS diff --git a/deps_src/admesh/connect.cpp b/deps_src/admesh/connect.cpp index 30a199120d..d0a3f909b6 100644 --- a/deps_src/admesh/connect.cpp +++ b/deps_src/admesh/connect.cpp @@ -488,6 +488,12 @@ void stl_check_facets_nearby(stl_file *stl, float tolerance) // No need to check any further. All facets are connected. return; + // A mesh built in memory has no shortest edge, so the tolerance arrives as 0, and load_nearby() would divide by it. + // Converting the infinities and NaNs to int is undefined: x86-64 makes them all INT_MIN, so no edge was ever + // matched, while ARM64 saturates them by sign and merged unrelated edges. Keep the x86-64 result everywhere. + if (!(tolerance > 0.f)) + return; + HashTableEdges hash_table(stl->stats.number_of_facets); for (uint32_t i = 0; i < stl->stats.number_of_facets; ++ i) { //FIXME is the copy necessary? diff --git a/deps_src/clipper2/Clipper2Lib/src/clipper.engine.cpp b/deps_src/clipper2/Clipper2Lib/src/clipper.engine.cpp index a3a5c7ca1b..db1166d311 100644 --- a/deps_src/clipper2/Clipper2Lib/src/clipper.engine.cpp +++ b/deps_src/clipper2/Clipper2Lib/src/clipper.engine.cpp @@ -2978,8 +2978,14 @@ namespace Clipper2Lib { for (size_t idx = 0; idx < splits->size(); ++idx) { OutRec* split = (*splits)[idx]; - if (!split->pts && split->splits && - CheckSplitOwner(outrec, split->splits)) return true; //#942 + if (!split->pts && split->splits) + { + if (split->recursive_split == outrec) continue; + split->recursive_split = outrec; // emptied OutRecs can reference each other + + if (CheckSplitOwner(outrec, split->splits)) return true; //#942 + } + split = GetRealOutRec(split); if (!split || split == outrec || split->recursive_split == outrec) continue; split->recursive_split = outrec; // prevent infinite loops diff --git a/docs/HLSD/filament-for-features.md b/docs/HLSD/filament-for-features.md new file mode 100644 index 0000000000..05d6b3b5e8 --- /dev/null +++ b/docs/HLSD/filament-for-features.md @@ -0,0 +1,151 @@ +# Filament for features + +## Purpose and scope + +On a multi-material printer, each feature of an object can print with its own +filament: walls in a colour, infill in a cheaper filament, a brim in a soluble +one. The Multimaterial page groups these selectors under *Filament for +Features*. The support selectors work the same way but sit in their own group +on the Support page. + +Every selector holds a 1-based filament number, and 0 shows as "Default". The +keys live in three config classes, according to the scope of the feature: + +| Key | Config | Mixed slots | +| --- | --- | --- | +| `outer_wall_filament_id`, `inner_wall_filament_id`, `sparse_infill_filament_id`, `internal_solid_filament_id`, `top_surface_filament_id`, `bottom_surface_filament_id` | `PrintRegionConfig` | allowed | +| `brim_filament_id`, `support_filament`, `support_interface_filament` | `PrintObjectConfig` | physical only | +| `wipe_tower_filament` | `PrintConfig` | physical only | + +The region keys can be set on the process, an object, a part, a modifier or a +height range, and painting overrides them. The object keys can be set on the +process or an object. A region key may name a mixed-colour slot because tool +ordering resolves those per layer (`resolve_mixed_filaments()`). The other keys +are consumed directly by the brim, support and wipe tower code, so the GUI +offers them only physical filaments and resets a mixed value +(`ConfigManipulation`, `physical_only_keys`), and `Print::validate()` rejects a +mixed brim or wipe tower filament that arrives from a project or the CLI. + +## What "Default" means + +Region keys never reach the engine as 0. `region_config_from_model_volume()` +applies each scope in turn: the process, the object, the part, its material and +the height range. An explicit filament at any scope sets that feature. A 0 marks +the feature as following the part's own filament (`extruder`), which every scope +that carries one applies to the features nobody set explicitly. What is still +unset becomes filament 1. A painted region then sets all six keys to the painted +filament (`PrintApply.cpp`). From there on every `PrintRegion` names a concrete +filament for every feature. + +Object and print keys keep 0 into the engine, and each gives it its own meaning: + +- Support and support interface: no tool change; the support prints with + whichever filament is active. +- Brim: the brim prints in the pass of the first filament that reaches the + object on the first layer, see [Brim](#brim). +- Wipe tower: any filament, preferring a non-soluble one. + +## Which filament prints an extrusion + +`region_filament()` in `ToolOrdering.cpp` maps an island's extrusion collection +to a region key. Tool ordering and G-code export both go through it +(`LayerTools::extruder()`), so the tools planned for a layer are exactly the +tools the export asks for. + +- Sparse infill uses the sparse infill filament. +- Solid infill uses the top surface filament for top surfaces and ironing, the + bottom surface filament for bottom surfaces, and the internal solid filament + otherwise. Gap fill among infill follows the surface it fills. +- Gap fill between walls uses the inner wall filament when the region has more + than one wall, and the outer wall filament otherwise. +- A wall collection made only of inner walls uses the inner wall filament; + anything else uses the outer wall filament. + +A per-layer tool change from custom G-code (`extruder_override`) replaces all +region filaments on its layers. + +## Tool ordering + +`ToolOrdering::collect_extruders()` builds each layer's filament set from what +is actually printed there: the filaments of the regions' walls and fills, the +support filaments of support layers, the chosen brim filament on the object's +first layer, and the brim filament on every layer that carries a belt brim band. +The brim filament is added even when nothing else uses it, so a filament can be +loaded only for the brim. + +## Brim + +**Planning.** `getObjectExtruderMap()` gives each object one brim filament: the +chosen `brim_filament_id`, otherwise the lowest outer wall filament of the +object's first layer. `make_brim()` generates the brims in passes over the +first-layer filaments, and each brim records that filament +(`SkirtBrimGroup::Brim::filament_id`) for the nozzle-specific bed exclusions. +The brim line width uses the nozzle of the first object's chosen brim filament, +or of the first region's outer wall filament. + +**Combining.** *Combine brims* merges a brim with a chosen filament only with +brims that chose the same filament, so each merged brim still has a single +filament. Brims left on Default combine as before. + +**Emission.** A Default brim prints at the first visit of any of its instances, +in whichever filament's pass gets there first. This keeps the established +order, in which the brim usually goes with the outer wall filament because tool +ordering starts the first layer with it. Only nozzle-specific bed exclusions +make a Default brim wait for its recorded filament. A brim with a chosen +filament prints at the start of that filament's pass on the first layer, +before the pass visits any object (`GCode::process_layer()`), and the first +visits of other passes skip it. That filament may print nothing else on the +object, so the brim cannot rely on an object visit in its pass. + +**Belt printers.** They never print the plate brim. Belt brim bands print with +`PrintObject::belt_brim_filament()`: the chosen brim filament, or the lowest +outer wall filament of the object. + +**Invalidation.** On a flat bed the brim filament affects only the brim, the +tool ordering and the export, so changing it reruns those steps and keeps the +sliced object and its supports. The belt brim is generated with the supports +and takes its line width from the brim filament's nozzle, so on a belt printer +the change reruns the supports as well. + +## Predicting the used filaments + +Several places need the set of filaments a print or plate will use before, or +without, building the tool ordering. Each one derives it from the config with +the same rules: a feature filament counts only while its feature prints, such +as walls or a brim for the wall filaments, support for the support filaments, +and a brim for the brim filament. + +- `Print::extruders()`: the G-code writer's filament list for by-object export, + and validation. +- `PrintObject::printing_extruders()`: bed exclusion collisions and automatic + filament grouping. +- `PartPlate::get_extruders()` and `get_extruders_under_cli()`: the plate's + filament list for AMS mapping and filament checks. +- `PartPlate::get_object_filament_extruders()`: the bed exclusion preview. +- `project_used_filament_slots()` in `PublishSettingsDialog.cpp`: the filament + slots a published project uses. + +A filament missing from these lists can still be printed by the tool ordering +but is unknown to the consumer; in by-object export that means the writer has +no extruder for it. + +## Filament count changes + +When the filament count shrinks, `PresetBundle::full_fff_config()` resets +out-of-range region and brim keys to Default and clamps the support and wipe +tower keys, and `PrintObject::object_config_from_model_object()` does the same +for object overrides. Deleting a filament renumbers the support and brim keys of +objects, parts and the plater config (`ObjectList`, `Plater`). + +## Compatibility + +Older keys are renamed on load in `handle_legacy()`: `infill_extruder` and +`sparse_infill_filament`, `solid_infill_extruder` and `solid_infill_filament`, +`top_solid_infill_filament`, `bottom_solid_infill_filament`, +`perimeter_extruder`, `wall_filament`, `wall_filament_id`, +`inner_wall_filament` and `outer_wall_filament`. Their old value 1 meant "the +active filament" and maps to 0, Default; other values stay explicit. +`wipe_tower_extruder` and `support_material_extruder` are renamed as they are. +A part's `extruder` fills the region keys that are still 0 +(`DynamicPrintConfig::normalize_fdm()`). Every key defaults to 0, so a project +or profile without a key keeps its behaviour. diff --git a/docs/HLSD/gcode-preview-dragging.md b/docs/HLSD/gcode-preview-dragging.md index b3ee633f36..17fe9106c8 100644 --- a/docs/HLSD/gcode-preview-dragging.md +++ b/docs/HLSD/gcode-preview-dragging.md @@ -101,7 +101,7 @@ The solid stands in for the toolpaths, so it wears their colours. In the views t filament (Summary, Filament, Tool) each body keeps the filament colour its shell was loaded with. In every other view `GCodeViewer::update_solid_model_colors()` samples the toolpaths through `Viewer::get_vertex_color()`: the body takes the outer wall's colour over the layers the solid -stands for, each cap the infill's in the layer it is cut under, sparse infill before solid, and +stands for, each layer cap the infill's in the layer it is cut under, sparse infill before solid, and the prime tower its own role's. One vertex stands for the role, chosen by `Viewer::find_extrusion_vertex()`: in a view that grades the toolpaths by a value, the length-weighted median of that value over the role's extrusions in up to eight layers spread over @@ -116,7 +116,9 @@ the ends of the layer range then do not bound. And so does a belt printer's: its tilted at the belt angle, with heights in the G-code's frame, which no horizontal cut follows. A section view cuts the solid by its plane as it cuts the toolpaths, and the section face is one -more cap, counted on the body cut by that plane alone and drawn between the two heights. +more cap, counted on the body cut by that plane alone and drawn between the two heights. It may +cross any of the layers the solid stands for, so its colour is the infill's sampled over all of +them, as the body's is, or the body's own where the body has no infill. The solid is drawn opaque whatever the filaments' alpha: a translucent filament shows its toolpaths inside through the walls at rest, and the solid has no inside to show. diff --git a/docs/HLSD/infill-corner-smoothing.md b/docs/HLSD/infill-corner-smoothing.md index d7a7f05d2e..da5c3b6be2 100644 --- a/docs/HLSD/infill-corner-smoothing.md +++ b/docs/HLSD/infill-corner-smoothing.md @@ -44,9 +44,20 @@ vertex stands out of the chord of its neighbours by less than the resolution, as `LayerRegion::simplify_*` simplifies the infill to it afterwards and would drop that vertex again. +The resolution is followed down to 5 microns (`corner_smoothing_tolerance()`), no +finer. G-code coordinates come in steps of 1 micron, and rounding the vertices of +a corner split for a finer tolerance makes their turns uneven, by about a quarter +between neighbours at 1 micron, so the planner slows at the sharpest of them and +the corner prints no faster. Finer corners also pack their moves closer: a curve +held to its centripetal limit runs through about `sqrt(acceleration / (8 × +tolerance))` moves per second, 1,100 at 10,000 mm/s² and 1 micron. A printer host +that cannot plan moves that fast runs out of buffered moves, and Klipper then +flushes its lookahead queue and stops the toolhead in the middle of the path, a +pause the preview does not show. + The vertices depend on the geometry and the resolution only, not on the printer. -A finer resolution splits a corner into more and gentler turns, which a planner -takes faster, for a larger G-code file. +A finer resolution, down to that limit, splits a corner into more and gentler +turns, which a planner takes faster, for a larger G-code file. A corner of a given turn and vertex count is the same shape at any reach and resolution, scaled. Each thread builds a shape once at unit reach and all its diff --git a/docs/HLSD/layer-cooling-time.md b/docs/HLSD/layer-cooling-time.md new file mode 100644 index 0000000000..707400ad8b --- /dev/null +++ b/docs/HLSD/layer-cooling-time.md @@ -0,0 +1,82 @@ +# Layer cooling time — High Level Design + +## Purpose and scope + +Two filament cooling settings depend on how long a layer takes. The slowdown for better layer cooling slows a +layer that is shorter than `slow_down_layer_time`. The part cooling fan interpolates its speed between +`fan_cooling_layer_time` and `slow_down_layer_time`. Both thresholds are in seconds, and users read the layer +times off the Preview, so `CoolingBuffer` measures a layer with the same estimate as the Preview. +`GCodeProcessor` provides it, with acceleration, cornering and the printer's motion limits. + +The time at the feed rates, the length of each move over its speed, is much shorter on a printer whose moves +spend a large part of their time accelerating. On fast printers with moderate acceleration, the Preview time is +often 1.3 to 2 times the time at the feed rates. The slowdown itself still works in the time at the feed rates. +The estimate sets the targets it aims at, and the time the fan goes by. + +## What is timed + +A layer is timed whole, from its layer change to its end, as in the Preview. A layer whose first extrusion comes +after a filament change is timed from that extrusion instead: a long filament change before the printing would +otherwise hide a layer whose printing is quick. The time at the feed rates covers the same part of the layer. + +The estimate leaves out the time the printer spends loading, unloading or changing a filament +(`machine_load_filament_time`, `machine_unload_filament_time`, `machine_tool_change_time`). The time at the feed +rates never counted it either. The moves of a filament change, such as the purge and the prime tower, count. + +## The timer + +The export runs its own `GCodeProcessor` on the G-code as it is written, in a later stage of the export pipeline +than the cooling. That processor has not seen a layer when the cooling decides on it, so `CoolingBuffer` owns a +second one. Before each estimate it resets that processor and applies the print config, with the filament change +times set to zero. + +The layer is timed from a standstill. The G-code timed is preceded by lines that put the processor in the +machine state where the timed part starts: + +- the extruder, as a `T` command; +- the extrusion mode, `M82` or `M83`; +- the last line of each kind that sets an acceleration or another motion limit, seen so far, in the order the + lines came; +- the position, as a `G92`. + +A line kind is its command and its parameter names, for example `M204 P T` or +`SET_VELOCITY_LIMIT ACCEL ACCEL_TO_DECEL`, so a later line overrides only what it sets. The commands followed are +`M201`, `M203`, `M204`, `M205`, `M221`, `M566` and `SET_VELOCITY_LIMIT`. Most of the G-code reaches the cooling +layer by layer. `GCode` passes it the G-code that users write and that goes straight to the file before the first +layer: the start G-code, the IDEX or IQEX mode G-code, and the first filament's start G-code on Bambu Lab +printers. The machine limits Orca writes at the top of the file come from the config, which the processor has +already. The first layer starts where the start G-code left the print head, which the export's processor knows by +then, as it reads everything written before the first layer as it is written. A `G4 P0` at the end makes the +planner finish the last moves. + +## Slowdown + +The slowdown lowers the fastest extrusions first, to a common speed cap, in the time at the feed rates. Its +targets, the minimum layer times, are multiplied by a scale, and the scale is searched for so that the estimate +of the slowed layer reaches the longest minimum layer time among its filaments: + +1. A layer whose estimate already reaches the target is not slowed down. +2. The first scale is the ratio of the layer's time at the feed rates to its estimate. +3. Until a slowed layer reaches the target, the next scale comes from a model of the slowed layer. With the + moves slowed to one speed, acceleration adds about `k / t` to a layer that takes `t` at its feed rates. Where + that has no solution, because the moves never reach their speed, the time is taken as proportional to the + scale. +4. Once a slowed layer reaches the target, false position between the last layer short of it and the shortest + one past it. + +A layer from 0.2% short of the target to 1% past it is accepted, as a slightly longer layer only cools more. The +search stops after six estimates. If it ends short of the target with a longer candidate found, the layer takes +that candidate. It also stops when the minimum print speed caps the slowdown, which the time at the feed rates +shows when it no longer grows. + +## Fan + +The fan interpolates on the estimate of the layer as it is printed, after the slowdown. + +## Cost + +Acceleration only makes a layer longer, so a layer that takes more than every fan and slowdown threshold at its +feed rates, by a 10% margin, is not timed: it gets the minimum fan and no slowdown either way. Those are the large +layers, which hold most of the G-code. Any other layer is timed once, and a slowed layer about three times more. +The cooling runs in its own stage of the export pipeline. On the 51 MB fan calibration cone of issue 11751, whose +65 s fan threshold has every layer timed, the slicing takes about 2% more processor time. diff --git a/docs/HLSD/mcp-server.md b/docs/HLSD/mcp-server.md index d87d87c4c2..e2690dba4a 100644 --- a/docs/HLSD/mcp-server.md +++ b/docs/HLSD/mcp-server.md @@ -2593,7 +2593,10 @@ its option key is read from the "parameter name" line of its tooltip, and its la option's definition. Failing that, the label to its left on the same row names it, then its tooltip. A control's state reads `[checked]` or `[unchecked]`, or `[mixed]` for a checkbox that shows neither (a three-state one undetermined, Orca's `CheckBox` half-checked for an unset nullable -setting). An option of a selector Orca builds of buttons (`RadioGroup`, `TabCtrl`, `MultiSwitchButton`) +setting). Orca's `LabeledCheckBox`, a panel holding a `CheckBox` and its label, is one checkbox named +by its label, as a native one is: its parts are neither listed nor matched, and its check holds its +state, takes its click and says whether it is disabled (`check_part()`), since the panel itself stays +enabled. An option of a selector Orca builds of buttons (`RadioGroup`, `TabCtrl`, `MultiSwitchButton`) is a button that reads checked while it is the selected one (`selector_option()`), so `widget_set_value true` selects it, and a `SwitchButton` with a label at each end has the one it is on as its value. @@ -3177,7 +3180,7 @@ matter: a field made before the label above it reads after it, and PrintHostSend before their labels, each meet their own label. In a row: - A toggle with no label of its own (Orca's `CheckBox` and `RadioBox`) takes the cell to its right as - its label: `[x] Remember my choice.`. With nothing there, it takes the topmost single-line cell to + its label: `[x] Run Python scripts unrestricted`. With nothing there, it takes the topmost single-line cell to its left, as Preferences and CloneDialog lay their switches out: `Show splash screen | [x]`. Of a title and its hint stacked beside a switch (RecordingDialog), that is the title. - Single-line cells side by side join with ` | `. A container whose children make one line counts as diff --git a/docs/HLSD/multiline-infill.md b/docs/HLSD/multiline-infill.md index a12295bdd6..8995ee546f 100644 --- a/docs/HLSD/multiline-infill.md +++ b/docs/HLSD/multiline-infill.md @@ -13,10 +13,19 @@ any other infill. Clipping also cuts an outline at its first point, which may be anywhere along a line, so `join_cut_outlines()` joins the pieces back first. Outlines of centerlines that cross each other overlap at every crossing, which -over-extrudes the wall intersections. The line-crossing patterns Grid, -Triangles, Tri-hexagon, Cubic and Quarter Cubic therefore build centerlines that -never cross (`FillRectilinear::fill_surface_trapezoidal()`), and so do Adaptive Cubic and -Support Cubic (`FillAdaptive`). 3D Honeycomb skips `multiline_fill()` and draws +over-extrudes the wall intersections. `sparse_infill_strategy` chooses what the +line-crossing patterns Grid, Triangles, Tri-hexagon, Cubic, Quarter Cubic, +Adaptive Cubic and Support Cubic do about it. Non-crossing builds centerlines +that never cross (`FillRectilinear::fill_surface_trapezoidal()`, and `FillAdaptive` +for the two octree patterns). With a single line, `d1 = spacing` and those +centerlines are printed as they are. Crossing keeps the straight lines of the +single-line pattern and prints each wall as N copies of its line, `spacing` +apart: the `FillRectilinear` patterns slice the region with the copies, as +Rectilinear does, and `FillAdaptive` shifts copies of each octree segment. The +walls overlap where they cross. +Default crosses with one line and turns back with more. `make_fills()` resolves +Default per region before grouping the surfaces, so regions that print the same +paths share a fill. 3D Honeycomb skips `multiline_fill()` and draws its N lines itself as parallel copies of each wave, which never cross (`Fill3DHoneycomb`). Rectilinear, Aligned Rectilinear, Lateral Lattice and Lateral Honeycomb have only parallel lines, so they skip `multiline_fill()` too: @@ -50,7 +59,8 @@ Cubic run at 0°, 60° and 120°. Those rows rotate by 120° every layer about a 3-fold center of the arrangement, so each family takes every role in turn. The pattern is phased on fixed positions, so it lines up across layers and across the regions of one layer. Rounding the corners with -`sparse_infill_smooth_factor` happens before `multiline_fill()`. +`sparse_infill_smooth_factor` happens before `multiline_fill()`, and only these +paths have corners to round: the crossing lines are straight. Each region builds only the rows over its bounding box in that frame, and outlines only the centerlines within `d1 / 2` of it, the ones whose outlines diff --git a/docs/HLSD/only-one-wall-top.md b/docs/HLSD/only-one-wall-top.md new file mode 100644 index 0000000000..7aa8b7ab8a --- /dev/null +++ b/docs/HLSD/only-one-wall-top.md @@ -0,0 +1,96 @@ +# Only one wall on top surfaces — High Level Design + +## Purpose and scope + +`only_one_wall_top` leaves a single wall, the outer one, where a layer has a top surface, so the top fill runs up +to the outer wall instead of stopping at a band of inner walls. The topmost layer of an object, which is all top +surface, is printed with one wall. Below it, the perimeter generators find the top surface of each island and deal +with the inner walls that run over it. + +The option needs a top shell to act on. With `top_shell_layers` at 0 the top surfaces are retyped as internal (see +`LayerRegion::prepare_fill_surfaces()`), so `has_top_shell_layers()` switches the option off and the GUI hides it. +`only_one_wall_first_layer` is its bottom counterpart: it thins the first layer to one wall, and needs bottom shell +layers in the same way. + +A top surface is the part of an island that the next layer leaves uncovered. Bridges keep their walls, and a top +surface narrower than `min_width_top_surface` next to the geometry above is not treated as top, so thin features +such as lettering on the next layer do not strip the walls under them. + +## Two strategies + +What happens to the inner walls depends on whether the top fill can take their place +(`top_fill_replaces_inner_walls()`). + +- **Rerouting.** With `top_surface_expansion` at 0 or `top_surface_density` at 0%, the inner walls are generated + on the part of the island that is not top surface only. They stop at the top surface and run along its edge, so + every feature rising from a top surface is ringed by inner walls. Projects that do not use the expansion get + this result. +- **Removal.** With both set, the walls are generated on the real geometry, as with the option off, and the inner + walls that run over the top surface are then removed. `detect_surfaces_type()` grows the top surface by + `top_surface_expansion` under the features rising from it, inside the island less one wall, so the top fill runs + on under those features instead of being cut up by the walls that rerouting would put around them. + +Crossing zero with either setting switches between the strategies, so it regenerates the walls; other changes to +them only redo the fill steps. + +## Which walls run over the top + +The walls are generated before the surfaces are typed, so the perimeter generator works from the real top surface, +never from the expanded one. + +A wall runs over the top by the length of its centerline that lies inside the top region (`over_top_length()`). +Testing its vertices is not enough: a straight wall along a ledge crosses the top between two vertices that both +sit under the geometry rising at either end of the ledge. A wall whose bounding box misses the region is skipped +without any clipping. + +The classic generator's region is the area the top fill takes (`top_fill_area()`): the top fills grown by half the +outer wall spacing, to meet the outer wall, which is exactly what becomes the top fill later. The not-top +complement that `split_top_surfaces()` returns does not do: when gap fill is on it counts as not top the band +within one outer wall spacing of the outer wall, which the rerouting strategy leaves to gap fill. With the precise +outer wall off, or a wall order other than inner/outer, and equal wall spacings, the first inner wall lies exactly +on the inner edge of that band. Measured against the complement it never runs over the top, while the top fill +covers it along a whole exposed edge. + +## Classic walls + +A classic wall is a closed loop, printed as an `ExtrusionLoop` with its seam, place in the wall order, overhang +detection and fuzzy skin, so it is kept or dropped whole: + +- a wall with nothing over the top is kept; +- a wall that only grazes the top, by less than two wall widths, is kept whole, and the band it covers is withheld + from the top fill so the fill is routed around it; +- any other wall is dropped. + +The band a dropped wall covered outside the top region goes to the fill surfaces, so nothing is left void, and the +gaps inside the region are removed from the gap fill. Those fill surfaces are typed later like any other: top fill +where the expansion reaches, internal solid infill with Ensure vertical shell thickness at All, sparse infill with +the other settings. + +A dropped loop loses its parts outside the top surface as well. When a loop runs both over a ledge and under the +geometry rising from it, the walls under that geometry go for that layer, and a small top patch crossed by long +loops drops them all. + +## Arachne walls + +Arachne walls can be open lines, so `clip_inner_walls_over_top()` cuts them instead of dropping them, and the walls +under geometry that keeps rising stay. Each line is measured the same way against Arachne's top region. A line with +nothing over the top is kept and one wholly over it is dropped. Any other line is clipped against the region grown +by half a wall width, because the rounded end of a bead reaches half a width past its endpoint. Clipper treats the +line as open, so it also cuts a closed loop at its start vertex and may reverse pieces; pieces sharing an endpoint +are stitched back together, and pieces shorter than a wall width are dropped. A clip that would remove less than +two wall widths, about the pull-back of one crossing, keeps the line whole and withholds its footprint from the top +fill instead. + +The inner walls are numbered after the single outer wall. Arachne's single-wall pass may widen two beads to fill a +wall narrower than three outer walls, which leaves no room for the inner walls outside the top surface. When its +outer walls run more than a tenth of an outer wall width away from the full pass's, for more than a wall width +outside the top surface, the full pass's outer walls and the area inside them are used instead. + +## Constraints + +- A kept inner wall is never under the top fill; a wall that grazes the top has the fill routed around it. +- With the option off nothing changes, and without a top fill to take their place the inner walls are rerouted. +- Classic walls are dropped whole, Arachne walls are cut. Cutting classic walls would need open inner walls through + the loop pipeline, with a start and an end at every cut. +- The cost is one clip per inner wall whose bounding box meets the top region, on islands with a top surface below + the topmost layer. diff --git a/docs/HLSD/plugin-permissions.md b/docs/HLSD/plugin-permissions.md index 1d98097263..81d83fc659 100644 --- a/docs/HLSD/plugin-permissions.md +++ b/docs/HLSD/plugin-permissions.md @@ -24,27 +24,34 @@ Permissions are stored per plugin key. A plugin can hold: | Field | Kind | Governs | | --- | --- | --- | | `fs_read` | target list | Read-shaped filesystem events. Targets are exact paths or `/*` trees. | -| `fs_readwrite` | target list | Write-shaped and read/write filesystem events mapped to `FsReadWrite`: a write-mode `open`, rename, chmod, utime, copy, move, archive extraction, and similar. Same target matching as `fs_read`. A write-mode `open` can create a file, but this grant does not cover events mapped to `FsCreate` or `FsDelete`, which have no persistent grant list. | +| `fs_readwrite` | target list | Write-shaped and read/write filesystem events mapped to `FsReadWrite`: a write-mode `open`, rename, chmod, utime, copy, move, archive extraction, and similar. Same target matching as `fs_read`. A write-mode `open` can create a file, but this grant does not cover events mapped to `FsCreate` or `FsDelete`. | +| `fs_create` | folder list | Filesystem create events such as `os.mkdir` and `os.symlink`. | +| `fs_delete` | folder list | Filesystem delete events such as `os.remove` and `shutil.rmtree`. | | `network_http` | target list | Network targets, consulted together with `network_socket` for both HTTP and socket events. A canonical `scheme://host` entry is host-wide and covers both layers; a URL with a path, port, query or trailing slash is exact; a bare host or legacy address tuple covers raw sockets. | | `network_socket` | target list | The same network matching, kept as a separate list so a plugin can declare socket access without an HTTP URL. | -| `process` | target list | Process creation and process replacement: `os.system`, `subprocess.Popen`, `os.spawn*`, `os.exec*`, `pty.spawn`, `_winapi.CreateProcess`, and similar. Targets match the audited value verbatim. | +| `process` | target list | Process creation and process replacement: `subprocess.Popen`, `os.spawn*`, `os.exec*`, `pty.spawn`, `_winapi.CreateProcess`, and similar. Targets name the tool, not its arguments. The exception is a Windows command line with an unquoted executable followed by arguments: it is stored as an exact full command line, because `CreateProcess` may resolve a longer executable prefix than the first token shows. `os.system` names the shell it runs (see "Target matching"). | | `threading` | boolean | Permission to start a Python thread with `_thread.start_new_thread`. | | `events` | target list | Audited events that expose no target, keyed as `:`, for example `Socket:socket.__new__`. Matched verbatim. | | `full_access` | boolean | Turns off the permission decision for the plugin. See "Full access". | -Filesystem create and delete events (`os.mkdir`, `os.symlink`, `tempfile.mkstemp`, -`os.remove`, `shutil.rmtree`, and similar) are audited, but they have no persistent grant -list. A `fs_read` or `fs_readwrite` grant does not cover these events, although a write grant -can create a file through `open()`. Without full access, each such -event outside an allowed root is prompted only when it can be answered inline. On the wx -main thread a Yes applies only to the operation that raised it and is not saved. Off the -main thread the event is denied immediately and an informational denial is shown instead; -there is no Yes/No prompt, no saved grant, and no promise that a later attempt will be -approved. +Create and delete grants are independent of read and read/write grants. An empty list grants +no folders; an absolute folder path grants operations directly inside that folder, while a path +ending in `/*` also covers its subfolders; a list containing only `*` grants all folders. Runtime approval stores +the parent folder of the audited target, except for a recursive delete, whose consent is +transient and is never stored. A delete grant covers existing entries in that folder, +not just entries created by the plugin. The unconditional denied paths still apply. + +A recursive delete (`shutil.rmtree`) is a subtree operation: a plain folder grant is +insufficient even when it names the target folder or its parent. It requires either a saved +delete tree grant whose root covers the target, or explicit one-time consent for that canonical +subtree. A tree grant rooted exactly at the target covers the entries inside it but not the +final removal of the target folder itself, which is an entry in the parent; the operation asks +for consent unless the parent is granted separately. The consent applies only to the operation +that requested it and the nested deletes it performs inside that subtree. ### Target matching -- Exact filesystem entries match the audited path verbatim. An absolute exact entry also +- Read and read/write exact filesystem entries match the audited path verbatim. An absolute exact entry also matches an equivalent canonical path, including a symlink alias or a relative target resolved against the current working directory. Relative exact entries match only verbatim, so their equivalence scope cannot move with the working directory. Canonical equivalence fails closed @@ -56,6 +63,23 @@ approved. root must be absolute on the current platform: a relative root never matches, even when a target is spelled exactly like the entry, so the scope cannot float with the process working directory. +- Create and delete folder grants compare canonical parent directories; a final symlink is + governed by the folder containing the link. Link creation checks the destination folder; + a hardlink also requires write access to its source because writes through either name + affect the same file. Both source and destination remain + subject to the denied-path check. An unresolved parent + does not match a folder grant. Recursive deletion is checked as a subtree operation: an + exact folder grant does not cover it, but a delete tree grant does, and a one-time consent + covers the target subtree for that operation only. A target-rooted tree grant covers the + entries inside the target but not removing the target folder itself; that final removal needs + a grant for the containing folder or one-time consent. Nested delete entries inside an + approved subtree are allowed while the operation runs, provided they stay inside the canonical + subtree and are reached through standard-library frames. Scope is decided by the entry's + containing folder: deleting a symlink acts on the link entry, never on its destination. + Intermediate `..` components are resolved after symlinks, never lexically folded before + them, and a final `..` fails closed. A + symlink or `..` that would leave the subtree is judged on its own, and denied paths stay + blocked. - Network entries can be an HTTP URL, a canonical `scheme://host`, a bare host, a `host:port` pair, or a legacy persisted address tuple such as `('host', 443)`. `normalize_network_url` reduces a URL to lowercase `scheme://host`; path, query, @@ -65,8 +89,36 @@ approved. A canonical entry is host-wide and applies to HTTP and raw socket events for that host. A URL with a path, port, query, fragment or trailing slash that was stored without normalization remains an exact match. -- Process entries are compared verbatim with the string the audit event reports, - including Python representations of a command. +- Process entries name the tool an event runs, compared verbatim. When the event exposes + the executable or path, that argument is the target. For a command string or argv, the + first token or element is the target. Arguments after the tool are ignored, so one grant + covers repeated runs of the tool with different arguments. The exception is a Windows + command line whose executable is unquoted and followed by non-whitespace text. + `CreateProcess` resolves such a name by trying successively longer prefixes, so the first + whitespace-delimited token need not be the executable it starts: a command line + `C:\Program Files\app.exe --x` can start `C:\Program Files\app.exe`, not `C:\Program`. + The audit therefore stores the exact full command line instead of the first token, in a + reserved `CommandLine:` namespace in the `process` list. An exact entry matches only the + same full command line, compared verbatim, and a later run with different arguments asks + again. A quoted first argument, an explicit executable or application name, and a command + line that has no arguments keep the executable-only, argument-insensitive grant. The + command line is not parsed further, and the resolved executable is not checked: the same + approved command line can start a different binary if the working directory, `PATH`, or + the files it resolves through change. `os.system` works differently: + Python hands its whole string to the platform shell, so the target is every shell that may + run it. On POSIX that is `/bin/sh`. On Windows the C runtime runs the interpreter named by + `COMSPEC`, or `cmd.exe` when `COMSPEC` is unset or empty, and also falls back to `cmd.exe` + when it cannot open the configured file (ENOENT or EACCES). The configured interpreter and + the fallback are both required targets: a grant for a narrow `COMSPEC` does not authorize + the fallback shell. A `COMSPEC` that is already the bare name `cmd.exe`, in any casing, + names the fallback itself and is listed once. The value is read from the CRT environment + that `_wsystem` consults, not the process environment block, which can differ. The audit + does not test whether the `COMSPEC` file exists; the runtime decides that when it runs the + command, so a file present at prompt time can be gone by the call. The command string is + not parsed, and approving the shells covers every command and argument the plugin passes + to `os.system`. The targets are read when the event is raised, so a grant saved under one + `COMSPEC` value does not cover a run under another. Direct process creation, such as + `subprocess.Popen`, still names its executable. - An event with no target is granted by the `events` entry for its category and name. A targetless network event, such as `http.client.send`, is covered by any recorded network grant instead. @@ -101,10 +153,12 @@ order: before allowed roots, before a granted operation and before full access, so no grant can make a denied path reachable. 2. **Covered by a granted operation.** When a granted root operation is still running, - nested events raised through its standard-library frames are allowed without another - prompt. The coverage is bounded to the operation frame and does not extend to plugin - or third-party frames it calls back into. A nested `urllib.Request` is judged on its - own URL, including when it follows a redirect. + nested events raised through its standard-library frames are generally allowed without + another prompt. Delete operations still check nested delete events against their + own grants, or against the canonical subtree recorded by a one-time recursive-delete + consent started by this operation. The coverage is bounded to the operation frame and does + not extend to plugin or third-party frames it calls back into. A nested `urllib.Request` + is judged on its own URL, including when it follows a redirect. 3. **Implicit allowed root or standard-library read.** A filesystem target inside an allowed root is allowed; a read of the interpreter's standard library is also allowed. See "Implicit access". @@ -141,9 +195,11 @@ its UUID. A plugin declares its needs from Python with `orca.request_permissions(...)` while `register_capabilities` runs. The bridge collects the declarations per plugin. After registration returns and before any capability instance is created, OrcaSlicer presents -one combined prompt for the targets not already stored. Denying the request aborts the -load. A readable sidecar with `full_access` accepts the declaration without a prompt and -without adding a grant. +one combined prompt for the targets not already stored. The request joins the same +`AuditPromptQueue` as runtime prompts: a load worker waits for the answer, while a +GUI-thread caller is rejected when another prompt is active instead of blocking the GUI. +Denying the request aborts the load. A readable sidecar with `full_access` accepts the +declaration without a prompt and without adding a grant. Network URLs passed to `request_permissions(network=...)` are normalized to `scheme://host` before prompting or storing, so one approval covers every path and port @@ -154,20 +210,53 @@ sidecar show the absolute scope it covers. ### Runtime prompts An event that is not covered by a saved grant or an implicit rule is either put to the -user or denied. If the caller is on the wx main thread, the modal runs inline. If it is -not, as on the Script workflow, the plugin-load worker, or the slicing worker, the current -event is denied and the outcome is reported asynchronously. For a category with a persistent -grant list, a Yes/No prompt is posted to the main thread with `CallAfter`; if the user -accepts, the grant is saved and a later matching attempt can succeed without another prompt. -Create and delete do not support persistent grants: on the main thread they use the inline -prompt described above, while off the main thread they are denied and only an informational -denial is posted. That path offers no Yes/No choice and does not claim that the operation can -be approved on a retry. Blocking a worker on a marshalled modal is avoided because the UI -thread can itself be parked on the slicing worker. +user or denied. If the caller is on the wx main thread and no audit prompt is active, the +modal runs inline. Otherwise, as on the Script workflow, the plugin-load worker, or the +slicing worker, the current event is denied and the prompt is queued for the GUI thread. +`AuditPromptQueue` serializes runtime prompts, one-time recursive-delete consent, and +load-time declarations, so at most one is shown at a time, +including during a modal dialog's nested event loop. An event raised inside that loop is +queued and denied instead of opening a second dialog; the queued prompt opens after the +active dialog has closed. -Runtime approvals store the target observed by the audit hook. A URL with a path, port or -query is therefore an exact grant; a bare host remains usable for raw sockets. The -declared form and the runtime form are not normalized by the same code path. +For a category with a persistent grant list, a Yes saves the grant and a later matching +attempt can succeed without another prompt. Create and delete approvals save the target's +parent folder, so a worker can retry after the queued Yes. Recursive delete instead uses +one-time consent, as described below. Blocking a worker on a marshalled modal is avoided +because the UI thread can itself be parked on the slicing worker. A load worker does block on its declared-permission answer: +shutdown or plugin unload cancels queued requests and active requests whose accepted answer +has not begun committing, releasing waiting workers with a denial. An admission that races +that cancellation is discarded as soon as it becomes visible. A cancelled load stops being +treated as a live plugin even while its worker is still unwinding. A cancellation observed before +display suppresses the prompt; a dialog racing with cancellation may still appear or remain on +screen, but its answer is ignored unless committing won the race. An ordinary load failure is not +a cancellation: its queued runtime prompt stays actionable, so the user can approve the event +whose denial aborted the load and then retry with the saved grant. + +Runtime approvals store the target observed by the audit hook, except that create and delete +approvals store its parent folder. A URL with a path, port or +query is therefore an exact grant; a bare host remains usable for raw sockets. A Windows +command line that needs the exact fallback is saved in the reserved `CommandLine:` namespace +as its full text, so the approval is argument-sensitive; the prompt shows the command line +without the storage marker and states that the full line, including any sensitive values in +its arguments, is shown and saved. The declared form and the runtime form are not normalized +by the same code path. + +A recursive delete is different: a Yes grants consent for the canonical target subtree for +that operation only. The prompt shows the subtree root and states that the consent is not +saved; a filesystem, drive, or network share root gets an explicit warning that its whole +filesystem, drive, or network share is covered. Nested deletes inside that subtree proceed +during the same operation; after it ends, the same target asks again. Denied paths stay blocked +throughout. When the prompt cannot run inline, the current attempt is denied and a Yes from the +posted dialog is kept as a short-lived, single-use approval bound to the plugin key and +canonical target. The posted prompt says it applies to the next matching attempt within one +minute after approval; the next matching attempt consumes it. A different plugin, a different +target, a reused or an expired approval does not. A prompt already open for the same plugin and +target is not posted again, so a retry loop cannot queue duplicate dialogs. The pending-prompt +set is bounded; at capacity, new prompts are denied rather than evicting a dialog that is +already queued. A permission edit, revocation, or reinstall invalidates the plugin's transient +approvals and pending prompt keys; a dialog callback already queued becomes a no-op instead of +recreating a stale approval. ## Implicit access @@ -181,6 +270,12 @@ Some access needs no grant because it is part of the plugin system's normal oper - A per-call scoped root can be added. The G-code post-process hook grants the folder containing the exported G-code file so the plugin can edit it; the root is scoped to that call. +- A delete inside a writable allowed root is scoped by the entry's containing folder. Deleting + a symlink that lives in the root is therefore implicit even when the link points outside, + because the operation removes the link entry; an outside link that points into the root is + not implicit. A recursive delete inside a writable root records its target subtree as the + running operation, so its fd-based reads do not trigger a separate prompt and its nested + deletes cannot leave that subtree. ### Denied paths @@ -199,8 +294,10 @@ The following are denied before any allowed root or full-access check: ## Persistence and editing Grants and install state live in `.install_state.json` in the plugin root. The -`permissions` object stores `fs_read`, `fs_readwrite`, `network_http`, -`network_socket`, `process`, `threading`, `events`, and `full_access`. The file is +`permissions` object stores `fs_read`, `fs_readwrite`, `fs_create`, `fs_delete`, `network_http`, +`network_socket`, `process`, `threading`, `events`, and `full_access`. It never stores a +recursive-delete consent: that approval and any retry approval are in memory only, so accepting +one does not widen the plugin's saved delete scope. The file is written by `write_install_state`, the single writer for the sidecar schema. In-process reads and read-modify-write operations are synchronized. Writes prepare a complete replacement in the plugin directory and replace the sidecar only after the write succeeds. @@ -225,6 +322,14 @@ Anything else at the sidecar path is left in place: a link or a directory, or a that cannot be opened or read in full, since a read error can look like truncated contents. +Declared permissions are added in one locked read-modify-write, including the `threading` +boolean. A successful write notifies an open Plugins dialog so its Permissions tab +refreshes; a failed write notifies nothing. If the sidecar was readable when the declaration +was read but is absent when the answer is saved, the write is refused instead of recreating +it: that is lost state, not a new install. Only a sidecar absent at both reads is seeded. +Runtime grants use the same per-target helper, which takes the lock and re-reads the sidecar +for every target. + Each audit decision reads the current sidecar through `PluginManager::get_install_state`, so a grant persisted by a prompt applies to subsequent top-level operations. A root frame that was already recorded is not @@ -246,7 +351,8 @@ targets; unchanged entries, including grants written by an older release, are ca byte-for-byte. New filesystem targets must be absolute on the current platform: a POSIX path starts at `/`, and a Windows path names a drive plus root or a UNC share. A `*` is accepted only as the final `/*` of a folder tree, and `..` components are -refused. The matcher also refuses to widen a relative tree root, so a relative tree entry +refused for filesystem grants. Create and delete use absolute folder paths, optional final `/*` +tree grants, or the all-folders mode. The matcher also refuses to widen a relative tree root, so a relative tree entry saved by hand or carried over from an older release never authorizes. New network targets must be a full `http://` or `https://` URL; the writer stores `normalize_network_url`'s canonical lowercase `scheme://host`, dropping port, path, query and fragment. Bare hosts, other @@ -258,6 +364,11 @@ while full access is on are inert and apply again when full access is off. Turni on does not delete the stored lists. A permission change affects subsequent audit decisions, not operations already authorized. +The dialog also asks for confirmation before granting create or delete access to all folders. +On Linux and macOS, create and delete operations using a directory file descriptor are checked +against its resolved path. If that path cannot be resolved, the operation is denied, even with +full access. + ## Full access Full access is a per-plugin boolean that turns off the permission decision. It does not @@ -298,6 +409,15 @@ never treated as an opt-out. context, so its events are not attributed or restricted. - **Subprocesses leave the policy.** A process created by a granted or full-access plugin runs with the user's rights and is not covered by the parent's audit scope. +- **An `os.system` grant is a shell grant.** It authorizes every command string the plugin + passes to `os.system`, not only the one that triggered the prompt, because the shell + parses and runs the whole string. Arguments are not inspected or restricted. +- **An exact command line grant is command-sensitive, not binary-sensitive.** It is stored + and shown in full, so it can expose credentials or tokens passed as arguments to anyone + who sees the prompt or the sidecar. Approval covers only the same full command line. + `CreateProcess` still resolves the executable from the working directory, `PATH`, and the + filesystem, so the same approved command line can start a different binary later; the + grant does not pin the resolved image or verify it. - **Host APIs are not audit events.** Calls into OrcaSlicer's Python host APIs, such as preset updates or UI actions, execute C++ host code and follow that API's contract. The audit hook judges the Python-level filesystem, network, process and thread events it is @@ -307,6 +427,17 @@ never treated as an opt-out. - **Denied paths are a direct-access block.** Path laundering through a symlink, hardlink, subprocess, or Windows 8.3 short name is outside the model. A tree grant is canonicalized for matching, but the deny check itself is base-name and component based. +- **A recursive delete stops at a denied path.** Consent for the subtree does not override the + deny registry. A protected entry inside the tree makes `shutil.rmtree` fail with + `PermissionError` (or be skipped by `ignore_errors`), leaving that entry and any unvisited + entries in place. This is deliberate: protected paths stay protected. +- **fd-based recursive deletes expose only partial paths.** `shutil.rmtree` reads with + `os.scandir(fd)` and opens entries with `dir_fd`; those audit events carry an integer + descriptor or a relative name rather than the full path. The running operation frame covers + them normally, and each relative entry name is still checked, so denied entries stay blocked. + A relative `os.open` target is canonicalized against the process working directory, so a + working directory containing a denied keyword can over-block nested opens. That fails closed + and does not widen access. - **`data_dir()` is shared and writable.** Every plugin can write anywhere in the application data directory, including other plugin package files. Only the install-state sidecar and the denied names and keywords are blocked there. @@ -320,19 +451,23 @@ never treated as an opt-out. be re-entered as an absolute path to take effect. - **An off-main-thread prompt denies the current event.** A persistable grant is saved only if the user later accepts, so the first attempt from a worker fails with - `PermissionError`. Create and delete have no persistable grant and no retryable approval: - off the main thread they are denied and only an informational denial is shown, while the - inline main-thread prompt covers only the operation that raised it. -- **A running root operation is not re-evaluated.** Revoking full access or changing a - grant affects later top-level operations, not an operation whose root frame already - recorded coverage. + `PermissionError`; a later attempt can succeed after approval. A recursive-delete consent is + instead kept as a short-lived, single-use retry approval bound to the plugin and canonical + target, valid for the next matching attempt within one minute after approval, and is never + persisted. Duplicate prompts for the same plugin and target are not posted. +- **A running root operation is generally not re-evaluated.** Revoking full access or changing a + grant affects later top-level operations, not an operation whose root frame already recorded + coverage. Nested delete events within a delete operation are checked separately, or covered + by the one-time subtree consent recorded on that operation. ## File and symbol map - `src/slic3r/plugin/PluginAuditManager.hpp` / `.cpp` - `PluginAuditManager`, `install_hook`, `audit_plugin_event`, `decide_audited_event`, `request_permissions`, - `request_permission`, `check_path_access`, `network_permission_matches`, - `default_denied_filenames`, `default_denied_path_keywords`, `ScopedPluginAuditContext`. + `request_permission`, `request_recursive_delete_consent`, `delete_target_inside_approved_subtree`, + `delete_target_inside_writable_allowed_root`, `AuditPromptQueue`, `check_path_access`, + `network_permission_matches`, `default_denied_filenames`, `default_denied_path_keywords`, + `ScopedPluginAuditContext`. - `src/slic3r/plugin/PluginFsUtils.hpp` / `.cpp` - `PluginPermissions`, `PluginInstallState`, `read_install_state`, `write_install_state`. - `src/slic3r/plugin/PythonPluginBridge.cpp` - `request_permissions` binding, diff --git a/docs/HLSD/preset-cache.md b/docs/HLSD/preset-cache.md index 4b7a05e8c9..fdad8676f9 100644 --- a/docs/HLSD/preset-cache.md +++ b/docs/HLSD/preset-cache.md @@ -360,7 +360,8 @@ step, not something a build should do to a working tree by surprise: the Windows refuses that target unless given `--prune-source`, and CI passes it. Generation runs after the build, in the same job, so the caches ship with a build that -can read them. +can read them. On Linux it runs while the package tree is staged (`build_linux.sh -P`), so +the AppImage is packed from a tree that already holds them. The flatpak differs only in where the script is called from. Nothing outside flatpak-builder ever builds it, so there is no packaged tree for the workflow to point diff --git a/docs/HLSD/python-plugin-async-bridge.md b/docs/HLSD/python-plugin-async-bridge.md index 5d54a66235..0de7b9678f 100644 --- a/docs/HLSD/python-plugin-async-bridge.md +++ b/docs/HLSD/python-plugin-async-bridge.md @@ -141,12 +141,22 @@ dropping the pybind holder from a non-Python thread would `DECREF` without the G closed and `tl_script_loop` cleared before the worker exits. A consequence of running Script on a non-main thread: the audit permission prompt is fail-closed off -the main thread. `request_permission` in `src/slic3r/plugin/PluginAuditManager.cpp` posts the dialog -with `CallAfter` and denies the current event. For a category with a persistent grant list, the grant -is saved when the user accepts, so a Script sees a denial on the first attempt and can succeed on a -later one. Create and delete have no persistent grant list, so their off-main-thread path posts only -an informational denial with no Yes/No choice and does not promise a retry. This matches the existing -behavior for the plugin-load worker and the slicing worker. +the main thread. `request_permission` in `src/slic3r/plugin/PluginAuditManager.cpp` queues the dialog +for the GUI thread and denies the current event. For permissions with persistent grants, accepting +the prompt saves a grant for a later attempt, so a Script sees a denial on the first attempt and can +succeed on a later one. Create and delete approvals save the target's parent folder in the same way. +Recursive-delete consent is instead a one-time approval for the next matching attempt within one +minute, bound to the plugin and canonical target. It is never saved. The plugin-load worker and the +slicing worker follow the same behavior. + +`AuditPromptQueue` serializes runtime prompts, recursive-delete consent and load-time declared-permission +prompts. Only one is shown at a time, including during a modal dialog's nested event loop. A load +worker waits for its declared-permission answer; shutdown or plugin unload cancels pending requests +and active requests whose accepted answers have not started committing, releasing waiting workers +with a denial. An accepted answer already being persisted completes before its worker is released. +A declared-permission request on the GUI thread is +denied if another prompt is active or pending, rather than blocking the GUI or opening a deferred +dialog. The queue outlives static destruction so shutdown can discard requests safely. ### Blocking UI continuation diff --git a/docs/HLSD/python-plugin-wheel-installation.md b/docs/HLSD/python-plugin-wheel-installation.md new file mode 100644 index 0000000000..6076af5bb7 --- /dev/null +++ b/docs/HLSD/python-plugin-wheel-installation.md @@ -0,0 +1,57 @@ +# Python plugin wheel installation + +## Purpose and identity + +OrcaSlicer runs Python plugins in its embedded interpreter. A plugin's entry is a `.py` file or a wheel stored in its plugin directory. Discovery and metadata reading use that entry file; the wheel remains available after installation. Local plugin keys derive from the entry filename, while cloud plugins use their UUID. Those identities connect plugins to their settings, permissions, capabilities and other references and must not change because of how a wheel is installed. + +Writable plugin data is stored separately from the plugin package. Package removal or replacement must not inadvertently remove that data. + +## Installing wheels + +A wheel entry is installed with bundled `uv` and bundled Python when the plugin is loaded, unless a usable installation is already present. The target is the plugin's legacy extraction path, `/__whl_extracted__//`, which is also where the pre-uv loader extracted the entry wheel. That gives one cache location and one loading flow: the entry package is always imported from that directory, whether it was extracted before or installed by uv. The stored wheel, plugin key and `.install_state.json` sidecar remain where they are, preserving their settings, permissions and capability choices. A `.py` entry is still imported directly. + +`__whl_extracted__/` is shared with dependency wheels. A dependency wheel `.whl` is extracted to `__whl_extracted__//`, so only the entry package's own subdirectory is the installation target; dependency extractions alongside it are left alone. If a dependency wheel's filename stem equals the entry package, both would need the same directory and import name. Installation fails with a collision error instead of replacing the dependency extraction. + +An existing `__whl_extracted__//` without an installation marker is a pre-uv entry extraction. When it already contains the entry package it is used directly: the same directory import runs, and uv is not started, so its files are not rewritten. Only the entry package's own directory counts. The shared `__whl_extracted__/` parent, which holds dependency extractions, is never treated as an entry installation. A markerless target that does not contain the entry package is replaced. A target with a marker that is stale or invalid is a uv-managed installation and is also replaced, through the normal reinstall path. Plugin-owned data belongs in the separate plugin data directory. If uv fails before promotion, the previous directory is left untouched; if promotion fails, it is restored. Either way a markerless extraction remains usable until a replacement succeeds. + +The entry package is metadata-derived and becomes a path component and an import name. It must be a non-empty dotted name whose components are non-empty and contain no path separators, control characters, or characters Windows forbids in filenames. Non-ASCII Unicode names are allowed. This is path-component safety rather than full Python identifier validation: a name that cannot be imported fails when the module is imported. + +uv runs without contacting a package index and without installing dependencies: + +``` +uv --no-config pip install --python --no-python-downloads + --no-deps --no-index --no-cache --link-mode copy + --target +``` + +Declared dependencies continue to use the existing shared installation policy: they are installed separately by uv into the shared packages directory and added to the interpreter's import path. Wheel files next to the entry that are not the entry itself are extracted under `__whl_extracted__/` as before, alongside the entry target. + +The installed directory provides real filesystem paths for package resources. Wheel installation can relocate files compared with literal extraction, especially files in a wheel's `.data` directory. Plugins that derive resource paths from their package location should be checked against the installed layout. + +## Path spelling on Windows + +The plugin root, its `__whl_extracted__/` caches and the files below them can pass the legacy 260-character `MAX_PATH`. Filesystem probes and operations use the extended-length (`\\?\`) spelling where the plain spelling cannot reach a path; uv receives plain paths and qualifies them itself, and a `sys.path` entry keeps the plain spelling it was given whenever the import can be served through it. For an imported package or module that is decided from the entry files the finder probes: the plain spelling is kept while `/__init__.py`, a compiled `__init__` initializer, or the single-module `.py`/compiled extension also fit below the limit. A package with no `.py` entry, such as a namespace or compiled-only package, therefore keeps the plain spelling instead of being prefixed for lack of a file to probe, while any entry file past the limit selects the extended-length form. Dependency extraction roots follow the same rule, decided by whether the extraction root itself is reachable through the plain spelling. + +One limit remains: files nested below the entry are not probed individually. They are reached through the recorded `sys.path` entry, so a submodule that itself lies past the limit is only reached when the entry above it already selected the extended-length form. + +## Wheel filename reconstruction + +uv requires a valid PEP 427 wheel filename. A stored cloud download or a locally renamed wheel may not have one, so installation stages a copy under a name built from the wheel's own `METADATA` name and version and its declared `WHEEL` tags. The stored entry filename is not changed. The tag is selected from the tags the wheel declares; it is never invented, and uv performs the final interpreter/platform compatibility check. + +## Cache and reuse + +Installation happens in a staging directory, `__wheel_staging__-*`, and is promoted to `__whl_extracted__//` only after uv succeeds and the entry package is present. The previous target is moved to `__wheel_prev__-*` during promotion and restored if promotion fails; it is removed after a successful promotion. All of these names start with `__`, so discovery ignores them. + +A marker inside the installed target records the installation format, interpreter ABI, entry package, wheel size and a fingerprint of the wheel bytes. A later load reuses the target when all of them match, so unchanged wheels do not run uv again. A markerless target that contains the entry package is a pre-uv extraction and is reused directly. Any marker that does not match the current wheel, format or ABI causes reinstallation, so a stale uv installation is never reused. The marker is a cache hint, not evidence that a plugin is trustworthy. The entry package must still be identified independently of the distribution name. + +Legacy acceptance and uv installation take the same lock, so a load never accepts a markerless target while another load is rebuilding it. + +The local plugin cache-clear action removes `__whl_extracted__/`, including the entry installation and all dependency extractions. It does not remove the stored wheel, the sidecar or the separate plugin data directory. + +## Failure and lifecycle + +If uv fails or the promoted target is incomplete, the load fails with an error naming the installation problem. There is no silent fallback to extraction. The previous target is restored if promotion fails, and the stored wheel, sidecar, settings and permissions are left in place, so a later load can retry once the problem is resolved. + +Native extensions may remain loaded after a plugin is stopped, particularly on Windows, so replacing or removing their files may require an application restart. + +Each plugin's installation directory is private, but plugins share one interpreter, `sys.path`, `sys.modules` and the dependency directory. Separate directories do not isolate conflicting imports. Installation and execution of plugin code are not security sandboxes. diff --git a/docs/HLSD/resonance-avoidance.md b/docs/HLSD/resonance-avoidance.md new file mode 100644 index 0000000000..a6ec873d55 --- /dev/null +++ b/docs/HLSD/resonance-avoidance.md @@ -0,0 +1,82 @@ +# Resonance avoidance — High Level Design + +## Purpose and scope + +Many printers ring or show vertical fine artifacts (VFAs) on the surface when +the toolhead moves within a certain speed range. Resonance avoidance keeps outer +walls out of that range. Only outer walls are covered, because they form the +visible surface. Inner walls, infill and the other features keep their speeds. + +The range is a property of the printer, so the settings are printer settings, in +Motion ability: `resonance_avoidance` (off by default), +`min_resonance_avoidance_speed` and `max_resonance_avoidance_speed`. The VFA +calibration measures the range. The calibrations that test speeds or motion turn +the option off, so it cannot hide what they measure: pressure advance, flow +rate, temperature, max volumetric speed, retraction, VFA, input shaping and +cornering. + +An outer wall can get its speed in two places: when the G-code is generated, and +later in the layer cooling slowdown. The range is enforced in both. + +## Speed of each path + +`GCode::_extrude()` resolves the speed of an outer wall path first. This covers +the outer wall speed, the small perimeter speed, the scarf seam speed, the first +layer speeds and their ramp over the following layers, and the cap from the +filament's max volumetric speed. When the result falls inside the range, it +moves to the nearer half's end: a speed in the lower half goes down to the +minimum, and a speed in the upper half goes up to the maximum. Speeds above the +range, and speeds below it, are left alone. + +## Layer cooling slowdown + +When a layer prints faster than the filament's minimum layer time, +`CoolingBuffer` slows the layer down, as [layer-cooling-time.md](layer-cooling-time.md) +describes. It lowers the fastest moves first, so most features end at one shared +speed. Without resonance avoidance, that speed can +fall anywhere, including inside the range. + +`CoolingBuffer::process_layer()` handles this in up to three passes of that +slowdown over the parsed layer: + +1. The normal slowdown runs. If no outer wall ends inside the range, its result + is used as is. +2. Otherwise the slowdown runs again from the unslowed layer. This time the outer + walls whose speed was at or above the maximum are fixed at the maximum and + are not adjustable. The other features must take the remaining time. This is + the same mechanism that "Don't slow down outer walls" uses to exclude outer + walls. +3. The second result is used if its estimated layer time reaches the time of + the first pass or the minimum layer time, whichever is shorter, within the + 0.2% the slowdown accepts short of its target. If not, the other features + cannot slow down enough, and the outer walls are fixed at the minimum of the + range instead. + +Holding at the maximum comes first for two reasons. The path speeds of outer +walls are already outside the range, so the walls held here had a speed above +it, and the maximum is the allowed speed closest to their own. It also keeps the wall speed smooth from layer to layer: as +the layers get shorter, the slowed speed drops towards the maximum and then +stays there. The minimum layer time is a cooling requirement, so it is never +traded for the range. The minimum of the range only adds time, so the fallback +always keeps the layer as long as the first pass made it. The fallback makes a +step in wall speed, from the maximum to the minimum, at the first layer that +needs it. + +Only the extruders whose outer walls landed inside the range are held. Holding +the walls of every extruder would slow filaments that the slowdown did not +touch, such as a filament with the slowdown turned off, or one whose own +minimum layer time the layer already meets. + +The layer is only copied when resonance avoidance is on, and the extra passes +run only on layers where an outer wall landed inside the range. With "Don't +slow down outer walls" on, the walls are never slowed, so these passes never +run. The cooling stage needs a minimum above zero, because holding a wall at +zero speed has no meaning. + +## Not covered + +Overhang speeds are set for each point of a path, after the path speed above. +They can put parts of an outer wall inside the range. Those speeds are set by +the user for overhang quality, so resonance avoidance leaves them as they are. +The cooling stage does not hold them either: it only holds outer walls whose +speed was at or above the maximum. diff --git a/docs/HLSD/volumetric-speeds.md b/docs/HLSD/volumetric-speeds.md new file mode 100644 index 0000000000..243154e713 --- /dev/null +++ b/docs/HLSD/volumetric-speeds.md @@ -0,0 +1,106 @@ +# Volumetric speeds — High Level Design + +## Purpose + +A linear speed (mm/s) extrudes a different flow on every line whose cross section +differs: a wide gap fill line, an Arachne wall that widens, a thicker first layer +or an adaptive layer height all push more plastic at the same feed rate. Users who +tune a profile around the hotend's melting capacity think in mm³/s instead. + +Volumetric speeds let a process profile set the speed of each feature as a flow. +Each line is printed at that flow divided by its own cross section, so every line +of a feature extrudes the same flow whatever its width or height. + +## Settings + +`enable_volumetric_speeds` switches every feature at once. It is a global +`PrintConfig` option and is off by default, so existing profiles and projects +slice exactly as before. + +Each feature whose linear speed is an absolute value has a volumetric alternative, +`_volumetric_flow`: first layer, first layer infill, outer and inner +wall, sparse infill, internal solid infill, top surface, gap infill, support, +support interface, and external and internal bridges. Each one is a nullable +per-nozzle-variant vector in the same config class as its linear counterpart, so +the wall, infill, bridge and support flows can be overridden per object like +their speeds. A value is either absolute (mm³/s) or a percentage of the +`filament_max_volumetric_speed` of the filament printing the line. The filament +limit still caps the result, whichever form is used. + +The keys end in `_volumetric_flow` because `outer_wall_volumetric_speed` is +already a custom G-code placeholder that vendor change-filament G-code reads. + +Some speeds have no volumetric alternative and apply over the resolved speeds: + +- Small perimeter, small support perimeter, overhang and scarf joint speeds are + modifiers. A percentage is taken of the resolved feature speed, which is the + same as a percentage of its flow; an absolute value stays in mm/s. +- Ironing extrudes a small fraction of a full line, so a flow target would give + meaningless feed rates. +- Travel speeds and the skirt speed override do not extrude, or override the + feature speed outright. + +## Speed resolution + +`GCode::_extrude` resolves every feature speed through `GCode::feature_speed`, +which returns the linear speed, or with volumetric speeds the configured flow +divided by the path's flow. That flow is `GCode::extrusion_mm3_per_mm`: the +geometric flow times the print, filament and role flow ratios and the mixed-colour +sub-layer ratio. The E values and the filament limit use the same flow, so the +configured flow is the flow the printer extrudes. A path that extrudes nothing, +such as the move inward before an outer wall seam, keeps the linear speed. + +Speeds derived from a feature speed follow it: the first-layer speeds and the +interpolation over the slow-down layers, the overhang reference speeds, small +perimeters (resolved per path in `extrude_loop`), small support perimeters +(from the first path of each support entity) and the skirt and brim, which +`_extrude` prints at the support speed by role. + +Calibration prints set linear speeds, some of them per layer through the +calibration config, so `feature_speed` ignores volumetric speeds whenever +`Print::calib_mode()` is set. The flow rate calibration sets no calibration mode, +so its setup turns the option off in the print preset instead. + +## Max external volumetric speed + +`filament_max_external_volumetric_speed` is a per-variant filament option, 0 by +default, that caps the flow of the visible features below the filament's max +volumetric speed, with or without volumetric speeds. It applies to outer walls, +to what prints at the external bridge speed (bridge infill and overhang walls), +and to top surfaces on a layer where their region is not ironed. + +`GCode::volumetric_speed_limit` returns the flow limit of a path's role, and +`_extrude` uses it everywhere the filament limit used to cap a speed, including +the resonance-avoidance re-cap and the overhang reference speed. Resonance +avoidance moves an outer wall in the upper half of its band up to the band's top; +when the limit keeps the wall below that top, the wall drops to the band's bottom +instead, so the boost never exceeds the limit. Whether a top +surface is ironed follows `Layer::choose_ironing_extruder`, the rule the ironing +generator uses, so an ironed top surface keeps the higher limit. Calibration prints +ignore the option, as they do volumetric speeds. A volumetric speed in percent is +still a share of the filament's max volumetric speed, not of this limit. + +## Outside the G-code generator + +- Fill grouping and perimeter merging: `SurfaceFillParams` compares the + volumetric flow of the infill role next to its linear speed, and + `Layer::is_perimeter_compatible` compares the wall and gap fill flows. Both + compare them whether or not the option is on; that can only keep apart regions + whose volumetric values were overridden per object. +- Wipe towers borrow feature speeds: `WipeTower2` the sparse infill, inner wall and + first layer speeds, `WipeTower` the first layer speed. With volumetric speeds, + `set_layer` derives them from the configured flows and the tower's own line cross + section on that layer. A percentage uses the maximum volumetric speed of the + initial tool, as the linear values use its nozzle. +- The `outer_wall_volumetric_speed` placeholder reports the configured outer wall + flow, capped by the filament limit and the max external volumetric speed. +- Each key invalidates the same steps as its linear counterpart, except the gap + fill flow, which invalidates perimeters because perimeter merging compares it. + +## GUI + +The Speed page opens with a "Speed definition" group holding the switch, and each +volumetric row sits under its linear row (the bridge rows as a pair). +`ConfigManipulation::toggle_print_fff_options` shows exactly one row of each pair +through `toggle_line`, so the choice holds on every page, in the object settings +and in the Object Table, whose Speed category lists both keys of each pair. diff --git a/localization/i18n/OrcaSlicer.pot b/localization/i18n/OrcaSlicer.pot index e8ff50e250..960b645c84 100644 --- a/localization/i18n/OrcaSlicer.pot +++ b/localization/i18n/OrcaSlicer.pot @@ -14890,8 +14890,9 @@ msgid "Brim ear detection radius" msgstr "" msgid "" -"The geometry will be decimated before detecting sharp angles. This parameter indicates the minimum length of the deviation for the decimation.\n" -"0 to deactivate." +"The direction change at a corner is measured over a window of this length along the outline.\n" +"The window grows while the outline keeps curving, so a rounded corner counts as one corner once its whole turn is seen.\n" +"0 to measure the angle at every vertex without smoothing." msgstr "" msgid "Brim ears outer only" diff --git a/localization/i18n/ko/OrcaSlicer_ko.po b/localization/i18n/ko/OrcaSlicer_ko.po index 432de782a8..680c041950 100644 --- a/localization/i18n/ko/OrcaSlicer_ko.po +++ b/localization/i18n/ko/OrcaSlicer_ko.po @@ -49,7 +49,7 @@ msgid "Left extruder" msgstr "왼쪽 압출기" msgid "left extruder" -msgstr "왼쪽 익스트루더" +msgstr "왼쪽 압출기" msgid "Right Extruder" msgstr "오른쪽 압출기" @@ -58,7 +58,7 @@ msgid "Right extruder" msgstr "오른쪽 압출기" msgid "right extruder" -msgstr "오른쪽 익스트루더" +msgstr "오른쪽 압출기" # AI Translated msgid "Main Nozzle" @@ -180,7 +180,7 @@ msgid "Right" msgstr "오른쪽" msgid "extruder" -msgstr "익스트루더" +msgstr "압출기" msgid "TPU is not supported by AMS." msgstr "TPU는 AMS에서 지원되지 않습니다." @@ -219,7 +219,7 @@ msgid "Damp PVA will become flexible and get stuck inside AMS, please take care msgstr "습한 PVA는 유연해져서 AMS 내부에 달라붙게 됩니다. 사용하기 전에 건조시키십시오." msgid "Damp PVA is flexible and may get stuck in extruder. Dry it before use." -msgstr "습한 PVA는 유연하여 익스트루더에 끼일 수 있습니다. 사용 전에 건조시키세요." +msgstr "습한 PVA는 유연하여 압출기에 끼일 수 있습니다. 사용 전에 건조시키세요." msgid "The rough surface of PLA Glow can accelerate wear on the AMS system, particularly on the internal components of the AMS Lite." msgstr "PLA Glow의 거친 표면은 AMS 시스템, 특히 AMS Lite의 내부 부품의 마모를 가속화할 수 있습니다." @@ -263,7 +263,7 @@ msgstr "%s은(는) Filament Track Switch로 인해 로드 또는 언로드에 #, c-format, boost-format msgid "%s is not supported by %s extruder." -msgstr "%s은(는) %s 익스트루더에서 지원되지 않습니다." +msgstr "%s은(는) %s 압출기에서 지원되지 않습니다." # AI Translated #, c-format, boost-format @@ -6209,10 +6209,10 @@ msgid "AMS temperature is too high, which may cause the filament to soften. Plea msgstr "AMS 온도가 너무 높아 필라멘트가 연화될 수 있습니다. AMS 온도가 %d℃ 이하로 떨어질 때까지 기다리세요." msgid "The current chamber temperature or the target chamber temperature exceeds 45℃. In order to avoid extruder clogging, low temperature filament(PLA/PETG/TPU) is not allowed to be loaded." -msgstr "현재 챔버 온도 또는 목표 챔버 온도가 45℃를 초과합니다. 익스트루더 막힘을 방지하기 위해 저온 필라멘트(PLA/PETG/TPU) 로딩이 허용되지 않습니다." +msgstr "현재 챔버 온도 또는 목표 챔버 온도가 45℃를 초과합니다. 압출기 막힘을 방지하기 위해 저온 필라멘트(PLA/PETG/TPU) 로딩이 허용되지 않습니다." msgid "Low temperature filament(PLA/PETG/TPU) is loaded in the extruder. In order to avoid extruder clogging, it is not allowed to set the chamber temperature." -msgstr "저온 필라멘트(PLA/PETG/TPU)가 익스트루더에 로드되어 있습니다. 익스트루더 막힘을 방지하기 위해 챔버 온도 설정이 허용되지 않습니다." +msgstr "저온 필라멘트(PLA/PETG/TPU)가 압출기에 로드되어 있습니다. 압출기 막힘을 방지하기 위해 챔버 온도 설정이 허용되지 않습니다." msgid "When you set the chamber temperature below 40℃, the chamber temperature control will not be activated, and the target chamber temperature will automatically be set to 0℃." msgstr "챔버 온도를 40℃ 이하로 설정하면 챔버 온도 제어가 활성화되지 않습니다. 그리고 목표 챔버 온도는 자동으로 0℃ 로 설정됩니다." @@ -8466,7 +8466,7 @@ msgid "When printing is paused, filament loading and unloading are only supporte msgstr "인쇄가 일시 중지되면 필라멘트 로딩 및 언로딩은 외부 슬롯에서만 지원됩니다." msgid "Current extruder is busy changing filament." -msgstr "현재 익스트루더가 필라멘트 교체 중입니다." +msgstr "현재 압출기가 필라멘트 교체 중입니다." # AI Translated msgid "\"Load\" or \"Unload\" is not supported for external spool while using Filament Track Switch." @@ -13850,7 +13850,7 @@ msgid "Single extruder multi-material setup" msgstr "단일 압출기 다중 재료 설정" msgid "Number of extruders of the printer." -msgstr "프린터 익스트루더 수." +msgstr "프린터 압출기 수." msgid "" "Single Extruder Multi Material is selected, and all extruders must have the same diameter.\n" @@ -14420,7 +14420,7 @@ msgstr "" "수정한 사전 설정 값을 삭제하거나 수정된 ​​값을 새 프로젝트로 전송하도록 선택할 수 있습니다" msgid "Extruder count" -msgstr "익스트루더 수" +msgstr "압출기 수" # AI Translated msgid "Capabilities" diff --git a/resources/images/live_stream_bambu.png b/resources/images/live_stream_bambu.png new file mode 100644 index 0000000000..480a544ccd Binary files /dev/null and b/resources/images/live_stream_bambu.png differ diff --git a/resources/images/live_stream_default.png b/resources/images/live_stream_default.png index 480a544ccd..c5a8bdcdab 100644 Binary files a/resources/images/live_stream_default.png and b/resources/images/live_stream_default.png differ diff --git a/resources/profiles/Anker.json b/resources/profiles/Anker.json index a902697e8c..7711db67e4 100644 --- a/resources/profiles/Anker.json +++ b/resources/profiles/Anker.json @@ -1,6 +1,6 @@ { "name": "Anker", - "version": "02.04.00.07", + "version": "02.04.00.08", "force_update": "0", "description": "Anker configurations", "machine_model_list": [ diff --git a/resources/profiles/Anker/machine/fdm_marlin_common.json b/resources/profiles/Anker/machine/fdm_marlin_common.json index 4f17be404f..044a9b2ca7 100644 --- a/resources/profiles/Anker/machine/fdm_marlin_common.json +++ b/resources/profiles/Anker/machine/fdm_marlin_common.json @@ -6,7 +6,7 @@ "instantiation": "false", "gcode_flavor": "marlin2", "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\nG92 E0.0\n;[layer_z]\n\n", - "file_start_gcode": ";TIME:{print_time_sec}s\n;Filament weight: {total_weight}g\n;Filament used: {used_filament}m\n;Layer height: {layer_height}\n;material_print_temperature_layer_0: {first_layer_temperature[0]}", + "file_start_gcode": ";TIME:{print_time_total_sec}\n;Filament weight: {total_weight}g\n;Filament used: {used_filament}m\n;Layer height: {layer_height}\n;material_print_temperature_layer_0: {first_layer_temperature[0]}", "machine_start_gcode": "M4899 T3 ; Enable v3 jerk and S-curve acceleration \nM104 S150 ; Set hotend temp to 150 degrees to prevent ooze\nM190 S{first_layer_bed_temperature[0]} ; set and wait for bed temp to stabilize\nM109 S{first_layer_temperature[0]} ; set final nozzle temp to stabilize\nG28 ;Home\n;LAYER_COUNT:{total_layer_count}", "machine_end_gcode": "M104 S0\nM140 S0\n;Retract the filament\nG92 E1\nG1 E-1 F300\nG28 X0 Y0\nM18", "change_filament_gcode": "M600", diff --git a/resources/profiles/Prusa.json b/resources/profiles/Prusa.json index 26d7a16f32..ea5ee4678a 100644 --- a/resources/profiles/Prusa.json +++ b/resources/profiles/Prusa.json @@ -1,6 +1,6 @@ { "name": "Prusa", - "version": "02.04.00.19", + "version": "02.04.00.20", "force_update": "0", "description": "Prusa configurations", "machine_model_list": [ diff --git a/resources/profiles/Prusa/process/0.15mm BALANCED @COREONE0.4 + MMU3.json b/resources/profiles/Prusa/process/0.15mm BALANCED @COREONE0.4 + MMU3.json index 5403009920..276ff4d376 100644 --- a/resources/profiles/Prusa/process/0.15mm BALANCED @COREONE0.4 + MMU3.json +++ b/resources/profiles/Prusa/process/0.15mm BALANCED @COREONE0.4 + MMU3.json @@ -17,9 +17,6 @@ "infill_wall_overlap": "25%", "reduce_infill_retraction": "1", "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[0]}-{filament_type[1]}-{filament_type[2]}-{filament_type[3]}-{filament_type[4]}_COREONE_MMU3_{print_time}.gcode", - "overhang_1_4_speed": "0", - "overhang_2_4_speed": "25", - "overhang_4_4_speed": "80%", "support_line_width": "0.4", "minimum_sparse_infill_area": "15", "support_bottom_z_distance": "0.17", diff --git a/resources/profiles/Prusa/process/0.15mm SPEED @CORE One 0.4.json b/resources/profiles/Prusa/process/0.15mm SPEED @CORE One 0.4.json index d3b097db08..26927eb4c3 100644 --- a/resources/profiles/Prusa/process/0.15mm SPEED @CORE One 0.4.json +++ b/resources/profiles/Prusa/process/0.15mm SPEED @CORE One 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "VzCIZcLeFkrR4e3N", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.15mm SPEED @CORE One HF 0.4.json b/resources/profiles/Prusa/process/0.15mm SPEED @CORE One HF 0.4.json index 9b36c67a5f..2fe41e9a8c 100644 --- a/resources/profiles/Prusa/process/0.15mm SPEED @CORE One HF 0.4.json +++ b/resources/profiles/Prusa/process/0.15mm SPEED @CORE One HF 0.4.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "Ajm1BOji7RhOH8vj", "instantiation": "true", - "overhang_1_4_speed": "50", - "overhang_3_4_speed": "60%", + "overhang_2_4_speed": "50", + "overhang_1_4_speed": "60%", "sparse_infill_speed": "300", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.15mm SPEED @CORE One L HF 0.4.json b/resources/profiles/Prusa/process/0.15mm SPEED @CORE One L HF 0.4.json index cb588c27b1..7bb1cecd96 100644 --- a/resources/profiles/Prusa/process/0.15mm SPEED @CORE One L HF 0.4.json +++ b/resources/profiles/Prusa/process/0.15mm SPEED @CORE One L HF 0.4.json @@ -6,7 +6,7 @@ "setting_id": "wATWoU2pvkCugSEj", "instantiation": "true", "overhang_2_4_speed": "50", - "overhang_3_4_speed": "60%", + "overhang_1_4_speed": "60%", "sparse_infill_speed": "300", "travel_speed": "500", "travel_acceleration": "6000", diff --git a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.4.json b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.4.json index de47b769b0..da097b50c4 100644 --- a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.4.json +++ b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "Er7s41kb6bBDjBVP", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "sparse_infill_speed": "120", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.5.json b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.5.json index 4d3400fdfe..2f5ba297ee 100644 --- a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.5.json +++ b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "Ri9JPCMN8YgbT9pp", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.6.json b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.6.json index f21c7f6283..56e693a755 100644 --- a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One 0.6.json @@ -6,8 +6,8 @@ "setting_id": "M8WdIdQWUxYohSoe", "instantiation": "true", "inner_wall_speed": "70", - "overhang_3_4_speed": "30", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "30", + "overhang_1_4_speed": "70%", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One L 0.6.json b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One L 0.6.json index 447e355c81..a7a418e492 100644 --- a/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One L 0.6.json +++ b/resources/profiles/Prusa/process/0.15mm STRUCTURAL @CORE One L 0.6.json @@ -7,7 +7,7 @@ "instantiation": "true", "inner_wall_speed": "80", "overhang_2_4_speed": "30", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "travel_speed": "500", "travel_acceleration": "6000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm BALANCED @COREONE0.4 + MMU3.json b/resources/profiles/Prusa/process/0.20mm BALANCED @COREONE0.4 + MMU3.json index fde34e9db1..d919035b67 100644 --- a/resources/profiles/Prusa/process/0.20mm BALANCED @COREONE0.4 + MMU3.json +++ b/resources/profiles/Prusa/process/0.20mm BALANCED @COREONE0.4 + MMU3.json @@ -17,9 +17,6 @@ "infill_wall_overlap": "25%", "reduce_infill_retraction": "1", "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[0]}-{filament_type[1]}-{filament_type[2]}-{filament_type[3]}-{filament_type[4]}_COREONE_MMU3_{print_time}.gcode", - "overhang_1_4_speed": "0", - "overhang_2_4_speed": "25", - "overhang_4_4_speed": "80%", "support_line_width": "0.4", "minimum_sparse_infill_area": "15", "support_base_pattern": "default", diff --git a/resources/profiles/Prusa/process/0.20mm SOLUBLE FULL @CORE One 0.4.json b/resources/profiles/Prusa/process/0.20mm SOLUBLE FULL @CORE One 0.4.json index 36b166b8ba..234b3620dc 100644 --- a/resources/profiles/Prusa/process/0.20mm SOLUBLE FULL @CORE One 0.4.json +++ b/resources/profiles/Prusa/process/0.20mm SOLUBLE FULL @CORE One 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "o828K3OgfkY099HE", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "compatible_printers_condition": "printer_notes=~/.*PRINTER_MODEL_COREONE[^_a-zA-Z0-9].*/ and nozzle_diameter[0]==0.4 and printer_notes!~/.*HF_NOZZLE.*/", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.20mm SOLUBLE INTERFACE @CORE One 0.4.json b/resources/profiles/Prusa/process/0.20mm SOLUBLE INTERFACE @CORE One 0.4.json index 7a880ee217..f0f707eb60 100644 --- a/resources/profiles/Prusa/process/0.20mm SOLUBLE INTERFACE @CORE One 0.4.json +++ b/resources/profiles/Prusa/process/0.20mm SOLUBLE INTERFACE @CORE One 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "hC9F5dv2WJ4pJMJx", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "compatible_printers_condition": "printer_notes=~/.*PRINTER_MODEL_COREONE[^_a-zA-Z0-9].*/ and nozzle_diameter[0]==0.4 and printer_notes!~/.*HF_NOZZLE.*/", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.4.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.4.json index 0edfed5957..39a1ee4cec 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.4.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "TcOnRh8cZfyZcQzx", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.5.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.5.json index 3f83a3ff54..de568bc9bd 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.5.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "0XpimvIotRzkG5C0", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.6.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.6.json index 65410c7fa8..535c4affda 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "wfltF3Wq4BExv5nn", "instantiation": "true", - "overhang_3_4_speed": "30", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "30", + "overhang_1_4_speed": "70%", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.4.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.4.json index 3e286cb782..19b7af2862 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.4.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.4.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "JiBYOvJXa3KIsWlk", "instantiation": "true", - "overhang_3_4_speed": "50", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "50", + "overhang_1_4_speed": "70%", "sparse_infill_speed": "300", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.5.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.5.json index f42edd925c..69bf0abf78 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.5.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "8FVn4dELsu1VoEFn", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.6.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.6.json index c6d2192d23..beab37e42b 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.6.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One HF 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "kzKpZiJ0ni4ry97j", "instantiation": "true", - "overhang_3_4_speed": "30", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "30", + "overhang_1_4_speed": "70%", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L 0.6.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L 0.6.json index 3bfe8d97b0..a855b22c39 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L 0.6.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L 0.6.json @@ -6,7 +6,7 @@ "setting_id": "Xge3hbQO7LYu708A", "instantiation": "true", "overhang_2_4_speed": "30", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "travel_speed": "500", "travel_acceleration": "6000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.4.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.4.json index ccae634dde..1f3c3d0a56 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.4.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.4.json @@ -6,7 +6,7 @@ "setting_id": "VfD1ailcNZG4715m", "instantiation": "true", "overhang_2_4_speed": "50", - "overhang_3_4_speed": "60%", + "overhang_1_4_speed": "60%", "sparse_infill_speed": "300", "travel_speed": "500", "travel_acceleration": "6000", diff --git a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.6.json b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.6.json index 76a8c84750..53e77fd5b7 100644 --- a/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.6.json +++ b/resources/profiles/Prusa/process/0.20mm SPEED @CORE One L HF 0.6.json @@ -6,7 +6,7 @@ "setting_id": "NlEh0boG6G8cm7er", "instantiation": "true", "overhang_2_4_speed": "30", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "travel_speed": "500", "travel_acceleration": "6000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.4.json b/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.4.json index 49c0105c04..180be48eee 100644 --- a/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.4.json +++ b/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "MJI3kUwsJ3adqKx7", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.5.json b/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.5.json index 3b9fa87546..ad31722fe9 100644 --- a/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.5.json +++ b/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "4dkMphdZvBhDyRH3", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.6.json b/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.6.json index 4b3404e0d6..35de036a4c 100644 --- a/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.20mm STRUCTURAL @CORE One 0.6.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "SJgbNC9RPNJ5pETW", "instantiation": "true", - "overhang_3_4_speed": "30", + "overhang_2_4_speed": "30", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm BALANCED @COREONE0.4 + MMU3.json b/resources/profiles/Prusa/process/0.25mm BALANCED @COREONE0.4 + MMU3.json index 5ed8b5b9be..301304d61e 100644 --- a/resources/profiles/Prusa/process/0.25mm BALANCED @COREONE0.4 + MMU3.json +++ b/resources/profiles/Prusa/process/0.25mm BALANCED @COREONE0.4 + MMU3.json @@ -17,9 +17,6 @@ "infill_wall_overlap": "25%", "reduce_infill_retraction": "1", "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[0]}-{filament_type[1]}-{filament_type[2]}-{filament_type[3]}-{filament_type[4]}_COREONE_MMU3_{print_time}.gcode", - "overhang_1_4_speed": "0", - "overhang_2_4_speed": "15", - "overhang_3_4_speed": "25", "inner_wall_line_width": "0.45", "outer_wall_line_width": "0.45", "sparse_infill_line_width": "0.45", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.5.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.5.json index 3c3e91d783..9ca8868267 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.5.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "j18VMrjkn0nNcqF0", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.6.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.6.json index e86acffc45..9ca2bfa671 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "UbyRKcnbmQtxSOGo", "instantiation": "true", - "overhang_3_4_speed": "30", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "30", + "overhang_1_4_speed": "70%", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.4.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.4.json index d9e9f8e422..599f109d24 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.4.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.4.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "HmzxDcsh7N8XFbcZ", "instantiation": "true", - "overhang_3_4_speed": "50", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "50", + "overhang_1_4_speed": "70%", "sparse_infill_speed": "300", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.5.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.5.json index 7f96a05054..8f1233d9f6 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.5.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "HvtMtivKFekmwpqp", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.6.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.6.json index 41dc420472..84c0234f35 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.6.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One HF 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "L5p4CoVhGtFA8NUk", "instantiation": "true", - "overhang_3_4_speed": "30", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "30", + "overhang_1_4_speed": "70%", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L 0.6.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L 0.6.json index d6dce7700c..0aea259882 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L 0.6.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L 0.6.json @@ -6,7 +6,7 @@ "setting_id": "mMMK2jmzahWruFjK", "instantiation": "true", "overhang_2_4_speed": "30", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "travel_speed": "500", "travel_acceleration": "6000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.4.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.4.json index ae07e2925f..f440a00f02 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.4.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.4.json @@ -6,7 +6,7 @@ "setting_id": "MOYF1incx6aCPT3i", "instantiation": "true", "overhang_2_4_speed": "50", - "overhang_3_4_speed": "60%", + "overhang_1_4_speed": "60%", "sparse_infill_speed": "300", "travel_speed": "500", "travel_acceleration": "6000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.6.json b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.6.json index 76b3e99919..cb3540cd0e 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.6.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @CORE One L HF 0.6.json @@ -6,7 +6,7 @@ "setting_id": "71l9zfjgGKBk7P4O", "instantiation": "true", "overhang_2_4_speed": "30", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "travel_speed": "500", "travel_acceleration": "6000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm SPEED @COREONE0.4 + MMU3.json b/resources/profiles/Prusa/process/0.25mm SPEED @COREONE0.4 + MMU3.json index 040ce8e331..0b700cf903 100644 --- a/resources/profiles/Prusa/process/0.25mm SPEED @COREONE0.4 + MMU3.json +++ b/resources/profiles/Prusa/process/0.25mm SPEED @COREONE0.4 + MMU3.json @@ -15,9 +15,6 @@ "infill_wall_overlap": "25%", "reduce_infill_retraction": "1", "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[0]}-{filament_type[1]}-{filament_type[2]}-{filament_type[3]}-{filament_type[4]}_COREONE_MMU3_{print_time}.gcode", - "overhang_1_4_speed": "0", - "overhang_2_4_speed": "15", - "overhang_3_4_speed": "25", "inner_wall_line_width": "0.45", "outer_wall_line_width": "0.45", "sparse_infill_line_width": "0.45", diff --git a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.5.json b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.5.json index 1bf77877b3..1623d2f6e8 100644 --- a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.5.json +++ b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "Xwzu2GvZfskVw39Z", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.6.json b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.6.json index 71beca6418..5a8092b8af 100644 --- a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One 0.6.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "2Az8F1vPrNXgKK1V", "instantiation": "true", - "overhang_3_4_speed": "30", + "overhang_2_4_speed": "30", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One HF 0.4.json b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One HF 0.4.json index 572cc0d9db..f734551f27 100644 --- a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One HF 0.4.json +++ b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @CORE One HF 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "zBWdXWEuyUFu88Pg", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @COREONE0.4 + MMU3.json b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @COREONE0.4 + MMU3.json index 31e7244fec..8670c819bd 100644 --- a/resources/profiles/Prusa/process/0.25mm STRUCTURAL @COREONE0.4 + MMU3.json +++ b/resources/profiles/Prusa/process/0.25mm STRUCTURAL @COREONE0.4 + MMU3.json @@ -15,9 +15,6 @@ "infill_wall_overlap": "25%", "reduce_infill_retraction": "1", "filename_format": "{input_filename_base}_{layer_height}mm_{filament_type[0]}-{filament_type[1]}-{filament_type[2]}-{filament_type[3]}-{filament_type[4]}_COREONE_MMU3_{print_time}.gcode", - "overhang_1_4_speed": "50%", - "overhang_2_4_speed": "15", - "overhang_4_4_speed": "90%", "inner_wall_line_width": "0.45", "outer_wall_line_width": "0.45", "sparse_infill_line_width": "0.45", diff --git a/resources/profiles/Prusa/process/0.28mm DRAFT @CORE One HF 0.4.json b/resources/profiles/Prusa/process/0.28mm DRAFT @CORE One HF 0.4.json index 53a0ac9a31..7fc1746765 100644 --- a/resources/profiles/Prusa/process/0.28mm DRAFT @CORE One HF 0.4.json +++ b/resources/profiles/Prusa/process/0.28mm DRAFT @CORE One HF 0.4.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "CbQCA65dMMEkK134", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "support_threshold_angle": "35", "outer_wall_acceleration": "3000", "inner_wall_acceleration": "6000", diff --git a/resources/profiles/Prusa/process/0.30mm DETAIL @CORE One 0.8.json b/resources/profiles/Prusa/process/0.30mm DETAIL @CORE One 0.8.json index 9c6bd58097..41c119630c 100644 --- a/resources/profiles/Prusa/process/0.30mm DETAIL @CORE One 0.8.json +++ b/resources/profiles/Prusa/process/0.30mm DETAIL @CORE One 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "m23j7wSoEJdezJgy", "instantiation": "true", - "overhang_3_4_speed": "35", + "overhang_2_4_speed": "35", "top_surface_acceleration": "2000", "inner_wall_acceleration": "2500", "internal_solid_infill_acceleration": "5000", diff --git a/resources/profiles/Prusa/process/0.30mm SPEED @CORE One HF 0.8.json b/resources/profiles/Prusa/process/0.30mm SPEED @CORE One HF 0.8.json index bf03acf0f0..62fff95603 100644 --- a/resources/profiles/Prusa/process/0.30mm SPEED @CORE One HF 0.8.json +++ b/resources/profiles/Prusa/process/0.30mm SPEED @CORE One HF 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "wV3jMl7YWJ8dwdE8", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "top_surface_acceleration": "2000", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.30mm STRUCTURAL @CORE One HF 0.8.json b/resources/profiles/Prusa/process/0.30mm STRUCTURAL @CORE One HF 0.8.json index 39b25ddf00..fc88a32c50 100644 --- a/resources/profiles/Prusa/process/0.30mm STRUCTURAL @CORE One HF 0.8.json +++ b/resources/profiles/Prusa/process/0.30mm STRUCTURAL @CORE One HF 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "uzCEBmbNEQVjR8i8", "instantiation": "true", - "overhang_3_4_speed": "40", + "overhang_2_4_speed": "40", "top_surface_acceleration": "2000", "support_speed": "100", "support_interface_speed": "55%", diff --git a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One 0.6.json b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One 0.6.json index 2eff09b3df..287c7141ea 100644 --- a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "ggWI2g8z3wNfnFG3", "instantiation": "true", - "overhang_3_4_speed": "30", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "30", + "overhang_1_4_speed": "70%", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.5.json b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.5.json index 130a8407ab..b1edf78e64 100644 --- a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.5.json +++ b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "gDKE0bH5qPyNewzu", "instantiation": "true", - "overhang_3_4_speed": "50", + "overhang_2_4_speed": "50", "support_interface_speed": "50%", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.6.json b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.6.json index 0493091619..85f66e22bb 100644 --- a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.6.json +++ b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One HF 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "h1nfJq2NJquQhuRt", "instantiation": "true", - "overhang_3_4_speed": "35", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "35", + "overhang_1_4_speed": "70%", "top_surface_acceleration": "2000", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L 0.6.json b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L 0.6.json index 4a08d4af83..bf530fc8f9 100644 --- a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L 0.6.json +++ b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L 0.6.json @@ -6,7 +6,7 @@ "setting_id": "T7OokZGHzzb08zU1", "instantiation": "true", "overhang_2_4_speed": "30", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "travel_speed": "500", "travel_acceleration": "6000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L HF 0.6.json b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L HF 0.6.json index 59e38d58b3..a6a0141879 100644 --- a/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L HF 0.6.json +++ b/resources/profiles/Prusa/process/0.32mm SPEED @CORE One L HF 0.6.json @@ -6,7 +6,7 @@ "setting_id": "cK8T3bqisPivC2MG", "instantiation": "true", "overhang_2_4_speed": "35", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "top_surface_speed": "2000", "travel_speed": "500", "travel_acceleration": "6000", diff --git a/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One 0.6.json b/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One 0.6.json index 8047c051e5..349adb0fb4 100644 --- a/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One 0.6.json +++ b/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One 0.6.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "xwwhZvsBxulQ1x0L", "instantiation": "true", - "overhang_3_4_speed": "30", + "overhang_2_4_speed": "30", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.5.json b/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.5.json index 616f708c24..6609251619 100644 --- a/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.5.json +++ b/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.5.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "RISdNOnVSnA7v3yH", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "support_speed": "120", "support_interface_speed": "50%", "travel_speed": "350", diff --git a/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.6.json b/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.6.json index 6af7e5c99e..13f6ace652 100644 --- a/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.6.json +++ b/resources/profiles/Prusa/process/0.32mm STRUCTURAL @CORE One HF 0.6.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "VeYx8eYxSM2B7X2d", "instantiation": "true", - "overhang_3_4_speed": "35", + "overhang_2_4_speed": "35", "support_speed": "110", "support_interface_speed": "50%", "travel_speed": "350", diff --git a/resources/profiles/Prusa/process/0.40mm QUALITY @CORE One 0.8.json b/resources/profiles/Prusa/process/0.40mm QUALITY @CORE One 0.8.json index 13aac206ae..c085f8244c 100644 --- a/resources/profiles/Prusa/process/0.40mm QUALITY @CORE One 0.8.json +++ b/resources/profiles/Prusa/process/0.40mm QUALITY @CORE One 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "2XzTOQAtbbUhXKeX", "instantiation": "true", - "overhang_3_4_speed": "35", + "overhang_2_4_speed": "35", "top_surface_acceleration": "2000", "inner_wall_acceleration": "2500", "internal_solid_infill_acceleration": "5000", diff --git a/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.6.json b/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.6.json index b6efaf1a85..7b27d0d7a9 100644 --- a/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.6.json +++ b/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.6.json @@ -5,8 +5,8 @@ "from": "system", "setting_id": "ecyfUzv5L2MJ74lQ", "instantiation": "true", - "overhang_3_4_speed": "35", - "overhang_4_4_speed": "70%", + "overhang_2_4_speed": "35", + "overhang_1_4_speed": "70%", "top_surface_acceleration": "2000", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.8.json b/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.8.json index 1d1f670be5..60f513e6c0 100644 --- a/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.8.json +++ b/resources/profiles/Prusa/process/0.40mm SPEED @CORE One HF 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "md2z7xPjOLeOWx25", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "top_surface_acceleration": "2000", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.40mm SPEED @CORE One L HF 0.6.json b/resources/profiles/Prusa/process/0.40mm SPEED @CORE One L HF 0.6.json index d06cdafb35..bbb77c9125 100644 --- a/resources/profiles/Prusa/process/0.40mm SPEED @CORE One L HF 0.6.json +++ b/resources/profiles/Prusa/process/0.40mm SPEED @CORE One L HF 0.6.json @@ -6,7 +6,7 @@ "setting_id": "Qz6UOajHaO5Zctcf", "instantiation": "true", "overhang_2_4_speed": "35", - "overhang_3_4_speed": "70%", + "overhang_1_4_speed": "70%", "top_surface_speed": "2000", "travel_speed": "500", "travel_acceleration": "6000", diff --git a/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.6.json b/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.6.json index a9704ffdf7..cbe0aeb7ea 100644 --- a/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.6.json +++ b/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.6.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "6oVNX62VOpdaRmbI", "instantiation": "true", - "overhang_3_4_speed": "35", + "overhang_2_4_speed": "35", "travel_speed": "350", "travel_acceleration": "7000", "default_acceleration": "3000", diff --git a/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.8.json b/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.8.json index b860b0ccad..3a7ce5ee82 100644 --- a/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.8.json +++ b/resources/profiles/Prusa/process/0.40mm STRUCTURAL @CORE One HF 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "oGmCrMvVMo9eXPlo", "instantiation": "true", - "overhang_3_4_speed": "40", + "overhang_2_4_speed": "40", "top_surface_acceleration": "2000", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/profiles/Prusa/process/0.55mm SPEED @CORE One HF 0.8.json b/resources/profiles/Prusa/process/0.55mm SPEED @CORE One HF 0.8.json index de9024e3f2..ed7c04f300 100644 --- a/resources/profiles/Prusa/process/0.55mm SPEED @CORE One HF 0.8.json +++ b/resources/profiles/Prusa/process/0.55mm SPEED @CORE One HF 0.8.json @@ -5,7 +5,7 @@ "from": "system", "setting_id": "zBotlr9rsKLjriaN", "instantiation": "true", - "overhang_3_4_speed": "45", + "overhang_2_4_speed": "45", "top_surface_acceleration": "2000", "travel_speed": "350", "travel_acceleration": "7000", diff --git a/resources/web/dialog/PluginsDialog/index.js b/resources/web/dialog/PluginsDialog/index.js index c2d31588da..2c3efdc0d1 100644 --- a/resources/web/dialog/PluginsDialog/index.js +++ b/resources/web/dialog/PluginsDialog/index.js @@ -369,8 +369,12 @@ function HandleStudio(value) { delete draft.additions[request.category]; if (payload.success === true && draft && (request.operation === "replace" || request.operation === "remove")) delete draft.edits[request.category]?.[request.old_value]; - // The host sends the updated list before this result. Re-read it instead of dropping the - // draft: edits the user made while this request was in flight must survive the reply. + if (payload.success === true && draft && (request.category === "fs_create" || request.category === "fs_delete")) { + if (request.operation === "set_mode") + (draft.partialModes ||= {})[request.category] = request.value === "partial"; + else if (request.operation === "remove") + (draft.partialModes ||= {})[request.category] = true; + } if (draft) ApplyLatestPermissionSource(request.pluginKey); renderedPermissionsSignature = null; @@ -1107,11 +1111,11 @@ function RenderPermissions(plugin) { ["events", "permissions_events", "Events"] ]; const categoryGuidance = { - fs_read: [T("permissions_filesystem_help", "Enter an absolute path on this computer. Add /* at the end to include the folder and everything below it; no other wildcard is accepted. A read/write grant can create files through open(), but it does not cover create or delete events such as os.mkdir and os.remove. Without Full access, each such event outside allowed folders needs its own approval, which is never saved. When a plugin runs in the background, these events are denied without asking."), T("permissions_filesystem_placeholder", "/path/to/directory/*")], - fs_readwrite: [T("permissions_filesystem_help", "Enter an absolute path on this computer. Add /* at the end to include the folder and everything below it; no other wildcard is accepted. A read/write grant can create files through open(), but it does not cover create or delete events such as os.mkdir and os.remove. Without Full access, each such event outside allowed folders needs its own approval, which is never saved. When a plugin runs in the background, these events are denied without asking."), T("permissions_filesystem_placeholder", "/path/to/directory/*")], + fs_read: [T("permissions_filesystem_help", "Enter an absolute path on this computer. Add /* at the end to include the folder and everything below it; no other wildcard is accepted. A read/write grant can create files through open(), but does not cover create or delete events such as os.mkdir and os.remove."), T("permissions_filesystem_placeholder", "/path/to/directory/*")], + fs_readwrite: [null, ""], network_http: [null, "https://example.com"], network_socket: [null, "https://example.com"], - process: [T("permissions_process_help", "Enter the exact value recorded by the audit. It may be a Python representation of the command."), T("permissions_process_placeholder", "Exact audited value")], + process: [T("permissions_process_help", "Executable grants cover all arguments. CommandLine: entries cover only the exact command line."), T("permissions_process_placeholder", "Executable or command name")], threading: [T("permissions_threading_help_short", "Allow this plugin to create threads."), ""], events: [T("permissions_events_help", "Enter a category and event separated by a colon, such as Socket:socket.__new__."), T("permissions_events_placeholder", "Socket:socket.__new__")] }; @@ -1233,6 +1237,7 @@ function RenderPermissions(plugin) { for (const [key, translation, fallback] of categories) { if (key === "fs_read") { groupBodies.get(key).appendChild(RenderFilesystemSection(plugin, pluginKey, draft, installed, categoryGuidance.fs_read)); + groupBodies.get(key).appendChild(RenderFolderModes(plugin, pluginKey, draft, installed)); continue; } if (key === "fs_readwrite") @@ -1331,6 +1336,102 @@ function RenderPermissions(plugin) { } } +function RenderFolderModes(plugin, pluginKey, draft, editable) { + const section = document.createElement("section"); + section.className = "permission-section permission-filesystem"; + const description = document.createElement("div"); + description.className = "permission-description"; + const guidance = document.createElement("p"); + guidance.className = "permission-guidance"; + guidance.id = "permission-guidance-folder-modes"; + guidance.textContent = T("permissions_folder_modes_help", "Choose none, selected folders, or all folders. Enter an absolute folder path to allow operations directly inside it, or add /* to include all nested folders. No other wildcard is accepted. Delete access allows deleting files and folders inside the granted scope; deleting the granted folder itself requires access to its parent. Some folders are allowed automatically, while protected paths remain blocked. Other operations may require approval. A background operation needing approval is denied first; after approval, a retry may succeed."); + description.appendChild(guidance); + const controls = document.createElement("div"); + controls.className = "permission-controls"; + section.append(description, controls); + const types = [ + { key: "fs_create", label: T("permissions_create", "Create"), name: T("permissions_create_name", "File system: Create") }, + { key: "fs_delete", label: T("permissions_delete", "Delete"), name: T("permissions_delete_name", "File system: Delete") } + ]; + for (const type of types) { + const bucket = document.createElement("section"); + bucket.className = "permission-filesystem-bucket"; + const entries = draft.values[type.key]; + if (!Array.isArray(entries) || !Array.isArray(plugin.permissions?.[type.key])) { + const notice = document.createElement("p"); + notice.className = "permission-notice"; + notice.textContent = T("permissions_unavailable", "Permissions are unavailable."); + bucket.appendChild(notice); + controls.appendChild(bucket); + continue; + } + const savedEntries = plugin.permissions[type.key]; + const mode = savedEntries.length === 1 && savedEntries[0] === "*" ? "full" + : savedEntries.length || draft.partialModes?.[type.key] ? "partial" : "none"; + const fieldset = document.createElement("fieldset"); + fieldset.className = "permission-mode"; + fieldset.setAttribute("aria-describedby", guidance.id); + const legend = document.createElement("legend"); + legend.className = "permission-heading"; + legend.textContent = type.label; + fieldset.appendChild(legend); + for (const [value, label] of [["none", T("permissions_mode_none", "None")], ["partial", T("permissions_mode_partial", "Selected folders")], ["full", T("permissions_mode_full", "All folders")]]) { + const wrapper = document.createElement("label"); + const radio = document.createElement("input"); + radio.type = "radio"; + radio.id = `permission-mode-${type.key}-${value}`; + radio.name = `permission-mode-${type.key}`; + radio.value = value; + radio.checked = mode === value; + radio.disabled = !editable; + radio.addEventListener("change", () => { + if (savedEntries.length === 0 && value !== "full") { + (draft.partialModes ||= {})[type.key] = value === "partial"; + renderedPermissionsSignature = null; + RenderDetails(); + document.getElementById(radio.id)?.focus(); + } else { + CommitPermission(pluginKey, { operation: "set_mode", category: type.key, value }); + } + }); + wrapper.append(radio, document.createTextNode(label)); + fieldset.appendChild(wrapper); + } + bucket.appendChild(fieldset); + if (mode !== "partial" && (draft.additions[type.key] || Object.keys(draft.edits[type.key] || {}).length)) { + const notice = document.createElement("p"); + notice.className = "permission-notice"; + notice.textContent = T("permissions_folder_drafts_retained", "Unsaved folder changes are kept. Choose Selected folders to review or discard them."); + bucket.appendChild(notice); + } + if (mode === "partial") { + if (savedEntries.includes("*")) { + const notice = document.createElement("p"); + notice.className = "permission-notice"; + notice.textContent = T("permissions_folder_invalid_wildcard", "The wildcard is ignored when combined with folder paths. Remove it or choose all folders."); + bucket.appendChild(notice); + } + if (savedEntries.length === 0) { + const notice = document.createElement("p"); + notice.className = "permission-notice"; + notice.textContent = T("permissions_folder_empty", "Add a folder to save selected-folder access. No selected folders are saved until you add one."); + bucket.appendChild(notice); + } + const list = document.createElement("ul"); + list.className = "permission-list"; + const placeholder = T("permissions_folder_placeholder", "Absolute folder path"); + entries.forEach((entry, index) => { + const item = document.createElement("li"); + item.appendChild(PermissionForm(pluginKey, type.key, type.name, index, editable, placeholder, guidance.id, draft)); + list.appendChild(item); + }); + bucket.append(list, PermissionForm(pluginKey, type.key, type.name, null, editable, placeholder, guidance.id, draft)); + } + controls.appendChild(bucket); + } + return section; +} + function RenderFilesystemSection(plugin, pluginKey, draft, editable, guidanceText) { const section = document.createElement("section"); section.className = "permission-section permission-filesystem"; @@ -1910,7 +2011,8 @@ function ApplyDetailUpdateButton(button, plugin) { const updateStatus = plugin ? GetUpdateStatus(plugin) : "normal"; button.hidden = updateStatus !== "update_available"; // Re-enable after each render; the click handler disables it until the catalog refreshes. - button.disabled = false; + // A loading plugin cannot be updated, so keep the button disabled until its status settles. + button.disabled = plugin ? IsPluginLoading(plugin) : false; } function UpdateSelectedPlugin() { diff --git a/resources/web/dialog/PluginsDialog/index.test.js b/resources/web/dialog/PluginsDialog/index.test.js new file mode 100644 index 0000000000..f5b7051efc --- /dev/null +++ b/resources/web/dialog/PluginsDialog/index.test.js @@ -0,0 +1,51 @@ +// Regression tests for the Plugins dialog update control. +// Run: node resources/web/dialog/PluginsDialog/index.test.js +"use strict"; + +const fs = require("node:fs"); +const path = require("node:path"); +const vm = require("node:vm"); +const { test } = require("node:test"); +const assert = require("node:assert/strict"); + +// index.js is a browser script, not a module. Load it the way the page does, with just enough of +// the host globals present for its top-level declarations. Only pure render helpers are exercised. +function loadPluginDialog() { + const context = { + console, + T: (_key, fallback) => (fallback === undefined ? _key : fallback) + }; + context.window = context; + vm.createContext(context); + vm.runInContext(fs.readFileSync(path.join(__dirname, "index.js"), "utf8"), context); + return context; +} + +test("update control stays disabled while the plugin is loading", () => { + const dialog = loadPluginDialog(); + const button = { hidden: true, disabled: false }; + + dialog.ApplyDetailUpdateButton(button, { status: "Loading", update_status: "update_available" }); + + assert.equal(button.hidden, false, "an available update is shown while loading"); + assert.equal(button.disabled, true, "the update must not be startable during a load"); +}); + +test("update control is enabled once loading finishes", () => { + const dialog = loadPluginDialog(); + const button = { hidden: true, disabled: true }; + + dialog.ApplyDetailUpdateButton(button, { status: "Activated", update_status: "update_available" }); + + assert.equal(button.hidden, false); + assert.equal(button.disabled, false); +}); + +test("update control stays hidden when no update is available, even while loading", () => { + const dialog = loadPluginDialog(); + const button = { hidden: false, disabled: true }; + + dialog.ApplyDetailUpdateButton(button, { status: "Loading", update_status: "normal" }); + + assert.equal(button.hidden, true); +}); diff --git a/resources/web/dialog/PluginsDialog/styles.css b/resources/web/dialog/PluginsDialog/styles.css index 8e64111461..7c2b209290 100644 --- a/resources/web/dialog/PluginsDialog/styles.css +++ b/resources/web/dialog/PluginsDialog/styles.css @@ -1465,6 +1465,24 @@ body.pane-resizing { .permission-filesystem-bucket + .permission-filesystem-bucket { margin-top: 17px; } +.permission-mode { + min-width: 0; + margin: 0 0 10px; + padding: 0; + border: 0; +} + +.permissions-content .permission-mode label { + display: inline-flex; + align-items: center; + gap: 5px; + margin: 4px 16px 4px 0; + color: var(--text); +} + +.permission-mode input { accent-color: var(--main-color); } +.permission-mode input:focus-visible { outline: 2px solid var(--main-color); outline-offset: 2px; } + .permissions-content label.permission-thread-toggle { display: inline-flex; align-items: center; diff --git a/resources/web/flush/NozzleListTable.html b/resources/web/flush/NozzleListTable.html index 51da2cbd52..7c660e856b 100644 --- a/resources/web/flush/NozzleListTable.html +++ b/resources/web/flush/NozzleListTable.html @@ -4,13 +4,17 @@ 喷嘴选择表格 +