diff --git a/xLights/preferences/CheckSequenceSettingsPanel.cpp b/xLights/preferences/CheckSequenceSettingsPanel.cpp index 07dc677b3..95fdbee41 100644 --- a/xLights/preferences/CheckSequenceSettingsPanel.cpp +++ b/xLights/preferences/CheckSequenceSettingsPanel.cpp @@ -30,6 +30,7 @@ const long CheckSequenceSettingsPanel::ID_CHECKBOX3 = wxNewId(); const long CheckSequenceSettingsPanel::ID_CHECKBOX4 = wxNewId(); const long CheckSequenceSettingsPanel::ID_CHECKBOX5 = wxNewId(); const long CheckSequenceSettingsPanel::ID_CHECKBOX6 = wxNewId(); +const long CheckSequenceSettingsPanel::ID_CHECKBOX8 = wxNewId(); const long CheckSequenceSettingsPanel::ID_CHECKBOX7 = wxNewId(); //*) @@ -71,6 +72,10 @@ CheckSequenceSettingsPanel::CheckSequenceSettingsPanel(wxWindow* parent, xLights CheckBox_CustomSizeCheck->SetValue(false); CheckBox_CustomSizeCheck->SetHelpText(_("Large custom models with largely empty cells generate significant rendering overhead. You may want to consider shrinking the custom model dimensions if this can done without too significantly adversely affecting appearance.")); GridBagSizer1->Add(CheckBox_CustomSizeCheck, wxGBPosition(6, 0), wxDefaultSpan, wxALL|wxEXPAND, 5); + CheckBox_DupNodeSub = new wxCheckBox(this, ID_CHECKBOX8, _("Disable checks for duplicate nodes in submodels."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX8")); + CheckBox_DupNodeSub->SetValue(false); + CheckBox_DupNodeSub->SetHelpText(_("Duplicate nodes in submodels can be a result of planned overlap of common pixels")); + GridBagSizer1->Add(CheckBox_DupNodeSub, wxGBPosition(8, 0), wxDefaultSpan, wxALL, 5); CheckBox_DisableSketch = new wxCheckBox(this, ID_CHECKBOX7, _("Disable sketch image file checking."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX7")); CheckBox_DisableSketch->SetValue(false); CheckBox_DisableSketch->SetHelpText(_("Sketch effect image files are not essential to rendering.")); @@ -92,6 +97,7 @@ CheckSequenceSettingsPanel::CheckSequenceSettingsPanel(wxWindow* parent, xLights CheckBox_NonContigChOnPort->SetToolTip(CheckBox_NonContigChOnPort->GetHelpText()); CheckBox_PreviewGroup->SetToolTip(CheckBox_PreviewGroup->GetHelpText()); CheckBox_DupNodeMG->SetToolTip(CheckBox_DupNodeMG->GetHelpText()); + CheckBox_DupNodeMG->SetToolTip(CheckBox_DupNodeSub->GetHelpText()); CheckBox_TransTime->SetToolTip(CheckBox_TransTime->GetHelpText()); CheckBox_CustomSizeCheck->SetToolTip(CheckBox_CustomSizeCheck->GetHelpText()); CheckBox_DisableSketch->SetToolTip(CheckBox_DisableSketch->GetHelpText()); @@ -108,6 +114,7 @@ bool CheckSequenceSettingsPanel::TransferDataToWindow() { CheckBox_NonContigChOnPort->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("NonContigChOnPort")); CheckBox_PreviewGroup->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("PreviewGroup")); CheckBox_DupNodeMG->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("DupNodeMG")); + CheckBox_DupNodeSub->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("DupNodeSub")); CheckBox_TransTime->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("TransTime")); CheckBox_CustomSizeCheck->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("CustomSizeCheck")); CheckBox_DisableSketch->SetValue(xLightsFrame::IsCheckSequenceOptionDisabled("SketchImage")); @@ -118,6 +125,7 @@ bool CheckSequenceSettingsPanel::TransferDataFromWindow() { xLightsFrame::SetCheckSequenceOptionDisable("NonContigChOnPort", CheckBox_NonContigChOnPort->IsChecked()); xLightsFrame::SetCheckSequenceOptionDisable("PreviewGroup", CheckBox_PreviewGroup->IsChecked()); xLightsFrame::SetCheckSequenceOptionDisable("DupNodeMG", CheckBox_DupNodeMG->IsChecked()); + xLightsFrame::SetCheckSequenceOptionDisable("DupNodeSub", CheckBox_DupNodeSub->IsChecked()); xLightsFrame::SetCheckSequenceOptionDisable("TransTime", CheckBox_TransTime->IsChecked()); xLightsFrame::SetCheckSequenceOptionDisable("CustomSizeCheck", CheckBox_CustomSizeCheck->IsChecked()); xLightsFrame::SetCheckSequenceOptionDisable("SketchImage", CheckBox_DisableSketch->IsChecked()); @@ -172,3 +180,10 @@ void CheckSequenceSettingsPanel::OnCheckBox_DisableSketchClick(wxCommandEvent& e TransferDataFromWindow(); } } + +void CheckSequenceSettingsPanel::OnCheckBox_DupNodeSubClick(wxCommandEvent& event) +{ + if (wxPreferencesEditor::ShouldApplyChangesImmediately()) { + TransferDataFromWindow(); + } +} diff --git a/xLights/preferences/CheckSequenceSettingsPanel.h b/xLights/preferences/CheckSequenceSettingsPanel.h index 9c0180700..562e97a72 100644 --- a/xLights/preferences/CheckSequenceSettingsPanel.h +++ b/xLights/preferences/CheckSequenceSettingsPanel.h @@ -29,6 +29,7 @@ class CheckSequenceSettingsPanel: public wxPanel wxCheckBox* CheckBox_CustomSizeCheck; wxCheckBox* CheckBox_DisableSketch; wxCheckBox* CheckBox_DupNodeMG; + wxCheckBox* CheckBox_DupNodeSub; wxCheckBox* CheckBox_DupUniv; wxCheckBox* CheckBox_NonContigChOnPort; wxCheckBox* CheckBox_PreviewGroup; @@ -49,6 +50,7 @@ class CheckSequenceSettingsPanel: public wxPanel static const long ID_CHECKBOX4; static const long ID_CHECKBOX5; static const long ID_CHECKBOX6; + static const long ID_CHECKBOX8; static const long ID_CHECKBOX7; //*) @@ -63,6 +65,7 @@ class CheckSequenceSettingsPanel: public wxPanel void OnCheckBox_TransTimeClick(wxCommandEvent& event); void OnCheckBox_CustomSizeCheckClick(wxCommandEvent& event); void OnCheckBox_DisableSketchClick(wxCommandEvent& event); + void OnCheckBox_DupNodeSubClick(wxCommandEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/xLights/wxsmith/CheckSequenceSettingsPanel.wxs b/xLights/wxsmith/CheckSequenceSettingsPanel.wxs index 8e8347645..f112704d4 100644 --- a/xLights/wxsmith/CheckSequenceSettingsPanel.wxs +++ b/xLights/wxsmith/CheckSequenceSettingsPanel.wxs @@ -86,6 +86,17 @@ 5 + + + + Duplicate nodes in submodels can be a result of planned overlap of common pixels + + 0 + 8 + wxALL + 5 + + diff --git a/xLights/xLightsMain.cpp b/xLights/xLightsMain.cpp index b3e6c6dad..67a360c7d 100644 --- a/xLights/xLightsMain.cpp +++ b/xLights/xLightsMain.cpp @@ -5915,23 +5915,28 @@ std::string xLightsFrame::CheckSequence(bool displayInEditor, bool writeToFile) warncountsave = warncount; // Check for submodels with duplicate nodes - LogAndWrite(f, ""); - LogAndWrite(f, "SubModels with duplicate nodes"); + if (!IsCheckSequenceOptionDisabled("DupNodeSub")) { + LogAndWrite(f, ""); + LogAndWrite(f, "SubModels with duplicate nodes"); - for (const auto& it : AllModels) { - if (it.second->GetDisplayAs() != "ModelGroup") { - for (int i = 0; i < it.second->GetNumSubModels(); ++i) { - SubModel* sm = dynamic_cast(it.second->GetSubModel(i)); - if (sm != nullptr) { - std::string dups = sm->GetDuplicateNodes(); - if (dups != "") { - wxString msg = wxString::Format(" WARN: SubModel '%s' contains duplicate nodes: %s. This may not render as expected.", (const char*)sm->GetFullName().c_str(), (const char*)dups.c_str()); - LogAndWrite(f, msg.ToStdString()); - warncount++; + for (const auto& it : AllModels) { + if (it.second->GetDisplayAs() != "ModelGroup") { + for (int i = 0; i < it.second->GetNumSubModels(); ++i) { + SubModel* sm = dynamic_cast(it.second->GetSubModel(i)); + if (sm != nullptr) { + std::string dups = sm->GetDuplicateNodes(); + if (dups != "") { + wxString msg = wxString::Format(" WARN: SubModel '%s' contains duplicate nodes: %s. This may not render as expected.", (const char*)sm->GetFullName().c_str(), (const char*)dups.c_str()); + LogAndWrite(f, msg.ToStdString()); + warncount++; + } } } } } + } else { + LogAndWrite(f, ""); + LogAndWrite(f, "SubModels with duplicate nodes - CHECK DISABLED"); } if (errcount + warncount == errcountsave + warncountsave) {