Skip to content

Commit f504374

Browse files
jgfosterJames Foster
andauthored
Refactor Directories (#432)
* Rename DataLogger_TC to DataLogger since it doesn't have any other names that would conflict. * Refactor 'Devices' directory to 'wrappers' (for classes that wrap an external library (*_CI) and 'model' (for other classes) * Renname NumberCollectorState to NumberCollector. --------- Co-authored-by: James Foster <git@jgfoster.net>
1 parent b0cad17 commit f504374

105 files changed

Lines changed: 351 additions & 350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ FLAGS=-std=c++0x \
2222
INCLUDE=-I$(ARDUINO_CI)/arduino \
2323
-I$(ARDUINO_CI)/unittest \
2424
-I$(LIBRARIES)/TankController/src \
25-
-I$(LIBRARIES)/TankController/src/Devices \
25+
-I$(LIBRARIES)/TankController/src/model \
2626
-I$(LIBRARIES)/TankController/src/UIState \
27+
-I$(LIBRARIES)/TankController/src/wrappers \
2728
-I$(LIBRARIES)/Adafruit_BusIO/src \
2829
-I$(LIBRARIES)/Adafruit_MAX31865_library/src \
2930
-I$(LIBRARIES)/PID/src \
@@ -44,14 +45,14 @@ INCLUDE=-I$(ARDUINO_CI)/arduino \
4445
-I$(LIBRARIES)/SdFat/src/common \
4546
-I$(LIBRARIES)/SdFat/src/iostream
4647

47-
HEADERS=$(wildcard src/*.h) $(wildcard src/Devices/*) $(wildcard src/UIState/*)
48+
HEADERS=$(wildcard src/*.h) $(wildcard src/wrappers/*) $(wildcard src/UIState/*)
4849

4950
.PHONY : all
5051
all : $(BIN)/PHCalibrationWarningTest.cpp.bin $(BIN)/BlinkTest.cpp.bin $(BIN)/DateTimeTest.cpp.bin $(BIN)/EEPROMTest.cpp.bin \
5152
$(BIN)/EnablePIDTest.cpp.bin $(BIN)/EthernetServerTest.cpp.bin $(BIN)/EthernetTest.cpp.bin \
5253
$(BIN)/GetTimeTest.cpp.bin $(BIN)/JSONBuilderTest.cpp.bin $(BIN)/KeypadTest.cpp.bin \
5354
$(BIN)/LiquidCrystalTest.cpp.bin \
54-
$(BIN)/MenuTest.cpp.bin $(BIN)/NumberCollectorStateTest.cpp.bin $(BIN)/PHCalibrationHighTest.cpp.bin \
55+
$(BIN)/MenuTest.cpp.bin $(BIN)/NumberCollectorTest.cpp.bin $(BIN)/PHCalibrationHighTest.cpp.bin \
5556
$(BIN)/PHCalibrationLowTest.cpp.bin $(BIN)/PHCalibrationMidTest.cpp.bin \
5657
$(BIN)/PHCalibrationPromptTest.cpp.bin $(BIN)/PHControlTest.cpp.bin \
5758
$(BIN)/PHProbeTest.cpp.bin $(BIN)/PIDTest.cpp.bin $(BIN)/PushingBoxTest.cpp.bin $(BIN)/SDTest.cpp.bin \
@@ -105,8 +106,8 @@ $(BIN)/LiquidCrystalTest.cpp.bin: $(BIN)/libarduino.so $(TEST)/LiquidCrystalTest
105106
$(BIN)/MenuTest.cpp.bin: $(BIN)/libarduino.so $(TEST)/MenuTest.cpp $(HEADERS)
106107
$(GPP_TEST) -o $(BIN)/MenuTest.cpp.bin $(TEST)/MenuTest.cpp -larduino
107108

108-
$(BIN)/NumberCollectorStateTest.cpp.bin: $(BIN)/libarduino.so $(TEST)/NumberCollectorStateTest.cpp $(HEADERS)
109-
$(GPP_TEST) -o $(BIN)/NumberCollectorStateTest.cpp.bin $(TEST)/NumberCollectorStateTest.cpp -larduino
109+
$(BIN)/NumberCollectorTest.cpp.bin: $(BIN)/libarduino.so $(TEST)/NumberCollectorTest.cpp $(HEADERS)
110+
$(GPP_TEST) -o $(BIN)/NumberCollectorTest.cpp.bin $(TEST)/NumberCollectorTest.cpp -larduino
110111

111112
$(BIN)/PHCalibrationHighTest.cpp.bin: $(BIN)/libarduino.so $(TEST)/PHCalibrationHighTest.cpp $(HEADERS)
112113
$(GPP_TEST) -o $(BIN)/PHCalibrationHighTest.cpp.bin $(TEST)/PHCalibrationHighTest.cpp -larduino
@@ -247,13 +248,13 @@ SDFAT=$(BIN)/FreeStack.o $(BIN)/MinimumSerial.o $(BIN)/File_CI.o $(BIN)/SD_CI.o
247248
$(BIN)/istream.o $(BIN)/ostream.o
248249

249250
OBJECTS=$(BIN)/Arduino.o $(BIN)/Godmode.o $(BIN)/stdlib.o $(BIN)/ArduinoUnitTests.o \
250-
$(BIN)/TC_util.o $(BIN)/TankController.o $(BIN)/DataLogger_TC.o $(BIN)/DateTime_TC.o \
251+
$(BIN)/TC_util.o $(BIN)/TankController.o $(BIN)/DataLogger.o $(BIN)/DateTime_TC.o \
251252
$(BIN)/EEPROM_TC.o $(BIN)/EthernetServer_TC.o $(BIN)/Ethernet_TC.o $(BIN)/GetTime.o \
252253
$(BIN)/JSONBuilder.o \
253254
$(BIN)/Keypad_TC.o $(BIN)/LiquidCrystal_TC.o $(BIN)/PHControl.o $(BIN)/PHProbe.o \
254255
$(BIN)/PID_TC.o $(BIN)/PushingBox.o $(BIN)/SD_TC.o $(BIN)/Serial_TC.o $(BIN)/ThermalProbe_TC.o \
255256
$(BIN)/ThermalControl.o $(BIN)/PHCalibrationWarning.o $(BIN)/EnablePID.o $(BIN)/MainMenu.o \
256-
$(BIN)/NumberCollectorState.o $(BIN)/PHCalibrationHigh.o $(BIN)/PHCalibrationLow.o \
257+
$(BIN)/NumberCollector.o $(BIN)/PHCalibrationHigh.o $(BIN)/PHCalibrationLow.o \
257258
$(BIN)/PHCalibrationMid.o $(BIN)/PHCalibrationPrompt.o $(BIN)/SeeDeviceAddress.o \
258259
$(BIN)/SeeDeviceUptime.o $(BIN)/SeeFreeMemory.o \
259260
$(BIN)/SeeGoogleMins.o $(BIN)/SeeLogFile.o $(BIN)/SeePHCalibration.o \
@@ -281,62 +282,62 @@ $(BIN)/stdlib.o: $(ARDUINO_CI)/arduino/stdlib.cpp $(HEADERS)
281282
$(BIN)/ArduinoUnitTests.o: $(ARDUINO_CI)/unittest/ArduinoUnitTests.cpp $(HEADERS)
282283
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/ArduinoUnitTests.o $(ARDUINO_CI)/unittest/ArduinoUnitTests.cpp
283284

284-
$(BIN)/TC_util.o: $(SRC)/TC_util.cpp $(HEADERS)
285-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/TC_util.o $(SRC)/TC_util.cpp
285+
$(BIN)/TC_util.o: $(SRC)/model/TC_util.cpp $(HEADERS)
286+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/TC_util.o $(SRC)/model/TC_util.cpp
286287

287288
$(BIN)/TankController.o: $(SRC)/TankController.cpp $(HEADERS)
288289
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/TankController.o $(SRC)/TankController.cpp
289290

290-
$(BIN)/DataLogger_TC.o: $(SRC)/Devices/DataLogger_TC.cpp $(HEADERS)
291-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/DataLogger_TC.o $(SRC)/Devices/DataLogger_TC.cpp
291+
$(BIN)/DataLogger.o: $(SRC)/model/DataLogger.cpp $(HEADERS)
292+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/DataLogger.o $(SRC)/model/DataLogger.cpp
292293

293-
$(BIN)/DateTime_TC.o: $(SRC)/Devices/DateTime_TC.cpp $(HEADERS)
294-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/DateTime_TC.o $(SRC)/Devices/DateTime_TC.cpp
294+
$(BIN)/DateTime_TC.o: $(SRC)/wrappers/DateTime_TC.cpp $(HEADERS)
295+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/DateTime_TC.o $(SRC)/wrappers/DateTime_TC.cpp
295296

296-
$(BIN)/EEPROM_TC.o: $(SRC)/Devices/EEPROM_TC.cpp $(HEADERS)
297-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/EEPROM_TC.o $(SRC)/Devices/EEPROM_TC.cpp
297+
$(BIN)/EEPROM_TC.o: $(SRC)/wrappers/EEPROM_TC.cpp $(HEADERS)
298+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/EEPROM_TC.o $(SRC)/wrappers/EEPROM_TC.cpp
298299

299-
$(BIN)/EthernetServer_TC.o: $(SRC)/Devices/EthernetServer_TC.cpp $(HEADERS)
300-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/EthernetServer_TC.o $(SRC)/Devices/EthernetServer_TC.cpp
300+
$(BIN)/EthernetServer_TC.o: $(SRC)/wrappers/EthernetServer_TC.cpp $(HEADERS)
301+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/EthernetServer_TC.o $(SRC)/wrappers/EthernetServer_TC.cpp
301302

302-
$(BIN)/Ethernet_TC.o: $(SRC)/Devices/Ethernet_TC.cpp $(HEADERS)
303-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/Ethernet_TC.o $(SRC)/Devices/Ethernet_TC.cpp
303+
$(BIN)/Ethernet_TC.o: $(SRC)/wrappers/Ethernet_TC.cpp $(HEADERS)
304+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/Ethernet_TC.o $(SRC)/wrappers/Ethernet_TC.cpp
304305

305-
$(BIN)/JSONBuilder.o: $(SRC)/Devices/JSONBuilder.cpp $(HEADERS)
306-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/JSONBuilder.o $(SRC)/Devices/JSONBuilder.cpp
306+
$(BIN)/JSONBuilder.o: $(SRC)/model/JSONBuilder.cpp $(HEADERS)
307+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/JSONBuilder.o $(SRC)/model/JSONBuilder.cpp
307308

308-
$(BIN)/GetTime.o: $(SRC)/Devices/GetTime.cpp $(HEADERS)
309-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/GetTime.o $(SRC)/Devices/GetTime.cpp
309+
$(BIN)/GetTime.o: $(SRC)/model/GetTime.cpp $(HEADERS)
310+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/GetTime.o $(SRC)/model/GetTime.cpp
310311

311-
$(BIN)/Keypad_TC.o: $(SRC)/Devices/Keypad_TC.cpp $(HEADERS)
312-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/Keypad_TC.o $(SRC)/Devices/Keypad_TC.cpp
312+
$(BIN)/Keypad_TC.o: $(SRC)/wrappers/Keypad_TC.cpp $(HEADERS)
313+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/Keypad_TC.o $(SRC)/wrappers/Keypad_TC.cpp
313314

314-
$(BIN)/LiquidCrystal_TC.o: $(SRC)/Devices/LiquidCrystal_TC.cpp $(HEADERS)
315-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/LiquidCrystal_TC.o $(SRC)/Devices/LiquidCrystal_TC.cpp
315+
$(BIN)/LiquidCrystal_TC.o: $(SRC)/wrappers/LiquidCrystal_TC.cpp $(HEADERS)
316+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/LiquidCrystal_TC.o $(SRC)/wrappers/LiquidCrystal_TC.cpp
316317

317-
$(BIN)/PHControl.o: $(SRC)/Devices/PHControl.cpp $(HEADERS)
318-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PHControl.o $(SRC)/Devices/PHControl.cpp
318+
$(BIN)/PHControl.o: $(SRC)/model/PHControl.cpp $(HEADERS)
319+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PHControl.o $(SRC)/model/PHControl.cpp
319320

320-
$(BIN)/PHProbe.o: $(SRC)/Devices/PHProbe.cpp $(HEADERS)
321-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PHProbe.o $(SRC)/Devices/PHProbe.cpp
321+
$(BIN)/PHProbe.o: $(SRC)/model/PHProbe.cpp $(HEADERS)
322+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PHProbe.o $(SRC)/model/PHProbe.cpp
322323

323-
$(BIN)/PID_TC.o: $(SRC)/Devices/PID_TC.cpp $(HEADERS)
324-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PID_TC.o $(SRC)/Devices/PID_TC.cpp
324+
$(BIN)/PID_TC.o: $(SRC)/wrappers/PID_TC.cpp $(HEADERS)
325+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PID_TC.o $(SRC)/wrappers/PID_TC.cpp
325326

326-
$(BIN)/PushingBox.o: $(SRC)/Devices/PushingBox.cpp $(HEADERS)
327-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PushingBox.o $(SRC)/Devices/PushingBox.cpp
327+
$(BIN)/PushingBox.o: $(SRC)/model/PushingBox.cpp $(HEADERS)
328+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PushingBox.o $(SRC)/model/PushingBox.cpp
328329

329-
$(BIN)/SD_TC.o: $(SRC)/Devices/SD_TC.cpp $(HEADERS)
330-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/SD_TC.o $(SRC)/Devices/SD_TC.cpp
330+
$(BIN)/SD_TC.o: $(SRC)/wrappers/SD_TC.cpp $(HEADERS)
331+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/SD_TC.o $(SRC)/wrappers/SD_TC.cpp
331332

332-
$(BIN)/Serial_TC.o: $(SRC)/Devices/Serial_TC.cpp $(HEADERS)
333-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/Serial_TC.o $(SRC)/Devices/Serial_TC.cpp
333+
$(BIN)/Serial_TC.o: $(SRC)/wrappers/Serial_TC.cpp $(HEADERS)
334+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/Serial_TC.o $(SRC)/wrappers/Serial_TC.cpp
334335

335-
$(BIN)/ThermalProbe_TC.o: $(SRC)/Devices/ThermalProbe_TC.cpp $(HEADERS)
336-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/ThermalProbe_TC.o $(SRC)/Devices/ThermalProbe_TC.cpp
336+
$(BIN)/ThermalProbe_TC.o: $(SRC)/wrappers/ThermalProbe_TC.cpp $(HEADERS)
337+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/ThermalProbe_TC.o $(SRC)/wrappers/ThermalProbe_TC.cpp
337338

338-
$(BIN)/ThermalControl.o: $(SRC)/Devices/ThermalControl.cpp $(HEADERS)
339-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/ThermalControl.o $(SRC)/Devices/ThermalControl.cpp
339+
$(BIN)/ThermalControl.o: $(SRC)/model/ThermalControl.cpp $(HEADERS)
340+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/ThermalControl.o $(SRC)/model/ThermalControl.cpp
340341

341342
$(BIN)/PHCalibrationWarning.o: $(SRC)/UIState/PHCalibrationWarning.cpp $(HEADERS)
342343
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PHCalibrationWarning.o $(SRC)/UIState/PHCalibrationWarning.cpp
@@ -347,8 +348,8 @@ $(BIN)/EnablePID.o: $(SRC)/UIState/EnablePID.cpp $(HEADERS)
347348
$(BIN)/MainMenu.o: $(SRC)/UIState/MainMenu.cpp $(HEADERS)
348349
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/MainMenu.o $(SRC)/UIState/MainMenu.cpp
349350

350-
$(BIN)/NumberCollectorState.o: $(SRC)/UIState/NumberCollectorState.cpp $(HEADERS)
351-
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/NumberCollectorState.o $(SRC)/UIState/NumberCollectorState.cpp
351+
$(BIN)/NumberCollector.o: $(SRC)/UIState/NumberCollector.cpp $(HEADERS)
352+
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/NumberCollector.o $(SRC)/UIState/NumberCollector.cpp
352353

353354
$(BIN)/PHCalibrationHigh.o: $(SRC)/UIState/PHCalibrationHigh.cpp $(HEADERS)
354355
g++ -c $(FLAGS) $(INCLUDE) -o $(BIN)/PHCalibrationHigh.o $(SRC)/UIState/PHCalibrationHigh.cpp

extras/mockUI/libTC.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
#include <thread>
2020
#include <vector>
2121

22-
#include "DateTime_TC.h"
23-
#include "EEPROM_TC.h"
24-
#include "Keypad_TC.h"
25-
#include "LiquidCrystal_TC.h"
26-
#include "PhProbe.h"
27-
#include "SD_TC.h"
28-
#include "Serial_TC.h"
29-
#include "TC_util.h"
3022
#include "TankController.h"
31-
#include "ThermalProbe_TC.h"
32-
#include "UIState.h"
23+
#include "UIState/UIState.h"
24+
#include "model/PhProbe.h"
25+
#include "model/TC_util.h"
3326
#include "pybind11/pybind11.h"
27+
#include "wrappers/DateTime_TC.h"
28+
#include "wrappers/EEPROM_TC.h"
29+
#include "wrappers/Keypad_TC.h"
30+
#include "wrappers/LiquidCrystal_TC.h"
31+
#include "wrappers/SD_TC.h"
32+
#include "wrappers/Serial_TC.h"
33+
#include "wrappers/ThermalProbe_TC.h"
3434

3535
#define LED_PIN 13
3636

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const String gitVersion = '23.8.1-2-g03ebd+';
1+
const String gitVersion = '23.8.1-5-g91577+';

src/TankController.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
#include <avr/wdt.h>
44
#include <stdlib.h>
55

6-
#include "Devices/DataLogger_TC.h"
7-
#include "Devices/DateTime_TC.h"
8-
#include "Devices/EEPROM_TC.h"
9-
#include "Devices/EthernetServer_TC.h"
10-
#include "Devices/Ethernet_TC.h"
11-
#include "Devices/GetTime.h"
12-
#include "Devices/Keypad_TC.h"
13-
#include "Devices/LiquidCrystal_TC.h"
14-
#include "Devices/PHControl.h"
15-
#include "Devices/PHProbe.h"
16-
#include "Devices/PID_TC.h"
17-
#include "Devices/PushingBox.h"
18-
#include "Devices/SD_TC.h"
19-
#include "Devices/Serial_TC.h"
20-
#include "Devices/ThermalControl.h"
21-
#include "Devices/ThermalProbe_TC.h"
22-
#include "TC_util.h"
236
#include "UIState/MainMenu.h"
247
#include "UIState/UIState.h"
258
#include "Version.h"
9+
#include "model/DataLogger.h"
10+
#include "model/GetTime.h"
11+
#include "model/PHControl.h"
12+
#include "model/PHProbe.h"
13+
#include "model/PushingBox.h"
14+
#include "model/TC_util.h"
15+
#include "model/ThermalControl.h"
16+
#include "wrappers/DateTime_TC.h"
17+
#include "wrappers/EEPROM_TC.h"
18+
#include "wrappers/EthernetServer_TC.h"
19+
#include "wrappers/Ethernet_TC.h"
20+
#include "wrappers/Keypad_TC.h"
21+
#include "wrappers/LiquidCrystal_TC.h"
22+
#include "wrappers/PID_TC.h"
23+
#include "wrappers/SD_TC.h"
24+
#include "wrappers/Serial_TC.h"
25+
#include "wrappers/ThermalProbe_TC.h"
2626

2727
const char TANK_CONTROLLER_VERSION[] = VERSION;
2828

@@ -56,7 +56,7 @@ TankController::TankController() {
5656
EEPROM_TC::instance();
5757
Keypad_TC::instance();
5858
LiquidCrystal_TC::instance(TANK_CONTROLLER_VERSION);
59-
DataLogger_TC::instance();
59+
DataLogger::instance();
6060
DateTime_TC::rtc();
6161
Ethernet_TC::instance();
6262
ThermalProbe_TC::instance();
@@ -160,7 +160,7 @@ void TankController::loop(bool report_loop_delay) {
160160
blink(); // blink the on-board LED to show that we are running
161161
updateControls(); // turn CO2 and temperature controls on or off
162162
handleUI(); // look at keypad, update LCD (~90ms)
163-
DataLogger_TC::instance()->loop(); // record current data to SD and serial
163+
DataLogger::instance()->loop(); // record current data to SD and serial
164164
GetTime::instance()->loop(); // update the time
165165
PushingBox::instance()->loop(); // write data to Google Sheets (~1130ms every report)
166166
Ethernet_TC::instance()->loop(); // renew DHCP lease

src/TankController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#endif
55
#include <Arduino.h>
66

7-
#include "TC_util.h"
7+
#include "model/TC_util.h"
88

99
#define TURN_SOLENOID_OFF HIGH
1010
#define TURN_SOLENOID_ON LOW

src/UIState/EnablePID.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#include "EnablePID.h"
66

7-
#include "Devices/LiquidCrystal_TC.h"
8-
#include "Devices/PHControl.h"
7+
#include "model/PHControl.h"
8+
#include "wrappers/LiquidCrystal_TC.h"
99

1010
float EnablePID::getCurrentValue() {
1111
return PHControl::instance()->getUsePID() ? 1 : 9;

src/UIState/EnablePID.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* Enable PID Controller
55
*/
66
#pragma once
7-
#include "NumberCollectorState.h"
7+
#include "NumberCollector.h"
88

9-
class EnablePID : public NumberCollectorState {
9+
class EnablePID : public NumberCollector {
1010
public:
1111
virtual bool isInteger() {
1212
return true;

src/UIState/MainMenu.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#include "MainMenu.h"
22

3-
#include "Devices/LiquidCrystal_TC.h"
4-
#include "Devices/PHControl.h"
5-
#include "Devices/PHProbe.h"
6-
#include "Devices/ThermalControl.h"
7-
#include "Devices/ThermalProbe_TC.h"
83
#include "EnablePID.h"
94
#include "PHCalibrationPrompt.h"
105
#include "PHCalibrationWarning.h"
@@ -32,6 +27,11 @@
3227
#include "SetThermalTarget.h"
3328
#include "SetTime.h"
3429
#include "ThermalCalibration.h"
30+
#include "model/PHControl.h"
31+
#include "model/PHProbe.h"
32+
#include "model/ThermalControl.h"
33+
#include "wrappers/LiquidCrystal_TC.h"
34+
#include "wrappers/ThermalProbe_TC.h"
3535

3636
MainMenu::MainMenu() : UIState() {
3737
viewMenus[VIEW_ADDRESS] = F("View IP and MAC");

src/UIState/MainMenu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#pragma once
88

9-
#include "../TC_util.h"
109
#include "UIState.h"
10+
#include "model/TC_util.h"
1111

1212
class TankController; // forward reference
1313
class MainMenu : public UIState {
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#include "NumberCollectorState.h"
1+
#include "NumberCollector.h"
22

33
#include <math.h>
44

5-
#include "Devices/LiquidCrystal_TC.h"
6-
#include "Devices/Serial_TC.h"
75
#include "MainMenu.h"
6+
#include "wrappers/LiquidCrystal_TC.h"
7+
#include "wrappers/Serial_TC.h"
88
// useful for future debugging
9-
#include "TC_util.h"
9+
#include "model/TC_util.h"
1010

11-
void NumberCollectorState::clear() {
11+
void NumberCollector::clear() {
1212
hasDecimal = false;
1313
numDigits = 0;
1414
value = 0;
1515
factor = 10;
1616
}
1717

18-
void NumberCollectorState::handleKey(char key) {
18+
void NumberCollector::handleKey(char key) {
1919
if (key >= '0' && key <= '9') { // a digit
2020
numDigits++;
2121
handleDigit(key - '0');
@@ -34,7 +34,7 @@ void NumberCollectorState::handleKey(char key) {
3434
printValue();
3535
}
3636

37-
void NumberCollectorState::handleDigit(uint16_t digit) {
37+
void NumberCollector::handleDigit(uint16_t digit) {
3838
if (hasDecimal) {
3939
value = value + (float)digit / factor;
4040
factor = factor * 10;
@@ -43,7 +43,7 @@ void NumberCollectorState::handleDigit(uint16_t digit) {
4343
}
4444
}
4545

46-
void NumberCollectorState::backSpace() {
46+
void NumberCollector::backSpace() {
4747
if (hasDecimal && factor == 10) {
4848
hasDecimal = false;
4949
} else if (hasDecimal) {
@@ -57,7 +57,7 @@ void NumberCollectorState::backSpace() {
5757
}
5858
}
5959

60-
void NumberCollectorState::printValue() {
60+
void NumberCollector::printValue() {
6161
char format[20], strValue[20];
6262
// The Arduino does not support variable widths, so we construct the format string at runtime!
6363
char buffer[8];
@@ -87,7 +87,7 @@ void NumberCollectorState::printValue() {
8787
LiquidCrystal_TC::instance()->writeLine(strValue, 1);
8888
}
8989

90-
void NumberCollectorState::start() {
90+
void NumberCollector::start() {
9191
UIState::start();
9292
printValue();
9393
}

0 commit comments

Comments
 (0)