Typos and clarity fixes from review of jogging branch
Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
This commit is contained in:
parent
ea3de5f45d
commit
d9deb1a7e7
3 changed files with 10 additions and 8 deletions
|
|
@ -337,8 +337,11 @@ def test_thing_description_equivalence(dummy_stage, mocker):
|
||||||
assert sanga_properties == dummy_properties == base_properties
|
assert sanga_properties == dummy_properties == base_properties
|
||||||
|
|
||||||
|
|
||||||
def test_job_repr():
|
def test_jog_command_repr():
|
||||||
"""Test when printing a jog command the result is as expected."""
|
"""Test when printing a jog command the result is as expected.
|
||||||
|
|
||||||
|
This tests the ``__repr__`` method of ``JogCommand``.
|
||||||
|
"""
|
||||||
# Jog should represent itself the same whether displacement is set with a list or a
|
# Jog should represent itself the same whether displacement is set with a list or a
|
||||||
# tuple.
|
# tuple.
|
||||||
assert str(JogCommand([1, 2, 3])) == "<JogCommand>(1, 2, 3)"
|
assert str(JogCommand([1, 2, 3])) == "<JogCommand>(1, 2, 3)"
|
||||||
|
|
@ -416,7 +419,7 @@ def test_send_jog_commands(dummy_stage, mocker, caplog):
|
||||||
assert mock_thread.call_count == 1
|
assert mock_thread.call_count == 1
|
||||||
# The thread target is the jog loop
|
# The thread target is the jog loop
|
||||||
assert mock_thread.call_args.kwargs["target"] == dummy_stage._jog_loop
|
assert mock_thread.call_args.kwargs["target"] == dummy_stage._jog_loop
|
||||||
# Args are jut the first command
|
# Args are just the first command
|
||||||
thread_args = mock_thread.call_args.kwargs["args"]
|
thread_args = mock_thread.call_args.kwargs["args"]
|
||||||
assert len(thread_args) == 1
|
assert len(thread_args) == 1
|
||||||
assert thread_args[0] is commands[0]
|
assert thread_args[0] is commands[0]
|
||||||
|
|
@ -438,7 +441,7 @@ def test_send_jog_commands(dummy_stage, mocker, caplog):
|
||||||
dummy_stage._jog_thread.is_alive.return_value = False
|
dummy_stage._jog_thread.is_alive.return_value = False
|
||||||
assert not dummy_stage._jog_thread.is_alive()
|
assert not dummy_stage._jog_thread.is_alive()
|
||||||
|
|
||||||
# 3rd call call, will create a new thread and a new queue
|
# call with the 3rd command, will create a new thread and a new queue
|
||||||
dummy_stage._send_jog_command(commands[2])
|
dummy_stage._send_jog_command(commands[2])
|
||||||
|
|
||||||
# Thread is alive again
|
# Thread is alive again
|
||||||
|
|
@ -448,7 +451,7 @@ def test_send_jog_commands(dummy_stage, mocker, caplog):
|
||||||
assert mock_thread.call_count == 2
|
assert mock_thread.call_count == 2
|
||||||
# The thread target is the jog loop
|
# The thread target is the jog loop
|
||||||
assert mock_thread.call_args.kwargs["target"] == dummy_stage._jog_loop
|
assert mock_thread.call_args.kwargs["target"] == dummy_stage._jog_loop
|
||||||
# Args are jut the first command
|
# Args are just the first command
|
||||||
thread_args = mock_thread.call_args.kwargs["args"]
|
thread_args = mock_thread.call_args.kwargs["args"]
|
||||||
assert len(thread_args) == 1
|
assert len(thread_args) == 1
|
||||||
assert thread_args[0] is commands[2]
|
assert thread_args[0] is commands[2]
|
||||||
|
|
|
||||||
|
|
@ -267,12 +267,12 @@ export default {
|
||||||
* Jog for key-presses.
|
* Jog for key-presses.
|
||||||
*
|
*
|
||||||
* This is a similar to the function in stageControlButtons.vue however it uses
|
* This is a similar to the function in stageControlButtons.vue however it uses
|
||||||
* uses the key repeat to fire in case a key up is missed. It debounes any
|
* uses the key repeat to fire in case a key up is missed. It debounces any
|
||||||
* request to jog that is too recent after the last jog.
|
* request to jog that is too recent after the last jog.
|
||||||
*/
|
*/
|
||||||
jog(x, y, z) {
|
jog(x, y, z) {
|
||||||
// Manually debounce extra requests from keyboard repeat rate.
|
// Manually debounce extra requests from keyboard repeat rate.
|
||||||
// This is used rather than and interval in case of missing a repeat.
|
// This is used rather than an interval in case of missing a repeat.
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const navigationInvert = this.$store.state.navigationInvert;
|
const navigationInvert = this.$store.state.navigationInvert;
|
||||||
if (now - this.lastJogTime < this.jogTime) {
|
if (now - this.lastJogTime < this.jogTime) {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ export default {
|
||||||
eventBus.on("globalUpdatePositionEvent", this.updatePosition);
|
eventBus.on("globalUpdatePositionEvent", this.updatePosition);
|
||||||
// A global signal listener to perform a move action in pixels
|
// A global signal listener to perform a move action in pixels
|
||||||
eventBus.on("globalMoveInImageCoordinatesEvent", this.onMoveImage);
|
eventBus.on("globalMoveInImageCoordinatesEvent", this.onMoveImage);
|
||||||
// A global signal listener to perform a move in multiples of a step size
|
|
||||||
|
|
||||||
// Update the current position in text boxes
|
// Update the current position in text boxes
|
||||||
await this.updatePosition();
|
await this.updatePosition();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue