-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.jl.html
184 lines (171 loc) · 8.17 KB
/
app.jl.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<style>
.stipple-core .container > .row > .st-col > .row:not(:first-child),
.stipple-core .st-dashboard > .row > .st-col > .row:not(:first-child) {
margin-top: 0rem;
}
</style>
<div class="row" style="padding-top: 0px;">
<div class="st-col st-module col-3">
<div>
<h1>Inputs</h1>
</div>
<!-- <h3>
Select track and weather data
</h3> -->
<!-- <h3>Specify route and weather data</h3> -->
<q-select v-model="selected_track" :options="track_files" label="Select track" emit-value/>
<q-select v-model="selected_weather" :options="weather_files" label="Select weather" style="margin-top: 0px"/>
<br/>
<h4>Select starting point</h4>
<div class="q-pa-md">
<q-badge color="secondary">
Starting point # {{ start_index }}
</q-badge>
<q-slider v-model="start_index" :min="1" :max="max_track_index" label="true">slider text</q-slider>
</div>
<div class="row">
<q-input label="Latitute" type="number" v-model.number="latitude_in" :disable="track_not_selected" style="width: 30%; margin-right: 5%;"></q-input>
<q-input label="Longitude" type="number" v-model.number="longitude_in" :disable="track_not_selected" style="width: 30%; margin-right: 5%;"></q-input>
<q-btn label="Find point" color="primary" v-on:click="selecting_location = !selecting_location"
style="font-size: 10;"></q-btn>
</div>
<h3>Simulation parameters</h3>
<div>
<!-- <q-date v-model="start_datetime" mask="YYYY-MM-DD HH:mm" color="purple" title="Date" now-btn :dense="true" style="max-width: 20%"/>
<q-time v-model="start_datetime" mask="YYYY-MM-DD HH:mm" color="purple" title="Time" now-btn style="width: 20%" format24h/> -->
<template>
<div class="q-pa-md">
<q-input filled v-model="start_datetime">
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-date v-model="start_datetime" mask="YYYY-MM-DD HH:mm:ss">
<div class="row items-center justify-end">
<q-btn v-close-popup label="Close" color="primary" flat />
</div>
</q-date>
</q-popup-proxy>
<q-tooltip class="bg-accent">Select date</q-tooltip>
</q-icon>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
<q-time v-model="start_datetime" mask="YYYY-MM-DD HH:mm:ss" now-btn format24h with-seconds>
<div class="row items-center justify-end">
<q-btn v-close-popup label="Close" color="primary" flat />
</div>
</q-time>
</q-popup-proxy>
<q-tooltip class="bg-accent">Select time</q-tooltip>
</q-icon>
</template>
<template v-slot:append>
<q-btn icon="update"
v-on:click="set_time = !set_time">
<q-tooltip class="bg-accent">Set current time and date</q-tooltip>
</q-icon>
</template>
<!-- <template v-slot:append>
<q-btn icon="update"
v-on:click="set_time = !set_time"></q-icon>
</template>
<template v-slot:append>
<q-btn icon="access_time"
v-on:click="set_time = !set_time"></q-icon>
</template> -->
</q-input>
</div>
</template>
</div>
<!-- <h3>Simulation parameters</h3> -->
<q-input label="Energy in system (W*h)" type="number" v-model.number="start_energy"></q-input>
<q-input label="Subtasks scaling" type="number" v-model.number="subtasks_scaling_coef"></q-input>
<q-input label="Input speeds scaling" type="number" v-model.number="speeds_scaling_coef"></q-input>
<br/>
<!-- <br/> -->
<!-- <q-timeline-entry></q-timeline-entry> -->
<!-- something I don't really need: https://quasar.dev/vue-components/timeline -->
<!-- button to submit<br /> -->
<!-- <q-btn :label="Start calculation" :type="submit" :color="primary"/> -->
<q-btn
label="Start calculation"
color="primary"
style="width: 80%; margin-left: 10%; margin-right: 10%;"
:loading="is_calculating"
:percentage="calculation_progress"
v-on:click="calculating = !calculating"
>
<template v-slot:loading>
<q-spinner-gears class="on-left" />
Calculating...
</template>
</q-btn>
<q-dialog v-model="calculation_alert">
<q-card>
<q-card-section>
<div class="text-h6">Alert</div>
</q-card-section>
<q-card-section class="q-pt-none">
Choose all the data first! (track, weather, starting point and datetime)
</q-card-section>
<q-card-actions align="right">
<q-btn flat label="OK" color="primary" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
<br/>
<!-- https://youtu.be/dffZTCDpiRs?t=2609 -->
</p>
</div>
<div class="st-col st-module col-4">
<div class="column">
<div class="st-col st-module col">
<div>
<h1>Map</h1>
</div>
<plotly :data="track_traces" :layout="track_layout" style="max-width: inherit;"></plotly>
</div>
<div class="st-col st-module col">
<div>
<h1>
Results
</h1>
</div>
<div v-if="results_ready">
<p>Travel time is {{travel_time}} seconds.</p>
<p>Projected finish time is {{finish_time}}</p>
<p>Average speed is {{average_speed}} km/h</p>
<!-- <p>Maximum energy is {{max_energy}}</p> -->
<p>Minimum energy is {{min_energy}} Wt*h</p>
</div>
<div v-if="!results_ready" style="height: 250px;">
<p>Start calculation to see the results</p>
</div>
</div>
</div>
<!-- <plotly :data="track_traces" :layout="track_layout" style="max-width: inherit;"></plotly> -->
</div>
<div class="st-col st-module col">
<div>
<h1>Suggested strategy</h1>
</div>
<plotly v-if="!track_not_selected" :data="track_altitude_traces" :layout="track_altitude_layout"></plotly>
<div v-if="track_not_selected" style="height: 250px;">
<p>Select the track to see the track profile</p>
</div>
<plotly v-if="results_ready" :data="speeds_traces" :layout="speeds_layout"></plotly>
<div v-if="!results_ready" style="height: 250px;">
<p>Start calculation and wait until results are ready to see the speed graph</p>
</div>
<plotly v-if="results_ready" :data="energies_traces" :layout="energies_layout"></plotly>
<div v-if="!results_ready" style="height: 250px;">
<p>Start calculation and wait until results are ready to see the energy graph</p>
</div>
</div>
<!-- <div class="st-col st-module col-sm">
<div>
<h1>Other content</h1>
</div>
<q-uploader label="Upload track data" accept=".csv" multiple="false" method="POST" url="http://localhost:9101/track" field-name="csv_file_track"></q-uploader>
<q-uploader label="Upload weather data" accept=".json" multiple="false" method="POST" url="http://localhost:9101/weather" field-name="csv_file_weather"></q-uploader>
</div> -->
</div>