Skip to content

Commit

Permalink
Implemented rest of PRS
Browse files Browse the repository at this point in the history
  • Loading branch information
Buzze11 committed Aug 12, 2023
1 parent ebb0cba commit bd639c2
Show file tree
Hide file tree
Showing 16 changed files with 1,171 additions and 338 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,34 @@ For EZO Pumps the following states are listening for changes:
* **"Constant_flow_rate"** -> Format: commaseparated values ml per min,duration -> Dispenses constantly the given volume/min over the given duration in minutes. ml for volume/min and duration in minutes. Negative amounts will run the pump in reverse. The state will be cleared automatically after the command has been executed.
* **"Pause_Pump"** -> If set to true the pump will be paused. Unpause is done on next dispense action.

## PRS-Related funtionalities & Settings

### PRS Admin-UI Elements

![Image](pictures/prs_config.png)

* **"Clear Calibration"-Button** -> Delete calibration Data
* **"Calibrate Zeropoint"-Button** -> calibrate device zeropoint
* **"Calibrate High"-Button** -> calibrate device high point to desired value

* **"psi"-Switch** -> Switch to enable or disable "output will be in psi" inside the reading string
* **"atm"-Switch** -> Switch to enable or disable "output will be in atm" inside the reading string
* **"bar"-Switch** -> Switch to enable or disable "output will be in bar" inside the reading string
* **"kPa"-Switch** -> Switch to enable or disable "output will be in kPa" inside the reading string
* **"inh2o"-Switch** -> Switch to enable or disable "output will be in inches of water" inside the reading string
* **"cmh2o"-Switch** -> Switch to enable or disable "output will be in cm of water" inside the reading string


### PRS States with include State change detection

For PRS Sensor following states are listening for changes:
* **"Calibrate_Clear"** -> Set to true to clear sensor calibration. Will be set to false calibration was cleared.
* **"Calibrate_Zeropoint"** -> Set to true to run a zeropoint sensor calibration. Will be set to false after calibration run.
* **"Calibrate_High"** -> Set to true to to run a high sensor calibration with the desired value. Will be cleared after calibration automatically
* **"Alarm_enabled"** -> Set to true to to enable Alarm pin from sensor, false to disable
* **"Alarm_Threshold"** -> Set the desired value for alarm threshold. After change value will be written to sensor
* **"Alarm_Tolerance"** -> Set the desired value for alarm threshold. After change value will be written to sensor


## Visualization example with Grafana Dashboard

Expand Down Expand Up @@ -2762,6 +2790,10 @@ You can check other adapters for examples or ask in the developer community. Usi
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
- Added support for EZO PRS Sensor
- Added help for PRS in readme.md

### 2.2.2 (2023-08-06)
- Bugfixings: Fixed wrong order of delay initialization and delay values for some drivers
- Added backend hardware driver for embedded EZO PRS (not functional right now)
Expand Down
946 changes: 675 additions & 271 deletions admin/.watch/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions admin/.watch/index.js.map

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions admin/build/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions admin/build/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions admin/src/devices/ezo-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as ScientificEzoORP from './orp';
import * as ScientificEzoRTD from './rtd';
import * as ScientificEzoPump from './pmp';
import * as ScientificEzoEC from './ec';
import * as ScientificEzoPRS from './prs';

export interface DeviceInfo {
readonly name: string;
Expand All @@ -22,6 +23,8 @@ export class EzoFactory {
...ScientificEzoRTD.Infos,
...ScientificEzoPump.Infos,
...ScientificEzoEC.Infos,
...ScientificEzoPRS.Infos,

];

static getSupportedDevices(address: number): DeviceInfo[] {
Expand Down
24 changes: 2 additions & 22 deletions admin/src/devices/prs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PRS extends EzoBase<PRSConfig> {
@boundMethod
protected doZeropointCalibration(_event: React.FormEvent<HTMLElement>): boolean {
console.log('Zeropoint Calibration Button pressed');
this.handleCalibration("PRSZeropoint", this.calibrateValue);
this.handleCalibration("Zeropoint", this.calibrateValue);
return false;
}

Expand Down Expand Up @@ -103,26 +103,6 @@ class PRS extends EzoBase<PRSConfig> {

// ***************************************************

// ******* Alarm configuration *******

// @boundMethod
// protected onAlarmThresholdValueChange(_event: React.FormEvent<HTMLElement>): boolean {
// const target = event.target as HTMLInputElement | HTMLSelectElement;
// const value = this.parseChangedSetting(target);
// this.calibrateValue = value.toString();
// console.log('new alarm threshold value: ' + this.alarmThresholdValue);
// return false;
// }

// @boundMethod
// protected onAlarmToleranceValueChange(_event: React.FormEvent<HTMLElement>): boolean {
// const target = event.target as HTMLInputElement | HTMLSelectElement;
// const value = this.parseChangedSetting(target);
// this.calibrateValue = value.toString();
// console.log('new alarm tolerance value: ' + this.alarmToleranceValue);
// return false;
// }

@boundMethod
protected setAlarmConfig(_event: React.FormEvent<HTMLElement>): boolean {
console.log('Set Alarm Config Button pressed');
Expand Down Expand Up @@ -248,7 +228,7 @@ class PRS extends EzoBase<PRSConfig> {
<Grid item xs={12} sm={12} md={12}>
<label >{I18n.t('PRS Parameters Configuration')}</label>
</Grid>
<Grid item xs={7} sm={5} md={3}>
<Grid item xs={7} sm={6} md={6}>
<label>
<Switch
checked={this.state.config.psiParamActive}
Expand Down
3 changes: 3 additions & 0 deletions build/atlas-scientific-i2c/index.js

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

4 changes: 2 additions & 2 deletions build/atlas-scientific-i2c/index.js.map

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

Loading

0 comments on commit bd639c2

Please sign in to comment.