My response to Te-Wei's review:
[ts_hexrotcomm]
[base_csc.py]
1. The value for SIMPLE_TELEMETRY_PORT is arbitrary. I will add a code comment explaining this.
The constant BASE_CSC_COMMAND_PORT is a mistake (thank you for catching it). During development I changed BASE_CSC_COMMAND_PORT to SIMPLE_TELEMETRY_PORT (the one you ask about next) and I forgot to remove this old constant.
Regarding "you say the command port is one larger. In this case, the SIMPLE_TELEMETRY_PORT should be 6209 instead of 6210. Right?". I don't think it matters because the value 6210 is arbitrary. The command port will be 6211.
I am not sure about your question of the place holder. I could not find the reference.
[ts_mthexapod]
[constants.py]
1. (Doc string enhancement) Good suggestion. I updated the description.
2. (Values for ControllerConstants in constants.py). Good point, though my resolution may not please you.
The ControllerConstants class records magic numbers used by the vendor.
The doc string is intended to explain what each value means.
At present the way I construct ControllerConstants in constants.py is a confusing mix of numeric and named constants.
I am changing the code code so that all values used to construct ControllerConstants are numbers, rather than named constants.
I strongly prefer numbers because it eliminates a lot of repetion, which I believe enhances readability.
The other extreme is to 8 separate named constants which are then used to construct the ControllerConstants instances
(and not used for anything else).
Note that this means getting rid of the FieldId enum class, which was only being used to construct ControllerConstants.
[mock_controller.py]
1. Excellent question.
This is regarding the ports for MockMTHexapodController.
The default values were, and still are, "the standard port for this device".
Formerly these were two specific numbers, but now that each device has its own standard ports, numeric defaults no longer work.
So I now use None to mean "the standard port for this device", and None is the default.
However, I forgot to update the doc string with this information. I have now done that.
[ts_mtrotator]
[rotator_commander.py]
1. This is in reference to the new digits argument of RotatorCommander._special_telemetry_callback.
I chose the default digits=2 to match the existing code in ts_salobj.
The choice of default makes very little difference; it only affects how I to call this method
from the two custom telemetry handlers.
The motors custom handler uses 1 digit because there is too much noise in the 2nd digit,
resulting in unwanted extra output. It also ignores the "raw" field when deciding whether to print new data.
That ignore could be handled without a custom handler in ts_salobj 6.2,
and a custom handler will be much simpler in salobj 6.3 (there will be no need for _special_telemetry_callback).
The rotation handler uses the standard 2 digits, but ignores the timestamp field.
This custom telemetry handler is unnecessary in ts_salobj 6.2 because it ignores the timestamp field.
So this code is temporary. Some can disappear when we require ts_salobj 6.2 and almost all of it will go away
if and when we require ts_salobj 6.3 (which is in development).
I felt it safest to retain compatibility with salobj 6.1 for now, as we need to deploy this new software as quickly as possible.
The new ports are: