diff --git a/src/octoprint/plugins/svgtogcode/static/css/svgtogcode.css b/src/octoprint/plugins/svgtogcode/static/css/svgtogcode.css index a5166fd7..a7a6e0a2 100644 --- a/src/octoprint/plugins/svgtogcode/static/css/svgtogcode.css +++ b/src/octoprint/plugins/svgtogcode/static/css/svgtogcode.css @@ -1,6 +1,6 @@ table th.settings_plugin_svgtogcode_profiles_key,table td.settings_plugin_svgtogcode_profiles_key{text-overflow:ellipsis;text-align:left;width:200px}table th.settings_plugin_svgtogcode_profiles_name,table td.settings_plugin_svgtogcode_profiles_name{text-overflow:ellipsis;text-align:left}table th.settings_plugin_svgtogcode_profiles_actions,table td.settings_plugin_svgtogcode_profiles_actions{text-align:center;width:100px}table th.settings_plugin_svgtogcode_profiles_actions a,table td.settings_plugin_svgtogcode_profiles_actions a{text-decoration:none;color:#000}table th.settings_plugin_svgtogcode_profiles_actions a.disabled,table td.settings_plugin_svgtogcode_profiles_actions a.disabled{color:#ccc;cursor:default} .slider_manual_input { - margin-left: 1.5em; + margin-left: 1.5em; width: 2.5em; } @@ -22,7 +22,7 @@ table th.settings_plugin_svgtogcode_profiles_key,table td.settings_plugin_svgtog } .svgtogcode_grayscale { - background-image: linear-gradient(90deg, #FFFFFF, #000000); + background-image: linear-gradient(90deg, #FFFFFF, #000000); width:220px; display: inline-block; } @@ -37,7 +37,7 @@ svg text { -ms-user-select: none; cursor: default; pointer-events: none; - + } .img_slider{ @@ -60,8 +60,8 @@ svg text { left:0; } -.img_preprocessing_preview.after .contrast, -.img_preprocessing_preview.after .sharpened, +.img_preprocessing_preview.after .contrast, +.img_preprocessing_preview.after .sharpened, .img_preprocessing_preview.after .sharpened_contrast { opacity: 0; } @@ -87,8 +87,8 @@ svg text { } #photo_preview { - width: 80vw; - height: 70vh; + width: 400px; + height: 300px; margin: auto; } @@ -97,8 +97,8 @@ svg text { } .overrideSlider input { - width:45%; + width:45%; } .overrideSlider span { padding-left: .6em; -} \ No newline at end of file +} diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index 57ab14ec..b4f71d85 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -100,7 +100,7 @@ $(function() { }); } }; - + self.fromCurrentData = function(data) { self._processStateData(data.state); }; @@ -138,7 +138,7 @@ $(function() { } }); }; - + self.fromResponse = function(response, filenameToFocus, locationToFocus) { var files = response.files; _.each(files, function(element, index, list) { @@ -267,7 +267,7 @@ $(function() { return "files_template_dummy"; } }; - + self.getEntryId = function(data) { return "gcode_file_" + md5(data["origin"] + ":" + data["name"]); }; @@ -344,7 +344,7 @@ $(function() { } return output; }; - + self.performSearch = function(e) { if (e !== undefined) { e.preventDefault(); @@ -375,7 +375,7 @@ $(function() { self.enableSVGConversion = function (data) { return self.loginState.isUser() && !(self.isPrinting() || self.isPaused()); }; - + self.onStartup = function() { $(".accordion-toggle[data-target='#files']").click(function() { var files = $("#files"); @@ -610,11 +610,13 @@ $(function() { $('#take_photo_dialog').on('shown', function () { $('#photo_preview').photobooth(); - var w = $('#photo_preview').width(); - var h = $('#photo_preview').height(); + var w = $('#photo_preview').parent().width()*0.98; + var h = w*3.0/4.0; + $('#photo_preview').height(h); + $('#photo_preview').width(w); $('#photo_preview').data('photobooth').resize(w, h); }); - + $('#photo_preview').on("image", function (event, dataUrl) { var photoBlob = self.dataUriToBlob(dataUrl); var t = new Date(); @@ -660,7 +662,7 @@ $(function() { ); return !!fGetUserMedia; }; - + self.dataUriToBlob = function(dataURI) { // serialize the base64/URLEncoded data var byteString; diff --git a/src/octoprint/util/comm_acc2.py b/src/octoprint/util/comm_acc2.py index 65801373..387a1b6c 100644 --- a/src/octoprint/util/comm_acc2.py +++ b/src/octoprint/util/comm_acc2.py @@ -213,11 +213,8 @@ class MachineCom(object): else: self._log("Send: %s" % cmd) try: - self._process_command_phase("sending", self._cmd) + self._cmd, _, _ = self._process_command_phase("sending", self._cmd) self._serial.write(cmd) - #self._metric_chars += len(cmd) - #if self._metric_time is None: - # self._metric_time = time.time() self._process_command_phase("sent", cmd) except serial.SerialException: self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))