mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-17 05:52:39 +00:00
Show Snapmaker U1 camera in Device tab
The U1 exposes no /server/webcams/list entry; its camera only captures after an explicit camera.start_monitor RPC, which the Moonraker websocket executes unauthenticated but only answers over MQTT - so the call is fire and forget. Start the camera when the camera view is shown and renew every 300 s: the printer retires the capture task at ~362 s and stop_monitor is accepted but ineffective, so teardown is simply to stop renewing. Frames land in monitor.jpg as still JPEGs (~2 fps at interval 0), so the webview loads a local HTML wrapper that repolls with a cache buster.
This commit is contained in:
@@ -1792,6 +1792,14 @@ int MachineObject::command_ams_refresh_rfid2(int ams_id, int slot_id)
|
||||
return this->publish_json(j);
|
||||
}
|
||||
|
||||
int MachineObject::command_start_camera()
|
||||
{
|
||||
if (!m_agent) return -1;
|
||||
// why: this fires from the camera view's renew timer, so a refusal must stay silent -
|
||||
// show_unsupported_dlg() here would pop a dialog every ~5 min on every other printer.
|
||||
return m_agent->command_start_camera(get_dev_id());
|
||||
}
|
||||
|
||||
|
||||
int MachineObject::command_ams_select_tray(std::string tray_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user