Skip to content

Commit b0b599d

Browse files
committed
Initial implementation of highlight and notes options
1 parent 9b5bd1c commit b0b599d

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

deploy/runtime/macros/Residential/Solar for All Calculator.lk

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,118 @@
6161

6262
@*/
6363

64+
//@ name=generate_pagenotes;type=checkbox;label=Create page notes;value=0*/
65+
//@ name=highlight_inputs;type=checkbox;label=Highlight inputs;value=0*/
66+
67+
function highlight( widget_name ) {
68+
g = widgetpos(widget_name);
69+
transp(g, highlight_color, highlight_transparency);
70+
g[1] = g[1] + 30;
71+
msgbox('Click OK to continue.',g);
72+
}
73+
74+
function highlight_inputs() {
75+
76+
generate_pagenotes();
77+
78+
highlight_color = 'yellow';
79+
highlight_transparency = 70;
80+
transp();
81+
82+
ok = show_page('Location and Resource');
83+
if (ok) {
84+
highlight('in_location');
85+
highlight('btn_download');
86+
}
87+
else {
88+
msgbox('Input page error!\nThis case does not have a Location and Resource page. The Solar for All Calculator macro is designed to work with the PVWatts/Residential configuration.');
89+
}
90+
ok = show_page('System Design');
91+
if (ok) {
92+
highlight('system_capacity');
93+
highlight('tilt');
94+
highlight('azimuth');
95+
highlight('array_type');
96+
}
97+
else {
98+
msgbox('Input page error!\nThis case does not have a System Design page. The Solar for All Calculator macro is designed to work with the PVWatts/Residential configuration.');
99+
}
100+
ok = show_page('Electricity Rates');
101+
if (ok) {
102+
highlight('btnQueryOpenEI');
103+
}
104+
else {
105+
msgbox('Input page error!\nThis case does not have an Electricity Rates page. The Solar for All Calculator macro is designed to work with the PVWatts/Residential configuration.');
106+
}
107+
ok = show_page('Electric Load');
108+
if (ok) {
109+
highlight('load_user_data');
110+
highlight('normalize_to_utility_bill');
111+
highlight('utility_bill_data');
112+
}
113+
else {
114+
msgbox('Input page error!\nThis case does not have an Electricity Rates page. The Solar for All Calculator macro is designed to work with the PVWatts/Residential configuration.');
115+
}
116+
transp(); // clear highight
117+
}
118+
119+
function generate_pagenotes() {
120+
ok = show_page('Location and Resource');
121+
if (ok) {
122+
pagenote('## Solar for All Macro Instructions ##\n\n' +
123+
'Location and Resource Page\n\n' +
124+
'1. Type the project street address or city and state in the box under Download Weather Files.\n' +
125+
'2. Click Download and Add to Library.\n' +
126+
'3. When the download finishes, review the data under Weather Data Information to verify the data.\n' +
127+
'4. Go to the System Design page.');
128+
129+
}
130+
else {
131+
msgbox('Input page error!\nThis case does not have a Location and Resource page. The Solar for All Calculator macro is designed to work with the PVWatts model that has a Location and Resource page.');
132+
}
133+
ok = show_page('System Design');
134+
if (ok) {
135+
pagenote('## Solar for All Macro Instructions ##\n\n' +
136+
'System Design Page\n\n' +
137+
'1. For System Nameplate Capacity, type the system size in DC kilowatts.\n' +
138+
'2. For Tilt, type the photovoltaic array tilt angle in degrees from horizontal (20 degrees is a typical value).\n' +
139+
'3. For Azimuth, type the photovoltaic array azimuth angle in degrees East of North (180 degrees, or facing south, is a typical value).\n' +
140+
'4. If you are modeling a ground-mounted or roof-mounted array that allows air to flow beneath the array, for Array Type, choose Fixed Open Rack.\n' +
141+
'5. Go to the Electricity Rates page.');
142+
}
143+
else {
144+
msgbox('Input page error!\nThis case does not have a System Design page. The Solar for All Calculator macro is designed to work with the PVWatts model that has a Location and Resource page.');
145+
}
146+
ok = show_page('Electricity Rates');
147+
if (ok) {
148+
pagenote('## Solar for All Macro Instructions ##\n\n' +
149+
'Electricity Rates Page\n\n' +
150+
'1. Click Search for Rates.\n' +
151+
'2. Type the project zip code and click Search by Zip Code, or if you know the name of the electric service provider, type a few letters of the provider name to filter the list.\n' +
152+
'3. Click the name of the electric service provider in the list, you should see a list of residential rates appear.\n' +
153+
'4. Choose the appropriate rate from the list.\n' +
154+
' If the service provider or rate is not available, you will need to enter rate data manually from the appropriate rate sheet.\n' +
155+
'5. Go to the Electric Load page.');
156+
}
157+
else {
158+
msgbox('Input page error!\nThis case does not have a Electricity Rates page. The Solar for All Calculator macro is designed to work with the PVWatts model that has a Location and Resource page.');
159+
}
160+
ok = show_page('Electric Load');
161+
if (ok) {
162+
pagenote('## Solar for All Macro Instructions ##\n\n' +
163+
'Electricity Load Page\n\n' +
164+
'1. Click Search for Rates.\n' +
165+
'2. Type the project zip code and click Search by Zip Code, or if you know the name of the electric service provider, type a few letters of the provider name to filter the list.\n' +
166+
'3. Click the name of the electric service provider in the list, you should see a list of residential rates appear.\n' +
167+
'4. Choose the appropriate rate from the list.\n' +
168+
' If the service provider or rate is not available, you will need to enter rate data manually from the appropriate rate sheet.\n' +
169+
'5. Go to the Electric Load page.');
170+
}
171+
else {
172+
msgbox('Input page error!\nThis case does not have a Electricity Rates page. The Solar for All Calculator macro is designed to work with the PVWatts model that has a Location and Resource page.');
173+
}
174+
}
175+
64176
// check for valid configuration only PVWatts/Residential is supported
65177
config = configuration();
66178

@@ -79,6 +191,15 @@ if (!ok) {
79191
exit;
80192
}
81193

194+
195+
if ( macro.generate_pagenotes == true ) {
196+
generate_pagenotes();
197+
}
198+
199+
if ( macro.highlight_inputs == true ) {
200+
highlight_inputs();
201+
}
202+
82203
// run simulation
83204
out('Running simulation...');
84205
sim_msg = '';

0 commit comments

Comments
 (0)