feat: update happy hare parsing

This commit is contained in:
Ian Chua
2026-10-16 20:48:57 +08:00
parent 7ed4095b20
commit f68fbfed58
8 changed files with 768 additions and 77 deletions
+12 -1
View File
@@ -7,6 +7,7 @@
#include "DevFilaSwitch.h"
#include "DevUtil.h"
#include <cstddef>
#include <map>
#include <set>
#include <string>
@@ -82,7 +83,7 @@ public:
wxColour wx_color;
bool is_bbl;
bool is_exists = false;
bool is_slot_placeholder = false; // Orca: True for empty tray slots from pull-mode agents
bool is_slot_placeholder = false; // Orca: True for synthetic topology slots or empty reported trays
int hold_count = 0;
int remain = 0; // filament remain: 0 ~ 100
@@ -114,6 +115,16 @@ public:
std::optional<DevFilamentDryingPreset> get_ams_drying_preset() const;
};
/**
* Ensure the virtual-tray vector can address the slot for a virtual tray id. The slot's index is
* `VIRTUAL_TRAY_MAIN_ID - tray_id` and placeholder entries carry id = VIRTUAL_TRAY_MAIN_ID - index.
* Existing entries are left untouched, so a slot already populated with reported filament data
* keeps it; callers then assign the reported tray at index `VIRTUAL_TRAY_MAIN_ID - tray_id`.
* Appended placeholders are marked `is_slot_placeholder`, so consumers can tell a synthetic
* topology filler from a spool the printer actually reported (overwriting the entry clears it).
*/
void grow_virtual_tray_slots(std::vector<DevAmsTray>& slots, std::size_t tray_id);
/**
* DevAms - Represents a single AMS (Automatic Material System) unit.
*