mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Fixes / Improvements for Covers & Printer Selection dialog (#11151)
* init * update * Crop cover images * match setup wizard UI * update * tiertime * anycubic * anycubic * construct3d * update --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -107,15 +107,8 @@ function HandleModelList( pVal )
|
||||
//Collect Html Node Nozzel Html
|
||||
if( !ModelHtml.hasOwnProperty(strVendor))
|
||||
ModelHtml[strVendor]='';
|
||||
|
||||
let CoverImage=OneModel['cover'];
|
||||
ModelHtml[strVendor]+='<div class="PrinterBlock" onClick="ChooseModel(\''+strVendor+'\',\''+OneModel['model']+'\')">'+
|
||||
'<div class="PImg">'+
|
||||
'<img class="ModelThumbnail" src="'+CoverImage+'" />'+
|
||||
'<div class="ModelCheckBox" vendor="' +strVendor+ '" model="'+OneModel['model']+'"></div>'+
|
||||
'</div>'+
|
||||
' <div class="PName">'+OneModel['name']+'</div>'+
|
||||
'</div>';
|
||||
|
||||
ModelHtml[strVendor]+=CreatePrinterBlock(OneModel); // ORCA
|
||||
}
|
||||
|
||||
//Update Nozzel Html Append
|
||||
@@ -231,15 +224,8 @@ function FilterModelList(keyword) {
|
||||
//Collect Html Node Nozzel Html
|
||||
if (!ModelHtml.hasOwnProperty(strVendor))
|
||||
ModelHtml[strVendor] = '';
|
||||
|
||||
let CoverImage = OneModel['cover'];
|
||||
ModelHtml[strVendor] += '<div class="PrinterBlock" onClick="ChooseModel(\''+strVendor+'\',\''+OneModel['model']+'\')">'+
|
||||
'<div class="PImg">'+
|
||||
'<img class="ModelThumbnail" src="'+CoverImage+'" />'+
|
||||
'<div class="ModelCheckBox" vendor="' +strVendor+ '" model="'+OneModel['model']+'"></div>'+
|
||||
'</div>'+
|
||||
' <div class="PName">'+OneModel['name']+'</div>'+
|
||||
'</div>';
|
||||
|
||||
ModelHtml[strVendor]+=CreatePrinterBlock(OneModel); // ORCA
|
||||
}
|
||||
|
||||
//Update Nozzel Html Append
|
||||
@@ -276,6 +262,38 @@ function FilterModelList(keyword) {
|
||||
TranslatePage();
|
||||
}
|
||||
|
||||
function CreatePrinterBlock(OneModel)
|
||||
{
|
||||
// ORCA use single functuon to create blocks to simplify code
|
||||
let vendor = OneModel['vendor']
|
||||
vendorName = vendor=="BBL" ? "Bambu Lab" : vendor=="Custom" ? "Generic Printer" : vendor;
|
||||
|
||||
let modelName = OneModel['name'];
|
||||
// Most of it unneeded. this can be applied in profiles
|
||||
if( vendor=="Custom")
|
||||
modelName = modelName.split(" ")[1];
|
||||
// these uses different case in name; seckit, ratrig, blocks
|
||||
else if (modelName.toLowerCase().startsWith(vendorName.toLowerCase()))
|
||||
modelName = modelName.slice(vendorName.length);
|
||||
// these not matches. have to fix in profiles to reduce conditions in here;
|
||||
else if (vendor == "MagicMaker" && modelName.startsWith("MM"))
|
||||
modelName = modelName.slice(("MM").length);
|
||||
else if (vendor == "OrcaArena")
|
||||
modelName = modelName.slice(("Orca Arena").length);
|
||||
else if (vendor == "RolohaunDesign" && modelName.startsWith("Rolohaun"))
|
||||
modelName = modelName.slice(("Rolohaun").length);
|
||||
|
||||
return '<div class="PrinterBlock" onClick="ChooseModel(\''+vendor+'\',\''+OneModel['model']+'\')">'+
|
||||
'<div class="PImg">'+
|
||||
'<img class="ModelThumbnail" src="' + OneModel['cover'] + '" />'+
|
||||
'</div>'+
|
||||
'<div style="display: flex;">'+
|
||||
' <div class="ModelCheckBox" vendor="' +vendor+ '" model="'+OneModel['model']+'"></div>'+
|
||||
' <div class="PName"><p>'+ vendorName +'</p><p>' + modelName +'</p></div>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
function SelectPrinterAll( sVendor )
|
||||
{
|
||||
$("div.OneVendorBlock[vendor='"+sVendor+"'] .ModelCheckBox").addClass('ModelCheckBoxSelected');
|
||||
|
||||
Reference in New Issue
Block a user