Skip to content

Commit

Permalink
Merge pull request #129 from HSLdevcom/master
Browse files Browse the repository at this point in the history
Release 4.1.1
  • Loading branch information
Jens West authored Dec 13, 2021
2 parents 1cc422c + 5cdd1df commit e0736a9
Show file tree
Hide file tree
Showing 26 changed files with 501 additions and 306 deletions.
75 changes: 44 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

[![Build Status](https://travis-ci.com/HSLdevcom/helmet-ui.svg?branch=master)](https://travis-ci.com/HSLdevcom/helmet-ui)

Desktop user interface for [Helmet 4.0 Model System](https://github.com/HSLdevcom/helmet-model-system) and [EMME - Multimodal Transport Planning Software](https://www.inrosoftware.com/en/products/emme/).
Desktop user interface for [Helmet 4 Model System](https://github.com/HSLdevcom/helmet-model-system) and
[EMME - Multimodal Transport Planning Software](https://www.inrosoftware.com/en/products/emme/).

## Development

This is an [Electron](https://electrojs.org) application written in JavaScript _([NodeJS API](https://nodejs.org/api/) and [Electron API](https://www.electronjs.org/docs/api) available within app)_, HTML and CSS.
This is an [Electron](https://electrojs.org) application written in JavaScript _([NodeJS API](https://nodejs.org/api/)
and [Electron API](https://www.electronjs.org/docs/api) available within app)_, HTML and CSS.

### Requirements

Expand All @@ -19,14 +21,16 @@ On Mac and Linux, [Wine](https://www.winehq.org/) and [Mono](https://www.mono-pr

### Setup

Due to tight integration with EMME, the application is mainly targeted for Windows but can be developed on Mac and Linux as well. However, the final testing should always happen on Windows with Emme.
Due to tight integration with EMME, the application is mainly targeted for Windows but can be developed on Mac and Linux as well.
However, the final testing should always happen on Windows with Emme.

```
$ git clone <this repository>
$ npm install
```

See [End-User Enviroment](#end-user-environment) for preparing the Windows environment for testing. EMME and EMME-Python versions can be set in [versions.js](src/versions.js), affecting the automatic resolving of Python binary.
See [End-User Enviroment](#end-user-environment) for preparing the Windows environment for testing.
EMME and EMME-Python versions can be set in [versions.js](src/versions.js), affecting the automatic resolving of Python binary.

### Running and building

Expand All @@ -36,19 +40,25 @@ See also: [Electronforge.io](https://www.electronforge.io/)

### Version Control

[Git](https://git-scm.com/) is used as the primary tool for version control and `master` branch is the main development line, aka. bleeding edge. All changes should be made in dedicated feature/bugfix branches, followed by a [pull request](https://help.github.com/en/articles/creating-a-pull-request) and a peer-review. Then, after all checks have passed, the branch may be merged in `master`.
[Git](https://git-scm.com/) is used as the primary tool for version control and `master` branch is the main development line, aka. bleeding edge.
All changes should be made in dedicated feature/bugfix branches, followed by a [pull request](https://help.github.com/en/articles/creating-a-pull-request) and a peer-review.
Then, after all checks have passed, the branch may be merged in `master`.

### Continuous Integration

The application is built automatically by [Travis CI](https://travis-ci.org/HSLdevcom/helmet-ui.svg?branch=master) when changes are pushed in master branch or pull requests are opened.
The application is built automatically by [Travis CI](https://travis-ci.org/HSLdevcom/helmet-ui.svg?branch=master)
when changes are pushed in master branch or pull requests are opened.

[Releases](https://github.com/HSLdevcom/helmet-ui/releases) are deployed automatically when changes are pushed in the `release` branch, which should be updated with `master` only to make new releases.
[Releases](https://github.com/HSLdevcom/helmet-ui/releases) are deployed automatically when changes are pushed in the `release` branch,
which should be updated with `master` only to make new releases.

### Publishing Releases

The Electron Forge's [Github publisher](https://www.electronforge.io/config/publishers/github) is used to upload files and draft a new release, thus avoiding the need to upload and tag releases manually.
The Electron Forge's [Github publisher](https://www.electronforge.io/config/publishers/github) is used to upload files and draft a new release,
thus avoiding the need to upload and tag releases manually.

The resulting draft must be reviewed, edited and approved in Github to make it publically available to everyone. This allows testing the package and making final fixes to it before making it public.
The resulting draft must be reviewed, edited and approved in Github to make it publically available to everyone.
This allows testing the package and making final fixes to it before making it public.

1. Test and bring all the desired changes in the `master` branch.
1. Remove if there's word `SNAPSHOT` in `version` field of [package.json](./package.json), and update version as per semver practises.
Expand All @@ -74,63 +84,66 @@ _Notice: you cannot create drafts with an existing version number (i.e. release

Before using Helmet UI, the following requirements must be met:

1. [Emme 4.4.X](https://www.inrosoftware.com/en/products/emme/) is installed, with active license/dongle.
1. [Emme 4.5.X](https://www.inrosoftware.com/en/products/emme/) is installed, with active license/dongle.
1. `%EMMEPATH%\programs` is set in user's `PATH` environment variable.
1. _[optionally]_ [Helmet 4.0 Model System](https://github.com/HSLdevcom/helmet-model-system) is downloaded and set up _(or let UI download it)_
1. _[optionally]_ [Helmet 4 Model System](https://github.com/HSLdevcom/helmet-model-system) is downloaded and set up _(or let UI download it)_

The Helmet UI installer can be downloaded from [releases](https://github.com/HSLdevcom/helmet-ui/releases), where the exe packages is found under the **Assets** of each release.

:warning: **The release packages are not signed at the moment so Windows will complain about it and prevents the installer from running. This can be overridden in either of two ways:**
:warning: **The release packages are not downloaded by many so Windows will complain about it and prevents the installer from running.
This can be overridden in either of two ways:**

- Simply by selecting "More info" ("Lisätiedot") and then clicking "Run anyway". (This option will probably work only if you have admin rights)
- By right-clicking the downloaded .exe-file, selecting Properties and ticking the box "Unblock".

![Unblock](docs/unblock.png)

The application installs itself in the user's `%HOMEPATH%/AppData` folder. The app itself is located under `AppData\Local`, while settings are persisted in `AppData\Roaming`. The settings should survive as-is when updating to newer version, assuming the new version is backwards compatible with the old settings.
The application installs itself in the user's `%HOMEPATH%/AppData` folder.
The app itself is located under `AppData\Local`, while settings are persisted in `AppData\Roaming`.
The settings should survive as-is when updating to newer version, assuming the new version is backwards compatible with the old settings.

On first start, the application attempts to find Emme installation on the workstation and download the latest version of [Helmet 4.0 Model System](https://github.com/HSLdevcom/helmet-model-system) scripts. The application will also run `pip install`. The EMME Python path setup may fail if `EMMEPATH` environment variable is not set or the application is installed in an unusual way. If this is the case, you must set the location of Python executable manually in the setting dialog (Asetukset), along with the location of Scripts folder.
On first start, the application attempts to find Emme installation on the workstation and download the latest version of
[Helmet 4.0 Model System](https://github.com/HSLdevcom/helmet-model-system) scripts.
The application will also run `pip install`.
The EMME Python path setup may fail if `EMMEPATH` environment variable is not set or the application is installed in an unusual way.
If this is the case, you must set the location of Python executable manually in the setting dialog (Asetukset), along with the location of Scripts folder.

### Settings

- Emme Python executable
- This **must** be the `python.exe` shipped with Emme to meet some special dependencies.
- e.g. `C:\Program Files\INRO\Emme-4.4.2\Python27\python.exe`
- The `Scripts` folder of [Helmet 4.0 Model System](https://github.com/HSLdevcom/helmet-model-system)
- e.g. `C:\Program Files\INRO\Emme-4.5.0\Python37\python.exe`
- The `Scripts` folder of [Helmet 4 Model System](https://github.com/HSLdevcom/helmet-model-system)
- This is the Python backend doing most of the work.
- This can be updated to a fresh/updated version by clicking "Lataa eri versio...". This will not overwrite your old (tweaked) scripts, it will always save the scripts in a new directory.
- This can be updated to a fresh/updated version by clicking "Lataa eri versio...".
This will not overwrite your old (tweaked) scripts, it will always save the scripts in a new directory.
- It can also be set to an existing folder on your computer.
- Project directory
- This is where your model run specifications (.json) will be saved.
- Base data directory
- This is where base demand matrices and base year (2016) data are located
- This is where base demand matrices and base year (2018) data are located
- Result data directory
- This is where you want your model run results to be saved

### Model run setup

**Need to update this!**
For each HELMET scenario you want to run, you must also specify the following:

1. Scenario/run name
1. Emme project file (`.emp`)
1. The number of the Emme scenario where the bike network is located (usually 19), this scenario must be followed by the walk scenario and three time-dependent car and transit scenarios (aht, pt, iht).
1. Folder containing the input data.
2. Emme project file (`.emp`)
3. The number of the Emme scenario where the bike network is located (usually 19),
this scenario must be followed by the walk scenario and three time-dependent car and transit scenarios (aht, pt, iht).
4. Folder containing the input data.
- e.g. `c:\Helmet\helmet-model-system\Scenario_input_data\2030`
1. Whether or not you have a pre-calculated transit cost matrix (located in the results folder for this scenario)
1. Number of iterations to be executed
5. Whether or not you have a pre-calculated transit cost matrix (located in the results folder for this scenario)
6. Number of iterations to be executed

This is the download link that can be handed to users, along with an advice to download the latest version, i.e. the first one on the list.

- https://github.com/HSLdevcom/helmet-ui/releases

The package to be downloaded is named `Helmet.4.0.UI-x.y.z.Setup.exe`, where the `x.y.z` corresponds to the application version.

## TODO & Known Problems

As of 2020-03-17:

1. The application is not [signed](https://electronjs.org/docs/tutorial/code-signing), causing the anti-virus software and Windows to consider it suspicious.
- Fix: aqcuire a certificate and add it to the [build process](https://www.electronforge.io/config/makers/squirrel.windows) to enable signing
The package to be downloaded is named `Helmet.4.1.UI-x.y.z.Setup.exe`, where the `x.y.z` corresponds to the application version.

## Version history

Expand Down
8 changes: 5 additions & 3 deletions docs/kaytto-ohje.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Mallin ajoa varten tulee määritellä seuraavat asetukset.

- Suorituskelpoinen Emme Python
- Tämän **on oltava** Emmen mukana tullut ’python.exe’, jotta tietyt edellytykset täyttyvät.
- esim. `C:\Program Files\INRO\Emme\Emme 4\Emme-4.5.0\Python27\python.exe`
- esim. `C:\Program Files\INRO\Emme\Emme 4\Emme-4.5.0\Python37\python.exe`
- GitHubin [Helmet 4.1 Model System](https://github.com/HSLdevcom/helmet-model-system)-sivuston kansio ’Scripts’
- Kansiossa ovat järjestelmän käyttämät Python-ohjelmat.
- Version päivitys voidaan tehdä klikkaamalla "Lataa eri versio...". Nämä eivät korvaa skriptien vanhoja versioita,
Expand All @@ -87,13 +87,15 @@ Mallin ajoa varten tulee määritellä seuraavat asetukset.
- Tänne talletetaan Helmet-skenaarioiden (malliajojen) määrittelyt (.json)
- Tämä **ei** siis viittaa Emmen projektitiedostoon (.emp)
- Lähtödatan sisältävä kansio
- Tässä ovat omissa alakansioissaan pohjakysyntämatriisit ja nykytilanteen syöttötiedot (2016)
- Tässä ovat omissa alakansioissaan pohjakysyntämatriisit ja nykytilanteen syöttötiedot (2018)
- Kansion sisällön saa HSL:ltä (ks. [lähtötietotiedostojen ohje](mallin_lahtotietotiedostot.md))
- Tulosten tallennuspolku
- Tänne talletetaan ennusteajojen tulokset

Näiden asetusten lisäksi on kehittäjille tarkoitettuja asetuksia helmet-model-system -kansion tiedostossa `dev-config.json`.
Näihin ei ole tavalliselle käyttäjälle yleensä syytä koskea, mutta joissain tapauksissa hyödyllinen asetusmahdollisuus ei ole vielä implementoitu käyttöliittymään.
Lisää tietoja `dev-config.json`-tiedoston asetuksista löytyy
[tästä](https://github.com/HSLdevcom/helmet-model-system/tree/olusanya/Scripts#configuring-the-model-run-with-dev-configjson).

### Malliajon määrittely

Expand All @@ -117,7 +119,7 @@ Jokaista ajettavaa HELMET-skenaariota kohden on tehtävä seuraavat määrittely
7. Valinta, poistetaanko sijoittelun strategiatiedostot malliajon jälkeen.
8. Valinta, tallennetaanko eri ajanjaksot erillisiin Emme-skenaarioihin.
9. Valinta, tallennetaanko mm. joukkoliikenteen matka-ajan osamatriisit (in-vehicle time, first
waiting time, jne.) talteen. Malliajoon ja hankearviointiin tarpeelliset matriisit tallennetaan
waiting time, jne.). Malliajoon ja hankearviointiin tarpeelliset matriisit tallennetaan
aina .omx-muodossa riippumatta tästä valinnasta.
- Mikäli halutaan useiden Helmet-skenaarioiden kaikki Emme-matriisit talteen samaan
Emme-projektiin (.emx-tiedostoihin), voidaan lisäksi ennen jokaista malliajoa määrittää
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "helmet-ui",
"productName": "Helmet 4.1",
"version": "4.1.0",
"version": "4.1.1",
"description": "Helmet 4 Model System UI",
"main": "src/main/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ let mainWindow, entrypointWorkerWindow, cbaWorkerWindow, useMockAssignmentInstea
async function createUI() {
// Render main window including UI (index.html linking to all UI components)
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
width: 1300,
height: 1200,
resizable: false,
maximizable: false,
fullscreen: false,
Expand Down
53 changes: 36 additions & 17 deletions src/renderer/components/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@ body {
padding: 0;
position: relative;
background: #ffffff;
font-size: 8pt;
font-size: 18px;
font-family: gotham_rounded_medium, sans-serif;
}

button {
display: flex;
align-items: center;
justify-content: center;
background-color: #ffffff;
color: #007AC9;
border: 1px solid #888888;
min-width: 120px;
height: 30px;
padding: 0 20px;
border-radius: 37px;
outline: none;
text-decoration: none;
height: 44px;
padding: 0 26px;
border-radius: 25px;
font-family: inherit;
font-size: inherit;
letter-spacing: -0.5px;
font-weight: 350;
}

button:hover {
Expand All @@ -39,6 +41,16 @@ input {
padding: 0 0.25em;
}

input[type="checkbox"] {
background: #FFFFFF;
border: 1px solid #888888;
box-sizing: border-box;
border-radius: 3px;
width: 30px;
height: 30px;
margin: 0;
}

hr {
border-top: 1px solid black;
border-bottom: none;
Expand All @@ -62,31 +74,38 @@ hr {
height: 100%;
}

.App__open-settings-btn {
.App__open-settings {
position: absolute;
right: 0;
margin-right: 10px;
margin-top: 10px;
top: 87px;
right: 58px;
width: 24px;
height: 24px;
background-color: #ffffff;
background-image: url('Settings.png');
background-repeat: no-repeat;
}

.App__header {
height: 50px;
display: flex;
align-items: center;
height: 70px;
background-color: #007AC9;
background-image: url('pylvasdiagrammi_valkoinen.png'), url('hsl_logo_valkoinen.png');
background-size: auto, 102px 41px;
background-position: 10px, 97%;
background-size: 41px 41px, 102px 41px;
background-position: left 15px center, right 15px center;
background-repeat: no-repeat, no-repeat;
color: #ffffff;
font-size: 20pt;
padding: 30px 0 0 75px;
font-size: 24px;
padding: 0 0 0 85px;
font-weight: normal;
letter-spacing: -0.02em;
}

.App__header-title {
}

.App__header-version {
font-size: 40%;
font-size: 60%;
}

.App__body {
Expand Down
18 changes: 7 additions & 11 deletions src/renderer/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,9 @@ const App = ({helmetUIVersion, versions, searchEMMEPython}) => {

{/* UI title bar, app-version, etc. */}
<div className="App__header">
<span className="App__header-title">Helmet 4.0</span>
<span className="App__header-title">Helmet 4.1</span>
&nbsp;
<span className="App__header-version">{`UI v${helmetUIVersion}`}</span>
</div>
<div>
<button className="App__open-settings-btn"
style={{display: isSettingsOpen ? "none" : "block"}}
onClick={(e) => setSettingsOpen(true)}
disabled={isProjectRunning}
>
Projektin asetukset
</button>
<span className="App__header-version">{`UI ${helmetUIVersion}`}</span>
</div>

{/* HELMET Project -specific content, including runtime- & per-scenario-settings */}
Expand All @@ -202,6 +193,11 @@ const App = ({helmetUIVersion, versions, searchEMMEPython}) => {
signalProjectRunning={setProjectRunning}
/>
</div>

<div className="App__open-settings"
style={{display: isSettingsOpen | isProjectRunning ? "none" : "block"}}
onClick={(e) => setSettingsOpen(true)}
></div>
</div>
)
};
Binary file added src/renderer/components/Edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e0736a9

Please sign in to comment.