Loading openflexure_microscope/api/templates/index_v1.html +26 −21 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ <script> // TODO: Remember a position and restore that position // TODO: Right click to auto-focus, centered on that region // Key IDs var pgupKeyID = 33; Loading Loading @@ -117,7 +118,9 @@ // Methods for input events // Click-to-move function clickHotspotImage(event) { if (document.getElementById("clickPositionCheck").checked == true) { xCoordinate = event.offsetX; yCoordinate = event.offsetY; console.log(xCoordinate, yCoordinate) Loading @@ -129,6 +132,18 @@ console.log(xSteps, ySteps, 0) moveStagePositions(xSteps, ySteps, 0) } } // Scroll-to-focus window.addEventListener('wheel', function(e) { multiplier = 1/100; z_delta = e.deltaY * multiplier * focusVelocity; console.log(z_delta); if (document.getElementById("scrollFocusCheck").checked == true) { // Make a position request safeRequest("POST", "{{ url_for('position') }}", { "absolute": false, "z": z_delta}, keyMoveCallback) } }); addEventListener("keydown", function (e) { keysDown[e.keyCode] = true; //Add key to array Loading Loading @@ -169,16 +184,6 @@ delete keysDown[e.keyCode]; //Remove key from array }, false); window.addEventListener('wheel', function(e) { multiplier = 1/100; z_delta = e.deltaY * multiplier * focusVelocity; console.log(z_delta); if (document.getElementById("scrollFocusCheck").checked == true) { // Make a position request safeRequest("POST", "{{ url_for('position') }}", { "absolute": false, "z": z_delta}, keyMoveCallback) } }); // Methods for making requests function safeRequest(method, url, payload, callback) { if (requestLock == false) { Loading Loading
openflexure_microscope/api/templates/index_v1.html +26 −21 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ <script> // TODO: Remember a position and restore that position // TODO: Right click to auto-focus, centered on that region // Key IDs var pgupKeyID = 33; Loading Loading @@ -117,7 +118,9 @@ // Methods for input events // Click-to-move function clickHotspotImage(event) { if (document.getElementById("clickPositionCheck").checked == true) { xCoordinate = event.offsetX; yCoordinate = event.offsetY; console.log(xCoordinate, yCoordinate) Loading @@ -129,6 +132,18 @@ console.log(xSteps, ySteps, 0) moveStagePositions(xSteps, ySteps, 0) } } // Scroll-to-focus window.addEventListener('wheel', function(e) { multiplier = 1/100; z_delta = e.deltaY * multiplier * focusVelocity; console.log(z_delta); if (document.getElementById("scrollFocusCheck").checked == true) { // Make a position request safeRequest("POST", "{{ url_for('position') }}", { "absolute": false, "z": z_delta}, keyMoveCallback) } }); addEventListener("keydown", function (e) { keysDown[e.keyCode] = true; //Add key to array Loading Loading @@ -169,16 +184,6 @@ delete keysDown[e.keyCode]; //Remove key from array }, false); window.addEventListener('wheel', function(e) { multiplier = 1/100; z_delta = e.deltaY * multiplier * focusVelocity; console.log(z_delta); if (document.getElementById("scrollFocusCheck").checked == true) { // Make a position request safeRequest("POST", "{{ url_for('position') }}", { "absolute": false, "z": z_delta}, keyMoveCallback) } }); // Methods for making requests function safeRequest(method, url, payload, callback) { if (requestLock == false) { Loading