Correct issues with gml files and ep_workflow

This commit is contained in:
Guille Gutierrez 2022-06-07 13:18:07 -04:00
parent 8d3cf3a341
commit 9fa55f2ca3
6 changed files with 25 additions and 13 deletions

View File

@ -1,10 +1,9 @@
const { dialog } = require('@electron/remote')
const { Console } = require('console')
const { app, BrowserWindow, Notification } = require('electron')
const { app, BrowserWindow, Notification, electron } = require('electron')
const { get } = require('http')
const path = require('path')
let {PythonShell} = require('python-shell')
function showNotification () { new Notification({ title: 'NOTIFICATION_TITLE', body: 'event_text' }).show()}
@ -50,12 +49,10 @@ function plot_results() {
labels: dates,
datasets: [{
label: 'Heating (J)',
//backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: heating
},
{ label: 'Cooling (J)',
//backgroundColor: 'rgb(132, 99, 255)',
borderColor: 'rgb(132, 99, 255)',
data: cooling
}]

View File

@ -2,9 +2,11 @@
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="script-src 'self';">
<link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./css/base.css">
<link rel="icon" type="image/svg+xml" href="./img/favicon.svg">
<title>Energy+ Workflow v1.0</title>
</head>
<body>

View File

@ -10,7 +10,7 @@ function createWindow () {
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false,
devTools: false,
devTools: true,
preload: path.join(__dirname, 'init.js')
}
})

View File

@ -1,16 +1,21 @@
import sys
from pathlib import Path
import csv
sys.path.append('../hub')
try:
sys.path.append('./')
from imports.customized_imports_factory import CustomizedImportsFactory
from imports.customized_imports.stochastic_schedules_importer import StochasticSchedulesImporter as ssi
from imports.geometry_factory import GeometryFactory
from imports.construction_factory import ConstructionFactory
from imports.usage_factory import UsageFactory
from exports.exports_factory import ExportsFactory
from imports.customized_imports_factory import CustomizedImportsFactory
from imports.customized_imports.stochastic_schedules_importer import StochasticSchedulesImporter as ssi
try:
gml = ''
for argument_tuple in sys.argv[1:]:
print(argument_tuple)
argument = argument_tuple.split(' ')
option = argument[0]
value = argument[1]
@ -22,9 +27,15 @@ try:
print(f'city created from {gml}')
for building in city.buildings:
building.year_of_construction = 2006
if building.function is None:
building.function = 'large office'
ConstructionFactory('nrel', city).enrich()
print('enrich constructions... done')
UsageFactory('comnet', city).enrich()
for building in city.buildings:
for internal_zone in building.internal_zones:
for usage_zone in internal_zone.usage_zones:
print(usage_zone.occupancy.occupancy_schedules)
print('enrich usage... done')
in_path = (Path(__file__).parent.parent / 'data' / 'occupancyschedules_2019_point4.xlsx')
CustomizedImportsFactory(ssi, city, in_path).enrich()
@ -59,7 +70,9 @@ try:
print(f'info: {idf_file}, {csv_file}, {eso_file}, {area}, {volume}, {obj_file}')
print('[simulation end]')
except Exception as ex:
print(ex)
print('error: ', ex)
print('[simulation abort]')
sys.stdout.flush()