Skip to content

Commit

Permalink
add renewable energy control in Inverter Detail page + more
Browse files Browse the repository at this point in the history
fixed: renewable battery icon not shown on AC and DC coupled flow overviews

added support for v3.00~32 which includes fast updates for older grid meters
	fast updates in v3.00 released version are only for newer grid meters

add support for v3.10~33
  • Loading branch information
kwindrem committed Sep 1, 2023
1 parent 60299c4 commit cefb11d
Show file tree
Hide file tree
Showing 2,007 changed files with 62,829 additions and 33,904 deletions.
41 changes: 26 additions & 15 deletions FileSets/enhancedFormat.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
//// For GuiMods GUI
//
// formats values to varying resolution depending on the value
// the global variable killowattThreshold specifies the transition between units an K units
// the global variable sys.kilowattThreshold specifies the transition between units an K units
// item is a VBusItem
// unit is an optional string ("W", "A", "V", etc appended to the value
// if unit is omitted, VBusItem unit is used
// to disable the VBusItem unit specify "", or some other value
// note if you need to specify a threshold, you must also specify a unit !

// functions that take a value can be used when a VBusItem doesn't provide the value
// if no unit is provided, no unit is displayed
// for value > 1000, only K is then displayed
// for value > 1000, only K will always be displayed even if the unit is blank

// the optional precision parameter always displays the value to the indicated number of decimal point
// (e.g, 2 would display 12.34)
// scaling to kilo values is disabled
// you must specify a unit if precision is needed !!!

// the ...Abs versions always display a postive number
// used when a direction indicator is also displayed

function formatValue (value, unit)
function formatValue (value, unit, precision)
{
if (unit == undefined)
unit = ""
Expand All @@ -26,48 +29,56 @@ function formatValue (value, unit)
else
threshold = sys.kilowattThreshold


if (threshold == 0 || (value >= 0 && value < threshold) || (value < 0 && value > -threshold))
{
if (value >= 100 || value <= -100)
if (precision != undefined)
return value.toFixed (precision) + " " + unit
else if (value >= 100 || value <= -100)
return value.toFixed (0) + " " + unit
else
return value.toFixed (1) + " " + unit
}
else if (value >= 10000 || value <= -10000)
return (value/1000).toFixed (1) + " K" + unit
else
return (value/1000).toFixed (2) + " K" + unit
{
if (precision != undefined)
return value.toFixed (precision) + " " + unit
else if (value >= 10000 || value <= -10000)
return (value/1000).toFixed (1) + " K" + unit
else
return (value/1000).toFixed (2) + " K" + unit
}
}

function formatValueAbs (value, unit)
function formatValueAbs (value, unit, precision)
{
if (unit == undefined)
unit = ""
if ( value < 0)
value = -value
return formatValue (value, unit)
return formatValue (value, unit, precision)
}

function formatVBusItem (item, unit)
function formatVBusItem (item, unit, precision)
{
if (item.valid)
{
if (unit == undefined)
unit = item.unit
return formatValue (item.value, unit)
return formatValue (item.value, unit, precision)
}
else
return ""
}

function formatVBusItemAbs (item, unit)
function formatVBusItemAbs (item, unit, precision)
{
var value
if (item.valid)
{
if (unit == undefined)
unit = item.unit
return formatValueAbs (item.value, unit)
return formatValueAbs (item.value, unit, precision)
}
else
return ""
Expand Down
18 changes: 18 additions & 0 deletions FileSets/overview-renewable-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions FileSets/v2.71/Battery.qml
File renamed without changes.
1 change: 1 addition & 0 deletions FileSets/v2.71/DetailAcInput.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/DetailInverter.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/DetailLoadsCombined.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/DetailLoadsOnInput.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/DetailLoadsOnOutput.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/HubData.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MarqueeEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MbEditBox.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MbEditBoxDateTime.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MbItem.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MbSpinBox.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MbStyle.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/MbSubMenu.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/Multi.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/ObjectAcConnection.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewBox.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewConnection.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewConnectionEnd.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewFlowComplex.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewGeneratorEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewGeneratorRelayEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewGridParallel.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewHub.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewHubEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewMobileEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewSolarCharger.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewSolarInverter.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewTankDelegate.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewTanks.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/OverviewTanksTempsDigInputs.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PageGenerator.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PageMain.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PageSettingsDisplay.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PageSettingsGenerator.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PageSettingsGuiMods.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PageSettingsRelay.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/PowerGauge.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/Tile.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/TileDigIn.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/TileRelay.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/TileTankEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/TileText.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/dbus_generator.py
1 change: 1 addition & 0 deletions FileSets/v2.71/dbus_systemcalc.py
1 change: 1 addition & 0 deletions FileSets/v2.71/main.qml
1 change: 1 addition & 0 deletions FileSets/v2.71/startstop.py
1 change: 1 addition & 0 deletions FileSets/v2.71/styles.css
1 change: 1 addition & 0 deletions FileSets/v2.72/Battery.qml
File renamed without changes.
1 change: 1 addition & 0 deletions FileSets/v2.72/DetailAcInput.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/DetailInverter.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/DetailLoadsCombined.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/DetailLoadsOnInput.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/DetailLoadsOnOutput.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/HubData.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MarqueeEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MbEditBox.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MbEditBoxDateTime.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MbItem.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MbSpinBox.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MbStyle.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/MbSubMenu.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/Multi.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/ObjectAcConnection.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewBox.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewConnection.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewConnectionEnd.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewFlowComplex.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewGeneratorEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewGeneratorRelayEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewGridParallel.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewHub.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewHubEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewMobileEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewSolarCharger.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewSolarInverter.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewTankDelegate.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewTanks.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/OverviewTanksTempsDigInputs.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PageGenerator.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PageMain.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PageSettingsDisplay.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PageSettingsGenerator.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PageSettingsGuiMods.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PageSettingsRelay.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/PowerGauge.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/Tile.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/TileDigIn.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/TileRelay.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/TileTankEnhanced.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/TileText.qml
1 change: 1 addition & 0 deletions FileSets/v2.72/dbus_generator.py
1 change: 1 addition & 0 deletions FileSets/v2.72/dbus_systemcalc.py
1 change: 1 addition & 0 deletions FileSets/v2.72/main.qml
Loading

0 comments on commit cefb11d

Please sign in to comment.