Skip to content

Commit

Permalink
Merge pull request #105 from maxbundscherer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
maxbundscherer authored Aug 1, 2022
2 parents 272223a + 1ce1ac8 commit e3a7f01
Show file tree
Hide file tree
Showing 10 changed files with 996 additions and 171 deletions.
Binary file added case/ttgo-case/LoRa-T3_case-bottom.stl
Binary file not shown.
Binary file added case/ttgo-case/LoRa-T3_case-cover.stl
Binary file not shown.
Binary file added case/ttgo-case/LoRa-T3_case-inlay.stl
Binary file not shown.
744 changes: 744 additions & 0 deletions case/ttgo-case/LoRa-T3_case_thingiversified.scad

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions case/ttgo-case/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Thank you

greygoo!

https://www.thingiverse.com/thing:5330732/files
32 changes: 18 additions & 14 deletions independer-app/src/application/application-actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ void application_actor_who_is_in_my_area()
boolean hasComp = false;
while (!hasComp)
{
int selected = gui_selection("Scan Ausgabe", gui_items, collected_counter - 1 + 1, false); // Add + 1 (go back item)
if (selected == collected_counter)
S_GUI_SELECTION_ITEM selected_wrapper = gui_selection("Scan Ausgabe", gui_items, collected_counter - 1 + 1, false); // Add + 1 (go back item)
if (selected_wrapper.success == false or selected_wrapper.value == collected_counter)
hasComp = true;
else
gui_msg_long_text("Scan Detail", gui_items[selected]);
gui_msg_long_text("Scan Detail", gui_items[selected_wrapper.value]);
}
}

Expand Down Expand Up @@ -401,11 +401,11 @@ void application_actor_query_msgs_from_gateway()
boolean hasMesageShown = false;
while (!hasMesageShown)
{
int selected = gui_selection("Briefe", gui_items, numMessages - 1 + 1, false); // Add + 1 (go back item)
if (selected == numMessages)
S_GUI_SELECTION_ITEM selected_wrapper = gui_selection("Briefe", gui_items, numMessages - 1 + 1, false); // Add + 1 (go back item)
if (selected_wrapper.success == false or selected_wrapper.value == numMessages)
hasMesageShown = true;
else
gui_msg_long_text("Brief", gui_items[selected]);
gui_msg_long_text("Brief", gui_items[selected_wrapper.value]);
}
}
else
Expand Down Expand Up @@ -622,11 +622,11 @@ void application_actor_query_msgs_from_internet(String myId)
boolean hasMesageShown = false;
while (!hasMesageShown)
{
int selected = gui_selection("Chats", messages_buffer, i_msg_count - 1 + 1, false); // Add + 1 (go back item)
if (selected == i_msg_count)
S_GUI_SELECTION_ITEM selected_wrapper = gui_selection("Chats", messages_buffer, i_msg_count - 1 + 1, false); // Add + 1 (go back item)
if (selected_wrapper.success == false or selected_wrapper.value == i_msg_count)
hasMesageShown = true;
else
gui_msg_long_text("Chat", messages_buffer[selected]);
gui_msg_long_text("Chat", messages_buffer[selected_wrapper.value]);
}
}
else
Expand Down Expand Up @@ -675,15 +675,19 @@ void application_actor_automatic_wifi()
boolean hasMesageShown = false;
while (!hasMesageShown)
{
int selected = gui_selection("SSIDs", gui_items, n - 1 + 1, false); // Add + 1 (go back item)
if (selected == 0)
S_GUI_SELECTION_ITEM selected_wrapper = gui_selection("SSIDs", gui_items, n - 1 + 1, false); // Add + 1 (go back item)
if (selected_wrapper.success == false or selected_wrapper.value == 0)
hasMesageShown = true;
else
{
String t_ssid = gui_items[selected];
String t_password = gui_input_text("Passwort", "");
String t_ssid = gui_items[selected_wrapper.value];

db_save_wifi_settings(t_ssid, t_password);
S_GUI_INPUT_TEXT t_password_wrapper = gui_input_text("Passwort", "");

if (t_password_wrapper.success == false)
return;

db_save_wifi_settings(t_ssid, t_password_wrapper.value);

gui_msg_animated("Info", "Einstellungen\ngespeichert", C_GUI_DELAY_MSG_SHORT_I);
return;
Expand Down
26 changes: 21 additions & 5 deletions independer-app/src/device/mb-gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,13 @@ void i_gui_menu(String menu_title, String page, String menu0, String menu1, Stri
}
}

int gui_selection(String menu_title, String menu_items[], int count_items, boolean disableShortcuts = false)
struct S_GUI_SELECTION_ITEM
{
boolean success;
int value;
};

S_GUI_SELECTION_ITEM gui_selection(String menu_title, String menu_items[], int count_items, boolean disableShortcuts = false)
{

// Serial.println("Got " + String(count_items) + " in menu onl");
Expand Down Expand Up @@ -690,11 +696,13 @@ int gui_selection(String menu_title, String menu_items[], int count_items, boole
curSelected = 8;
hasSelected = true;
}
if (c == 0x1B) // Press Escape
return S_GUI_SELECTION_ITEM{false, -1};
}
}
}

return curSelected;
return S_GUI_SELECTION_ITEM{true, curSelected};
}

/*
Expand Down Expand Up @@ -782,7 +790,13 @@ void i_gui_input_single_line(String menu_title, String val, int current_cursor)
display.display();
}

String gui_input_text(String menu_title, String default_value)
struct S_GUI_INPUT_TEXT
{
boolean success;
String value;
};

S_GUI_INPUT_TEXT gui_input_text(String menu_title, String default_value)
{

i_gui_flush_input();
Expand Down Expand Up @@ -831,6 +845,8 @@ String gui_input_text(String menu_title, String default_value)
}
else if (c == 0xD) // Press Enter
hasSelected = true;
else if (c == 0x1B) // Press Escape
return S_GUI_INPUT_TEXT{false, ""};
else if (c != 0xB5 and c != 0xB6) // Ignore Down and Up
{
// current += c;
Expand All @@ -842,7 +858,7 @@ String gui_input_text(String menu_title, String default_value)
}
}

return current;
return S_GUI_INPUT_TEXT{true, current};
}

char gui_input_char_no_output()
Expand Down Expand Up @@ -971,7 +987,7 @@ void gui_msg_long_text(String msg_title, String msg)
else if (currentPage > num_pages - 1)
currentPage = num_pages - 1;
}
else if (c == 0xD) // Press Enter
else if (c == 0xD or c == 0x1B) // Press Enter or Escape
hasSelected = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion independer-app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ boolean c_actor_mode = false;
* ####################################
*/
// Product Config
String c_product_version = "v.0.2.9";
String c_product_version = "v.0.3.0";
boolean c_demo_mode = false;

/*
Expand Down
Loading

0 comments on commit e3a7f01

Please sign in to comment.