Add swap command #104

Open
atse wants to merge 2 commits from atse/thermostat:swap_tec_polarity into master

For use with Zotino, since the Zotino header on the Thermostat has the current pins reversed.

For use with Zotino, since the Zotino header on the Thermostat has the current pins reversed.
atse added 2 commits 2024-04-26 17:44:37 +08:00
6fadfc0b49 Add swap command
Per-channel current swapping, for use with Zotino in the meantime on
HWRevs < 3.0 as the Zotino headers are swapped on the Thermostat.
f95a1b24f5 add swap status to the report
Signed-off-by: Egor Savkin <es@m-labs.hk>
esavkin reviewed 2024-04-29 10:41:52 +08:00
@ -414,1 +414,4 @@
fn swap_tec_polarity (socket: &mut TcpSocket, channels: &mut Channels, channel: Option<usize>) -> Result<Handler, Error> {
for c in 0..CHANNELS {
if channel.is_none() || channel == Some(c) {

Isn't there a way to set it directly into channel_state?

Isn't there a way to set it directly into channel_state?
sb10q reviewed 2024-04-29 13:22:46 +08:00
@ -122,0 +122,4 @@
-i_set
} else {
i_set
}

Can't it be handled just at the DAC and current readout, instead of having to invert it all over the place?

Can't it be handled just at the DAC and current readout, instead of having to invert it all over the place?
sb10q reviewed 2024-04-29 13:26:20 +08:00
@ -415,0 +415,4 @@
fn swap_tec_polarity (socket: &mut TcpSocket, channels: &mut Channels, channel: Option<usize>) -> Result<Handler, Error> {
for c in 0..CHANNELS {
if channel.is_none() || channel == Some(c) {
channels.channel_state(c).swap_tec_polarity = !channels.channel_state(c).swap_tec_polarity;

That's a terrible API. Simply add a way to set swapped to true/false (with the reference being the front panel polarity) instead of only something that toggles the property without any way to know what its value is.

That's a terrible API. Simply add a way to set swapped to true/false (with the reference being the front panel polarity) instead of only something that toggles the property without any way to know what its value is.
This pull request has changes conflicting with the target branch.
  • src/channels.rs
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b atse-swap_tec_polarity master
git pull swap_tec_polarity

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff atse-swap_tec_polarity
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/thermostat#104
There is no content yet.