now windows it's selected based on id not in focus
This commit is contained in:
parent
610ad66475
commit
9c81a2b241
|
@ -2,6 +2,8 @@ const { dialog, BrowserWindow } = require ("electron");
|
||||||
const dotenv = require('dotenv')
|
const dotenv = require('dotenv')
|
||||||
const session_start = 'https://nextgenerations-cities.encs.concordia.ca/api/v1.4/session/start'
|
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 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/retrofit-results'
|
||||||
|
|
||||||
|
|
||||||
exports.run = async (application, buildings, tmp_path) => {
|
exports.run = async (application, buildings, tmp_path) => {
|
||||||
|
@ -24,6 +26,7 @@ exports.run = async (application, buildings, tmp_path) => {
|
||||||
const application_response = await response.json()
|
const application_response = await response.json()
|
||||||
const session_id = response.headers.get('session_id')
|
const session_id = response.headers.get('session_id')
|
||||||
let token = response.headers.get('token')
|
let token = response.headers.get('token')
|
||||||
|
console.log(`token: ${token}`)
|
||||||
request = { 'scenarios': [] }
|
request = { 'scenarios': [] }
|
||||||
application_response.scenarios.forEach((scenario) => {
|
application_response.scenarios.forEach((scenario) => {
|
||||||
scenario_request = {}
|
scenario_request = {}
|
||||||
|
@ -40,7 +43,8 @@ exports.run = async (application, buildings, tmp_path) => {
|
||||||
'accept': 'application/json'
|
'accept': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify(request)
|
body: JSON.stringify(request)
|
||||||
})
|
}, 600000)
|
||||||
|
console.log(`response: ${response.status}`)
|
||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
results = await response.json()
|
results = await response.json()
|
||||||
|
|
||||||
|
@ -184,7 +188,7 @@ exports.run = async (application, buildings, tmp_path) => {
|
||||||
`${operational_co2_header}\n${operational_co2_lines.join('\n')}`,
|
`${operational_co2_header}\n${operational_co2_lines.join('\n')}`,
|
||||||
function (err) { console.log(err ? err : 'operational_co2 saved') }
|
function (err) { console.log(err ? err : 'operational_co2 saved') }
|
||||||
)
|
)
|
||||||
BrowserWindow.getFocusedWindow().webContents.send('task-completed', '<a href="../../tmp/meb.csv">meb</a><br /><a href="../../tmp/cost.csv">costs</a><br /><a href="../../tmp/operational_co2.csv">operational_co2</a>')
|
BrowserWindow.fromId(1).webContents.send('task-completed', '<a href="../../tmp/meb.csv">meb</a><br /><a href="../../tmp/cost.csv">costs</a><br /><a href="../../tmp/operational_co2.csv">operational_co2</a>')
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('unautorized retrofit')
|
console.log('unautorized retrofit')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user