diff --git a/data/widgets/alarm.json b/data/widgets/alarm.json new file mode 100644 index 00000000..e0e636c3 --- /dev/null +++ b/data/widgets/alarm.json @@ -0,0 +1,6 @@ +{ + "widget": "anydata", + "icon": "body", + "color": "red", + "descrColor": "red" +} \ No newline at end of file diff --git a/data/conf/c001.txt b/doc/conf/c001.txt similarity index 100% rename from data/conf/c001.txt rename to doc/conf/c001.txt diff --git a/data/conf/c002.txt b/doc/conf/c002.txt similarity index 100% rename from data/conf/c002.txt rename to doc/conf/c002.txt diff --git a/data/conf/c003.txt b/doc/conf/c003.txt similarity index 100% rename from data/conf/c003.txt rename to doc/conf/c003.txt diff --git a/data/conf/c004.txt b/doc/conf/c004.txt similarity index 100% rename from data/conf/c004.txt rename to doc/conf/c004.txt diff --git a/data/conf/c005.txt b/doc/conf/c005.txt similarity index 100% rename from data/conf/c005.txt rename to doc/conf/c005.txt diff --git a/data/conf/c006.txt b/doc/conf/c006.txt similarity index 100% rename from data/conf/c006.txt rename to doc/conf/c006.txt diff --git a/data/conf/c007.txt b/doc/conf/c007.txt similarity index 100% rename from data/conf/c007.txt rename to doc/conf/c007.txt diff --git a/data/conf/c008.txt b/doc/conf/c008.txt similarity index 100% rename from data/conf/c008.txt rename to doc/conf/c008.txt diff --git a/data/conf/c009.txt b/doc/conf/c009.txt similarity index 100% rename from data/conf/c009.txt rename to doc/conf/c009.txt diff --git a/data/conf/c010.txt b/doc/conf/c010.txt similarity index 100% rename from data/conf/c010.txt rename to doc/conf/c010.txt diff --git a/data/conf/c011.txt b/doc/conf/c011.txt similarity index 100% rename from data/conf/c011.txt rename to doc/conf/c011.txt diff --git a/data/conf/c012.txt b/doc/conf/c012.txt similarity index 100% rename from data/conf/c012.txt rename to doc/conf/c012.txt diff --git a/data/conf/c013.txt b/doc/conf/c013.txt similarity index 100% rename from data/conf/c013.txt rename to doc/conf/c013.txt diff --git a/data/conf/c014.txt b/doc/conf/c014.txt similarity index 100% rename from data/conf/c014.txt rename to doc/conf/c014.txt diff --git a/data/conf/c015.txt b/doc/conf/c015.txt similarity index 100% rename from data/conf/c015.txt rename to doc/conf/c015.txt diff --git a/data/conf/c016.txt b/doc/conf/c016.txt similarity index 100% rename from data/conf/c016.txt rename to doc/conf/c016.txt diff --git a/data/conf/c017.txt b/doc/conf/c017.txt similarity index 100% rename from data/conf/c017.txt rename to doc/conf/c017.txt diff --git a/data/conf/c018.txt b/doc/conf/c018.txt similarity index 100% rename from data/conf/c018.txt rename to doc/conf/c018.txt diff --git a/data/conf/c019.txt b/doc/conf/c019.txt similarity index 100% rename from data/conf/c019.txt rename to doc/conf/c019.txt diff --git a/data/conf/c020.txt b/doc/conf/c020.txt similarity index 100% rename from data/conf/c020.txt rename to doc/conf/c020.txt diff --git a/data/conf/c021.txt b/doc/conf/c021.txt similarity index 100% rename from data/conf/c021.txt rename to doc/conf/c021.txt diff --git a/data/conf/c100.txt b/doc/conf/c100.txt similarity index 100% rename from data/conf/c100.txt rename to doc/conf/c100.txt diff --git a/data/conf/s001.txt b/doc/conf/s001.txt similarity index 100% rename from data/conf/s001.txt rename to doc/conf/s001.txt diff --git a/data/conf/s002.txt b/doc/conf/s002.txt similarity index 100% rename from data/conf/s002.txt rename to doc/conf/s002.txt diff --git a/data/conf/s003.txt b/doc/conf/s003.txt similarity index 100% rename from data/conf/s003.txt rename to doc/conf/s003.txt diff --git a/data/conf/s004.txt b/doc/conf/s004.txt similarity index 100% rename from data/conf/s004.txt rename to doc/conf/s004.txt diff --git a/data/conf/s005.txt b/doc/conf/s005.txt similarity index 100% rename from data/conf/s005.txt rename to doc/conf/s005.txt diff --git a/data/conf/s006.txt b/doc/conf/s006.txt similarity index 100% rename from data/conf/s006.txt rename to doc/conf/s006.txt diff --git a/data/conf/s007.txt b/doc/conf/s007.txt similarity index 100% rename from data/conf/s007.txt rename to doc/conf/s007.txt diff --git a/data/conf/s008.txt b/doc/conf/s008.txt similarity index 100% rename from data/conf/s008.txt rename to doc/conf/s008.txt diff --git a/data/conf/s009.txt b/doc/conf/s009.txt similarity index 100% rename from data/conf/s009.txt rename to doc/conf/s009.txt diff --git a/data/conf/s010.txt b/doc/conf/s010.txt similarity index 100% rename from data/conf/s010.txt rename to doc/conf/s010.txt diff --git a/data/conf/s011.txt b/doc/conf/s011.txt similarity index 100% rename from data/conf/s011.txt rename to doc/conf/s011.txt diff --git a/data/conf/s012.txt b/doc/conf/s012.txt similarity index 100% rename from data/conf/s012.txt rename to doc/conf/s012.txt diff --git a/data/conf/s013.txt b/doc/conf/s013.txt similarity index 100% rename from data/conf/s013.txt rename to doc/conf/s013.txt diff --git a/data/conf/s014.txt b/doc/conf/s014.txt similarity index 100% rename from data/conf/s014.txt rename to doc/conf/s014.txt diff --git a/data/conf/s015.txt b/doc/conf/s015.txt similarity index 100% rename from data/conf/s015.txt rename to doc/conf/s015.txt diff --git a/data/conf/s016.txt b/doc/conf/s016.txt similarity index 100% rename from data/conf/s016.txt rename to doc/conf/s016.txt diff --git a/data/conf/s017.txt b/doc/conf/s017.txt similarity index 100% rename from data/conf/s017.txt rename to doc/conf/s017.txt diff --git a/data/conf/s018.txt b/doc/conf/s018.txt similarity index 100% rename from data/conf/s018.txt rename to doc/conf/s018.txt diff --git a/data/conf/s019.txt b/doc/conf/s019.txt similarity index 100% rename from data/conf/s019.txt rename to doc/conf/s019.txt diff --git a/data/conf/s020.txt b/doc/conf/s020.txt similarity index 100% rename from data/conf/s020.txt rename to doc/conf/s020.txt diff --git a/data/conf/s021.txt b/doc/conf/s021.txt similarity index 100% rename from data/conf/s021.txt rename to doc/conf/s021.txt diff --git a/data/conf/s100.txt b/doc/conf/s100.txt similarity index 100% rename from data/conf/s100.txt rename to doc/conf/s100.txt diff --git a/include/Utils/StringUtils.h b/include/Utils/StringUtils.h index 260beaa9..3c23ee4a 100644 --- a/include/Utils/StringUtils.h +++ b/include/Utils/StringUtils.h @@ -18,6 +18,8 @@ String deleteBeforeDelimiter(String str, String found); String deleteBeforeDelimiterTo(String str, String found); +String deleteToMarkerLast(String str, String found); + String selectFromMarkerToMarker(String str, String found, int number); size_t itemsCount(String str, const String& separator); diff --git a/src/Cmd.cpp b/src/Cmd.cpp index 1d0eb782..2e14c994 100644 --- a/src/Cmd.cpp +++ b/src/Cmd.cpp @@ -31,10 +31,13 @@ void cmd_init() { sCmd.addCommand("button-out", buttonOut); sCmd.addCommand("pwm-out", pwmOut); sCmd.addCommand("button-in", buttonIn); + sCmd.addCommand("input-digit", inputDigit); sCmd.addCommand("input-time", inputTime); sCmd.addCommand("output-text", textOut); + + diff --git a/src/ItemsList.cpp b/src/ItemsList.cpp index 73d5071e..6861d85f 100644 --- a/src/ItemsList.cpp +++ b/src/ItemsList.cpp @@ -1,14 +1,14 @@ #include "ItemsList.h" +#include "Utils\StringUtils.h" static const char* firstLine PROGMEM = "Тип элемента;Id;Виджет;Имя вкладки;Имя виджета;Позиция виджета"; void addItem(String name) { String item = readFile("items/" + name + ".txt", 1024); - + name = deleteToMarkerLast(name, "-"); item.replace("id", name + String(getNewElementNumber("id.txt"))); item.replace("order", String(getNewElementNumber("order.txt"))); item.replace("pin", "pin[" + String(getFreePin()) + "]"); - item.replace("\r\n", ""); item.replace("\r", ""); item.replace("\n", ""); diff --git a/src/Utils/StringUtils.cpp b/src/Utils/StringUtils.cpp index 64ee047d..7c043f0e 100644 --- a/src/Utils/StringUtils.cpp +++ b/src/Utils/StringUtils.cpp @@ -1,5 +1,4 @@ #include "Utils\StringUtils.h" - #include "Consts.h" String selectToMarkerLast(String str, String found) {