diff --git a/simulator/src/app.scss b/simulator/src/app.scss index 61f2a86..87f24b6 100644 --- a/simulator/src/app.scss +++ b/simulator/src/app.scss @@ -80,3 +80,18 @@ input[type=number] { .battery-charge-graph text { font-size: 10px; } + +input[name="parameters-accordion"], .panel-block { + display: none; +} + +label.panel-heading { + cursor: pointer; + display: block; +} + +#advanced-parameters:checked ~ .panel > .advanced-parameters-body, +#main-parameters:checked ~ .panel > .main-parameters-body { + display: flex; +} + diff --git a/simulator/src/simulator-ui.ts b/simulator/src/simulator-ui.ts index 5f04ee1..401c22d 100644 --- a/simulator/src/simulator-ui.ts +++ b/simulator/src/simulator-ui.ts @@ -2,7 +2,11 @@ interface SimulationParameters { batteryCapacity: number, + emptyVehicleWeight: number, + driverWeight: number, additionalWeight: number, + humanPower: number, + averageSpeed: number, climateZone: string, dailyDistance: number, dailyAscendingElevation: number @@ -13,7 +17,11 @@ function runSimulation(parameters: SimulationParameters): Simulator.SimulationRe let vehicle = new Simulator.Vehicle(); vehicle.batteryCapacity = parameters.batteryCapacity; + vehicle.emptyVehicleWeight = parameters.emptyVehicleWeight; + vehicle.driverWeight= parameters.driverWeight; vehicle.additionalWeight = parameters.additionalWeight; + vehicle.humanPower = parameters.humanPower; + vehicle.averageSpeed = parameters.averageSpeed; let solarIrradiance: number[] = climateData[parameters.climateZone.toLowerCase()]; let planning = new Simulator.OutingPlanning(parameters.dailyDistance, parameters.dailyAscendingElevation); @@ -56,7 +64,11 @@ function initializeSimulator(container: HTMLElement) { container.querySelector('.simulate-button').addEventListener('click', e => { let parameters: SimulationParameters = { batteryCapacity: Number((container.querySelector('[name=battery-capacity]')).value), + emptyVehicleWeight: Number((container.querySelector('[name=empty-weight]')).value), + driverWeight: Number((container.querySelector('[name=driver-weight]')).value), additionalWeight: Number((container.querySelector('[name=additional-weight]')).value), + humanPower: Number((container.querySelector('[name=human-power]')).value), + averageSpeed: Number((container.querySelector('[name=average-speed]')).value), climateZone: (container.querySelector('.zone-selector')).value, dailyDistance: Number((container.querySelector('[name=daily-distance]')).value), dailyAscendingElevation: Number((container.querySelector('[name=daily-elevation]')).value), diff --git a/simulator/src/simulator.html b/simulator/src/simulator.html index 6a13012..325e88e 100644 --- a/simulator/src/simulator.html +++ b/simulator/src/simulator.html @@ -1,110 +1,183 @@
-
-
-
- -
-
-
-

- -

-

- Wh -

+ + + +
+ +
+
+
+
+ +
+
+
+

+ +

+

+ Wh +

+
+
-
-
- -
-
- -
-
-
-

- -

-

- kg -

+ +
+
+ +
+
+
+

+ +

+

+ kg +

+
+
-
-
- -
-
- -
-
-
-
-
- + +
+
+ +
+
+
+
+
+ +
+
+

+ Choix sur la carte... +

-

- Choix sur la carte... -

-
-
- -
-
- -
-
-
-

- -

-

- km/jour -

+ +
+
+ +
+
+
+

+ +

+

+ km/jour +

+
+
-
-
- -
-
- -
-
-
-

- -

-

- m/jour -

+ +
+
+ +
+
+
+

+ +

+

+ m/jour +

+
+
+
- -
-
-
-
-
-

- Simuler -

+
+ + + + +
+ +
+
+
+
+ +
+
+
+

+ +

+

+ kg +

+
+
+
+ +
+
+ +
+
+
+

+ +

+

+ kg +

+
+
+
+ +
+
+ +
+
+
+

+ +

+

+ W +

+
+
+
+ +
+
+ +
+
+
+

+ +

+

+ km/h +

+
+
+ + Simuler