workflow_launcher/workflows/retrofit v2/module/module.js
2024-06-22 16:59:23 +02:00

202 lines
41 KiB
JavaScript

const { BrowserWindow, app } = require('electron')
const path = require('path')
const dotenv = require('dotenv')
//const session_start = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/session/start'
//const retrofit_results = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/persistence/retrofit-results'
const session_start = 'http://127.0.0.1:15789/v1.4/session/start'
const retrofit_results = 'http://127.0.0.1:15789/v1.4/persistence/full-retrofit-results'
exports.run = async (application, param, tmp_path) => {
buildings = param['buildings']
console.log(`Executing ${param['workflow']} with ${application}`)
dotenv.config({ path: path.resolve(`${app.getAppPath()}/environments/${application}/.env`) })
const application_uuid = process.env.APPLICATION
const username = process.env.APPLICATION_USERNAME
const password = process.env.APPLICATION_PASSWORD
let response = await fetch(session_start, {
method: 'PUT',
headers: {
'Content-type': 'application/json',
'username': username,
'password': password,
'application-uuid': application_uuid,
'accept': 'application/json'
}
})
if (response.status == 200) {
const application_response = await response.json()
const session_id = response.headers.get('session_id')
let token = response.headers.get('token')
console.log(`token: ${token}`)
request = { 'scenarios': [] }
application_response.scenarios.forEach((scenario) => {
scenario_request = {}
scenario_request[`${scenario}`] = buildings
request['scenarios'].push(scenario_request)
})
response = await fetch(retrofit_results, {
method: 'POST',
headers: {
'Content-type': 'application/json',
'session-id': session_id,
'token': token,
'application-uuid': application_uuid,
'accept': 'application/json'
},
body: JSON.stringify(request)
}, 600000)
console.log(`response: ${response.status}`)
if (response.status == 200) {
results = await response.json()
var meb_header = 'SCENARIO;BUILDING NAME;TOTAL HEATING AREA;YEAR_OF_CONSTRUCTION;FUNTION'
meb_header = `${meb_header};YEARLY COOLING DEMAND;YEARLY HEATING DEMAND;MONTHLY COOLING DEMAND(JAN);MONTHLY COOLING DEMAND(FEB);MONTHLY COOLING DEMAND(MAR);MONTHLY COOLING DEMAND(APR);MONTHLY COOLING DEMAND(MAY);MONTHLY COOLING DEMAND(JUN);MONTHLY COOLING DEMAND(JUL);MONTHLY COOLING DEMAND(AUG);MONTHLY COOLING DEMAND(SEPT);MONTHLY COOLING DEMAND(OCT);MONTHLY COOLING DEMAND(NOV);MONTHLY COOLING DEMAND(DEC);MONTHLY HEATING DEMAND(JAN);MONTHLY HEATING DEMAND(FEB);MONTHLY HEATING DEMAND(MAR);MONTHLY HEATING DEMAND(APR);MONTHLY HEATING DEMAND(MAY);MONTHLY HEATING DEMAND(JUN);MONTHLY HEATING DEMAND(JUL);MONTHLY HEATING DEMAND(AUG);MONTHLY HEATING DEMAND(SEPT);MONTHLY HEATING DEMAND(OCT);MONTHLY HEATING DEMAND(NOV);MONTHLY HEATING DEMAND(DEC)`
meb_header = `${meb_header};YEARLY COOLING PEAK LOAD;YEARLY HEATING PEAK LOAD;MONTHLY COOLING PEAK LOAD (JAN);MONTHLY COOLING PEAK LOAD (FEB);MONTHLY COOLING PEAK LOAD (MAR);MONTHLY COOLING PEAK LOAD (APR);MONTHLY COOLING PEAK LOAD (MAY);MONTHLY COOLING PEAK LOAD (JUN);MONTHLY COOLING PEAK LOAD (JUL);MONTHLY COOLING PEAK LOAD (AUG);MONTHLY COOLING PEAK LOAD (SEPT);MONTHLY COOLING PEAK LOAD (OCT);MONTHLY COOLING PEAK LOAD (NOV);MONTHLY COOLING PEAK LOAD (DEC);MONTHLY HEATING PEAK LOAD (JAN);MONTHLY HEATING PEAK LOAD (FEB);MONTHLY HEATING PEAK LOAD (MAR);MONTHLY HEATING PEAK LOAD (APR);MONTHLY HEATING PEAK LOAD (MAY);MONTHLY HEATING PEAK LOAD (JUN);MONTHLY HEATING PEAK LOAD (JUL);MONTHLY HEATING PEAK LOAD (AUG);MONTHLY HEATING PEAK LOAD (SEPT);MONTHLY HEATING PEAK LOAD (OCT);MONTHLY HEATING PEAK LOAD (NOV);MONTHLY HEATING PEAK LOAD (DEC)`
meb_header = `${meb_header};YEARLY LIGHTING PEAK LOAD;MONTHLY LIGHTING PEAK LOAD(JAN);MONTHLY LIGHTING PEAK LOAD(FEB);MONTHLY LIGHTING PEAK LOAD(MAR);MONTHLY LIGHTING PEAK LOAD(APR);MONTHLY LIGHTING PEAK LOAD(MAY);MONTHLY LIGHTING PEAK LOAD(JUN);MONTHLY LIGHTING PEAK LOAD(JUL);MONTHLY LIGHTING PEAK LOAD(AUG);MONTHLY LIGHTING PEAK LOAD(SEPT);MONTHLY LIGHTING PEAK LOAD(OCT);MONTHLY LIGHTING PEAK LOAD(NOV);MONTHLY LIGHTING PEAK LOAD(DEC)`
meb_header = `${meb_header};YEARLY COOLING CONSUMPTION;YEARLY HEATING CONSUMPTION;MONTHLY COOLING CONSUMPTION(JAN);MONTHLY COOLING CONSUMPTION(FEB);MONTHLY COOLING CONSUMPTION(MAR);MONTHLY COOLING CONSUMPTION(APR);MONTHLY COOLING CONSUMPTION(MAY);MONTHLY COOLING CONSUMPTION(JUN);MONTHLY COOLING CONSUMPTION(JUL);MONTHLY COOLING CONSUMPTION(AUG);MONTHLY COOLING CONSUMPTION(SEPT);MONTHLY COOLING CONSUMPTION(OCT);MONTHLY COOLING CONSUMPTION(NOV);MONTHLY COOLING CONSUMPTION(DEC);MONTHLY HEATING CONSUMPTION(JAN);MONTHLY HEATING CONSUMPTION(FEB);MONTHLY HEATING CONSUMPTION(MAR);MONTHLY HEATING CONSUMPTION(APR);MONTHLY HEATING CONSUMPTION(MAY);MONTHLY HEATING CONSUMPTION(JUN);MONTHLY HEATING CONSUMPTION(JUL);MONTHLY HEATING CONSUMPTION(AUG);MONTHLY HEATING CONSUMPTION(SEPT);MONTHLY HEATING CONSUMPTION(OCT);MONTHLY HEATING CONSUMPTION(NOV);MONTHLY HEATING CONSUMPTION(DEC)`
meb_header = `${meb_header};YEARLY APPLIANCES PEAK LOAD;MONTHLY APPLIANCES PEAK LOAD(JAN);MONTHLY APPLIANCES PEAK LOAD(FEB);MONTHLY APPLIANCES PEAK LOAD(MAR);MONTHLY APPLIANCES PEAK LOAD(APR);MONTHLY APPLIANCES PEAK LOAD(MAY);MONTHLY APPLIANCES PEAK LOAD(JUN);MONTHLY APPLIANCES PEAK LOAD(JUL);MONTHLY APPLIANCES PEAK LOAD(AUG);MONTHLY APPLIANCES PEAK LOAD(SEPT);MONTHLY APPLIANCES PEAK LOAD(OCT);MONTHLY APPLIANCES PEAK LOAD(NOV);MONTHLY APPLIANCES PEAK LOAD(DEC)`
meb_header = `${meb_header};YEARLY LIGHTING ELECTRICAL DEMAND;MONTHLY LIGHTING ELECTRICAL DEMAND(JAN);MONTHLY LIGHTING ELECTRICAL DEMAND(FEB);MONTHLY LIGHTING ELECTRICAL DEMAND(MAR);MONTHLY LIGHTING ELECTRICAL DEMAND(APR);MONTHLY LIGHTING ELECTRICAL DEMAND(MAY);MONTHLY LIGHTING ELECTRICAL DEMAND(JUN);MONTHLY LIGHTING ELECTRICAL DEMAND(JUL);MONTHLY LIGHTING ELECTRICAL DEMAND(AUG);MONTHLY LIGHTING ELECTRICAL DEMAND(SEPT);MONTHLY LIGHTING ELECTRICAL DEMAND(OCT);MONTHLY LIGHTING ELECTRICAL DEMAND(NOV);MONTHLY LIGHTING ELECTRICAL DEMAND(DEC)`
meb_header = `${meb_header};YEARLY APPLIANCES ELECTRICAL DEMAND;MONTHLY APPLIANCES ELECTRICAL DEMAND(JAN);MONTHLY APPLIANCES ELECTRICAL DEMAND(FEB);MONTHLY APPLIANCES ELECTRICAL DEMAND(MAR);MONTHLY APPLIANCES ELECTRICAL DEMAND(APR);MONTHLY APPLIANCES ELECTRICAL DEMAND(MAY);MONTHLY APPLIANCES ELECTRICAL DEMAND(JUN);MONTHLY APPLIANCES ELECTRICAL DEMAND(JUL);MONTHLY APPLIANCES ELECTRICAL DEMAND(AUG);MONTHLY APPLIANCES ELECTRICAL DEMAND(SEPT);MONTHLY APPLIANCES ELECTRICAL DEMAND(OCT);MONTHLY APPLIANCES ELECTRICAL DEMAND(NOV);MONTHLY APPLIANCES ELECTRICAL DEMAND(DEC)`
meb_header = `${meb_header};YEARLY ON SITE ELECTRICAL PRODUCTION;MONTHLY ON SITE ELECTRICAL PRODUCTION(JAN);MONTHLY ON SITE ELECTRICAL PRODUCTION(FEB);MONTHLY ON SITE ELECTRICAL PRODUCTION(MAR);MONTHLY ON SITE ELECTRICAL PRODUCTION(APR);MONTHLY ON SITE ELECTRICAL PRODUCTION(MAY);MONTHLY ON SITE ELECTRICAL PRODUCTION(JUN);MONTHLY ON SITE ELECTRICAL PRODUCTION(JUL);MONTHLY ON SITE ELECTRICAL PRODUCTION(AUG);MONTHLY ON SITE ELECTRICAL PRODUCTION(SEPT);MONTHLY ON SITE ELECTRICAL PRODUCTION(OCT);MONTHLY ON SITE ELECTRICAL PRODUCTION(NOV);MONTHLY ON SITE ELECTRICAL PRODUCTION(DEC)`
meb_header = `${meb_header};YEARLY DOMESTIC HOT WATER CONSUMPTION;YEARLY DOMESTIC HOT WATER HEAT DEMAND;MONTHLY DOMESTIC HOT WATER CONSUMPTION(JAN);MONTHLY DOMESTIC HOT WATER CONSUMPTION(FEB);MONTHLY DOMESTIC HOT WATER CONSUMPTION(MAR);MONTHLY DOMESTIC HOT WATER CONSUMPTION(APR);MONTHLY DOMESTIC HOT WATER CONSUMPTION(MAY);MONTHLY DOMESTIC HOT WATER CONSUMPTION(JUN);MONTHLY DOMESTIC HOT WATER CONSUMPTION(JUL);MONTHLY DOMESTIC HOT WATER CONSUMPTION(AUG);MONTHLY DOMESTIC HOT WATER CONSUMPTION(SEPT);MONTHLY DOMESTIC HOT WATER CONSUMPTION(OCT);MONTHLY DOMESTIC HOT WATER CONSUMPTION(NOV);MONTHLY DOMESTIC HOT WATER CONSUMPTION(DEC);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(JAN);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(FEB);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(MAR);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(APR);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(MAY);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(JUN);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(JUL);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(AUG);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(SEPT);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(OCT);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(NOV);MONTHLY DOMESTIC HOT WATER HEAT DEMAND(DEC)`
meb_header = `${meb_header};YEARLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION;MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(JAN);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(FEB);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(MAR);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(APR);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(MAY);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(JUN);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(JUL);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(AUG);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(SEPT);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(OCT);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(NOV);MONTHLY DISTRIBUTION SYSTEMS ELECTRICAL CONSUMPTION(DEC)`
var costs_header = 'SCENARIO;BUILDING NAME;TOTAL HEATING AREA;YEAR_OF_CONSTRUCTION;FUNTION'
costs_header = `${costs_header};TOTAL CAPITAL COSTS SKIN;TOTAL CAPITAL COSTS SYSTEMS;END OF LIFE COSTS;TOTAL OPERATIONAL COSTS;TOTAL MAINTENANCE COSTS;OPERATIONAL INCOMES`
costs_header = `${costs_header};B2010 OPAQUE WALLS(1);B2010 OPAQUE WALLS(2);B2010 OPAQUE WALLS(3);B2010 OPAQUE WALLS(4);B2010 OPAQUE WALLS(5);B2010 OPAQUE WALLS(6);B2010 OPAQUE WALLS(7);B2010 OPAQUE WALLS(8);B2010 OPAQUE WALLS(9);B2010 OPAQUE WALLS(10);B2010 OPAQUE WALLS(11);B2010 OPAQUE WALLS(12);B2010 OPAQUE WALLS(13);B2010 OPAQUE WALLS(14);B2010 OPAQUE WALLS(15);B2010 OPAQUE WALLS(16);B2010 OPAQUE WALLS(17);B2010 OPAQUE WALLS(18);B2010 OPAQUE WALLS(19);B2010 OPAQUE WALLS(20);B2010 OPAQUE WALLS(21);B2010 OPAQUE WALLS(22);B2010 OPAQUE WALLS(23);B2010 OPAQUE WALLS(24);B2010 OPAQUE WALLS(25);B2010 OPAQUE WALLS(26);B2010 OPAQUE WALLS(27);B2010 OPAQUE WALLS(28);B2010 OPAQUE WALLS(29);B2010 OPAQUE WALLS(30);B2010 OPAQUE WALLS(31)`
costs_header = `${costs_header};B2020 TRANSPARENT(1);B2020 TRANSPARENT(2);B2020 TRANSPARENT(3);B2020 TRANSPARENT(4);B2020 TRANSPARENT(5);B2020 TRANSPARENT(6);B2020 TRANSPARENT(7);B2020 TRANSPARENT(8);B2020 TRANSPARENT(9);B2020 TRANSPARENT(10);B2020 TRANSPARENT(11);B2020 TRANSPARENT(12);B2020 TRANSPARENT(13);B2020 TRANSPARENT(14);B2020 TRANSPARENT(15);B2020 TRANSPARENT(16);B2020 TRANSPARENT(17);B2020 TRANSPARENT(18);B2020 TRANSPARENT(19);B2020 TRANSPARENT(20);B2020 TRANSPARENT(21);B2020 TRANSPARENT(22);B2020 TRANSPARENT(23);B2020 TRANSPARENT(24);B2020 TRANSPARENT(25);B2020 TRANSPARENT(26);B2020 TRANSPARENT(27);B2020 TRANSPARENT(28);B2020 TRANSPARENT(29);B2020 TRANSPARENT(30);B2020 TRANSPARENT(31)`
costs_header = `${costs_header};B3010 OPAQUE ROOF(1);B3010 OPAQUE ROOF(2);B3010 OPAQUE ROOF(3);B3010 OPAQUE ROOF(4);B3010 OPAQUE ROOF(5);B3010 OPAQUE ROOF(6);B3010 OPAQUE ROOF(7);B3010 OPAQUE ROOF(8);B3010 OPAQUE ROOF(9);B3010 OPAQUE ROOF(10);B3010 OPAQUE ROOF(11);B3010 OPAQUE ROOF(12);B3010 OPAQUE ROOF(13);B3010 OPAQUE ROOF(14);B3010 OPAQUE ROOF(15);B3010 OPAQUE ROOF(16);B3010 OPAQUE ROOF(17);B3010 OPAQUE ROOF(18);B3010 OPAQUE ROOF(19);B3010 OPAQUE ROOF(20);B3010 OPAQUE ROOF(21);B3010 OPAQUE ROOF(22);B3010 OPAQUE ROOF(23);B3010 OPAQUE ROOF(24);B3010 OPAQUE ROOF(25);B3010 OPAQUE ROOF(26);B3010 OPAQUE ROOF(27);B3010 OPAQUE ROOF(28);B3010 OPAQUE ROOF(29);B3010 OPAQUE ROOF(30);B3010 OPAQUE ROOF(31)`
costs_header = `${costs_header};B10 SUPERSTRUCTURE(1);B10 SUPERSTRUCTURE(2);B10 SUPERSTRUCTURE(3);B10 SUPERSTRUCTURE(4);B10 SUPERSTRUCTURE(5);B10 SUPERSTRUCTURE(6);B10 SUPERSTRUCTURE(7);B10 SUPERSTRUCTURE(8);B10 SUPERSTRUCTURE(9);B10 SUPERSTRUCTURE(10);B10 SUPERSTRUCTURE(11);B10 SUPERSTRUCTURE(12);B10 SUPERSTRUCTURE(13);B10 SUPERSTRUCTURE(14);B10 SUPERSTRUCTURE(15);B10 SUPERSTRUCTURE(16);B10 SUPERSTRUCTURE(17);B10 SUPERSTRUCTURE(18);B10 SUPERSTRUCTURE(19);B10 SUPERSTRUCTURE(20);B10 SUPERSTRUCTURE(21);B10 SUPERSTRUCTURE(22);B10 SUPERSTRUCTURE(23);B10 SUPERSTRUCTURE(24);B10 SUPERSTRUCTURE(25);B10 SUPERSTRUCTURE(26);B10 SUPERSTRUCTURE(27);B10 SUPERSTRUCTURE(28);B10 SUPERSTRUCTURE(29);B10 SUPERSTRUCTURE(30);B10 SUPERSTRUCTURE(31)`
costs_header = `${costs_header};D3020 HEAT GENERATING SYSTEMS(1);D3020 HEAT GENERATING SYSTEMS(2);D3020 HEAT GENERATING SYSTEMS(3);D3020 HEAT GENERATING SYSTEMS(4);D3020 HEAT GENERATING SYSTEMS(5);D3020 HEAT GENERATING SYSTEMS(6);D3020 HEAT GENERATING SYSTEMS(7);D3020 HEAT GENERATING SYSTEMS(8);D3020 HEAT GENERATING SYSTEMS(9);D3020 HEAT GENERATING SYSTEMS(10);D3020 HEAT GENERATING SYSTEMS(11);D3020 HEAT GENERATING SYSTEMS(12);D3020 HEAT GENERATING SYSTEMS(13);D3020 HEAT GENERATING SYSTEMS(14);D3020 HEAT GENERATING SYSTEMS(15);D3020 HEAT GENERATING SYSTEMS(16);D3020 HEAT GENERATING SYSTEMS(17);D3020 HEAT GENERATING SYSTEMS(18);D3020 HEAT GENERATING SYSTEMS(19);D3020 HEAT GENERATING SYSTEMS(20);D3020 HEAT GENERATING SYSTEMS(21);D3020 HEAT GENERATING SYSTEMS(22);D3020 HEAT GENERATING SYSTEMS(23);D3020 HEAT GENERATING SYSTEMS(24);D3020 HEAT GENERATING SYSTEMS(25);D3020 HEAT GENERATING SYSTEMS(26);D3020 HEAT GENERATING SYSTEMS(27);D3020 HEAT GENERATING SYSTEMS(28);D3020 HEAT GENERATING SYSTEMS(29);D3020 HEAT GENERATING SYSTEMS(30);D3020 HEAT GENERATING SYSTEMS(31)`
costs_header = `${costs_header};D3030 COOLING GENERATION SYSTEMS(1);D3030 COOLING GENERATION SYSTEMS(2);D3030 COOLING GENERATION SYSTEMS(3);D3030 COOLING GENERATION SYSTEMS(4);D3030 COOLING GENERATION SYSTEMS(5);D3030 COOLING GENERATION SYSTEMS(6);D3030 COOLING GENERATION SYSTEMS(7);D3030 COOLING GENERATION SYSTEMS(8);D3030 COOLING GENERATION SYSTEMS(9);D3030 COOLING GENERATION SYSTEMS(10);D3030 COOLING GENERATION SYSTEMS(11);D3030 COOLING GENERATION SYSTEMS(12);D3030 COOLING GENERATION SYSTEMS(13);D3030 COOLING GENERATION SYSTEMS(14);D3030 COOLING GENERATION SYSTEMS(15);D3030 COOLING GENERATION SYSTEMS(16);D3030 COOLING GENERATION SYSTEMS(17);D3030 COOLING GENERATION SYSTEMS(18);D3030 COOLING GENERATION SYSTEMS(19);D3030 COOLING GENERATION SYSTEMS(20);D3030 COOLING GENERATION SYSTEMS(21);D3030 COOLING GENERATION SYSTEMS(22);D3030 COOLING GENERATION SYSTEMS(23);D3030 COOLING GENERATION SYSTEMS(24);D3030 COOLING GENERATION SYSTEMS(25);D3030 COOLING GENERATION SYSTEMS(26);D3030 COOLING GENERATION SYSTEMS(27);D3030 COOLING GENERATION SYSTEMS(28);D3030 COOLING GENERATION SYSTEMS(29);D3030 COOLING GENERATION SYSTEMS(30);D3030 COOLING GENERATION SYSTEMS(31)`
costs_header = `${costs_header};D3080 OTHER HVAC AHU(1);D3080 OTHER HVAC AHU(2);D3080 OTHER HVAC AHU(3);D3080 OTHER HVAC AHU(4);D3080 OTHER HVAC AHU(5);D3080 OTHER HVAC AHU(6);D3080 OTHER HVAC AHU(7);D3080 OTHER HVAC AHU(8);D3080 OTHER HVAC AHU(9);D3080 OTHER HVAC AHU(10);D3080 OTHER HVAC AHU(11);D3080 OTHER HVAC AHU(12);D3080 OTHER HVAC AHU(13);D3080 OTHER HVAC AHU(14);D3080 OTHER HVAC AHU(15);D3080 OTHER HVAC AHU(16);D3080 OTHER HVAC AHU(17);D3080 OTHER HVAC AHU(18);D3080 OTHER HVAC AHU(19);D3080 OTHER HVAC AHU(20);D3080 OTHER HVAC AHU(21);D3080 OTHER HVAC AHU(22);D3080 OTHER HVAC AHU(23);D3080 OTHER HVAC AHU(24);D3080 OTHER HVAC AHU(25);D3080 OTHER HVAC AHU(26);D3080 OTHER HVAC AHU(27);D3080 OTHER HVAC AHU(28);D3080 OTHER HVAC AHU(29);D3080 OTHER HVAC AHU(30);D3080 OTHER HVAC AHU(31)`
costs_header = `${costs_header};D5020 LIGHTING AND BRANCH WIRING(1);D5020 LIGHTING AND BRANCH WIRING(2);D5020 LIGHTING AND BRANCH WIRING(3);D5020 LIGHTING AND BRANCH WIRING(4);D5020 LIGHTING AND BRANCH WIRING(5);D5020 LIGHTING AND BRANCH WIRING(6);D5020 LIGHTING AND BRANCH WIRING(7);D5020 LIGHTING AND BRANCH WIRING(8);D5020 LIGHTING AND BRANCH WIRING(9);D5020 LIGHTING AND BRANCH WIRING(10);D5020 LIGHTING AND BRANCH WIRING(11);D5020 LIGHTING AND BRANCH WIRING(12);D5020 LIGHTING AND BRANCH WIRING(13);D5020 LIGHTING AND BRANCH WIRING(14);D5020 LIGHTING AND BRANCH WIRING(15);D5020 LIGHTING AND BRANCH WIRING(16);D5020 LIGHTING AND BRANCH WIRING(17);D5020 LIGHTING AND BRANCH WIRING(18);D5020 LIGHTING AND BRANCH WIRING(19);D5020 LIGHTING AND BRANCH WIRING(20);D5020 LIGHTING AND BRANCH WIRING(21);D5020 LIGHTING AND BRANCH WIRING(22);D5020 LIGHTING AND BRANCH WIRING(23);D5020 LIGHTING AND BRANCH WIRING(24);D5020 LIGHTING AND BRANCH WIRING(25);D5020 LIGHTING AND BRANCH WIRING(26);D5020 LIGHTING AND BRANCH WIRING(27);D5020 LIGHTING AND BRANCH WIRING(28);D5020 LIGHTING AND BRANCH WIRING(29);D5020 LIGHTING AND BRANCH WIRING(30);D5020 LIGHTING AND BRANCH WIRING(31)`
costs_header = `${costs_header};D301010 PHOTOVOLTAIC SYSTEM(1);D301010 PHOTOVOLTAIC SYSTEM(2);D301010 PHOTOVOLTAIC SYSTEM(3);D301010 PHOTOVOLTAIC SYSTEM(4);D301010 PHOTOVOLTAIC SYSTEM(5);D301010 PHOTOVOLTAIC SYSTEM(6);D301010 PHOTOVOLTAIC SYSTEM(7);D301010 PHOTOVOLTAIC SYSTEM(8);D301010 PHOTOVOLTAIC SYSTEM(9);D301010 PHOTOVOLTAIC SYSTEM(10);D301010 PHOTOVOLTAIC SYSTEM(11);D301010 PHOTOVOLTAIC SYSTEM(12);D301010 PHOTOVOLTAIC SYSTEM(13);D301010 PHOTOVOLTAIC SYSTEM(14);D301010 PHOTOVOLTAIC SYSTEM(15);D301010 PHOTOVOLTAIC SYSTEM(16);D301010 PHOTOVOLTAIC SYSTEM(17);D301010 PHOTOVOLTAIC SYSTEM(18);D301010 PHOTOVOLTAIC SYSTEM(19);D301010 PHOTOVOLTAIC SYSTEM(20);D301010 PHOTOVOLTAIC SYSTEM(21);D301010 PHOTOVOLTAIC SYSTEM(22);D301010 PHOTOVOLTAIC SYSTEM(23);D301010 PHOTOVOLTAIC SYSTEM(24);D301010 PHOTOVOLTAIC SYSTEM(25);D301010 PHOTOVOLTAIC SYSTEM(26);D301010 PHOTOVOLTAIC SYSTEM(27);D301010 PHOTOVOLTAIC SYSTEM(28);D301010 PHOTOVOLTAIC SYSTEM(29);D301010 PHOTOVOLTAIC SYSTEM(30);D301010 PHOTOVOLTAIC SYSTEM(31)`
costs_header = `${costs_header};GLOBAL END OF LIFE COSTS(1);GLOBAL END OF LIFE COSTS(2);GLOBAL END OF LIFE COSTS(3);GLOBAL END OF LIFE COSTS(4);GLOBAL END OF LIFE COSTS(5);GLOBAL END OF LIFE COSTS(6);GLOBAL END OF LIFE COSTS(7);GLOBAL END OF LIFE COSTS(8);GLOBAL END OF LIFE COSTS(9);GLOBAL END OF LIFE COSTS(10);GLOBAL END OF LIFE COSTS(11);GLOBAL END OF LIFE COSTS(12);GLOBAL END OF LIFE COSTS(13);GLOBAL END OF LIFE COSTS(14);GLOBAL END OF LIFE COSTS(15);GLOBAL END OF LIFE COSTS(16);GLOBAL END OF LIFE COSTS(17);GLOBAL END OF LIFE COSTS(18);GLOBAL END OF LIFE COSTS(19);GLOBAL END OF LIFE COSTS(20);GLOBAL END OF LIFE COSTS(21);GLOBAL END OF LIFE COSTS(22);GLOBAL END OF LIFE COSTS(23);GLOBAL END OF LIFE COSTS(24);GLOBAL END OF LIFE COSTS(25);GLOBAL END OF LIFE COSTS(26);GLOBAL END OF LIFE COSTS(27);GLOBAL END OF LIFE COSTS(28);GLOBAL END OF LIFE COSTS(29);GLOBAL END OF LIFE COSTS(30);GLOBAL END OF LIFE COSTS(31);GLOBAL END OF LIFE COSTS(32)`
costs_header = `${costs_header};FIXED COSTS ELECTRICITY PEAK(1);FIXED COSTS ELECTRICITY PEAK(2);FIXED COSTS ELECTRICITY PEAK(3);FIXED COSTS ELECTRICITY PEAK(4);FIXED COSTS ELECTRICITY PEAK(5);FIXED COSTS ELECTRICITY PEAK(6);FIXED COSTS ELECTRICITY PEAK(7);FIXED COSTS ELECTRICITY PEAK(8);FIXED COSTS ELECTRICITY PEAK(9);FIXED COSTS ELECTRICITY PEAK(10);FIXED COSTS ELECTRICITY PEAK(11);FIXED COSTS ELECTRICITY PEAK(12);FIXED COSTS ELECTRICITY PEAK(13);FIXED COSTS ELECTRICITY PEAK(14);FIXED COSTS ELECTRICITY PEAK(15);FIXED COSTS ELECTRICITY PEAK(16);FIXED COSTS ELECTRICITY PEAK(17);FIXED COSTS ELECTRICITY PEAK(18);FIXED COSTS ELECTRICITY PEAK(19);FIXED COSTS ELECTRICITY PEAK(20);FIXED COSTS ELECTRICITY PEAK(21);FIXED COSTS ELECTRICITY PEAK(22);FIXED COSTS ELECTRICITY PEAK(23);FIXED COSTS ELECTRICITY PEAK(24);FIXED COSTS ELECTRICITY PEAK(25);FIXED COSTS ELECTRICITY PEAK(26);FIXED COSTS ELECTRICITY PEAK(27);FIXED COSTS ELECTRICITY PEAK(28);FIXED COSTS ELECTRICITY PEAK(29);FIXED COSTS ELECTRICITY PEAK(30);FIXED COSTS ELECTRICITY PEAK(31);FIXED COSTS ELECTRICITY PEAK(32)`
costs_header = `${costs_header};FIXED COSTS ELECTRICITY MONTHLY(1);FIXED COSTS ELECTRICITY MONTHLY(2);FIXED COSTS ELECTRICITY MONTHLY(3);FIXED COSTS ELECTRICITY MONTHLY(4);FIXED COSTS ELECTRICITY MONTHLY(5);FIXED COSTS ELECTRICITY MONTHLY(6);FIXED COSTS ELECTRICITY MONTHLY(7);FIXED COSTS ELECTRICITY MONTHLY(8);FIXED COSTS ELECTRICITY MONTHLY(9);FIXED COSTS ELECTRICITY MONTHLY(10);FIXED COSTS ELECTRICITY MONTHLY(11);FIXED COSTS ELECTRICITY MONTHLY(12);FIXED COSTS ELECTRICITY MONTHLY(13);FIXED COSTS ELECTRICITY MONTHLY(14);FIXED COSTS ELECTRICITY MONTHLY(15);FIXED COSTS ELECTRICITY MONTHLY(16);FIXED COSTS ELECTRICITY MONTHLY(17);FIXED COSTS ELECTRICITY MONTHLY(18);FIXED COSTS ELECTRICITY MONTHLY(19);FIXED COSTS ELECTRICITY MONTHLY(20);FIXED COSTS ELECTRICITY MONTHLY(21);FIXED COSTS ELECTRICITY MONTHLY(22);FIXED COSTS ELECTRICITY MONTHLY(23);FIXED COSTS ELECTRICITY MONTHLY(24);FIXED COSTS ELECTRICITY MONTHLY(25);FIXED COSTS ELECTRICITY MONTHLY(26);FIXED COSTS ELECTRICITY MONTHLY(27);FIXED COSTS ELECTRICITY MONTHLY(28);FIXED COSTS ELECTRICITY MONTHLY(29);FIXED COSTS ELECTRICITY MONTHLY(30);FIXED COSTS ELECTRICITY MONTHLY(31);FIXED COSTS ELECTRICITY MONTHLY(32)`
costs_header = `${costs_header};VARIABLE COSTS ELECTRICITY(1);VARIABLE COSTS ELECTRICITY(2);VARIABLE COSTS ELECTRICITY(3);VARIABLE COSTS ELECTRICITY(4);VARIABLE COSTS ELECTRICITY(5);VARIABLE COSTS ELECTRICITY(6);VARIABLE COSTS ELECTRICITY(7);VARIABLE COSTS ELECTRICITY(8);VARIABLE COSTS ELECTRICITY(9);VARIABLE COSTS ELECTRICITY(10);VARIABLE COSTS ELECTRICITY(11);VARIABLE COSTS ELECTRICITY(12);VARIABLE COSTS ELECTRICITY(13);VARIABLE COSTS ELECTRICITY(14);VARIABLE COSTS ELECTRICITY(15);VARIABLE COSTS ELECTRICITY(16);VARIABLE COSTS ELECTRICITY(17);VARIABLE COSTS ELECTRICITY(18);VARIABLE COSTS ELECTRICITY(19);VARIABLE COSTS ELECTRICITY(20);VARIABLE COSTS ELECTRICITY(21);VARIABLE COSTS ELECTRICITY(22);VARIABLE COSTS ELECTRICITY(23);VARIABLE COSTS ELECTRICITY(24);VARIABLE COSTS ELECTRICITY(25);VARIABLE COSTS ELECTRICITY(26);VARIABLE COSTS ELECTRICITY(27);VARIABLE COSTS ELECTRICITY(28);VARIABLE COSTS ELECTRICITY(29);VARIABLE COSTS ELECTRICITY(30);VARIABLE COSTS ELECTRICITY(31);VARIABLE COSTS ELECTRICITY(32)`
costs_header = `${costs_header};FIXED COSTS GAS(1);FIXED COSTS GAS(2);FIXED COSTS GAS(3);FIXED COSTS GAS(4);FIXED COSTS GAS(5);FIXED COSTS GAS(6);FIXED COSTS GAS(7);FIXED COSTS GAS(8);FIXED COSTS GAS(9);FIXED COSTS GAS(10);FIXED COSTS GAS(11);FIXED COSTS GAS(12);FIXED COSTS GAS(13);FIXED COSTS GAS(14);FIXED COSTS GAS(15);FIXED COSTS GAS(16);FIXED COSTS GAS(17);FIXED COSTS GAS(18);FIXED COSTS GAS(19);FIXED COSTS GAS(20);FIXED COSTS GAS(21);FIXED COSTS GAS(22);FIXED COSTS GAS(23);FIXED COSTS GAS(24);FIXED COSTS GAS(25);FIXED COSTS GAS(26);FIXED COSTS GAS(27);FIXED COSTS GAS(28);FIXED COSTS GAS(29);FIXED COSTS GAS(30);FIXED COSTS GAS(31);FIXED COSTS GAS(32)`
costs_header = `${costs_header};VARIABLE COSTS GAS(1);VARIABLE COSTS GAS(2);VARIABLE COSTS GAS(3);VARIABLE COSTS GAS(4);VARIABLE COSTS GAS(5);VARIABLE COSTS GAS(6);VARIABLE COSTS GAS(7);VARIABLE COSTS GAS(8);VARIABLE COSTS GAS(9);VARIABLE COSTS GAS(10);VARIABLE COSTS GAS(11);VARIABLE COSTS GAS(12);VARIABLE COSTS GAS(13);VARIABLE COSTS GAS(14);VARIABLE COSTS GAS(15);VARIABLE COSTS GAS(16);VARIABLE COSTS GAS(17);VARIABLE COSTS GAS(18);VARIABLE COSTS GAS(19);VARIABLE COSTS GAS(20);VARIABLE COSTS GAS(21);VARIABLE COSTS GAS(22);VARIABLE COSTS GAS(23);VARIABLE COSTS GAS(24);VARIABLE COSTS GAS(25);VARIABLE COSTS GAS(26);VARIABLE COSTS GAS(27);VARIABLE COSTS GAS(28);VARIABLE COSTS GAS(29);VARIABLE COSTS GAS(30);VARIABLE COSTS GAS(31);VARIABLE COSTS GAS(32)`
costs_header = `${costs_header};HEATING MAINTENANCE(1);HEATING MAINTENANCE(2);HEATING MAINTENANCE(3);HEATING MAINTENANCE(4);HEATING MAINTENANCE(5);HEATING MAINTENANCE(6);HEATING MAINTENANCE(7);HEATING MAINTENANCE(8);HEATING MAINTENANCE(9);HEATING MAINTENANCE(10);HEATING MAINTENANCE(11);HEATING MAINTENANCE(12);HEATING MAINTENANCE(13);HEATING MAINTENANCE(14);HEATING MAINTENANCE(15);HEATING MAINTENANCE(16);HEATING MAINTENANCE(17);HEATING MAINTENANCE(18);HEATING MAINTENANCE(19);HEATING MAINTENANCE(20);HEATING MAINTENANCE(21);HEATING MAINTENANCE(22);HEATING MAINTENANCE(23);HEATING MAINTENANCE(24);HEATING MAINTENANCE(25);HEATING MAINTENANCE(26);HEATING MAINTENANCE(27);HEATING MAINTENANCE(28);HEATING MAINTENANCE(29);HEATING MAINTENANCE(30);HEATING MAINTENANCE(31);HEATING MAINTENANCE(32)`
costs_header = `${costs_header};COOLING MAINTENANCE(1);COOLING MAINTENANCE(2);COOLING MAINTENANCE(3);COOLING MAINTENANCE(4);COOLING MAINTENANCE(5);COOLING MAINTENANCE(6);COOLING MAINTENANCE(7);COOLING MAINTENANCE(8);COOLING MAINTENANCE(9);COOLING MAINTENANCE(10);COOLING MAINTENANCE(11);COOLING MAINTENANCE(12);COOLING MAINTENANCE(13);COOLING MAINTENANCE(14);COOLING MAINTENANCE(15);COOLING MAINTENANCE(16);COOLING MAINTENANCE(17);COOLING MAINTENANCE(18);COOLING MAINTENANCE(19);COOLING MAINTENANCE(20);COOLING MAINTENANCE(21);COOLING MAINTENANCE(22);COOLING MAINTENANCE(23);COOLING MAINTENANCE(24);COOLING MAINTENANCE(25);COOLING MAINTENANCE(26);COOLING MAINTENANCE(27);COOLING MAINTENANCE(28);COOLING MAINTENANCE(29);COOLING MAINTENANCE(30);COOLING MAINTENANCE(31);COOLING MAINTENANCE(32)`
costs_header = `${costs_header};PV MAINTENANCE(1);PV MAINTENANCE(2);PV MAINTENANCE(3);PV MAINTENANCE(4);PV MAINTENANCE(5);PV MAINTENANCE(6);PV MAINTENANCE(7);PV MAINTENANCE(8);PV MAINTENANCE(9);PV MAINTENANCE(10);PV MAINTENANCE(11);PV MAINTENANCE(12);PV MAINTENANCE(13);PV MAINTENANCE(14);PV MAINTENANCE(15);PV MAINTENANCE(16);PV MAINTENANCE(17);PV MAINTENANCE(18);PV MAINTENANCE(19);PV MAINTENANCE(20);PV MAINTENANCE(21);PV MAINTENANCE(22);PV MAINTENANCE(23);PV MAINTENANCE(24);PV MAINTENANCE(25);PV MAINTENANCE(26);PV MAINTENANCE(27);PV MAINTENANCE(28);PV MAINTENANCE(29);PV MAINTENANCE(30);PV MAINTENANCE(31);PV MAINTENANCE(32)`
costs_header = `${costs_header};GLOBAL OPERATIONAL INCOMES(1);GLOBAL OPERATIONAL INCOMES(2);GLOBAL OPERATIONAL INCOMES(3);GLOBAL OPERATIONAL INCOMES(4);GLOBAL OPERATIONAL INCOMES(5);GLOBAL OPERATIONAL INCOMES(6);GLOBAL OPERATIONAL INCOMES(7);GLOBAL OPERATIONAL INCOMES(8);GLOBAL OPERATIONAL INCOMES(9);GLOBAL OPERATIONAL INCOMES(10);GLOBAL OPERATIONAL INCOMES(11);GLOBAL OPERATIONAL INCOMES(12);GLOBAL OPERATIONAL INCOMES(13);GLOBAL OPERATIONAL INCOMES(14);GLOBAL OPERATIONAL INCOMES(15);GLOBAL OPERATIONAL INCOMES(16);GLOBAL OPERATIONAL INCOMES(17);GLOBAL OPERATIONAL INCOMES(18);GLOBAL OPERATIONAL INCOMES(19);GLOBAL OPERATIONAL INCOMES(20);GLOBAL OPERATIONAL INCOMES(21);GLOBAL OPERATIONAL INCOMES(22);GLOBAL OPERATIONAL INCOMES(23);GLOBAL OPERATIONAL INCOMES(24);GLOBAL OPERATIONAL INCOMES(25);GLOBAL OPERATIONAL INCOMES(26);GLOBAL OPERATIONAL INCOMES(27);GLOBAL OPERATIONAL INCOMES(28);GLOBAL OPERATIONAL INCOMES(29);GLOBAL OPERATIONAL INCOMES(30);GLOBAL OPERATIONAL INCOMES(31);GLOBAL OPERATIONAL INCOMES(32)`
costs_header = `${costs_header};SUBSIDIES CONSTRUCTION(1);SUBSIDIES CONSTRUCTION(2);SUBSIDIES CONSTRUCTION(3);SUBSIDIES CONSTRUCTION(4);SUBSIDIES CONSTRUCTION(5);SUBSIDIES CONSTRUCTION(6);SUBSIDIES CONSTRUCTION(7);SUBSIDIES CONSTRUCTION(8);SUBSIDIES CONSTRUCTION(9);SUBSIDIES CONSTRUCTION(10);SUBSIDIES CONSTRUCTION(11);SUBSIDIES CONSTRUCTION(12);SUBSIDIES CONSTRUCTION(13);SUBSIDIES CONSTRUCTION(14);SUBSIDIES CONSTRUCTION(15);SUBSIDIES CONSTRUCTION(16);SUBSIDIES CONSTRUCTION(17);SUBSIDIES CONSTRUCTION(18);SUBSIDIES CONSTRUCTION(19);SUBSIDIES CONSTRUCTION(20);SUBSIDIES CONSTRUCTION(21);SUBSIDIES CONSTRUCTION(22);SUBSIDIES CONSTRUCTION(23);SUBSIDIES CONSTRUCTION(24);SUBSIDIES CONSTRUCTION(25);SUBSIDIES CONSTRUCTION(26);SUBSIDIES CONSTRUCTION(27);SUBSIDIES CONSTRUCTION(28);SUBSIDIES CONSTRUCTION(29);SUBSIDIES CONSTRUCTION(30);SUBSIDIES CONSTRUCTION(31)`
costs_header = `${costs_header};SUBSIDIES HVAC(1);SUBSIDIES HVAC(2);SUBSIDIES HVAC(3);SUBSIDIES HVAC(4);SUBSIDIES HVAC(5);SUBSIDIES HVAC(6);SUBSIDIES HVAC(7);SUBSIDIES HVAC(8);SUBSIDIES HVAC(9);SUBSIDIES HVAC(10);SUBSIDIES HVAC(11);SUBSIDIES HVAC(12);SUBSIDIES HVAC(13);SUBSIDIES HVAC(14);SUBSIDIES HVAC(15);SUBSIDIES HVAC(16);SUBSIDIES HVAC(17);SUBSIDIES HVAC(18);SUBSIDIES HVAC(19);SUBSIDIES HVAC(20);SUBSIDIES HVAC(21);SUBSIDIES HVAC(22);SUBSIDIES HVAC(23);SUBSIDIES HVAC(24);SUBSIDIES HVAC(25);SUBSIDIES HVAC(26);SUBSIDIES HVAC(27);SUBSIDIES HVAC(28);SUBSIDIES HVAC(29);SUBSIDIES HVAC(30);SUBSIDIES HVAC(31)`
costs_header = `${costs_header};SUBSIDIES PV(1);SUBSIDIES PV(2);SUBSIDIES PV(3);SUBSIDIES PV(4);SUBSIDIES PV(5);SUBSIDIES PV(6);SUBSIDIES PV(7);SUBSIDIES PV(8);SUBSIDIES PV(9);SUBSIDIES PV(10);SUBSIDIES PV(11);SUBSIDIES PV(12);SUBSIDIES PV(13);SUBSIDIES PV(14);SUBSIDIES PV(15);SUBSIDIES PV(16);SUBSIDIES PV(17);SUBSIDIES PV(18);SUBSIDIES PV(19);SUBSIDIES PV(20);SUBSIDIES PV(21);SUBSIDIES PV(22);SUBSIDIES PV(23);SUBSIDIES PV(24);SUBSIDIES PV(25);SUBSIDIES PV(26);SUBSIDIES PV(27);SUBSIDIES PV(28);SUBSIDIES PV(29);SUBSIDIES PV(30);SUBSIDIES PV(31)`
var operational_co2_header = 'SCENARIO;BUILDING NAME;TOTAL HEATING AREA;YEAR_OF_CONSTRUCTION;FUNTION'
operational_co2_header = `${operational_co2_header};HEATING YEAR;HEATING MONTH(JAN);HEATING MONTH(FEB);HEATING MONTH(MAR);HEATING MONTH(APR);HEATING MONTH(MAY);HEATING MONTH(JUN);HEATING MONTH(JUL);HEATING MONTH(AUG);HEATING MONTH(SEPT);HEATING MONTH(OCT);HEATING MONTH(NOV);HEATING MONTH(DEC)`
operational_co2_header = `${operational_co2_header};DOMESTIC HOT WATER YEAR;DOMESTIC HOT WATER MONTH(JAN);DOMESTIC HOT WATER MONTH(FEB);DOMESTIC HOT WATER MONTH(MAR);DOMESTIC HOT WATER MONTH(APR);DOMESTIC HOT WATER MONTH(MAY);DOMESTIC HOT WATER MONTH(JUN);DOMESTIC HOT WATER MONTH(JUL);DOMESTIC HOT WATER MONTH(AUG);DOMESTIC HOT WATER MONTH(SEPT);DOMESTIC HOT WATER MONTH(OCT);DOMESTIC HOT WATER MONTH(NOV);DOMESTIC HOT WATER MONTH(DEC)`
operational_co2_header = `${operational_co2_header};COOLING YEAR;COOLING MONTH(JAN);COOLING MONTH(FEB);COOLING MONTH(MAR);COOLING MONTH(APR);COOLING MONTH(MAY);COOLING MONTH(JUN);COOLING MONTH(JUL);COOLING MONTH(AUG);COOLING MONTH(SEPT);COOLING MONTH(OCT);COOLING MONTH(NOV);COOLING MONTH(DEC)`
operational_co2_header = `${operational_co2_header};LIGHTS YEAR;LIGHTS MONTH(JAN);LIGHTS MONTH(FEB);LIGHTS MONTH(MAR);LIGHTS MONTH(APR);LIGHTS MONTH(MAY);LIGHTS MONTH(JUN);LIGHTS MONTH(JUL);LIGHTS MONTH(AUG);LIGHTS MONTH(SEPT);LIGHTS MONTH(OCT);LIGHTS MONTH(NOV);LIGHTS MONTH(DEC)`
operational_co2_header = `${operational_co2_header};APPLIANCES YEAR;APPLIANCES MONTH(JAN);APPLIANCES MONTH(FEB);APPLIANCES MONTH(MAR);APPLIANCES MONTH(APR);APPLIANCES MONTH(MAY);APPLIANCES MONTH(JUN);APPLIANCES MONTH(JUL);APPLIANCES MONTH(AUG);APPLIANCES MONTH(SEPT);APPLIANCES MONTH(OCT);APPLIANCES MONTH(NOV);APPLIANCES MONTH(DEC)`
operational_co2_header = `${operational_co2_header};ELECTRICITY YEAR;ELECTRICITY MONTH(JAN);ELECTRICITY MONTH(FEB);ELECTRICITY MONTH(MAR);ELECTRICITY MONTH(APR);ELECTRICITY MONTH(MAY);ELECTRICITY MONTH(JUN);ELECTRICITY MONTH(JUL);ELECTRICITY MONTH(AUG);ELECTRICITY MONTH(SEPT);ELECTRICITY MONTH(OCT);ELECTRICITY MONTH(NOV);ELECTRICITY MONTH(DEC)`
let meb_lines = []
let cost_lines = []
let operational_co2_lines = []
for (var scenario in results.results) {
var value = results.results[scenario];
value.forEach(building_info => {
const base_line = `"${scenario}";"${building_info.building}";${building_info.total_heating_area};${building_info.year_of_construction};${building_info.function}`
let meb = `${base_line}`
building_info['insel meb'].yearly_cooling_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_heating_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_cooling_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_heating_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_cooling_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_heating_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_cooling_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_heating_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_lighting_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_lighting_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_cooling_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_heating_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_cooling_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_heating_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_appliances_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_appliances_peak_load.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_lighting_electrical_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_lighting_electrical_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_appliances_electrical_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_appliances_electrical_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_on_site_electrical_production.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_on_site_electrical_production.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_domestic_hot_water_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_domestic_hot_water_heat_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_domestic_hot_water_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_domestic_hot_water_heat_demand.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].yearly_distribution_systems_electrical_consumption.forEach(element => meb = `${meb};${element}`)
building_info['insel meb'].monthly_distribution_systems_electrical_consumption.forEach(element => meb = `${meb};${element}`)
meb_lines.push(meb)
let cost = `${base_line};${building_info.costs.total_capital_costs_skin};${building_info.costs.total_capital_costs_systems};${building_info.costs.end_of_life_costs};${building_info.costs.total_operational_costs};${building_info.costs.total_maintenance_costs};${building_info.costs.operational_incomes}`
building_info.costs.global_capital_costs.B2010_opaque_walls.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.B2020_transparent.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.B3010_opaque_roof.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.B10_superstructure.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.D3020_heat_generating_systems.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.D3030_cooling_generation_systems.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.D3080_other_hvac_ahu.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.D5020_lighting_and_branch_wiring.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_costs.D301010_photovoltaic_system.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_end_of_life_costs.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_operational_costs.fixed_costs_electricity_peak.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_operational_costs.fixed_costs_electricity_monthly.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_operational_costs.variable_costs_electricity.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_operational_costs.fixed_costs_gas.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_operational_costs.variable_costs_gas.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_maintenance_costs.heating_maintenance.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_maintenance_costs.cooling_maintenance.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_maintenance_costs.pv_maintenance.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_operational_incomes.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_incomes.subsidies_construction.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_incomes.subsidies_hvac.forEach(element => cost = `${cost};${element}`)
building_info.costs.global_capital_incomes.subsidies_pv.forEach(element => cost = `${cost};${element}`)
cost_lines.push(cost)
let operational_co2 = `${base_line}`
building_info.operational_co2.Heating.year.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Heating.month.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2['Domestic Hot Water'].year.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2['Domestic Hot Water'].month.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Cooling.year.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Cooling.month.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Lights.year.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Lights.month.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Appliances.year.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Appliances.month.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Electricity.year.forEach(element => operational_co2 = `${operational_co2};${element}`)
building_info.operational_co2.Electricity.month.forEach(element => operational_co2 = `${operational_co2};${element}`)
operational_co2_lines.push(operational_co2)
})
}
require('fs').writeFile(
`${tmp_path}/retrofit_meb.csv`,
`${meb_header}\n${meb_lines.join('\n')}`,
function (err) { console.log(err ? err : 'meb saved') }
)
require('fs').writeFile(
`${tmp_path}/retrofit_cost.csv`,
`${costs_header}\n${cost_lines.join('\n')}`,
function (err) { console.log(err ? err : 'cost saved') }
)
require('fs').writeFile(
`${tmp_path}/retrofit_operational_co2.csv`,
`${operational_co2_header}\n${operational_co2_lines.join('\n')}`,
function (err) { console.log(err ? err : 'operational_co2 saved') }
)
BrowserWindow.fromId(1).webContents.send('task-completed', `<h3>${meb_lines.length} results returned</h3><br /> <a href="${tmp_path}/retrofit_meb.csv">meb</a><br /><a href="${tmp_path}/retrofit_cost.csv">costs</a><br /><a href="${tmp_path}/retrofit_operational_co2.csv">operational_co2</a>`)
}
else {
console.log('unautorized retrofit')
}
}
else {
console.log(response)
console.log(JSON.stringify(response))
console.log('unautorized session start')
}
}