Skip to content

Commit

Permalink
Fix AC input and battery mock changes to use mock configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
blammit committed Jan 22, 2024
1 parent 9d5ad46 commit cee38ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/mock/AcInputsImpl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ QtObject {
property Timer _measurementsTimer: Timer {
property int testEnergyCounter: -5

running: true
running: Global.mockDataSimulator.timersActive && !root.manualConfig
repeat: true
interval: 3000
onTriggered: {
Expand Down
3 changes: 3 additions & 0 deletions data/mock/BatteriesImpl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ QtObject {
function beginCharging() { stepSize = 1.0; start() }
function beginDischarging() { stepSize = -1.0; start() }
onTriggered: {
if (!Global.mockDataSimulator.timersActive) {
return
}
var newSoc = Global.batteries.system.stateOfCharge + stepSize
if (newSoc >= 0 && newSoc <= 100) { Global.batteries.system.stateOfCharge = newSoc }
else if (newSoc > 100) { Global.batteries.system.stateOfCharge = 100; stop() }
Expand Down

0 comments on commit cee38ab

Please sign in to comment.