Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Updated dependencies to their latest versions (PR #13). This especially includes an update to `measurements` `0.11.1`,
which now includes support for pressures in Torr and mTorr units.
This support was used in the Pfeiffer TPG36x gauge driver.
- Add a `SensorError` variant to `InstrumentError` to represent errors related to sensors (PR #12).
- Dropped generics in `LoopbackInterface` and renamed it to `LoopbackInterfaceString`.
This interface allows testing of instruments that communicate by sending byte encoded strings
Expand Down
163 changes: 107 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ members = ["instrumentRs", "other/digoutbox", "lakeshore/lakeshore_336", "pfeiff
exclude = ["demos", "demos/*", "examples", "examples/*", "template", "template/*"]

[workspace.dependencies]
measurements = "0.11.0"
serialport = "4.7.2"
rstest = "0.25.0"
measurements = "0.11.1"
serialport = "4.8.1"
rstest = "0.26.1"
2 changes: 1 addition & 1 deletion instrumentRs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/trappitsch/instrumentRs/tree/main/instrumentRs"
description = "A library for standardized control of (scientific) instruments from Rust."

[dependencies]
thiserror = "2.0.12"
thiserror = "2.0"
serialport = { workspace = true, optional = true }

[dev-dependencies]
Expand Down
8 changes: 2 additions & 6 deletions pfeiffer/tpg36x/src/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,9 @@ impl Display for PressureUnit {
pub(crate) fn from_value_unit(value: f64, unit: &PressureUnit) -> Tpg36xMeasurement {
match unit {
PressureUnit::mBar => Tpg36xMeasurement::Pressure(Pressure::from_millibars(value)),
PressureUnit::Torr => {
Tpg36xMeasurement::Pressure(Pressure::from_pascals(value * 133.32236842))
} // HACK
PressureUnit::Torr => Tpg36xMeasurement::Pressure(Pressure::from_torrs(value)),
PressureUnit::Pa => Tpg36xMeasurement::Pressure(Pressure::from_pascals(value)),
PressureUnit::mTorr => {
Tpg36xMeasurement::Pressure(Pressure::from_pascals(value * 0.13332236842))
} // HACK
PressureUnit::mTorr => Tpg36xMeasurement::Pressure(Pressure::from_millitorrs(value)),
PressureUnit::hPa => Tpg36xMeasurement::Pressure(Pressure::from_pascals(value * 100.0)),
PressureUnit::V => Tpg36xMeasurement::Voltage(Voltage::from_volts(value)),
}
Expand Down