mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 20:51:23 -07:00
Merge remote-tracking branch 'remote/master' into feature/merge_upstream
# Conflicts: # bbl/i18n/OrcaSlicer.pot # bbl/i18n/de/OrcaSlicer_de.po # bbl/i18n/en/OrcaSlicer_en.po # bbl/i18n/es/OrcaSlicer_es.po # bbl/i18n/fr/OrcaSlicer_fr.po # bbl/i18n/hu/OrcaSlicer_hu.po # bbl/i18n/it/OrcaSlicer_it.po # bbl/i18n/ja/OrcaSlicer_ja.po # bbl/i18n/nl/OrcaSlicer_nl.po # bbl/i18n/sv/OrcaSlicer_sv.po # bbl/i18n/zh_cn/OrcaSlicer_zh_CN.po # resources/config.json # resources/i18n/de/BambuStudio.mo # resources/i18n/en/BambuStudio.mo # resources/i18n/es/BambuStudio.mo # resources/i18n/fr/BambuStudio.mo # resources/i18n/hu/BambuStudio.mo # resources/i18n/it/BambuStudio.mo # resources/i18n/ja/OrcaSlicer.mo # resources/i18n/nl/BambuStudio.mo # resources/i18n/sv/BambuStudio.mo # resources/i18n/zh_cn/BambuStudio.mo # resources/images/ams_humidity_2.svg # resources/images/ams_humidity_3.svg # resources/images/ams_humidity_4.svg # resources/images/ams_humidity_tips.svg # resources/images/monitor_state_on.svg # resources/images/sdcard_state_normal.svg # resources/profiles/BBL.json # resources/profiles/BBL/filament/Bambu PETG-CF @base.json # resources/profiles/BBL/filament/Generic PETG-CF @base.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.4 nozzle.json # resources/web/data/text.js # resources/web/guide/3/index.html # resources/web/guide/31/index.html # src/BambuStudio.cpp # src/libslic3r/AABBTreeLines.hpp # src/libslic3r/Brim.cpp # src/libslic3r/CMakeLists.txt # src/libslic3r/ExPolygon.hpp # src/libslic3r/Fill/FillBase.hpp # src/libslic3r/Format/bbs_3mf.cpp # src/libslic3r/GCodeWriter.cpp # src/libslic3r/Line.hpp # src/libslic3r/PerimeterGenerator.cpp # src/libslic3r/Preset.cpp # src/libslic3r/Print.cpp # src/libslic3r/Print.hpp # src/libslic3r/PrintConfig.cpp # src/libslic3r/PrintConfig.hpp # src/libslic3r/TreeSupport.cpp # src/slic3r/GUI/AmsMappingPopup.cpp # src/slic3r/GUI/BackgroundSlicingProcess.cpp # src/slic3r/GUI/ConfigManipulation.cpp # src/slic3r/GUI/GCodeViewer.cpp # src/slic3r/GUI/GCodeViewer.hpp # src/slic3r/GUI/GLCanvas3D.cpp # src/slic3r/GUI/GUI_App.cpp # src/slic3r/GUI/MainFrame.cpp # src/slic3r/GUI/PartPlate.cpp # src/slic3r/GUI/Plater.cpp # src/slic3r/GUI/Preferences.cpp # src/slic3r/GUI/SelectMachine.cpp # src/slic3r/GUI/Widgets/AMSControl.cpp # src/slic3r/GUI/wxMediaCtrl2.cpp # src/slic3r/Utils/Process.cpp # version.inc
This commit is contained in:
commit
9f598046d1
658 changed files with 70312 additions and 4877 deletions
|
|
@ -78,6 +78,7 @@ void PrinterFileSystem::SetGroupMode(GroupMode mode)
|
|||
return;
|
||||
this->m_group_mode = mode;
|
||||
m_lock_start = m_lock_end = 0;
|
||||
UpdateGroupSelect();
|
||||
SendChangedEvent(EVT_MODE_CHANGED);
|
||||
}
|
||||
|
||||
|
|
@ -131,6 +132,7 @@ void PrinterFileSystem::ListAllFiles()
|
|||
}
|
||||
}
|
||||
BuildGroups();
|
||||
UpdateGroupSelect();
|
||||
m_status = Status::ListReady;
|
||||
SendChangedEvent(EVT_STATUS_CHANGED, m_status);
|
||||
SendChangedEvent(EVT_FILE_CHANGED);
|
||||
|
|
@ -253,7 +255,28 @@ size_t PrinterFileSystem::GetIndexAtTime(boost::uint32_t time)
|
|||
|
||||
void PrinterFileSystem::ToggleSelect(size_t index)
|
||||
{
|
||||
if (index < m_file_list.size()) {
|
||||
if (m_group_mode != G_NONE) {
|
||||
size_t beg = m_group_mode == G_YEAR ? m_group_month[m_group_year[index]] : m_group_month[index];
|
||||
size_t end_month = m_group_mode == G_YEAR ? ((index + 1) < m_group_year.size() ? m_group_year[index + 1] : m_group_month.size()) : index + 1;
|
||||
size_t end = end_month < m_group_month.size() ? m_group_month[end_month] : m_file_list.size();
|
||||
if ((m_group_flags[index] & FF_SELECT) == 0) {
|
||||
for (int i = beg; i < end; ++i) {
|
||||
if ((m_file_list[i].flags & FF_SELECT) == 0) {
|
||||
m_file_list[i].flags |= FF_SELECT;
|
||||
++m_select_count;
|
||||
}
|
||||
}
|
||||
m_group_flags[index] |= FF_SELECT;
|
||||
} else {
|
||||
for (int i = beg; i < end; ++i) {
|
||||
if (m_file_list[i].flags & FF_SELECT) {
|
||||
m_file_list[i].flags &= ~FF_SELECT;
|
||||
--m_select_count;
|
||||
}
|
||||
}
|
||||
m_group_flags[index] &= ~FF_SELECT;
|
||||
}
|
||||
} else if (index < m_file_list.size()) {
|
||||
m_file_list[index].flags ^= FF_SELECT;
|
||||
if (m_file_list[index].flags & FF_SELECT)
|
||||
++m_select_count;
|
||||
|
|
@ -268,9 +291,11 @@ void PrinterFileSystem::SelectAll(bool select)
|
|||
if (select) {
|
||||
for (auto &f : m_file_list) f.flags |= FF_SELECT;
|
||||
m_select_count = m_file_list.size();
|
||||
for (auto &s : m_group_flags) s |= FF_SELECT;
|
||||
} else {
|
||||
for (auto &f : m_file_list) f.flags &= ~FF_SELECT;
|
||||
m_select_count = 0;
|
||||
for (auto &s : m_group_flags) s &= ~FF_SELECT;
|
||||
}
|
||||
SendChangedEvent(EVT_SELECT_CHANGED, m_select_count);
|
||||
}
|
||||
|
|
@ -289,6 +314,17 @@ PrinterFileSystem::File const &PrinterFileSystem::GetFile(size_t index)
|
|||
{
|
||||
if (m_group_mode == G_NONE)
|
||||
return m_file_list[index];
|
||||
if (m_group_mode == G_YEAR) index = m_group_year[index];
|
||||
return m_file_list[m_group_month[index]];
|
||||
}
|
||||
|
||||
PrinterFileSystem::File const &PrinterFileSystem::GetFile(size_t index, bool &select)
|
||||
{
|
||||
if (m_group_mode == G_NONE) {
|
||||
select = m_file_list[index].IsSelect();
|
||||
return m_file_list[index];
|
||||
}
|
||||
select = m_group_flags[index] & FF_SELECT;
|
||||
if (m_group_mode == G_YEAR)
|
||||
index = m_group_year[index];
|
||||
return m_file_list[m_group_month[index]];
|
||||
|
|
@ -380,6 +416,26 @@ void PrinterFileSystem::BuildGroups()
|
|||
}
|
||||
}
|
||||
|
||||
void PrinterFileSystem::UpdateGroupSelect()
|
||||
{
|
||||
m_group_flags.clear();
|
||||
int beg = 0;
|
||||
if (m_group_mode != G_NONE) {
|
||||
auto group = m_group_mode == G_YEAR ? m_group_year : m_group_month;
|
||||
if (m_group_mode == G_YEAR)
|
||||
for (auto &g : group) g = m_group_month[g];
|
||||
m_group_flags.resize(group.size(), FF_SELECT);
|
||||
for (int i = 0; i < m_file_list.size(); ++i) {
|
||||
if ((m_file_list[i].flags & FF_SELECT) == 0) {
|
||||
auto iter = std::upper_bound(group.begin(), group.end(), i);
|
||||
m_group_flags[iter - group.begin() - 1] &= ~FF_SELECT;
|
||||
if (iter == group.end()) break;
|
||||
i = *iter - 1; // start from next group
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PrinterFileSystem::DeleteFilesContinue()
|
||||
{
|
||||
std::vector<size_t> indexes;
|
||||
|
|
@ -481,14 +537,12 @@ void PrinterFileSystem::DownloadNextFile()
|
|||
download->index = FindFile(download->index, download->name);
|
||||
if (download->index != size_t(-1)) {
|
||||
int progress = data.size * 100 / data.total;
|
||||
if (result > CONTINUE)
|
||||
progress = -2;
|
||||
auto & file = m_file_list[download->index];
|
||||
if (result == ERROR_CANCEL)
|
||||
file.flags &= ~FF_DOWNLOAD;
|
||||
else if (file.progress != progress) {
|
||||
file.progress = progress;
|
||||
SendChangedEvent(EVT_DOWNLOAD, download->index, file.path, data.size);
|
||||
SendChangedEvent(EVT_DOWNLOAD, download->index, file.path, result);
|
||||
}
|
||||
}
|
||||
if (result != CONTINUE) DownloadNextFile();
|
||||
|
|
@ -586,9 +640,14 @@ void PrinterFileSystem::FileRemoved(size_t index, std::string const &name)
|
|||
size_t index2 = removeFromGroup(m_group_month, index, m_file_list.size());
|
||||
if (index2 < m_group_month.size()) {
|
||||
int index3 = removeFromGroup(m_group_year, index, m_group_month.size());
|
||||
if (index3 < m_group_year.size())
|
||||
if (index3 < m_group_year.size()) {
|
||||
m_group_year.erase(m_group_year.begin() + index3);
|
||||
if (m_group_mode == G_YEAR)
|
||||
m_group_flags.erase(m_group_flags.begin() + index2);
|
||||
}
|
||||
m_group_month.erase(m_group_month.begin() + index2);
|
||||
if (m_group_mode == G_MONTH)
|
||||
m_group_flags.erase(m_group_flags.begin() + index2);
|
||||
}
|
||||
m_file_list.erase(m_file_list.begin() + index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ public:
|
|||
|
||||
File const &GetFile(size_t index);
|
||||
|
||||
File const &GetFile(size_t index, bool &select);
|
||||
|
||||
enum Status {
|
||||
Initializing,
|
||||
Connecting,
|
||||
|
|
@ -170,6 +172,8 @@ public:
|
|||
private:
|
||||
void BuildGroups();
|
||||
|
||||
void UpdateGroupSelect();
|
||||
|
||||
void DeleteFilesContinue();
|
||||
|
||||
void DownloadNextFile();
|
||||
|
|
@ -266,6 +270,7 @@ protected:
|
|||
FileList m_file_list2;
|
||||
std::vector<size_t> m_group_year;
|
||||
std::vector<size_t> m_group_month;
|
||||
std::vector<int> m_group_flags;
|
||||
|
||||
private:
|
||||
size_t m_select_count = 0;
|
||||
|
|
|
|||
|
|
@ -259,6 +259,8 @@ gst_bambusrc_get_property (GObject * object, guint prop_id,
|
|||
}
|
||||
}
|
||||
|
||||
int gst_bambu_last_error = 0;
|
||||
|
||||
static GstFlowReturn
|
||||
gst_bambusrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
||||
{
|
||||
|
|
@ -286,7 +288,8 @@ gst_bambusrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
}
|
||||
|
||||
if (rv != Bambu_success) {
|
||||
return GST_FLOW_ERROR;
|
||||
gst_bambu_last_error = rv;
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,68,0)
|
||||
|
|
@ -316,7 +319,7 @@ gst_bambusrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
//if (GST_CLOCK_TIME_NONE == src->sttime)
|
||||
// src->sttime
|
||||
GST_DEBUG_OBJECT(src,
|
||||
"sttime init to %llu.",
|
||||
"sttime init to %lu.",
|
||||
src->sttime);
|
||||
}
|
||||
//GST_BUFFER_DTS(*outbuf) = gst_element_get_current_clock_time((GstElement *)psrc) - src->sttime;
|
||||
|
|
@ -325,7 +328,7 @@ gst_bambusrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
GST_BUFFER_DURATION(*outbuf) = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
GST_DEBUG_OBJECT(src,
|
||||
"sttime:%llu, DTS:%llu, PTS: %llu~",
|
||||
"sttime:%lu, DTS:%lu, PTS: %lu~",
|
||||
src->sttime, GST_BUFFER_DTS(*outbuf), GST_BUFFER_PTS(*outbuf));
|
||||
|
||||
return GST_FLOW_OK;
|
||||
|
|
@ -377,6 +380,7 @@ gst_bambusrc_start (GstBaseSrc * bsrc)
|
|||
BAMBULIB(Bambu_Close)(src->tnl);
|
||||
BAMBULIB(Bambu_Destroy)(src->tnl);
|
||||
src->tnl = NULL;
|
||||
gst_bambu_last_error = rv;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue