ISISComputingGroup / ISISComputingGroup/IBEX
SM300: Issue with definition and use of MSTP macros
- Dominant language
- No language data
- Stars
- 6
- Forks
- 2
- Avg merge
- 16h 40m
- Merged PRs (30d)
- 2
Description
## Where?
**SM300** - `st-common.cmd`
## How?
When IOCs SM300_02 and SM300_03 were created, some issues with macro definitions surfaced
(See: https://github.com/ISISComputingGroup/IBEX/issues/4461)
First, `config.xml` claims to set a default value for `MSTP1` and `MSTP2` of `200`, but this seems to be inconsistent: when `MSTP1` and `MSTP2` macros are **not** set, and are accessed in `st-common.cmd` file by the following, their logs error with `macLib: macro <...> is undefined`.
```
dcalc("VELO1", "15000/$(MSTP1)", 1, 2) # Feed rate / steps to give velocity
dcalc("VELO2", "15000/$(MSTP2)", 1, 2) # Feed rate / steps to give velocity
```
More importantly, the value of `MSTP1` and `MSTP2` are **hard-coded** to exactly `200` and `1000` respectively a couple lines below:
```
# 2^data format * Gear factor denomentor / Gear factor numerator
dcalc("MSTP1", "100*10/5", 1, 1)
dcalc("MSTP2", "100*10/1", 1, 1)
```
Thus, **any** value given to `MSTP1` and `MSTP2` will _only_ affect the value of the **`VELO`** macros, since `MSTP1` and `MSTP2` immediately defect to their hard-coded values above - which seems bizarre.
In order to refactor this behaviour, it would be worth discussing how valid the above logic is in regards to how these IOCs are actually used, and how to reflect that more coherently in this file.
## Acceptance criteria
- [ ] **Discuss how the `MSTP` and `VELO` macros should be defined** in order to reflect their use by scientists.
- [ ] **Refactor `st-common.cmd`** to reflect the above.
## How to Test
_verbose instructions for reviewer to test changes
(**Add before making a PR**)_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.