Skip to content

Commit

Permalink
Integrated Machine Settings
Browse files Browse the repository at this point in the history
- "Machine Settings" moved under "Slice Settings" when expertise level is "Expert"
  • Loading branch information
Marcio T committed Mar 18, 2022
1 parent 34c93e2 commit 1757418
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 98 deletions.
3 changes: 2 additions & 1 deletion src-app/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ SynDaver Symple Slicer v1.1.0
=============================

* '''Slicing UI:''' Added ability to show overhangs when placing objects
* '''Slicing UI:''' Added ability to enable different slicing settings under "Advanced Features"
* '''Slicing UI:''' Added ability to select user expertise level under "Advanced Features"
* '''Slicing UI:''' "Machine Settings" moved under "Slice Settings" when expertise level is "Expert"
* '''Slicing UI:''' "Print Sequence" under "Special Modes" is now usable (no collision prevention, use with care!)
* '''Slicing UI:''' Added ability to pause print at certain layers or insert custom G-code
* '''Slicing UI:''' Added ability to cancel a slice.
Expand Down
3 changes: 1 addition & 2 deletions src-app/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ BODY[data-platform="desktop"] .webapp-only {display: none;}
}

#machine_start_gcode, #machine_end_gcode {
width: 75vw;
height: 75vh;
height: 8em;
}

#gcode-every-code {
Expand Down
6 changes: 3 additions & 3 deletions src-app/css/themes/classic.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ input, select {
font-size: 150%;
}

.axis_r input, button.axis_r {
.axis_r input, button.axis_r, #machine_width {
outline: 1px solid red;
}

.axis_g input, button.axis_g {
.axis_g input, button.axis_g, #machine_depth {
outline: 1px solid green;
}

.axis_b input, button.axis_b {
.axis_b input, button.axis_b, #machine_height {
outline: 1px solid blue;
}
6 changes: 3 additions & 3 deletions src-app/css/themes/darkness.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ input, select {
font-size: 150%;
}

.axis_r input, button.axis_r {
.axis_r input, button.axis_r, #machine_width {
outline: 1px solid red;
}

.axis_g input, button.axis_g {
.axis_g input, button.axis_g, #machine_depth {
outline: 1px solid green;
}

.axis_b input, button.axis_b {
.axis_b input, button.axis_b, #machine_height {
outline: 1px solid blue;
}
6 changes: 3 additions & 3 deletions src-app/css/themes/sporty.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ input, select {
font-size: 150%;
}

.axis_r input, button.axis_r {
.axis_r input, button.axis_r, #machine_width {
outline: 1px solid red;
}

.axis_g input, button.axis_g {
.axis_g input, button.axis_g, #machine_depth {
outline: 1px solid green;
}

.axis_b input, button.axis_b {
.axis_b input, button.axis_b, #machine_height {
outline: 1px solid blue;
}
6 changes: 3 additions & 3 deletions src-app/css/themes/syndaver-3d.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ input, select {
font-size: 150%;
}

.axis_r input, button.axis_r {
.axis_r input, button.axis_r, #machine_width {
outline: 1px solid red;
}

.axis_g input, button.axis_g {
.axis_g input, button.axis_g, #machine_depth {
outline: 1px solid green;
}

