Skip to content

Commit 8c5959b

Browse files
committed
Improve BTM battery dispatch option messages
1 parent 08106d0 commit 8c5959b

File tree

1 file changed

+105
-48
lines changed

1 file changed

+105
-48
lines changed

deploy/runtime/ui/Battery Dispatch Options BTM.json

Lines changed: 105 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"Width": {
2222
"Type": 3.0,
23-
"Integer": 415.0
23+
"Integer": 375.0
2424
},
2525
"Height": {
2626
"Type": 3.0,
@@ -61,7 +61,7 @@
6161
},
6262
"Width": {
6363
"Type": 3.0,
64-
"Integer": 415.0
64+
"Integer": 375.0
6565
},
6666
"Height": {
6767
"Type": 3.0,
@@ -102,7 +102,7 @@
102102
},
103103
"Width": {
104104
"Type": 3.0,
105-
"Integer": 415.0
105+
"Integer": 375.0
106106
},
107107
"Height": {
108108
"Type": 3.0,
@@ -143,7 +143,7 @@
143143
},
144144
"Width": {
145145
"Type": 3.0,
146-
"Integer": 415.0
146+
"Integer": 375.0
147147
},
148148
"Height": {
149149
"Type": 3.0,
@@ -184,7 +184,7 @@
184184
},
185185
"Width": {
186186
"Type": 3.0,
187-
"Integer": 415.0
187+
"Integer": 375.0
188188
},
189189
"Height": {
190190
"Type": 3.0,
@@ -225,7 +225,7 @@
225225
},
226226
"Width": {
227227
"Type": 3.0,
228-
"Integer": 415.0
228+
"Integer": 375.0
229229
},
230230
"Height": {
231231
"Type": 3.0,
@@ -266,7 +266,7 @@
266266
},
267267
"Width": {
268268
"Type": 3.0,
269-
"Integer": 415.0
269+
"Integer": 375.0
270270
},
271271
"Height": {
272272
"Type": 3.0,
@@ -356,7 +356,7 @@
356356
},
357357
"Width": {
358358
"Type": 3.0,
359-
"Integer": 415.0
359+
"Integer": 375.0
360360
},
361361
"Height": {
362362
"Type": 3.0,
@@ -380,38 +380,42 @@
380380
}
381381
}
382382
},
383-
"Label": {
383+
"MultilineText": {
384384
"Visible": 1.0,
385385
"ObjectProperties": {
386386
"Name": {
387387
"Type": 5.0,
388-
"String": "lbl_btm_warning_message"
388+
"String": "lbl_btm_dispatch_message"
389389
},
390390
"X": {
391391
"Type": 3.0,
392-
"Integer": 726.0
392+
"Integer": 690.0
393393
},
394394
"Y": {
395395
"Type": 3.0,
396396
"Integer": 60.0
397397
},
398398
"Width": {
399399
"Type": 3.0,
400-
"Integer": 315.0
400+
"Integer": 348.0
401401
},
402402
"Height": {
403403
"Type": 3.0,
404-
"Integer": 171.0
404+
"Integer": 195.0
405405
},
406406
"Tool Tip": {
407407
"Type": 5.0,
408408
"String": ""
409409
},
410-
"Caption": {
410+
"Text": {
411411
"Type": 5.0,
412412
"String": ""
413413
},
414-
"TextColour": {
414+
"Editable": {
415+
"Type": 2.0,
416+
"Boolean": 0.0
417+
},
418+
"ForeColour": {
415419
"Type": 4.0,
416420
"Color": {
417421
"Red": 0.0,
@@ -420,25 +424,18 @@
420424
"Alpha": 255.0
421425
}
422426
},
423-
"Bold": {
424-
"Type": 2.0,
425-
"Boolean": 0.0
427+
"BackColour": {
428+
"Type": 4.0,
429+
"Color": {
430+
"Red": 255.0,
431+
"Green": 255.0,
432+
"Blue": 255.0,
433+
"Alpha": 255.0
434+
}
426435
},
427-
"FontSize": {
436+
"TabOrder": {
428437
"Type": 3.0,
429-
"Integer": 0.0
430-
},
431-
"WordWrap": {
432-
"Type": 2.0,
433-
"Boolean": 1.0
434-
},
435-
"AlignRight": {
436-
"Type": 2.0,
437-
"Boolean": 0.0
438-
},
439-
"AlignTop": {
440-
"Type": 2.0,
441-
"Boolean": 1.0
438+
"Integer": -1.0
442439
}
443440
}
444441
},
@@ -715,6 +712,19 @@
715712
"UIObject": "Default",
716713
"sscVariableName": "",
717714
"sscVariableValue": ""
715+
},
716+
"lbl_btm_dispatch_message": {
717+
"Version": 4.0,
718+
"Type": 4.0,
719+
"Label": "BTM battery dispatch UI message",
720+
"Units": "",
721+
"Group": "Battery Dispatch",
722+
"IndexLabels": "",
723+
"Flags": 9.0,
724+
"DefaultValue": "",
725+
"UIObject": "MultilineText",
726+
"sscVariableName": "",
727+
"sscVariableValue": ""
718728
}
719729
},
720730
"Equations": [
@@ -769,12 +779,13 @@
769779
],
770780
"Callbacks": [
771781
"on_load{'Battery Dispatch Options BTM'} = define() {",
772-
"\tshow_hide_charge_options();",
782+
"\tshow_hide_charge_options();\r",
773783
"\tenable_disable_powerflow_options();",
774784
"\tenable_charge_from_clip();",
775785
"\tenable_charging_priority();\r",
776786
"\tenable_grid_limited_power();\r",
777787
"\tptc_pbi_with_grid_charging_message();",
788+
"\tbtm_dispatch_message();\r",
778789
"\tif ( technology() == 'Fuel Cell' && value('en_batt') == 0 ) { \r",
779790
"\t\tmsg = 'Battery storage is not enabled. Enable battery on Battery Storage page before setting storage dispatch options. ';\r",
780791
"\t\tclr = 'red';\r",
@@ -794,12 +805,13 @@
794805
"};",
795806
"",
796807
"on_change{'batt_dispatch_choice_ui'} = define() {",
797-
"\tshow_hide_charge_options();",
808+
"\tshow_hide_charge_options();\r",
798809
"\tenable_charge_from_clip();\r",
799810
"\tenable_grid_limited_power();",
800811
"\tenable_disable_powerflow_options();",
801812
"\tenable_charging_priority();\r",
802813
"\tptc_pbi_with_grid_charging_message();",
814+
"\tbtm_dispatch_message();\r",
803815
"\tvalue('batt_dispatch_excl', value('batt_dispatch_choice_ui'));",
804816
"};",
805817
"",
@@ -808,15 +820,18 @@
808820
"\tenable_grid_limited_power();\r",
809821
"};\r",
810822
"\r",
811-
"on_change{'batt_dispatch_auto_can_gridcharge'} = define() {ptc_pbi_with_grid_charging_message();};",
823+
"on_change{'batt_dispatch_auto_can_gridcharge'} = define() {\r",
824+
"\tptc_pbi_with_grid_charging_message();\r",
825+
"};\r",
826+
"\r",
827+
"on_change{'batt_dispatch_auto_can_curtailcharge'} = define() {\r",
828+
"\tbtm_dispatch_message();\r",
829+
"};",
812830
"",
813831
"// Only allow system charge priority options when this is unchecked",
814832
"on_change{'batt_dispatch_charge_only_system_exceeds_load'} = define() {",
815833
"\tenable_charging_priority();",
816834
"};",
817-
"\r",
818-
"\r",
819-
"\r",
820835
"",
821836
"function enable_charging_priority() {",
822837
"\tcharge_system_first = value('batt_dispatch_charge_only_system_exceeds_load');",
@@ -861,7 +876,6 @@
861876
"\t\tenable('batt_dispatch_auto_can_clipcharge',false);",
862877
"\t\tproperty('batt_dispatch_auto_can_clipcharge','State', 0);",
863878
"\t} ",
864-
"\tbtm_warning_message();",
865879
"}",
866880
"\r",
867881
"function enable_grid_limited_power()\r",
@@ -886,19 +900,62 @@
886900
"\t\tproperty('batt_dispatch_auto_can_curtailcharge','State', 0);\r",
887901
"\t}\r",
888902
"}\r",
903+
"\r",
904+
"function is_grid_limit()\r",
905+
"{\r",
906+
"\ten_interconnection = value(\"enable_interconnection_limit\");\r",
907+
"\tcurtailment = value(\"grid_curtailment\");\r",
908+
"\ten_curtailment = false;\r",
909+
"\tfor (i=0; i<#curtailment; i++)\r",
910+
"\t{\r",
911+
"\t\tif (curtailment[i] < 9e37) {\r",
912+
"\t\t\ten_curtailment = true;\r",
913+
"\t\t\tbreak;\r",
914+
"\t\t}\r",
915+
"\t}\r",
916+
"\treturn en_interconnection || en_curtailment;\r",
917+
"}\r",
918+
"",
919+
"function btm_dispatch_message() {\r",
920+
"\tis_dc = (value('batt_ac_or_dc' ) == 0);\r",
889921
"",
890-
"function btm_warning_message() {",
891-
"\tis_dc = (value('batt_ac_or_dc' ) == 0);",
892-
"\tcolor = 'black';",
893922
"\tif ( is_dc ) {",
894-
"\t\tmsg = 'Battery is DC-connected. The Charge From System Only When System Output Exceeds Load option is only available for AC-connected systems. Charging from clipped or grid-limited system power is only available for Retail Rate and Manual dispatch options.'; ",
923+
"\t\tmsg = 'Battery is DC-connected. (See Power Converters inputs on Battery Cell and System page.)'; ",
924+
"\t\tmsg += '\\nCharging from system only when system exceeds load is only available for AC-connected batteries.';\r",
895925
"\t}",
896926
"\telse { ",
897-
"\t\tmsg = 'Battery is AC-connected. Charging from clipped power is only available for DC-connected batteries. See input under Power Converters on Battery Cell and System page.'; ",
898-
"\t}",
899-
"\tmsg += ' See input under Power Converters on Battery Cell and System page.';",
900-
"\tproperty('lbl_btm_warning_message','Caption',msg);",
901-
"\tproperty('lbl_btm_warning_message','TextColour',color);",
927+
"\t\tmsg = 'Battery is AC-connected. (See Power Converters inputs on Battery Cell and System page.)'; ",
928+
"\t}\r",
929+
"\tif ( value('batt_dispatch_choice_ui') == 3 ) // manual dispatch\r",
930+
"\t{\r",
931+
"\t\tmsg += '\\nFor manual dispatch, use check boxes below to determine when the battery charges and discharges.';\r",
932+
"\t}\r",
933+
"\tif ( is_dc && !value('batt_dispatch_choice_ui') == 3 && !value('batt_dispatch_choice_ui') == 4 ) // clip charge only available for manual and retail rate dispatch\r",
934+
"\t{\r",
935+
"\t\tmsg += '\\nCharging from clipped system power is only available for Manual and Retail Rate dispatch.';\r",
936+
"\t}\r",
937+
"\tif ( !is_dc )\r",
938+
"\t{\r",
939+
"\t\tmsg += '\\nCharging from clipped system power is only available for DC-connected batteries.';\r",
940+
"\t}\r",
941+
"\tif ( value('batt_dispatch_auto_can_curtailcharge') == 1 )\r",
942+
"\t{\r",
943+
"\t\tmsg += '\\nBattery only charges from grid-limited system power in time steps that Charge from System is disabled.';\r",
944+
"\t}\r",
945+
"\telseif ( !is_grid_limit() )\r",
946+
"\t{\r",
947+
"\t\tmsg += '\\nCharging from grid-limited power is only available when limits are defined on the Grid Limits page.';\r",
948+
"\t}\r",
949+
"\tif ( value('batt_dispatch_choice_ui') != 2 && value('batt_dispatch_choice_ui') != 3 && value('batt_dispatch_choice_ui') != 4 )\r",
950+
"\t{\r",
951+
"\t\tmsg += '\\nBattery can only discharge to grid for Input Battery Power Targets, Manual, and Retail Rate dispatch.';\r",
952+
"\t}\r",
953+
"\tif ( value('batt_dispatch_choice_ui') == 1 || value('batt_dispatch_choice_ui') == 2) // grid or battery power targets \r",
954+
"\t{\r",
955+
"\t\tmsg = ''; \r",
956+
"\t}\r",
957+
"\tmsg += '\\nSee Help for more information about these dispatch options.';\t\r",
958+
"\tproperty('lbl_btm_dispatch_message','Text',msg);",
902959
"}",
903960
""
904961
]

0 commit comments

Comments
 (0)