Skip to content

Commit

Permalink
NEW:popup warning message when has filament in the extrusion
Browse files Browse the repository at this point in the history
Change-Id: Ice9a3b5e6ae6ef8514213e61d9034ceb4c585093
  • Loading branch information
walterwongbbl authored and lanewei120 committed Dec 15, 2022
1 parent 9f749b3 commit 33a3839
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/slic3r/GUI/MsgDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ class WarningDialog : public MsgDialog

#if 1
// Generic static line, used intead of wxStaticLine
class StaticLine: public wxTextCtrl
{
public:
StaticLine( wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString& name = wxString::FromAscii(wxTextCtrlNameStr))
: wxTextCtrl(parent, id, wxEmptyString, pos, size!=wxDefaultSize ? size : (style == wxLI_HORIZONTAL ? wxSize(10, 1) : wxSize(1, 10)), wxSIMPLE_BORDER, wxDefaultValidator, name)
{
this->Enable(false);
}
~StaticLine() {}
};
//class StaticLine: public wxTextCtrl
//{
//public:
// StaticLine( wxWindow* parent,
// wxWindowID id = wxID_ANY,
// const wxPoint& pos = wxDefaultPosition,
// const wxSize& size = wxDefaultSize,
// long style = wxLI_HORIZONTAL,
// const wxString& name = wxString::FromAscii(wxTextCtrlNameStr))
// : wxTextCtrl(parent, id, wxEmptyString, pos, size!=wxDefaultSize ? size : (style == wxLI_HORIZONTAL ? wxSize(10, 1) : wxSize(1, 10)), wxSIMPLE_BORDER, wxDefaultValidator, name)
// {
// this->Enable(false);
// }
// ~StaticLine() {}
//};

// Generic message dialog, used intead of wxMessageDialog
class MessageDialog : public MsgDialog
Expand Down
14 changes: 14 additions & 0 deletions src/slic3r/GUI/StatusPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
#include "BitmapCache.hpp"
#include "GUI_App.hpp"

#include "MsgDialog.hpp"
#include "slic3r/Utils/Http.hpp"
#include "libslic3r/Thread.hpp"

#include "RecenterDialog.hpp"
#include "ReleaseNote.hpp"


namespace Slic3r { namespace GUI {

#define TEMP_THRESHOLD_VAL 2
Expand Down Expand Up @@ -2227,6 +2230,17 @@ void StatusPanel::on_filament_edit(wxCommandEvent &event)
void StatusPanel::on_ams_refresh_rfid(wxCommandEvent &event)
{
if (obj) {

if (obj->is_filament_at_extruder()) {
MessageDialog msg_dlg(
nullptr,
_L("Cannot read filament info: the filament is loaded to the tool head,please unload the filament and try again."),
wxEmptyString,
wxICON_WARNING | wxYES);
msg_dlg.ShowModal();
return;
}

std::string curr_ams_id = m_ams_control->GetCurentAms();
std::string curr_can_id = event.GetString().ToStdString();

Expand Down

0 comments on commit 33a3839

Please sign in to comment.