Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
370 changes: 369 additions & 1 deletion src/webui/rega/www/esp/controls/maintenance.fn
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,372 @@ function ::CreateHeatingCooling() {
Call("/esp/controls/maintenance.fn::CreateNoFunction()");
}

}
}

function ::OutputMaintenanceDataPoint()
{
if (outLevel > 1) { WriteLine("</tr><tr>"); outLevel = 0; }
WriteLine("<td><div class='ControlBtnInfo CLASS02532'><span class='_CLASS02533'>");
Write("<span class='CLASS02534 j_translate' style='display: inline;'>" # mnDPText # "</span>");
Write("<span class='CLASS02535' style='color:white'>" # mnDPValue);
if (mnDPUnit != "") { Write("&nbsp;" # mnDPUnit); }
Write("</span>");
WriteLine("</div></td>");
outLevel = outLevel + 1;
}

function ::OutputMaintenanceFloatDP()
{
object oDP = cObj.DPByHssDP(mnDP);
if (oDP) {
mnDPValue = oDP.Value().ToString(1);
Call("/esp/controls/maintenance.fn::OutputMaintenanceDataPoint()");
}
mnDP = "";
mnDPText = "";
mnDPValue = "";
mnDPUnit = "";
}

function ::OutputMaintenanceTimeOfOperationDP()
{
object oDP = cObj.DPByHssDP(mnDP);
if (oDP) {
mnDPValue = (oDP.Value().ToInteger() / 86400);
if (mnDPValue >= 365) {
mnDPValue = (mnDPValue / 365) # "&nbsp;${optionUnitY}&nbsp;" # (mnDPValue % 365);
}
Call("/esp/controls/maintenance.fn::OutputMaintenanceDataPoint()");
}
mnDP = "";
mnDPText = "";
mnDPValue = "";
mnDPUnit = "";
}

function ::OutputMaintenanceValueDP()
{
object oDP = cObj.DPByHssDP(mnDP);
if (oDP) {
mnDPValue = oDP.Value();
Call("/esp/controls/maintenance.fn::OutputMaintenanceDataPoint()");
}
mnDP = "";
mnDPText = "";
mnDPValue = "";
mnDPUnit = "";
}

function ::OutputMaintenanceRSSIDP()
{
object oDP = cObj.DPByHssDP(mnDP);
if (oDP) {
integer rssiValue = oDP.Value().ToInteger();
if (oDP.ValueType() == ivtByte) {
rssiValue = (rssiValue - 256);
}

if (rssiValue < -200) {
mnDPValue = "n/a";
} else {
mnDPValue = rssiValue.ToString(0);
}
mnDPUnit = "dBm";
Call("/esp/controls/maintenance.fn::OutputMaintenanceDataPoint()");
}
mnDP = "";
mnDPText = "";
mnDPValue = "";
mnDPUnit = "";
}

function ::OutputMaintenanceEnumDP()
{
object oDP = cObj.DPByHssDP(mnDP);
if (oDP) {
if (oDP.Value().ToInteger() == 0) {
mnDPValue = mnDPValue0;
} elseif (oDP.Value().ToInteger() == 1) {
mnDPValue = mnDPValue1;
} elseif (oDP.Value().ToInteger() == 2) {
mnDPValue = mnDPValue2;
} elseif (oDP.Value().ToInteger() == 3) {
mnDPValue = mnDPValue3;
}
Call("/esp/controls/maintenance.fn::OutputMaintenanceDataPoint()");
}
mnDP = "";
mnDPText = "";
mnDPValue = "";
mnDPValue0 = "";
mnDPValue1 = "";
mnDPValue2 = "";
mnDPValue3 = "";
mnDPUnit = "";
}

function ::OutputMaintenanceBoolDP()
{
object oDP = cObj.DPByHssDP(mnDP);
if (oDP) {
if ((oDP.Value() == "true") || (oDP.Value().ToInteger() == 1)) {
mnDPValue = mnDPTrue;
} else {
mnDPValue = mnDPFalse;
}
object oDPAlarm = cObj.DPByHssDP(mnDP # "_ALARM");
if (oDPAlarm) {
if (oDPAlarm.Value().ToInteger() == 1) {
mnDPValue = mnDPValue # " [ALARM]";
} elseif (oDPAlarm.Value().ToInteger() == 2) {
mnDPValue = mnDPValue # " [ACKNOWLEDGED]";
}
}
Call("/esp/controls/maintenance.fn::OutputMaintenanceDataPoint()");
}
mnDP = "";
mnDPText = "";
mnDPValue = "";
mnDPTrue = "";
mnDPFalse = "";
mnDPUnit = "";
}

function ::CreateDeviceMaintenanceChannel()
{
WriteLine("<td class='CLASS02519'>");
WriteLine("<table cellspacing='0'>");
WriteLine("<tr>");

integer outLevel = 0;
string mnDP = "";
string mnDPText = "";
string mnDPTrue = "";
string mnDPFalse = "";
string mnDPValue = "";
string mnDPValue0 = "";
string mnDPValue1 = "";
string mnDPValue2 = "";
string mnDPValue3 = "";
string mnDPUnit = "";

mnDP = "ACTUAL_TEMPERATURE";
mnDPText = "${stringTableClimateControlRTTransceiverActualTemp}:";
mnDPUnit = "&deg;C";
Call("/esp/controls/maintenance.fn::OutputMaintenanceFloatDP()");

mnDP = "ACTUAL_TEMPERATURE_STATUS";
mnDPText = "${stringTableClimateControlRTTransceiverActualTemp}:";
mnDPValue0 = "${lblNormal}";
mnDPValue1 = "${lblUnknown}";
mnDPValue2 = "${lblOverflow}";
mnDPValue3 = "${lblUnderflow}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceEnumDP()");

!mnDP = "AES_KEY";
!mnDPText = "AES_KEY:";
!Call("/esp/controls/maintenance.fn::OutputMaintenanceValueDP()");

mnDP = "CONFIG_PENDING";
mnDPText = "";
mnDPTrue = "${stringTableConfigPendingTrue}";
mnDPFalse = "${stringTableConfigPendingFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "DATE_TIME_UNKNOWN";
mnDPText = "";
mnDPTrue = "${stringTableDateTimeUnknownTrue}";
mnDPFalse = "${stringTableDateTimeUnknownFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "DEVICE_IN_BOOTLOADER";
mnDPText = "${stringTableDeviceInBootloader}:";
mnDPTrue = "${dialogYes}";
mnDPFalse = "${dialogNo}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "DUTY_CYCLE";
mnDPText = "";
mnDPTrue = "${stringTableDutyCycleTrue}";
mnDPFalse = "${stringTableDutyCycleFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "DUTYCYCLE";
mnDPText = "";
mnDPTrue = "${stringTableDutyCycleTrue}";
mnDPFalse = "${stringTableDutyCycleFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

!mnDP = "ENTER_BOOTLOADER";
!mnDPText = "ENTER_BOOTLOADER:";
!Call("/esp/controls/maintenance.fn::OutputMaintenanceValueDP()");

mnDP = "ERROR_BAD_RECHARGEABLE_BATTERY_HEALTH";
mnDPText = "";
mnDPTrue = "${stringTableErrorBadRechargeableBatteryHealthTrue}";
mnDPFalse = "${stringTableErrorBadRechargeableBatteryHealthFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_CODE";
mnDPText = "${stringTableErrorCode}:";
Call("/esp/controls/maintenance.fn::OutputMaintenanceValueDP()");

mnDP = "ERROR_COMMUNICATION_PARTICLE_MATTER_SENSOR";
mnDPText = "";
mnDPTrue = "${stringTableErrorCommunicationParticulateMatterSensorTrue}";
mnDPFalse = "${stringTableErrorCommunicationParticulateMatterSensorFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_COMMUNICATION_TEMP_AND_HUMIDITY_SENSOR";
mnDPText = "";
mnDPTrue = "${stringTableErrorCommunicationTempAndHumiditySensorTrue}";
mnDPFalse = "${stringTableErrorCommunicationTempAndHumiditySensorFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_PARTICULATE_MATTER_MEASUREMENT";
mnDPText = "";
mnDPTrue = "${stringTableErrorParticulateMatterMeasurementTrue}";
mnDPFalse = "${stringTableErrorParticulateMatterMeasurementFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_TEMP_OR_HUMIDITY_MEASUREMENT";
mnDPText = "";
mnDPTrue = "${stringTableErrorTempOrHumidityMeasurementTrue}";
mnDPFalse = "${stringTableErrorTempOrHumidityMeasurementFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_NON_FLAT_POSITIONING";
mnDPText = "";
mnDPTrue = "${stringTableErrorNonFlatPositioningTrue}";
mnDPFalse = "${stringTableErrorNonFlatPositioningFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_OVERHEAT";
mnDPText = "";
mnDPTrue = "${stringTableErrorOverheatTrue}";
mnDPFalse = "${stringTableErrorOverheatFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_SABOTAGE";
mnDPText = "";
! the texts of stringTableErrorSabotageTrue/False are swapped
mnDPTrue = "${stringTableErrorSabotageFalse}";
mnDPFalse = "${stringTableErrorSabotageTrue}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "ERROR_UNDERVOLTAGE";
mnDPText = "";
mnDPTrue = "${stringTableErrorUndervoltageTrue}";
mnDPFalse = "${stringTableErrorUndervoltageFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "HEATING_COOLING";
mnDPText = "";
mnDPTrue = "${stringTableCooling}";
mnDPFalse = "${stringTableHeating}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "HUMIDITY_ALARM";
mnDPText = "";
mnDPTrue = "${stringTableHumidityAlarmTrue}";
mnDPFalse = "${stringTableHumidityAlarmFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "INHIBIT";
mnDPText = "";
mnDPTrue = "${stringTableInhibitTrue}";
mnDPFalse = "${stringTableInhibitFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "LOW_BAT";
mnDPText = "";
mnDPTrue = "${stringTableBatteryEmpty}";
mnDPFalse = "${stringTableBatteryOk}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "LOWBAT";
mnDPText = "";
mnDPTrue = "${stringTableBatteryEmpty}";
mnDPFalse = "${stringTableBatteryOk}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "OPERATING_VOLTAGE";
mnDPText = "${stringTableOperationVoltage}:";
mnDPUnit = "V";
Call("/esp/controls/maintenance.fn::OutputMaintenanceFloatDP()");

mnDP = "OPERATING_VOLTAGE_STATUS";
mnDPText = "${stringTableOperationVoltageState}:";
mnDPValue0 = "${lblNormal}";
mnDPValue1 = "${lblUnknown}";
mnDPValue2 = "${lblOverflow}";
mnDPValue3 = "${lblExternal}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceEnumDP()");

mnDP = "RSSI_DEVICE";
mnDPText = "${stringTableRSSIDevice}:";
Call("/esp/controls/maintenance.fn::OutputMaintenanceRSSIDP()");

mnDP = "RSSI_PEER";
mnDPText = "${stringTableRSSIPeer}:";
Call("/esp/controls/maintenance.fn::OutputMaintenanceRSSIDP()");

mnDP = "SABOTAGE";
mnDPText = "";
mnDPTrue = "${stringTableSabotageContactWasActive}";
mnDPFalse = "${stringTableSabotageContactOk}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "SENSOR_ERROR";
mnDPText = "";
mnDPTrue = "${stringTableSensorErrorTrue}";
mnDPFalse = "${stringTableSensorErrorFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "STICKY_SABOTAGE";
mnDPText = "";
mnDPTrue = "${stringTableSabotageStickyTrue}";
mnDPFalse = "${stringTableSabotageStickyFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "STICKY_UNREACH";
mnDPText = "";
mnDPTrue = "${stringTableStickyUnreachTrue}";
mnDPFalse = "${stringTableStickyUnreachFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "TEMPERATURE_LIMITER";
mnDPText = "";
mnDPTrue = "${stringTableTemperatureLimiterTrue}";
mnDPFalse = "${stringTableTemperatureLimiterFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "TIME_OF_OPERATION";
mnDPText = "${stringTableTimeOfOperation}:";
mnDPUnit = "${optionUnitD}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceTimeOfOperationDP()");

mnDP = "TIME_OF_OPERATION_STATUS";
mnDPText = "${stringTableTimeOfOperation}:";
mnDPValue0 = "${lblNormal}";
mnDPValue1 = "${lblUnknown}";
mnDPValue2 = "${lblOverflow}";
mnDPValue3 = "";
Call("/esp/controls/maintenance.fn::OutputMaintenanceEnumDP()");

mnDP = "UPDATE_PENDING";
mnDPText = "";
mnDPTrue = "${stringTableUpdatePendingTrue}";
mnDPFalse = "${stringTableUpdatePendingFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

mnDP = "UNREACH";
mnDPText = "";
mnDPTrue = "${stringTableUnreachTrue}";
mnDPFalse = "${stringTableUnreachFalse}";
Call("/esp/controls/maintenance.fn::OutputMaintenanceBoolDP()");

WriteLine("</tr>");
WriteLine("</table>");
WriteLine("</td>");
}
6 changes: 6 additions & 0 deletions src/webui/rega/www/esp/datapointconfigurator.fn
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,12 @@ function ::dcCreate()
}
}
}
! create device maintenance channel information
if (ictCH == ictMaintenance) {
WriteLine( '</tr></table><table cellspacing="0" class="ctrlTbl CLASS02510" border="0" ><tr>' );
Call("/esp/controls/maintenance.fn::CreateDeviceMaintenanceChannel()");
isKnownControl = true;
}
if (!isKnownControl)
{
WriteLine( '</tr></table><table cellspacing="0" class="ctrlTbl CLASS02510" border="0" ><tr>' );
Expand Down
1 change: 1 addition & 0 deletions src/webui/www/webui/js/lang/de/translate.lang.option.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ jQuery.extend(true, langJSON, {
"optionUnit8H" : "8 Stunden",
"optionUnit8M": "8 Minuten",
"optionUnit90S" : "90 Sekunden",
"optionUnitY" : "Jahre",
"optionUnitD" : "Tage",
"optionUnitH" : "Stunden",
"optionUnitM" : "Minuten",
Expand Down
Loading