Skip to content

Commit

Permalink
#632 - First support of visualizer import
Browse files Browse the repository at this point in the history
  • Loading branch information
graphefruit committed Sep 24, 2024
1 parent 475784d commit 9a6bf78
Showing 1 changed file with 36 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -664,30 +664,48 @@ export class BrewBrewingGraphComponent implements OnInit {
presetFlowProfile.pressureFlow &&
presetFlowProfile.pressureFlow.length > 0
) {
this.chartData.push(this.pressureTraceReference);
for (const data of presetFlowProfile.pressureFlow) {
this.pressureTraceReference.x.push(
new Date(
moment(data.timestamp, 'HH:mm:ss.SSS').toDate().getTime() -
delay
)
);
this.pressureTraceReference.y.push(data.actual_pressure);
const pressureDevice = this.bleManager.getPressureDevice();
if (
(pressureDevice != null &&
this.getPreparation().style_type ===
PREPARATION_STYLE_TYPE.ESPRESSO) ||
this.brewComponent?.brewBrewingPreparationDeviceEl?.preparationDeviceConnected() ||
!this.platform.is('cordova')
) {
/** We just push the data, if we also got an pressure device connected**/
this.chartData.push(this.pressureTraceReference);
for (const data of presetFlowProfile.pressureFlow) {
this.pressureTraceReference.x.push(
new Date(
moment(data.timestamp, 'HH:mm:ss.SSS').toDate().getTime() -
delay
)
);
this.pressureTraceReference.y.push(data.actual_pressure);
}
}
}
if (
presetFlowProfile.temperatureFlow &&
presetFlowProfile.temperatureFlow.length > 0
) {
this.chartData.push(this.temperatureTraceReference);
for (const data of presetFlowProfile.temperatureFlow) {
this.temperatureTraceReference.x.push(
new Date(
moment(data.timestamp, 'HH:mm:ss.SSS').toDate().getTime() -
delay
)
);
this.temperatureTraceReference.y.push(data.actual_temperature);
const temperatureDevice = this.bleManager.getTemperatureDevice();
if (
temperatureDevice != null ||
this.brewComponent?.brewBrewingPreparationDeviceEl?.preparationDeviceConnected() ||
!this.platform.is('cordova')
) {
/** We just push the data, if we also got an temperature device connected**/
this.chartData.push(this.temperatureTraceReference);
for (const data of presetFlowProfile.temperatureFlow) {
this.temperatureTraceReference.x.push(
new Date(
moment(data.timestamp, 'HH:mm:ss.SSS').toDate().getTime() -
delay
)
);
this.temperatureTraceReference.y.push(data.actual_temperature);
}
}
}
}
Expand Down

0 comments on commit 9a6bf78

Please sign in to comment.