Permalink
Browse files

Fix first load problem with screen diagonal size

  • Loading branch information...
1 parent 7acc378 commit 6edd1828fa713f68c70c7511524f6a7003c4d8c7 @wilbur-shi wilbur-shi committed Aug 10, 2016
Showing with 10 additions and 7 deletions.
  1. +10 −7 js/photonic3d.js
View
@@ -36,16 +36,19 @@ function setPrinterCalibrationSettings(printer) {
$buildVolumeY.val(buildVolYmm);
$buildVolumeZ.val(printer.configuration.machineConfig.PlatformZSize);
updateBuildVolumeSettings();
-
-
- $('#screen-diagonal-unit-in').prop('checked', false);
- $('#screen-diagonal-unit-mm').prop('checked', true);
- // After manually checking the mm unit, set the values then update UI
- $screenDiagonalSize.val(diagonalMM);
+ var unit = settings.get('screen.diagonal.unit')
+ var convert = unit == 'in';
+
+ $screenDiagonalSize.val(convert ? parseUnit(diagonalMM, unit) : diagonalMM);
$screenWidth.val(monitorDriverConfig.DLP_X_Res);
$screenHeight.val(monitorDriverConfig.DLP_Y_Res);
updateScreenSettings();
+ if (convert) {
+ $('#screen-diagonal-unit-in').prop('checked', false);
+ $('#screen-diagonal-unit-mm').prop('checked', true);
+ updateScreenSettings();
+ }
// No error occurred so return false
return false;
@@ -120,7 +123,7 @@ var oldEndSlicing = endSlicing;
endSlicing = function() {
oldEndSlicing();
- $('#new-zip-button').prop('disabled', false);
+ $('#new-zip-button').prop('disabled', !zipFile);
}
$(document).ready(initializeValues);

0 comments on commit 6edd182

Please sign in to comment.