Skip to content

Commit c9a79b8

Browse files
committed
chore(config): remove unused variables
1 parent 31cba72 commit c9a79b8

File tree

3 files changed

+8
-45
lines changed

3 files changed

+8
-45
lines changed

src/Configuration.h

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ constexpr size_t DEFAULT_LOG_FILE_SIZE = 1024 * 1024 * 5; // 5MB
3737
constexpr size_t DEFAULT_LOG_FILE_COUNT = 3; // 3 files
3838

3939
/* UI */
40-
constexpr size_t MODEL_TICK_INTERVAL = 100; // Interval to tick the model in milliseconds
41-
constexpr size_t MODEL_TICK_HZ = 1000 / MODEL_TICK_INTERVAL;
42-
constexpr uint32_t DEFAULT_SCREEN_TIMEOUT = 5 * 60 * 1000; // milliseconds
40+
constexpr std::chrono::milliseconds MODEL_TICK_INTERVAL = 100ms; // Interval to tick the model in milliseconds
41+
constexpr size_t MODEL_TICK_HZ = 1000 / MODEL_TICK_INTERVAL.count();
42+
constexpr std::chrono::seconds DEFAULT_SCREEN_TIMEOUT = 5min;
4343
constexpr std::string_view DEFAULT_ICON_SET = "material";
4444

4545
/* Duet */
@@ -48,12 +48,9 @@ constexpr std::string_view DEFAULT_MACROS_PATH = "0:/macros";
4848
constexpr std::chrono::milliseconds DEFAULT_PRINTER_POLL_INTERVAL = 250ms;
4949
constexpr std::chrono::milliseconds MIN_PRINTER_POLL_INTERVAL = 100ms;
5050
constexpr std::chrono::milliseconds PRINTER_REQUEST_TIMEOUT = 10000ms;
51-
constexpr int DEFAULT_COMMUNICATION_TYPE = 1;
5251
constexpr std::string_view DEFAULT_IP_ADDRESS = "192.168.0.";
5352
constexpr std::string DEFAULT_UART_PORT = "/dev/ttyS5";
5453
constexpr const int DEFAULT_BAUD_RATE = B115200;
55-
constexpr size_t MAX_IP_LENGTH = 50;
56-
constexpr size_t MAX_HOSTNAME_LENGTH = 64;
5754
constexpr std::chrono::milliseconds TIME_SYNC_INTERVAL = 10000ms; // Interval to resynchronize time with the Duet
5855
constexpr size_t MAX_UART_UPLOAD_SIZE = 1024;
5956
constexpr std::string_view DEFAULT_FILAMENTS_FILE = "filaments.csv";
@@ -93,51 +90,18 @@ constexpr unsigned int MAX_SENSORS = 32;
9390
constexpr unsigned int MAX_ENDSTOPS = 20;
9491
constexpr size_t MAX_TRACKED_OBJECTS = 40;
9592

96-
/* Move */
97-
constexpr int MAX_MOVE_FEEDRATE = 10000;
98-
99-
/* Extrusion */
100-
constexpr int MAX_EXTRUDE_FEEDRATE = 300;
101-
constexpr int MAX_EXTRUDE_DISTANCE = 500;
102-
103-
/* Print Status */
104-
constexpr float DEFAULT_BABY_STEP_SIZE = 0.05f;
105-
106-
/* Heightmap */
107-
constexpr double HEIGHTMAP_FIXED_MAX = 0.25;
108-
constexpr double HEIGHTMAP_FIXED_MIN = -0.25;
109-
constexpr size_t HEIGHTMAP_COLORBAR_SAMPLES = 100;
110-
11193
/* Console */
11294
constexpr unsigned int MAX_COMMAND_LENGTH = 50;
113-
constexpr unsigned int MAX_RESPONSE_LINE_LENGTH = 80;
11495
constexpr unsigned int MAX_RESPONSE_LINES = 200;
11596

116-
/* Webcam */
117-
constexpr size_t MAX_WEBCAMS = 20;
118-
constexpr int32_t DEFAULT_WEBCAM_UPDATE_INTERVAL = 500;
119-
constexpr int32_t MINIMUM_WEBCAM_UPDATE_INTERVAL = 100;
120-
12197
/* Misc UI */
122-
constexpr bool DEFAULT_SHOW_SETUP_ON_STARTUP = true;
12398
constexpr std::string_view DEFAULT_LANGUAGE_CODE = "en-GB";
12499

