mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-30 16:38:41 +03:00
fix some bug
This commit is contained in:
@@ -488,8 +488,9 @@ void PrinterWebView::SetLoginStatus(bool status) {
|
|||||||
}
|
}
|
||||||
}).detach();
|
}).detach();
|
||||||
#endif
|
#endif
|
||||||
} else {
|
}
|
||||||
#if QDT_RELEASE_TO_PUBLIC
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
|
else {
|
||||||
std::vector<NetDevice> devices;
|
std::vector<NetDevice> devices;
|
||||||
wxGetApp().set_devices(devices);
|
wxGetApp().set_devices(devices);
|
||||||
if (!wxGetApp().is_link_connect())
|
if (!wxGetApp().is_link_connect())
|
||||||
@@ -709,7 +710,7 @@ void PrinterWebView::updateDeviceConnectType(const std::string& device_id, const
|
|||||||
if (machine_button == nullptr) {
|
if (machine_button == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// cj_1 <20>л<EFBFBD><D0BB><EFBFBD>ð<EFBFBD>ť<EFBFBD><C5A5>ʾ<EFBFBD><CABE>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
|
// cj_1
|
||||||
cancelAllDevButtonSelect();
|
cancelAllDevButtonSelect();
|
||||||
clearStatusPanelData();
|
clearStatusPanelData();
|
||||||
machine_button->SetIsSelected(true);
|
machine_button->SetIsSelected(true);
|
||||||
@@ -939,7 +940,7 @@ void PrinterWebView::OnDeleteButtonClick(wxCommandEvent &event)
|
|||||||
bodyJson["serialNumber"] = m_cur_deviceId;
|
bodyJson["serialNumber"] = m_cur_deviceId;
|
||||||
bodyJson["source"] = "QIDIStudio";
|
bodyJson["source"] = "QIDIStudio";
|
||||||
httpData.body = bodyJson.dump();
|
httpData.body = bodyJson.dump();
|
||||||
httpData.env = TESTENV;
|
httpData.env = m_env;
|
||||||
httpData.target = DEVICE;
|
httpData.target = DEVICE;
|
||||||
wxEventType curEventType = event.GetEventType();
|
wxEventType curEventType = event.GetEventType();
|
||||||
httpData.taskPath = "/unbind";
|
httpData.taskPath = "/unbind";
|
||||||
@@ -1140,7 +1141,7 @@ void PrinterWebView::onStatusPanelTask(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
httpData.env = TESTENV;
|
httpData.env = m_env;
|
||||||
httpData.target = PRINTERTYPE;
|
httpData.target = PRINTERTYPE;
|
||||||
|
|
||||||
wxEventType curEventType = event.GetEventType();
|
wxEventType curEventType = event.GetEventType();
|
||||||
@@ -1199,7 +1200,7 @@ void PrinterWebView::onSetBoxTask(wxCommandEvent& event)
|
|||||||
event.GetString().ToLong(&index);
|
event.GetString().ToLong(&index);
|
||||||
bodyJson["idx"] = index;
|
bodyJson["idx"] = index;
|
||||||
httpData.body = bodyJson.dump();
|
httpData.body = bodyJson.dump();
|
||||||
httpData.env = TESTENV;
|
httpData.env = m_env;
|
||||||
httpData.target = PRINTERTYPE;
|
httpData.target = PRINTERTYPE;
|
||||||
wxEventType curEventType = event.GetEventType();
|
wxEventType curEventType = event.GetEventType();
|
||||||
if (m_boxEventToTaskPath.find(curEventType) != m_boxEventToTaskPath.end()) {
|
if (m_boxEventToTaskPath.find(curEventType) != m_boxEventToTaskPath.end()) {
|
||||||
@@ -1237,7 +1238,7 @@ void PrinterWebView::onRefreshRfid(wxCommandEvent& event)
|
|||||||
bodyJson["serialNumber"] = m_cur_deviceId;
|
bodyJson["serialNumber"] = m_cur_deviceId;
|
||||||
bodyJson["slotIndex"] = slotIndex;
|
bodyJson["slotIndex"] = slotIndex;
|
||||||
httpData.body = bodyJson.dump();
|
httpData.body = bodyJson.dump();
|
||||||
httpData.env = TESTENV;
|
httpData.env = m_env;
|
||||||
httpData.target = PRINTERTYPE;
|
httpData.target = PRINTERTYPE;
|
||||||
httpData.taskPath = "/set/filament/rfid";
|
httpData.taskPath = "/set/filament/rfid";
|
||||||
|
|
||||||
@@ -1464,22 +1465,19 @@ void PrinterWebView::OnScroll(wxScrollWinEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string extractBetweenMarkers(const std::string& path) {
|
std::string extractBetweenMarkers(const std::string& path) {
|
||||||
// <20><><EFBFBD><EFBFBD> "/gcodes" <20><>λ<EFBFBD><CEBB>
|
|
||||||
size_t startPos = path.find("/gcodes");
|
size_t startPos = path.find("/gcodes");
|
||||||
if (startPos == std::string::npos) {
|
if (startPos == std::string::npos) {
|
||||||
return ""; // û<>ҵ<EFBFBD> /gcodes
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// <20><> /gcodes <20><><EFBFBD>濪ʼ<E6BFAA><CABC><EFBFBD><EFBFBD><EFBFBD>ϳ<EFBFBD><CFB3>ȣ<EFBFBD>
|
startPos += 7;
|
||||||
startPos += 7; // "/gcodes" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>7
|
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD> ".3mf" <20><>λ<EFBFBD><CEBB>
|
|
||||||
size_t endPos = path.find(".3mf", startPos);
|
size_t endPos = path.find(".3mf", startPos);
|
||||||
if (endPos == std::string::npos) {
|
if (endPos == std::string::npos) {
|
||||||
return ""; // û<>ҵ<EFBFBD> .3mf
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// <20><>ȡ<EFBFBD>м䲿<D0BC><E4B2BF>
|
|
||||||
return path.substr(startPos, endPos - startPos);
|
return path.substr(startPos, endPos - startPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1516,7 +1514,7 @@ void PrinterWebView::OnScroll(wxScrollWinEvent& event)
|
|||||||
std::string oldPrintFileName = device->m_print_filename;
|
std::string oldPrintFileName = device->m_print_filename;
|
||||||
device->updateByJsonData(status);
|
device->updateByJsonData(status);
|
||||||
device->last_update = std::chrono::steady_clock::now();
|
device->last_update = std::chrono::steady_clock::now();
|
||||||
//cj_1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD>ӡ<EFBFBD>̶<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ͼƬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//cj_1
|
||||||
if (oldPrintFileName != device->m_print_filename) {
|
if (oldPrintFileName != device->m_print_filename) {
|
||||||
|
|
||||||
std::string url = device->m_frp_url + "/api/qidiclient/files/list";
|
std::string url = device->m_frp_url + "/api/qidiclient/files/list";
|
||||||
@@ -1721,6 +1719,16 @@ void PrinterWebView::initEventToTaskPath()
|
|||||||
{EVTSET_CHAMBERFAN_SPEED, "SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=%.2f"}
|
{EVTSET_CHAMBERFAN_SPEED, "SET_FAN_SPEED FAN=chamber_circulation_fan SPEED=%.2f"}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
|
std::string region = wxGetApp().app_config->get("region");
|
||||||
|
if (region == "China") {
|
||||||
|
m_env = PRODUCTIONENV;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_env = FOREIGNENV;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrinterWebView::bindTaskHandle()
|
void PrinterWebView::bindTaskHandle()
|
||||||
@@ -1729,7 +1737,6 @@ void PrinterWebView::bindTaskHandle()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD> key-value <20><>
|
|
||||||
for (auto& pair : m_eventToTaskPath) {
|
for (auto& pair : m_eventToTaskPath) {
|
||||||
const wxEventTypeTag< wxCommandEvent >eventType = pair.first;
|
const wxEventTypeTag< wxCommandEvent >eventType = pair.first;
|
||||||
t_status_page->Bind(eventType, &PrinterWebView::onStatusPanelTask, this);
|
t_status_page->Bind(eventType, &PrinterWebView::onStatusPanelTask, this);
|
||||||
@@ -1823,15 +1830,12 @@ std::string extractEndNumbers(const std::string& str) {
|
|||||||
size_t endPos = str.find_last_not_of("0123456789");
|
size_t endPos = str.find_last_not_of("0123456789");
|
||||||
|
|
||||||
if (endPos == std::string::npos) {
|
if (endPos == std::string::npos) {
|
||||||
// <20>ַ<EFBFBD><D6B7><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
else if (endPos == str.length() - 1) {
|
else if (endPos == str.length() - 1) {
|
||||||
// <20><><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// <20><><EFBFBD><EFBFBD>ĩβ<C4A9><CEB2><EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD>
|
|
||||||
return str.substr(endPos + 1);
|
return str.substr(endPos + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ private:
|
|||||||
|
|
||||||
#if QDT_RELEASE_TO_PUBLIC
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
std::vector<NetDevice> m_net_devices;
|
std::vector<NetDevice> m_net_devices;
|
||||||
|
Environment m_env;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -138,13 +138,23 @@ void QDSFilamentConfig::init()
|
|||||||
initFilamentData(m_vendor);
|
initFilamentData(m_vendor);
|
||||||
initFilamentData(m_filament_type);
|
initFilamentData(m_filament_type);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
|
std::string region = wxGetApp().app_config->get("region");
|
||||||
|
if (region == "China") {
|
||||||
|
m_env = PRODUCTIONENV;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_env = FOREIGNENV;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QDSFilamentConfig::initTypeName()
|
void QDSFilamentConfig::initTypeName()
|
||||||
{
|
{
|
||||||
#if QDT_RELEASE_TO_PUBLIC
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
std::string resultBody = MakerHttpHandle::getInstance().httpGetTask(Environment::TESTENV, m_typeName.path);
|
std::string resultBody = MakerHttpHandle::getInstance().httpGetTask(m_env, m_typeName.path);
|
||||||
if (resultBody == "") {
|
if (resultBody == "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -179,7 +189,7 @@ void QDSFilamentConfig::initTypeName()
|
|||||||
void QDSFilamentConfig::initFilamentData(FilamentData& filamentData)
|
void QDSFilamentConfig::initFilamentData(FilamentData& filamentData)
|
||||||
{
|
{
|
||||||
#if QDT_RELEASE_TO_PUBLIC
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
std::string resultBody = MakerHttpHandle::getInstance().httpGetTask(Environment::TESTENV, filamentData.path);
|
std::string resultBody = MakerHttpHandle::getInstance().httpGetTask(m_env, filamentData.path);
|
||||||
if (resultBody == "") {
|
if (resultBody == "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ private:
|
|||||||
std::string getData(FilamentData filamentData, int index);
|
std::string getData(FilamentData filamentData, int index);
|
||||||
int getIndex(FilamentData filementData, std::string name);
|
int getIndex(FilamentData filementData, std::string name);
|
||||||
|
|
||||||
|
#if QDT_RELEASE_TO_PUBLIC
|
||||||
|
Environment m_env;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FilamentData m_colorHexCode{ "/backend/v1/setting/filament/color/all","hexCode" };
|
FilamentData m_colorHexCode{ "/backend/v1/setting/filament/color/all","hexCode" };
|
||||||
FilamentData m_colorDes{ "/backend/v1/setting/filament/color/all","description" };
|
FilamentData m_colorDes{ "/backend/v1/setting/filament/color/all","description" };
|
||||||
|
|||||||
Reference in New Issue
Block a user