Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
79994ffe2f
|
@ -507,7 +507,7 @@ public static class Topology
|
|||
{
|
||||
var e = pvOnAcIsland is not null? pvOnAcIsland?.Dc.Power.Value: 0;
|
||||
var f = loadOnAcIsland is not null? loadOnAcIsland?.Ac.Power : 0;
|
||||
var g = acDc ?.Ac.Power; // We dont check on the AcDc because this device is mandatory, if this does not exist the system will not start
|
||||
var g = acDc ?.Ac.Power; // We don't check on the AcDc because this device is mandatory, if this does not exist the system will not start
|
||||
|
||||
if (e is null || f is null || g is null)
|
||||
return null;
|
||||
|
@ -519,9 +519,9 @@ public static class Topology
|
|||
|
||||
public static DcPowerDevice? CalculateDcLoad(AcDcDevicesRecord? acDc, AmptStatus? pvOnDc, DcDcDevicesRecord? dcDc)
|
||||
{
|
||||
var h = acDc?.Dc.Power; // We dont check on the AcDc because this device is mandatory
|
||||
var h = acDc?.Dc.Power; // We don't check on the AcDc because this device is mandatory
|
||||
var i = pvOnDc is not null? pvOnDc?.Dc.Power: 0;
|
||||
var k = dcDc?.Dc.Link.Power; // We dont check on the DcDc because this device is mandatory
|
||||
var k = dcDc?.Dc.Link.Power; // We don't check on the DcDc because this device is mandatory
|
||||
|
||||
if (h is null || i is null || k is null)
|
||||
return null;
|
||||
|
|
|
@ -2332,7 +2332,7 @@
|
|||
"type": "function",
|
||||
"z": "58aeeaac02a3a4c7",
|
||||
"name": "get_total_number_of_limb_strings",
|
||||
"func": "let total_num_limb_string=0;\nlimb_string_list = msg.payload.limb_string_list;\nmain_switch_state_list = msg.payload.main_switch_state;\nbattery_health = [];\nif (limb_string_list == null){\n msg.payload.battery_health = \"BMS connection lost!\";\n msg.payload.num_limb_string = -1\n return msg;\n}\n\nfor (let i = 0; i < limb_string_list.length; i++) {\n num_limb_string = limb_string_list[i][1][0];\n \n if(num_limb_string>1){\n total_num_limb_string = -1;//if there are more than 1 limb string in a battery, should give alarm to stop use this battery\n battery_health.push(\"Battery \"+(i+2)+\" has more than 1 limb string!\");\n }\n \n if(num_limb_string<=1){\n total_num_limb_string+=num_limb_string;\n battery_health.push(\"Battery \"+(i+2)+\" has \" + num_limb_string+ \" limb strings.\");\n }\n}\nmsg.payload.num_limb_string = total_num_limb_string;\nmsg.payload.battery_health = battery_health;\n\nreturn msg;",
|
||||
"func": "let total_num_limb_string=0;\nlimb_string_list = msg.payload.limb_string_list;\nmain_switch_state_list = msg.payload.main_switch_state;\nbattery_health = [];\nflag = 1;\nif (limb_string_list == null){\n msg.payload.battery_health = \"BMS connection lost!\";\n msg.payload.num_limb_string = -1\n return msg;\n}\n\nfor (let i = 0; i < limb_string_list.length; i++) {\n num_limb_string = limb_string_list[i][1][0];\n \n if(num_limb_string>1){\n flag = -1;\n }\n \n if(num_limb_string<=1){\n total_num_limb_string+=num_limb_string;\n }\n \n battery_health.push(\"Battery \"+(i+2)+\" has \" + num_limb_string+ \" limb strings.\");\n}\n\nconst updateNumLimbString = (total, flag) => flag === 1 ? total : -1;\nmsg.payload.num_limb_string = updateNumLimbString(total_num_limb_string, flag);\nmsg.payload.battery_health = battery_health;\n\nreturn msg;",
|
||||
"outputs": 1,
|
||||
"timeout": 0,
|
||||
"noerr": 0,
|
||||
|
@ -2604,7 +2604,7 @@
|
|||
"rules": [
|
||||
{
|
||||
"t": "set",
|
||||
"p": "payload",
|
||||
"p": "payload.controller_info",
|
||||
"pt": "msg",
|
||||
"to": "Please replace battery first!",
|
||||
"tot": "str"
|
||||
|
|
Loading…
Reference in New Issue