@@ -47,11 +47,11 @@ enum PORT_STATUS {
47
47
DISABLED
48
48
};
49
49
50
- using ConfigTypes = std::variant<bool , std::string , uint16_t , PORT_STATUS>;
50
+ using ConfigTypes = std::variant<bool , uint8t[ 4 ] , uint16_t , PORT_STATUS>;
51
51
52
52
std::unordered_map<std::string, ConfigTypes> config = {
53
- {" IP" , " 002.000.000.001 " },
54
- {" SUBNET" , " 255.000.000.000 " },
53
+ {" IP" , { 2 , 0 , 0 , 1 } },
54
+ {" SUBNET" , { 255 , 0 , 0 , 0 } },
55
55
{" DHCP" , true },
56
56
{" PORT_A_STATUS" , PORT_STATUS::OUTPUT},
57
57
{" PORT_A_UNIVERSE" , uint16_t (0x0000 )},
@@ -322,7 +322,7 @@ int main () {
322
322
drawRect (&display, 112 , 16 , 127 , 31 );
323
323
drawRect (&display, 112 , 32 , 127 , 47 );
324
324
if (std::get<bool >(config[" DHCP" ])) { // dhcp enabled
325
- drawText (&display, FONT, " v " , 114 , 15 );
325
+ drawText (&display, FONT, " x " , 114 , 15 );
326
326
} else { // dhcp disabled
327
327
drawText (&display, FONT, " x" , 114 , 31 );
328
328
}
@@ -335,9 +335,9 @@ int main () {
335
335
display.clear ();
336
336
draw_menu_content (&display, " IP:" , {}, false );
337
337
drawText (&display, font_8x8, " IP Address:" , 0 , 16 );
338
- drawText (&display, font_8x8, std::get< std::string> (config[" IP" ]). c_str ( ), 0 , 24 );
338
+ drawText (&display, font_8x8, std::to_string (config[ " IP " ][ 0 ]) + " . " + std::to_string (config[" IP" ][ 1 ]) + " . " + std::to_string (config[ " IP " ][ 2 ]) + " . " + std::to_string (config[ " IP " ][ 3 ] ), 0 , 24 );
339
339
drawText (&display, font_8x8, " Subnet Mask:" , 0 , 32 );
340
- drawText (&display, font_8x8, std::get< std::string> (config[" SUBNET" ]). c_str ( ), 0 , 40 );
340
+ drawText (&display, font_8x8, std::to_string (config[ " SUBNET " ][ 0 ]) + " . " + std::to_string (config[" SUBNET" ][ 1 ]) + " . " + std::to_string (config[ " SUBNET " ][ 2 ]) + " . " + std::to_string (config[ " SUBNET " ][ 3 ] ), 0 , 40 );
341
341
342
342
if (!edit_mode) {
343
343
if (button_exit_pressed) {
@@ -481,13 +481,13 @@ int main () {
481
481
drawRect (&display, 112 , 48 , 127 , 63 );
482
482
switch (std::get<PORT_STATUS>(config[" PORT_A_STATUS" ])) {
483
483
case PORT_STATUS::OUTPUT:
484
- drawText (&display, FONT, " v " , 114 , 15 );
484
+ drawText (&display, FONT, " x " , 114 , 15 );
485
485
break ;
486
486
case PORT_STATUS::INPUT:
487
- drawText (&display, FONT, " v " , 114 , 31 );
487
+ drawText (&display, FONT, " x " , 114 , 31 );
488
488
break ;
489
489
case PORT_STATUS::DISABLED:
490
- drawText (&display, FONT, " v " , 114 , 47 );
490
+ drawText (&display, FONT, " x " , 114 , 47 );
491
491
break ;
492
492
}
493
493
draw_menu_selected (&display, current_selection);
@@ -605,13 +605,13 @@ int main () {
605
605
drawRect (&display, 112 , 48 , 127 , 63 );
606
606
switch (std::get<PORT_STATUS>(config[" PORT_B_STATUS" ])) {
607
607
case PORT_STATUS::OUTPUT:
608
- drawText (&display, FONT, " v " , 114 , 15 );
608
+ drawText (&display, FONT, " x " , 114 , 15 );
609
609
break ;
610
610
case PORT_STATUS::INPUT:
611
- drawText (&display, FONT, " v " , 114 , 31 );
611
+ drawText (&display, FONT, " x " , 114 , 31 );
612
612
break ;
613
613
case PORT_STATUS::DISABLED:
614
- drawText (&display, FONT, " v " , 114 , 47 );
614
+ drawText (&display, FONT, " x " , 114 , 47 );
615
615
break ;
616
616
}
617
617
draw_menu_selected (&display, current_selection);
0 commit comments