halui test: reorganize the halui jogging test dir layout

This is in preparation for adding more tests of different halui
functionality.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
halui test: add an mdi test

Verify that halui runs MDI commands correctly, and that it restores
task_mode when it's done.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
halui test: give halui a few seconds to switch the task mode back

When halui finishes an mdi command it switches task back to whatever
mode it was in before the mdi command started, but this can take a
little while.  So dont freak out if it's not already done the first time
we check.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
halui: use lui for getting and thinking about task mode

... instead of using the EMC enums & stat struct.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
lui: redo how the Command NML system waits

add lui_set_command_wait_mode() and lui_command_wait_mode_t

add lui_send_command_and_wait()

    Takes an RCS message, sets the message's serial number from the
    lui_t, increments the lui_t's serial number for next time, sends
    the RCS message, and waits for Received or Done according to the
    lui_t's wait mode.

when waiting for a command to be done, first wait for it to be received

move the lui_command_wait_*() functions to the private header

rename command_nml_wait things to drop nml

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
lui-test: use implicit wait-for-done inside lui instead of explicit wait calls after each lui call

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
task-mode: use lui_send_nml_command_and_wait()

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
task-state: use lui_send_nml_command_and_wait()

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
lui-test: switch test_task_mode() to use fatal_if()

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
linuxcncrsh: when the user runs "set set_wait", set the wait mode of lui too

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
linuxcncrsh: warn about broken "set wait"

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
lui: add lui_send_mdi_command()

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
halui: use lui for sending mdi

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
xemc: use lui for send_mdi_command

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
change in-tree shcom users to use lui instead for mdi

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
tests: use linuxcncrsh's "set set_wait" instead of the broken "set wait"

Also, better waiting in toolchanger test.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>