.axis_b input, button.axis_b {
.axis_b input, button.axis_b, #machine_height {
outline: 1px solid blue;
}
96 changes: 23 additions & 73 deletions src-app/js/SettingsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class SettingsPanel {
ObjectTransformPage.init(s);
await SliceObjectsPage.init(s);
PrintAndPreviewPage.init(s);
MachineSettingsPage.init(s);
StartAndEndGCodePage.init(s);
ConfigWirelessPage.init(s);
if(isDesktop) {
MonitorWirelessPage.init(s);
Expand Down Expand Up @@ -263,7 +261,7 @@ class SelectProfilesPage {
try {
await this.populateProfileMenus(menus);
if(ProfileManager.loadStoredProfile()) {
MachineSettingsPage.onPrinterSizeChanged();
SliceObjectsPage.onPrinterSizeChanged();
this.rememberProfileSelections(menus);
} else {
// If no startup profile is found, load first profile from the selection box
Expand Down Expand Up @@ -388,7 +386,7 @@ class SelectProfilesPage {
quality: settings.get("print_quality"),
material: settings.get("print_profiles")
});
MachineSettingsPage.onPrinterSizeChanged();
SliceObjectsPage.onPrinterSizeChanged();
} finally {
ProgressBar.hide();
}
Expand All @@ -403,7 +401,7 @@ class SelectProfilesPage {
const el = settings.get("toml_file");
ProfileManager.importConfiguration(el.data);
el.clear();
MachineSettingsPage.onPrinterSizeChanged();
SliceObjectsPage.onPrinterSizeChanged();
SelectProfilesPage.onImportChanged(false);
SelectProfilesPage.onNext();
} catch(e) {
Expand Down Expand Up @@ -844,9 +842,29 @@ class SliceObjectsPage {
static onSlicerSettingsChanged(name, val) {
switch(name) {
case "support_angle": OverhangShader.setAngle(val); break;
case "machine_name":
case "machine_width":
case "machine_depth":
case "machine_height":
case "machine_center_is_zero":
case "machine_heated_bed":
SliceObjectsPage.onPrinterSizeChanged(); break;
}
}

static onPrinterSizeChanged() {
stage.setPrinterCharacteristics({
circular: slicer.getOption("machine_shape") == "elliptic",
origin_at_center: slicer.getOption("machine_center_is_zero"),
x_width: slicer.getOption("machine_width"),
y_depth: slicer.getOption("machine_depth"),
z_height: slicer.getOption("machine_height"),
name: slicer.getOption("machine_name")
});
stage.arrangeObjectsOnPlatform();
renderLoop.setView("front");
}

static onSliceClicked() {
var geometries = stage.getAllGeometry();
if(geometries.length) {
Expand Down Expand Up @@ -1123,74 +1141,6 @@ class PrintAndPreviewPage {
}
}

class MachineSettingsPage {
static init(s) {
s.page( "Machine Settings", {id: "page_machine"});

s.category( "Printhead Settings");
s.fromSlicer( "machine_nozzle_size");
s.fromSlicer( "machine_head_with_fans_x_min");
s.fromSlicer( "machine_head_with_fans_y_min");
s.fromSlicer( "machine_head_with_fans_x_max");
s.fromSlicer( "machine_head_with_fans_y_max");
s.fromSlicer( "gantry_height");

s.category( "Auto Leveling");
s.fromSlicer( "machine_probe_type");

s.category( "Build Volume");
s.fromSlicer( "machine_shape");
s.fromSlicer( "machine_width", {className: "axis_r"});
s.fromSlicer( "machine_depth", {className: "axis_g"});
s.fromSlicer( "machine_height", {className: "axis_b"});
s.fromSlicer( "machine_center_is_zero");
s.fromSlicer( "machine_heated_bed");
s.button( "Save Changes", {onclick: MachineSettingsPage.onPrinterSizeChanged});

s.category( "Start & End G-code");
s.buttonHelp( "Template to edit:");
s.button( "Start", {onclick: MachineSettingsPage.onEditStartGcode});
s.button( "End", {onclick: MachineSettingsPage.onEditEndGcode});
}

static onPrinterSizeChanged() {
stage.setPrinterCharacteristics({
circular: settings.get("machine_shape") == "elliptic",
origin_at_center: settings.get("machine_center_is_zero"),
x_width: settings.get("machine_width"),
y_depth: settings.get("machine_depth"),
z_height: settings.get("machine_height"),
name: slicer.getOption("machine_name")
});
stage.arrangeObjectsOnPlatform();
renderLoop.setView("front");
}

static onEditStartGcode() {
settings.gotoPage("page_start_gcode");
}

static onEditEndGcode() {
settings.gotoPage("page_end_gcode");
}
}

class StartAndEndGCodePage {
static init(s) {
s.page( "", {id: "page_start_gcode"});
s.fromSlicer( "machine_start_gcode");
s.button( "Done", {onclick: StartAndEndGCodePage.doneEditingGcode});

s.page( "", {id: "page_end_gcode"});
s.fromSlicer( "machine_end_gcode");
s.button( "Done", {onclick: StartAndEndGCodePage.doneEditingGcode});
}

static doneEditingGcode() {
settings.gotoPage("page_machine");
}
}

class AdvancedFeaturesPage {
static init(s) {
s.page( "Advanced Features", {id: "page_advanced"});
Expand Down
18 changes: 9 additions & 9 deletions src-app/js/SlicerSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,23 +517,23 @@ SlicerSettings.slicerSettings = {
"Machine Settings:",
"machine_name",
"machine_show_variants",
"#machine_start_gcode",
"#machine_end_gcode",
"machine_start_gcode",
"machine_end_gcode",
"material_guid",
"material_diameter",
"material_bed_temp_wait",
"material_print_temp_wait",
"material_print_temp_prepend",
"material_bed_temp_prepend",
"#machine_width",
"#machine_depth",
"#machine_height",
"#machine_shape",
"machine_width",
"machine_depth",
"machine_height",
"machine_shape",
"machine_buildplate_type",
"#machine_heated_bed",
"machine_heated_bed",
"machine_heated_build_volume",
"machine_always_write_active_tool",
"#machine_center_is_zero",
"machine_center_is_zero",
"machine_extruder_count",
"extruders_enabled_count",
"machine_nozzle_tip_outer_diameter",
Expand All @@ -554,7 +554,7 @@ SlicerSettings.slicerSettings = {
"machine_head_with_fans_polygon",
"gantry_height",
"machine_nozzle_id",
"#machine_nozzle_size",
"machine_nozzle_size",
"machine_use_extruder_offset_to_offset_coords",
"extruder_prime_pos_z",
"extruder_prime_pos_abs",
Expand Down
2 changes: 1 addition & 1 deletion src-app/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ importScripts('lib/util/misc/Wikify.js');
// Based on https://deanhume.com/displaying-a-new-version-available-progressive-web-app/

const info = {
cacheVersion: 201
cacheVersion: 203
};

const cacheName = 'v' + info.cacheVersion;
Expand Down

0 comments on commit 1757418

Please sign in to comment.