|
@@ -112,6 +112,7 @@ static const char *state_names[] = {
|
112
|
112
|
stringify(fullauto_kickstart_purge_run),
|
113
|
113
|
stringify(fullauto_plant_purge_run),
|
114
|
114
|
stringify(fullauto_plant_purge_overrun),
|
|
115
|
+ stringify(fullauto_plant_purge_over_pump_run),
|
115
|
116
|
stringify(fullauto_done),
|
116
|
117
|
|
117
|
118
|
stringify(automation_mode),
|
|
@@ -535,7 +536,8 @@ void Statemachine::input(int n) {
|
535
|
536
|
|| (state == fullauto_plant_run)
|
536
|
537
|
|| (state == fullauto_plant_overrun)
|
537
|
538
|
|| (state == fullauto_plant_purge_run)
|
538
|
|
- || (state == fullauto_plant_purge_overrun)) {
|
|
539
|
+ || (state == fullauto_plant_purge_overrun)
|
|
540
|
+ || (state == fullauto_plant_purge_over_pump_run)) {
|
539
|
541
|
plants.abort();
|
540
|
542
|
stop_time = millis();
|
541
|
543
|
switch_to(auto_done);
|
|
@@ -1535,7 +1537,8 @@ void Statemachine::act(void) {
|
1535
|
1537
|
if ((state == auto_plant_run) || (state == fillnwater_plant_run)
|
1536
|
1538
|
|| (state == fullauto_plant_run) || (state == fullauto_plant_overrun)
|
1537
|
1539
|
|| (state == fullauto_plant_purge_run)
|
1538
|
|
- || (state == fullauto_plant_purge_overrun)) {
|
|
1540
|
+ || (state == fullauto_plant_purge_overrun)
|
|
1541
|
+ || (state == fullauto_plant_purge_over_pump_run)) {
|
1539
|
1542
|
unsigned long runtime = millis() - start_time;
|
1540
|
1543
|
if ((runtime / 1000UL) >= selected_time) {
|
1541
|
1544
|
if (state == fullauto_plant_run) {
|
|
@@ -1596,6 +1599,33 @@ void Statemachine::act(void) {
|
1596
|
1599
|
} else if (state == fullauto_plant_purge_overrun) {
|
1597
|
1600
|
plants.abort();
|
1598
|
1601
|
stop_time = millis();
|
|
1602
|
+
|
|
1603
|
+ bool need_kickstart = false;
|
|
1604
|
+ for (int i = 0; i < plants.countPlants(); i++) {
|
|
1605
|
+ if (selected_plants.isSet(i)) {
|
|
1606
|
+ if (plants.getKickstart()->getPinNumber(i) >= 0) {
|
|
1607
|
+ need_kickstart = true;
|
|
1608
|
+ }
|
|
1609
|
+ }
|
|
1610
|
+ }
|
|
1611
|
+
|
|
1612
|
+ start_time = millis();
|
|
1613
|
+ selected_time = FULLAUTO_END_PUMP_TIME;
|
|
1614
|
+
|
|
1615
|
+ if (need_kickstart) {
|
|
1616
|
+ for (int i = 0; i < plants.countPlants(); i++) {
|
|
1617
|
+ if (selected_plants.isSet(i)) {
|
|
1618
|
+ plants.startPlant(i, true);
|
|
1619
|
+ }
|
|
1620
|
+ }
|
|
1621
|
+
|
|
1622
|
+ switch_to(fullauto_plant_purge_over_pump_run);
|
|
1623
|
+ } else {
|
|
1624
|
+ switch_to(fullauto_done);
|
|
1625
|
+ }
|
|
1626
|
+ } else if (state == fullauto_plant_purge_over_pump_run) {
|
|
1627
|
+ plants.abort();
|
|
1628
|
+ stop_time = millis();
|
1599
|
1629
|
switch_to(fullauto_done);
|
1600
|
1630
|
} else {
|
1601
|
1631
|
plants.abort();
|
|
@@ -1608,7 +1638,9 @@ void Statemachine::act(void) {
|
1608
|
1638
|
switch_to(state);
|
1609
|
1639
|
}
|
1610
|
1640
|
|
1611
|
|
- if ((state == fullauto_plant_overrun) || (state == fullauto_plant_purge_overrun)) {
|
|
1641
|
+ if ((state == fullauto_plant_overrun)
|
|
1642
|
+ || (state == fullauto_plant_purge_overrun)
|
|
1643
|
+ || (state == fullauto_plant_purge_over_pump_run)) {
|
1612
|
1644
|
// overrun should not exit when sensor returns empty
|
1613
|
1645
|
return;
|
1614
|
1646
|
}
|
|
@@ -1652,7 +1684,6 @@ void Statemachine::act(void) {
|
1652
|
1684
|
start_time = millis();
|
1653
|
1685
|
selected_time = OVERRUN_RUNTIME;
|
1654
|
1686
|
switch_to(fullauto_plant_purge_overrun);
|
1655
|
|
-
|
1656
|
1687
|
}
|
1657
|
1688
|
} else if (wl == Plants::invalid) {
|
1658
|
1689
|
plants.abort();
|
|
@@ -1878,7 +1909,9 @@ void Statemachine::switch_to(States s) {
|
1878
|
1909
|
b.c_str(),
|
1879
|
1910
|
"Hit any key to stop!",
|
1880
|
1911
|
-1);
|
1881
|
|
- } else if ((s == fullauto_plant_overrun) || (s == fullauto_plant_purge_overrun)) {
|
|
1912
|
+ } else if ((s == fullauto_plant_overrun)
|
|
1913
|
+ || (s == fullauto_plant_purge_overrun)
|
|
1914
|
+ || (s == fullauto_plant_purge_over_pump_run)) {
|
1882
|
1915
|
unsigned long runtime = millis() - start_time;
|
1883
|
1916
|
String a = String(F("Time: ")) + String(runtime / 1000UL) + String(F("s / ")) + String(selected_time) + String('s');
|
1884
|
1917
|
|