diff --git a/lib/obp60task/GwOBP60Task.cpp b/lib/obp60task/GwOBP60Task.cpp index f31f563..bc1c977 100644 --- a/lib/obp60task/GwOBP60Task.cpp +++ b/lib/obp60task/GwOBP60Task.cpp @@ -99,7 +99,8 @@ String formatValue(GwApi::BoatValue *value){ val=modf(value->value/3600.0,&inthr); val=modf(val*3600.0/60.0,&intmin); modf(val*60.0,&intsec); - snprintf(buffer,bsize,"%02.0f:%02.0f:%02.0f",inthr,intmin,intsec); +// snprintf(buffer,bsize,"%02.0f:%02.0f:%02.0f",inthr,intmin,intsec); + snprintf(buffer,bsize,"%02.0f:%02.0f",inthr,intmin); } else if (value->getFormat() == "formatFixed0"){ snprintf(buffer,bsize,"%.0f",value->value); @@ -322,9 +323,9 @@ void OBP60Task(void *param){ busInfo.SOG.fvalue = sog->value; sog->getFormat().toCharArray(busInfo.SOG.unit, 8, 0); busInfo.SOG.valid = int(sog->valid); - formatValue(date).toCharArray(busInfo.Date.svalue, 31, 0); + formatValue(date).toCharArray(busInfo.Date.svalue, 16, 0); busInfo.Date.valid = date->valid; - formatValue(time).toCharArray(busInfo.Time.svalue, 31, 0); + formatValue(time).toCharArray(busInfo.Time.svalue, 16, 0); busInfo.Time.valid = time->valid; busInfo.PDOP.fvalue = pdop->value; busInfo.PDOP.valid = pdop->valid; diff --git a/lib/obp60task/OBP60Data.h b/lib/obp60task/OBP60Data.h index 2a9b95b..f776b20 100644 --- a/lib/obp60task/OBP60Data.h +++ b/lib/obp60task/OBP60Data.h @@ -5,13 +5,17 @@ typedef struct{ float fvalue = 0; // Float value - char svalue[31] = ""; // Char value + char svalue[16] = ""; // Char value char unit[8] = ""; // Unit int valid = 0; // Valid flag } dataContainer; typedef struct{ bool simulation = false; // Simulate boat data + bool headline = true; + char dateformat[3] = "GB"; + int timezone = 0; + bool refresh = false; dataContainer AWA; dataContainer AWD; dataContainer AWS; diff --git a/lib/obp60task/OBP60Pages.h b/lib/obp60task/OBP60Pages.h index 261e537..86df68b 100644 --- a/lib/obp60task/OBP60Pages.h +++ b/lib/obp60task/OBP60Pages.h @@ -33,6 +33,8 @@ void showPage(busData values){ display.print(values.Date.svalue); display.print(" "); display.print(values.Time.svalue); + display.print(" "); + display.print("UTC"); } else{ display.print("No GPS data"); diff --git a/lib/obp60task/config.json b/lib/obp60task/config.json index 3a92615..bcef5a2 100644 --- a/lib/obp60task/config.json +++ b/lib/obp60task/config.json @@ -5,7 +5,138 @@ "type": "boolean", "default": "false", "description": "Switch on logging of position acquired/failed", - "category": "OBP60", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "dateFormat", + "label": "Date Format", + "type": "list", + "default": "GB", + "description": "Date format [DE|GB|US] DE: 31.12.2022, GB: 31/12/2022, US: 12/31/2022", + "list": [ + "DE", + "GB", + "US" + ], + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "timeZone", + "label": "Time Zone", + "type": "number", + "default": "0", + "check": "checkMinMax", + "min": -12, + "max": 12, + "description": "Time zone [UTC -12...+12]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "draft", + "label": "Boat Draft", + "type": "number", + "default": "0", + "check": "checkMinMax", + "min": 0, + "max": 10, + "description": "The draft of the boat [0...10m]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "fuelTank", + "label": "Fuel Tank", + "type": "number", + "default": "0", + "check": "checkMinMax", + "min": 0, + "max": 5000, + "description": "Fuel tank capacity [0...5000l]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "fuelConsumption", + "label": "Fuel Consuption", + "type": "number", + "default": "0", + "check": "checkMinMax", + "min": 0, + "max": 1000, + "description": "Medium fuel consumption [0...1000l/h]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "waterTank", + "label": "Water Tank", + "type": "number", + "default": "0", + "check": "checkMinMax", + "min": 0, + "max": 5000, + "description": "Water tank capacity [0...5000l]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "batteryVoltage", + "label": "Battery Voltage", + "type": "number", + "default": "12", + "check": "checkMinMax", + "min": 0, + "max": 1000, + "description": "Fuel tank capacity [0...1000V]", + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "batteryType", + "label": "Battery Type", + "type": "list", + "default": "Pb", + "description": "Type of battery", + "list": [ + "Pb", + "Gel", + "AGM", + "LiFePo4" + ], + "category": "OBP60 Settings", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "batteryCapacity", + "label": "Battery Capacity", + "type": "number", + "default": "0", + "check": "checkMinMax", + "min": 0, + "max": 5000, + "description": "Fuel tank capacity [0...5000Ah]", + "category": "OBP60 Settings", "capabilities": { "obp60":"true" } @@ -16,7 +147,7 @@ "type": "boolean", "default": "false", "description": "Using internal GPS modul NEO-6M", - "category": "OBP60", + "category": "OBP60 Hardware", "capabilities": { "obp60":"true" } @@ -27,7 +158,7 @@ "type": "boolean", "default": "false", "description": "Using internal BME280 modul", - "category": "OBP60", + "category": "OBP60 Hardware", "capabilities": { "obp60":"true" } @@ -38,7 +169,7 @@ "type": "boolean", "default": "false", "description": "Using external 1Wirew devices (DS18B20)", - "category": "OBP60", + "category": "OBP60 Hardware", "capabilities": { "obp60":"true" } @@ -55,7 +186,7 @@ "Only 5.0V", "Min Power" ], - "category": "OBP60", + "category": "OBP60 Hardware", "capabilities": { "obp60":"true" } @@ -66,7 +197,7 @@ "type": "boolean", "default": "false", "description": "Can use for simulation data by missing bus data.", - "category": "OBP60", + "category": "OBP60 Hardware", "capabilities": { "obp60":"true" } @@ -83,7 +214,29 @@ "Logo + QR Code", "Off" ], - "category": "OBP60", + "category": "OBP60 Display", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "statusLine", + "label": "Status line", + "type": "boolean", + "default": "true", + "description": "Show status line [on|off]", + "category": "OBP60 Display", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "refresh", + "label": "Refresh", + "type": "boolean", + "default": "false", + "description": "Refresh E-Ink display after each new page request [on|off]. A refresh reduce background shaddows from older pages.", + "category": "OBP60 Display", "capabilities": { "obp60":"true" } @@ -102,7 +255,7 @@ "Control by Key", "On" ], - "category": "OBP60", + "category": "OBP60 Display", "capabilities": { "obp60":"true" } @@ -119,7 +272,7 @@ "GPS Fix", "Limits Overrun" ], - "category": "OBP60", + "category": "OBP60 Display", "capabilities": { "obp60":"true" } @@ -130,7 +283,7 @@ "type": "boolean", "default": "false", "description": "Settings for buzzer", - "category": "OBP60", + "category": "OBP60 Buzzer", "capabilities": { "obp60":"true" } @@ -141,7 +294,7 @@ "type": "boolean", "default": "false", "description": "Settings for buzzer", - "category": "OBP60", + "category": "OBP60 Buzzer", "capabilities": { "obp60":"true" } @@ -152,7 +305,7 @@ "type": "boolean", "default": "false", "description": "Tone by limit overrun", - "category": "OBP60", + "category": "OBP60 Buzzer", "capabilities": { "obp60":"true" } @@ -169,7 +322,7 @@ "Longer Single Beep", "Beep until Confirmation" ], - "category": "OBP60", + "category": "OBP60 Buzzer", "capabilities": { "obp60":"true" } @@ -182,8 +335,36 @@ "check": "checkMinMax", "min": 0, "max": 100, - "description": "Buzzer Loudness 0...100%", - "category": "OBP60", + "description": "Buzzer Loudness [0...100%]", + "category": "OBP60 Buzzer", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "numberPages", + "label": "Number Of Pages", + "type": "number", + "default": "4", + "check": "checkMinMax", + "min": 1, + "max": 10, + "description": "Number of user pages [1...10]", + "category": "OBP60 Pages", + "capabilities": { + "obp60":"true" + } + }, + { + "name": "lastSettings", + "label": "Dummy", + "type": "number", + "default": "50", + "check": "checkMinMax", + "min": 0, + "max": 100, + "description": "Dummy", + "category": "OBP60 End", "capabilities": { "obp60":"true" }