From 99a8139c1b915709a854296f22a222bac07a47ce Mon Sep 17 00:00:00 2001 From: "zorro.zhang" Date: Fri, 21 Feb 2025 11:22:53 +0800 Subject: [PATCH] NEW: Ignore Nozzel Select in UserGuide JIRA: none Change-Id: I507a92abb9137167dbcbe1def8276f868529c4ab --- resources/web/guide/21/21.css | 43 +++++++++++++++-- resources/web/guide/21/21.js | 63 +++++++++++-------------- resources/web/guide/21/index.html | 42 +++++++++++------ resources/web/guide/24/24.css | 46 +++++++++++++++--- resources/web/guide/24/24.js | 64 +++++++++++--------------- resources/web/guide/img/greencheck.svg | 1 + src/slic3r/GUI/WebGuideDialog.cpp | 4 +- src/slic3r/GUI/WebViewDialog.cpp | 6 +-- 8 files changed, 166 insertions(+), 103 deletions(-) create mode 100644 resources/web/guide/img/greencheck.svg diff --git a/resources/web/guide/21/21.css b/resources/web/guide/21/21.css index 3273d375d..2210ff7cc 100644 --- a/resources/web/guide/21/21.css +++ b/resources/web/guide/21/21.css @@ -9,12 +9,13 @@ padding: 0px; border-bottom:#00AE42 1px solid; width: 100%; + display: flex; + justify-content:space-between; + align-items: center; } .BannerBtns { - float: right; - height: 40px; text-align: center; margin-right: 10px; } @@ -48,10 +49,42 @@ padding: 8px; } -.PrinterBlock img +.PImg { + position:relative; + background-color: #EEEEEE; width:160px; - height: 160px; + height: 160px; +} + +.ModelCheckBox +{ + position: absolute; + width: 20px; + height: 20px; + right: 10px; + top: 10px; + border:1px solid #ADADAD; + background-color: #FFF; + padding: 1px; + cursor: pointer; +} + +.ModelCheckBox.ModelCheckBoxSelected img +{ + display:inline; +} + +.ModelCheckBox img +{ + width:100%; + display: none; +} + +img.ModelThumbnail +{ + width: 100%; + height: 100%; } .PName @@ -62,7 +95,7 @@ .pNozzel { - display: flex; + display: none; align-items: center; justify-content:flex-start; color: #5A5A5A; diff --git a/resources/web/guide/21/21.js b/resources/web/guide/21/21.js index 0389d316a..5a548bac4 100644 --- a/resources/web/guide/21/21.js +++ b/resources/web/guide/21/21.js @@ -1,7 +1,7 @@ function OnInit() { //let strInput=JSON.stringify(cData); - //HandleStudio(strInput); + //HandleModelList(cData); TranslatePage(); @@ -47,6 +47,19 @@ function ShowPrinterThumb(pItem, strImg) $(pItem).attr('onerror',null); } +function ChooseModel( ModelName ) +{ + let ChooseItem=$(".ModelCheckBox[model='"+ModelName+"']"); + + if(ChooseItem!=null) + { + if( $(ChooseItem).hasClass('ModelCheckBoxSelected') ) + $(ChooseItem).removeClass('ModelCheckBoxSelected'); + else + $(ChooseItem).addClass('ModelCheckBoxSelected'); + } +} + function HandleModelList( pVal ) { if( !pVal.hasOwnProperty("model") ) @@ -71,11 +84,11 @@ function HandleModelList( pVal ) let HtmlNewVendor='
'+ '
'+ +' '+sVV+''+ '
'+ '
all
'+ '
none
'+ '
'+ -' '+sVV+''+ '
'+ '
'+ '
'+ @@ -93,22 +106,18 @@ function HandleModelList( pVal ) if( !ModelHtml.hasOwnProperty(strVendor)) ModelHtml[strVendor]=''; - let NozzleArray=OneModel['nozzle_diameter'].split(';'); - let HtmlNozzel=''; - for(let m=0;m'+nNozzel+'mm nozzle
'; - } - let CoverImage="../../image/printer/"+OneModel['model']+"_cover.png"; let CoverImage2="../../../profiles/"+strVendor+"/"+OneModel['model']+"_cover.png"; let CoverImage3=pVal['configpath']+"/system/"+strVendor+"/"+OneModel['model']+"_cover.png"; //alert( 'FinalCover: '+FinalCover ); ModelHtml[strVendor]+='
'+ - '
'+ - '
'+OneModel['model']+'
'+ HtmlNozzel +'
'; + '
'+ + ''+ + '
'+ + '
'+ + '
'+OneModel['model']+'
'+ + ''; } @@ -120,7 +129,6 @@ function HandleModelList( pVal ) //Update Checkbox - $('input').prop("checked", false); for(let m=0;m
+ BBL-3DP
所有
- - BBL-3DP
-
+
+ +
+
BBL-3DP-V4NORMAL
0.4mm nozzle
-
0.1mm nozzle
+
0.1mm nozzle
-
+
+ +
+
BBL-3DP-V4NORMAL
0.4mm nozzle
0.22mm nozzle
0.1mm nozzle
-
+
+ +
+
BBL-3DP-V4NORMAL
0.4mm nozzle
0.11mm nozzle
-
+
+ +
+
BBL-3DP-V4NORMAL
0.4mm nozzle
0.22mm nozzle
@@ -66,24 +77,29 @@
+ BAMBU-3DP
- - +
所有
+
- - BBL-3DP
-
+
+ +
+
BBL-3DP-V4NORMAL
0.4mm nozzle
0.1mm nozzle
-
+
+ +
+
BBL-3DP-V4NORMAL
0.4mm nozzle
0.2mm nozzle
diff --git a/resources/web/guide/24/24.css b/resources/web/guide/24/24.css index b88261ef6..a78f949c4 100644 --- a/resources/web/guide/24/24.css +++ b/resources/web/guide/24/24.css @@ -8,13 +8,13 @@ padding: 0px; border-bottom:#00AE42 1px solid; width: 100%; + display: flex; + justify-content:space-between; + align-items: center; } - .BannerBtns { - float: right; - height: 40px; text-align: center; margin-right: 10px; } @@ -48,21 +48,53 @@ padding: 8px; } -.PrinterBlock img +.PImg { + position:relative; + background-color: #EEEEEE; width:160px; - height: 160px; + height: 160px; +} + +.ModelCheckBox +{ + position: absolute; + width: 20px; + height: 20px; + right: 10px; + top: 10px; + border:1px solid #ADADAD; + background-color: #FFF; + padding: 1px; + cursor: pointer; +} + +.ModelCheckBox.ModelCheckBoxSelected img +{ + display:inline; +} + +.ModelCheckBox img +{ + width:100%; + display: none; +} + +img.ModelThumbnail +{ + width: 100%; + height: 100%; } .PName { font-weight: 700; - text-align:left; + text-align: left; } .pNozzel { - display: flex; + display: none; align-items: center; justify-content:flex-start; color: #5A5A5A; diff --git a/resources/web/guide/24/24.js b/resources/web/guide/24/24.js index f18608bf8..53522bc76 100644 --- a/resources/web/guide/24/24.js +++ b/resources/web/guide/24/24.js @@ -46,6 +46,19 @@ function ShowPrinterThumb(pItem, strImg) $(pItem).attr('onerror',null); } +function ChooseModel( ModelName ) +{ + let ChooseItem=$(".ModelCheckBox[model='"+ModelName+"']"); + + if(ChooseItem!=null) + { + if( $(ChooseItem).hasClass('ModelCheckBoxSelected') ) + $(ChooseItem).removeClass('ModelCheckBoxSelected'); + else + $(ChooseItem).addClass('ModelCheckBoxSelected'); + } +} + function HandleModelList( pVal ) { if( !pVal.hasOwnProperty("model") ) @@ -66,15 +79,15 @@ function HandleModelList( pVal ) { let sVV=strVendor; if( sVV=="BBL" ) - sVV="Bambu Lab"; + sVV="Bambu Lab"; let HtmlNewVendor='
'+ '
'+ +' '+sVV+''+ '
'+ '
all
'+ '
none
'+ '
'+ -' '+sVV+''+ '
'+ '
'+ '
'+ @@ -92,22 +105,19 @@ function HandleModelList( pVal ) if( !ModelHtml.hasOwnProperty(strVendor)) ModelHtml[strVendor]=''; - let NozzleArray=OneModel['nozzle_diameter'].split(';'); - let HtmlNozzel=''; - for(let m=0;m'+nNozzel+'mm nozzle
'; - } - let CoverImage="../../image/printer/"+OneModel['model']+"_cover.png"; let CoverImage2="../../../profiles/"+strVendor+"/"+OneModel['model']+"_cover.png"; let CoverImage3=pVal['configpath']+"/system/"+strVendor+"/"+OneModel['model']+"_cover.png"; //alert( 'FinalCover: '+FinalCover ); ModelHtml[strVendor]+='
'+ - '
'+ - '
'+OneModel['model']+'
'+ HtmlNozzel +'
'; + '
'+ + ''+ + '
'+ + '
'+ + '
'+OneModel['model']+'
'+ + '
'; + } //Update Nozzel Html Append @@ -118,7 +128,6 @@ function HandleModelList( pVal ) //Update Checkbox - $('input').prop("checked", false); for(let m=0;m \ No newline at end of file diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 0b616762e..2e3f769f1 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -432,7 +432,7 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt) wxString s1 = TmpModel["model"]; wxString s2 = OneSelect["model"]; if (s1.compare(s2) == 0) { - m_ProfileJson["model"][m]["nozzle_selected"] = OneSelect["nozzle_diameter"]; + m_ProfileJson["model"][m]["nozzle_selected"] = m_ProfileJson["model"][m]["nozzle_diameter"]; break; } } @@ -509,7 +509,7 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt) BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Error:" << e.what(); } - //wxString strAll = m_ProfileJson.dump(-1,' ',false, json::error_handler_t::ignore); + wxString strAll = m_ProfileJson.dump(-1,' ',false, json::error_handler_t::ignore); } void GuideFrame::RunScript(const wxString &javascript) diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index f4597e9c1..3a884ce95 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -1004,11 +1004,9 @@ std::string UrlEncode( const std::string &input ) escaped.fill('0'); escaped << std::hex; for (char c : input) { - // 如果字符是字母、数字、'-'、'.'、'_' 或 '~',则直接添加到结果中 if (std::isalnum(c) || c == '-' || c == '.' || c == '_' || c == '~') { escaped << c; } else { - // 对于其他字符,将其转换为 %XX 的形式 escaped << '%' << std::setw(2) << static_cast(static_cast(c)); } } @@ -1215,7 +1213,7 @@ void WebViewPanel::update_mode() */ void WebViewPanel::OnNavigationRequest(wxWebViewEvent& evt) { - BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetTarget().ToUTF8().data(); + BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data(); const wxString &url = evt.GetURL(); if (url.StartsWith("File://") || url.StartsWith("file://")) { if (!url.Contains("/web/homepage3/")) { @@ -1301,7 +1299,7 @@ void WebViewPanel::OnNavigationComplete(wxWebViewEvent& evt) //m_browser->Show(); Layout(); - BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetTarget().ToUTF8().data(); + BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << ": " << evt.GetURL().ToUTF8().data(); if (wxGetApp().get_mode() == comDevelop) wxLogMessage("%s", "Navigation complete; url='" + evt.GetURL() + "'"); UpdateState();