Compare commits

...
Author SHA1 Message Date
Kris Austin 88f05d3060 ci: move the nightly Build all to the quietest hour for macOS runners (#16053) 2026-10-01 17:58:00 -03:00
Kris Austin 4743d00793 ci: README build badge no longer shows failing when a queued main build is cancelled (#16054) 2026-10-01 17:56:57 -03:00
Ian Chua 2f4758446a feat: add foundation for configurable printer agent connection (#16027)
* feat: add foundation for configurable printer agent connection

* fix: regression after merge

* chore: remove duplcate http include

* fix: remove unrelated moonraker.cpp changes

* chore: port add_platform_root_certificates to 15711

* fix: clean diff
2026-10-01 22:50:56 +08:00
7 changed files with 66 additions and 24 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ on:
schedule: schedule:
- cron: '0 17 * * *' # run once a day at 1 AM Singapore time (UTC+8) - cron: '15 2 * * *' # 10:15 AM Singapore time (UTC+8), when macOS runners are least busy
workflow_dispatch: # allows for manual dispatch workflow_dispatch: # allows for manual dispatch
inputs: inputs:
+27
View File
@@ -0,0 +1,27 @@
# Reports the newest push build of main that was not cancelled, for the README badge.
name: Main build status
on:
workflow_run:
workflows: ["Build all"]
types: [completed]
branches: [main]
permissions:
actions: read
jobs:
status:
if: github.repository == 'OrcaSlicer/OrcaSlicer'
runs-on: ubuntu-latest
steps:
- env:
GH_TOKEN: ${{ github.token }}
run: |
for attempt in 1 2 3; do
conclusion=$(gh api "repos/${{ github.repository }}/actions/workflows/build_all.yml/runs?branch=main&event=push&status=completed&per_page=100" \
--jq '[.workflow_runs[] | select(.conclusion != "cancelled")][0].conclusion') && break
sleep 10
done
echo "Latest finished push build of main: $conclusion"
[ "$conclusion" = success ]
+1 -1
View File
@@ -6,7 +6,7 @@
<a href="https://trendshift.io/repositories/15552" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15552" alt="OrcaSlicer%2FOrcaSlicer | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> <a href="https://trendshift.io/repositories/15552" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15552" alt="OrcaSlicer%2FOrcaSlicer | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[![GitHub Repo stars](https://img.shields.io/github/stars/OrcaSlicer/OrcaSlicer)](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [![Build all](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml) [![GitHub Repo stars](https://img.shields.io/github/stars/OrcaSlicer/OrcaSlicer)](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [![Build all](https://img.shields.io/github/actions/workflow/status/OrcaSlicer/OrcaSlicer/main_build_status.yml?label=Build%20all)](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml)
OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints. OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints.
Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection. Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection.
+4 -1
View File
@@ -276,7 +276,10 @@ void MonitorPanel::select_machine(std::string machine_sn)
void MonitorPanel::on_timer(wxTimerEvent& event) void MonitorPanel::on_timer(wxTimerEvent& event)
{ {
if (update_flag) { // MediaPlayCtrl may yield the event loop while it joins its camera worker
// during window teardown. Do not let a queued monitor refresh touch panels
// that are already being destroyed.
if (!wxGetApp().is_closing() && update_flag) {
update_all(); update_all();
//Layout(); //Layout();
} }
+26 -15
View File
@@ -23,14 +23,15 @@
#include <wx/filedlg.h> #include <wx/filedlg.h>
#include <miniz.h> #include <miniz.h>
#include <algorithm> #include <algorithm>
#include <cctype>
#include "Plater.hpp" #include "Plater.hpp"
#include "BitmapCache.hpp" #include "BitmapCache.hpp"
#include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/GUI_App.hpp"
#include "DeviceCore/DevManager.h" #include "DeviceCore/DevManager.h"
#include "DeviceCore/DevStorage.h" #include "DeviceCore/DevStorage.h"
#include "md4c/src/md4c-html.h"
#include "../Utils/Http.hpp" #include "../Utils/Http.hpp"
#include "md4c/src/md4c-html.h"
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
@@ -1777,7 +1778,7 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
auto str_ip = m_input_ip->GetTextCtrl()->GetValue(); auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue(); auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
// ORCA enabling / disabling buttons with conditions enough to change its style // ORCA enabling / disabling buttons with conditions enough to change its style
m_button_ok->Enable(isIp(str_ip.ToStdString()) && m_button_ok->Enable(isValidEndpoint(str_ip.ToStdString()) &&
(str_access_code.IsEmpty() || str_access_code.Length() >= 8)); (str_access_code.IsEmpty() || str_access_code.Length() >= 8));
Layout(); Layout();
@@ -1815,19 +1816,29 @@ void InputIpAddressDialog::update_test_msg(wxString msg,bool connected)
Fit(); Fit();
} }
bool InputIpAddressDialog::isIp(std::string ipstr) bool InputIpAddressDialog::isValidEndpoint(std::string endpoint)
{ {
istringstream ipstream(ipstr); if (endpoint.empty() || std::any_of(endpoint.begin(), endpoint.end(), [](unsigned char c) {
int num[4]; return std::isspace(c) != 0;
char point[3]; }))
string end; return false;
ipstream >> num[0] >> point[0] >> num[1] >> point[1] >> num[2] >> point[2] >> num[3] >> end;
for (int i = 0; i < 3; ++i) { const bool has_http_scheme = endpoint.rfind("http://", 0) == 0;
if (num[i] < 0 || num[i]>255) return false; const bool has_https_scheme = endpoint.rfind("https://", 0) == 0;
if (point[i] != '.') return false; const auto scheme_pos = endpoint.find("://");
} if (scheme_pos != std::string::npos && !has_http_scheme && !has_https_scheme)
if (num[3] < 0 || num[3]>255) return false; return false;
if (!end.empty()) return false;
std::string port;
const std::string host = Http::get_host_from_url(endpoint, &port);
if (host.empty())
return false;
// get_host_from_url returns its input when libcurl cannot parse it. For a
// URL with a scheme, that means a failed parse still needs to be rejected.
if (scheme_pos != std::string::npos && host == endpoint)
return false;
return true; return true;
} }
@@ -2130,7 +2141,7 @@ void InputIpAddressDialog::on_text(wxCommandEvent &evt)
// ORCA enabling / disabling buttons with conditions enough to change its style // ORCA enabling / disabling buttons with conditions enough to change its style
bool valid_access_code_length = str_access_code.IsEmpty() || str_access_code.Length() >= 8; bool valid_access_code_length = str_access_code.IsEmpty() || str_access_code.Length() >= 8;
bool enable_btns = isIp(str_ip.ToStdString()) && valid_access_code_length && invalid_access_code; bool enable_btns = isValidEndpoint(str_ip.ToStdString()) && valid_access_code_length && invalid_access_code;
m_button_manual_setup->Enable(enable_btns); m_button_manual_setup->Enable(enable_btns);
m_button_ok->Enable(enable_btns); m_button_ok->Enable(enable_btns);
+1 -1
View File
@@ -348,7 +348,7 @@ public:
void update_title(wxString title); void update_title(wxString title);
void set_machine_obj(MachineObject* obj); void set_machine_obj(MachineObject* obj);
void update_test_msg(wxString msg, bool connected); void update_test_msg(wxString msg, bool connected);
bool isIp(std::string ipstr); bool isValidEndpoint(std::string endpoint);
void check_ip_address_failed(int result); void check_ip_address_failed(int result);
void on_check_ip_address_failed(wxCommandEvent& evt); void on_check_ip_address_failed(wxCommandEvent& evt);
void on_ok(wxMouseEvent& evt); void on_ok(wxMouseEvent& evt);
+6 -5
View File
@@ -1,5 +1,6 @@
#include "Http.hpp" #include "Http.hpp"
#include <atomic>
#include <cstdlib> #include <cstdlib>
#include <functional> #include <functional>
#include <thread> #include <thread>
@@ -122,7 +123,7 @@ struct Http::priv
std::string error_buffer; // Used for CURLOPT_ERRORBUFFER std::string error_buffer; // Used for CURLOPT_ERRORBUFFER
std::string headers; std::string headers;
size_t limit; size_t limit;
bool cancel; std::atomic_bool cancel;
std::unique_ptr<form_file> putFile; std::unique_ptr<form_file> putFile;
std::thread io_thread; std::thread io_thread;
@@ -260,9 +261,9 @@ int Http::priv::xfercb(void *userp, curl_off_t dltotal, curl_off_t dlnow, curl_o
self->progressfn(progress, cb_cancel); self->progressfn(progress, cb_cancel);
} }
if (cb_cancel) { self->cancel = true; } if (cb_cancel) { self->cancel.store(true); }
return self->cancel; return self->cancel.load();
} }
int Http::priv::xfercb_legacy(void *userp, double dltotal, double dlnow, double ultotal, double ulnow) int Http::priv::xfercb_legacy(void *userp, double dltotal, double dlnow, double ultotal, double ulnow)
@@ -473,7 +474,7 @@ void Http::priv::http_perform()
if (res != CURLE_OK) { if (res != CURLE_OK) {
if (res == CURLE_ABORTED_BY_CALLBACK) { if (res == CURLE_ABORTED_BY_CALLBACK) {
if (cancel) { if (cancel.load()) {
// The abort comes from the request being cancelled programatically // The abort comes from the request being cancelled programatically
Progress dummyprogress(0, 0, 0, 0, std::string()); Progress dummyprogress(0, 0, 0, 0, std::string());
bool cancel = true; bool cancel = true;
@@ -784,7 +785,7 @@ void Http::perform_sync()
void Http::cancel() void Http::cancel()
{ {
if (p) { p->cancel = true; } if (p) { p->cancel.store(true); }
} }
void Http::print() const void Http::print() const