Skip to content

Commit

Permalink
Change processng for VF pumps discussion #1004
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrouse committed Jul 20, 2024
1 parent 0267217 commit 35e494f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controller/comms/messages/status/PumpStateMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class PumpStateMessage {
pump.mode = msg.extractPayloadByte(1);
pump.driveState = msg.extractPayloadByte(2);
pump.watts = (msg.extractPayloadByte(3) * 256) + msg.extractPayloadByte(4);
pump.rpm = (typeof ptype !== 'undefined' && ptype.maxSpeed > 0) ? (msg.extractPayloadByte(5) * 256) + msg.extractPayloadByte(6) : 0;
pump.rpm = (typeof ptype !== 'undefined' && (ptype.maxSpeed > 0 || ptype.name === 'VF')) ? (msg.extractPayloadByte(5) * 256) + msg.extractPayloadByte(6) : 0;
pump.flow = (typeof ptype !== 'undefined' && ptype.maxFlow > 0) ? msg.extractPayloadByte(7) : 0;
pump.ppc = msg.extractPayloadByte(8);
pump.status = (msg.extractPayloadByte(11) * 256) + msg.extractPayloadByte(12); // 16-bits of error codes.
Expand Down
3 changes: 2 additions & 1 deletion controller/nixie/pumps/Pump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ export class NixiePumpVF extends NixiePumpRS485 {
// When we are not 0 then it sends 4[255], 6[10], 5[6], 1[flow]
if (!this.closing) await this.setPumpToRemoteControlAsync(); // Action 4
if (!this.closing) await this.setDriveStateAsync(); // Action 6
if (!this.closing) await this.setPumpFeatureAsync(this._targetSpeed > 0 ? 6 : undefined); // Action 5
//if (!this.closing) await this.setPumpFeatureAsync(this._targetSpeed > 0 ? 6 : undefined); // Action 5
if (!this.closing) await this.setPumpFeatureAsync(6); // Action 5
if (!this.closing && this._targetSpeed > 0) await this.setPumpGPMAsync(); // Action 1
if (!this.closing) await setTimeout(200);
if (!this.closing) await this.requestPumpStatusAsync(); // Action 7
Expand Down

0 comments on commit 35e494f

Please sign in to comment.