125-
/* Popup */
126-
constexpr uint32_t DEFAULT_NOTIFICATION_TIMEOUT = 5000;
127-
constexpr uint32_t DEFAULT_NOTIFICATION_LEVEL = 0;
128-
constexpr bool DEFAULT_NOTIFICATION_AUTO_CLOSE_ERROR = false;
129-
130100
/* Alert */
131101
constexpr size_t ALERT_TEXT_LENGTH = 165; // maximum characters in the alert text
132102
constexpr size_t ALERT_TITLE_LENGTH = 50; // maximum characters in the alert title
133103
constexpr size_t ALERT_RESPONSE_LENGTH = 50; // maximum characters in the alert response
134104
constexpr size_t ALERT_MAX_CHOICES = 40; // maximum number of choices in the alert
135105
constexpr size_t ALERT_CHOICES_TEXT_LENGTH = 50; // maximum characters in the alert choice text
136106

137-
/* Temperature Graph */
138-
constexpr float DEFAULT_TEMP_GRAPH_MAX = 300;
139-
constexpr size_t DEFAULT_TEMP_GRAPH_TIME_RANGE = 60;
140-
constexpr float TEMP_GRAPH_Y_AXIS_PADDING = 10;
141-
constexpr size_t GRAPH_DATAPOINTS = DEFAULT_TEMP_GRAPH_TIME_RANGE * (1000 / MIN_PRINTER_POLL_INTERVAL.count());
142-
143107
#endif /* JNI_CONFIGURATION_H_ */

src/Storage.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,19 @@ namespace std::chrono
4040
/* Duet */
4141
constexpr StorageKey<std::string_view> ID_DUET_IP_ADDRESS = {"duet:hostname", DEFAULT_IP_ADDRESS};
4242
constexpr StorageKey<std::string_view> ID_DUET_PASSWORD = {"duet:password", ""};
43-
constexpr StorageKey<Comm::CommunicationType> ID_DUET_COMMUNICATION_TYPE = {
44-
"duet:communication_type", Comm::CommunicationType(DEFAULT_COMMUNICATION_TYPE)};
43+
constexpr StorageKey<Comm::CommunicationType> ID_DUET_COMMUNICATION_TYPE = {"duet:communication_type",
44+
Comm::CommunicationType::usb};
4545
constexpr StorageKey<std::chrono::milliseconds> ID_DUET_POLL_INTERVAL = {"duet:poll_interval",
4646
DEFAULT_PRINTER_POLL_INTERVAL};
4747
constexpr StorageKey<speed_t> ID_DUET_BAUD_RATE = {"duet:baud_rate", DEFAULT_BAUD_RATE};
4848

4949
/* UI */
5050
constexpr StorageKey<size_t> ID_THEME = {"ui:theme", std::numeric_limits<size_t>::max()};
5151
constexpr StorageKey<std::string_view> ID_FONT = {"ui:font", "OpenSans"};
52-
constexpr StorageKey<std::string_view> ID_ICON_FOLDER = {"ui:icon_folder", "material"};
52+
constexpr StorageKey<std::string_view> ID_ICON_FOLDER = {"ui:icon_folder", DEFAULT_ICON_SET};
5353

5454
constexpr StorageKey<bool> ID_SCREENSAVER_ENABLE = {"ui:screensaver_enable", true};
55-
constexpr StorageKey<std::chrono::seconds> ID_SCREENSAVER_TIMEOUT = {"ui:screensaver_timeout",
56-
std::chrono::seconds(300)};
55+
constexpr StorageKey<std::chrono::seconds> ID_SCREENSAVER_TIMEOUT = {"ui:screensaver_timeout", DEFAULT_SCREEN_TIMEOUT};
5756
constexpr StorageKey<std::chrono::milliseconds> ID_NOTIFICATION_TIMEOUT = {"ui:info_timeout", std::chrono::seconds(5)};
5857
constexpr StorageKey<ResponseType> ID_NOTIFICATION_LEVEL = {"ui:notification_level", ResponseType::INFO};
5958
constexpr StorageKey<bool> ID_NOTIFICATION_AUTO_CLOSE_ERROR = {"ui:notification_auto_close_error", false};

src/UI/Core/Model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Model::Model()
175175
{
176176
m_timers.tick = lv_timer_create(
177177
[](lv_timer_t* timer) { static_cast<Model*>(lv_timer_get_user_data(timer))->post<EventType::Tick>(); },
178-
MODEL_TICK_INTERVAL,
178+
MODEL_TICK_INTERVAL.count(),
179179
this);
180180
}
181181
else

0 commit comments

Comments
 (0)