-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
633 lines (587 loc) · 32.4 KB
/
index.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="grapick.min.css">
<link rel="stylesheet" href="styles.css" >
<script src="grapick.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.plot.ly/plotly-2.18.2.min.js"></script>
<link href="tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="tabulator.min.js"></script>
<title>A193</title>
</head>
<body>
<div class="test-wrapper">
<div class="parameter-list">
<div class="parameters">
<div class="info-tip">?</div>
<section class="parameter-section additional-parameter">
<label for="standard-deviation">
Среднеквадратическое<br> отклонение, мм
</label>
<input
type="text"
class="parameter additional-input"
id="standard-deviation"
>
</section>
<section class="parameter-section additional-parameter">
<label for="armor">Бронепробиваемость, мм</label>
<input
type="text"
class="parameter additional-input"
id="armor"
>
</section>
<section class="parameter-section additional-parameter">
<div class="dimension">
<label for="width">Ширина, мм</label>
<div class="dimension-tip" id="width-dimension">!</div>
</div>
<input
type="text"
class="parameter additional-input"
id="width"
>
</section>
<section class="parameter-section additional-parameter">
<div class="dimension">
<label for="height">Высота, мм</label>
<div class="dimension-tip" id="height-dimension">!</div>
</div>
<input
type="text"
class="parameter additional-input"
id="height"
>
</section>
<button class="console">Подтвердить</button>
<div class="warn-tip" id="gradient-alert">
Градиент был сохранен в файл gradient.json!
</div>
<div class="warn-tip" id="size-alert">
Проверьте корректность введённых габаритов!
</div>
<div class="warn-tip" id="armor-alert">
Броня была сохранена в файл armor.json!
</div>
<div class="warn-tip" id="armor-excel-alert">
Броня была сохранена в файл armor_excel.xlsx!
</div>
</div>
</div>
<div class="target-div-wrapper">
<div class="buttons">
<div>
<label for="file-input" class="upload_label side-button">
Загрузить фото
<input type="file" id="file-input">
</label>
<button class="download-armor side-button">Сохранить броню</button>
<label for="upload-armor" class="upload_label side-button">
Загрузить броню
<input type="file" id="upload-armor">
</label>
<button class="delete-armor side-button">Удалить всю броню</button>
<button class="delete-last-armor side-button big-side-button">Удалить последнюю броню</button>
<button class="reset side-button">Удалить точки</button>
<button class="grid side-button big-side-button">Аналитический расчёт</button>
<button class="monte-carlo side-button big-side-button">Расчёт по Монте-Карло</button>
<button class="obstacle side-button">Новая местность</button>
<button class="delete-obstacle side-button">Удалить местность</button>
<button class="download-armor-excel side-button big-side-button">Скачать броню в excel</button>
</div>
<div>
<button class="mock-tank side-button big-side-button">Подставить пробный танк</button>
</div>
</div>
<div class="test-container">
<div class="image-content-section">
<img src="" class="tank_image" id="file-wrapper" alt="">
<span id="test-message">Вставьте изображение танка</span>
<div class="obstacle-wrapper">
</div>
<div class="test-img-wrapper">
<div class="test">
</div>
</div>
<div class="target">
<div id="target-sigma2">
<div id="target-sigma1">
<div class="target-cross">+</div>
</div>
</div>
</div>
</div>
</div>
<div class="gradient"></div>
<div class="list"></div>
</div>
</div>
<h1>Статистика</h1>
<div class="tabs">
<button class="tab" id="analytics-mode">Аналитический метод</button>
<button class="tab" id="monte-carlo-mode">Метод Монте-Карло</button>
<button class="tab" id="battle-mode">Бой</button>
<button class="tab" id="tanks-list-mode">Каталог</button>
<button class="tab" id="other-mode">Другое</button>
<button class="tab" id="settings-mode">Настройки</button>
</div>
<div class="stat">
<div class="plots" id="analytics-plots">
<div class="plot-wrapper">
<div class="target-div" id="plotlyDiv">
</div>
<div class="target-div" id="plotlyDiv2d">
</div>
</div>
<div class="tip">
* В аналитическом методе препятствия не учитываются
</div>
</div>
<div class="plots" id="monte-carlo-plots">
<div class="additional-parameters">
<div class="parameters add-param">
<section class="parameter-section additional-parameter">
<label for="tree-number">
Количество деревьев (1-10)
</label>
<input
type="number"
class="parameter additional-input"
id="tree-number"
min="1"
max="10"
>
</section>
<section class="parameter-section additional-parameter">
<label for="tree-mean">
Средний диаметр дерева, мм
</label>
<input
type="number"
class="parameter additional-input"
id="tree-mean"
min="1"
>
</section>
<section class="parameter-section additional-parameter">
<label for="tree-std">
Среднеквадратическое отклонени диаметра дерева, мм
</label>
<input
type="number"
class="parameter additional-input"
id="tree-std"
min="1"
>
</section>
<hr/>
<section class="parameter-section additional-parameter">
<label for="rock-number">Количество камней (1-10)</label>
<input
type="number"
class="parameter additional-input"
id="rock-number"
>
</section>
<div class="rock-parameters-grid">
<section class="parameter-section additional-parameter">
<label for="rock-mean-width">Средняя ширина</label>
<input
type="number"
class="parameter additional-input mini-input"
id="rock-mean-width"
>
</section>
<section class="parameter-section additional-parameter">
<label for="rock-mean-height">Средняя высота</label>
<input
type="number"
class="parameter additional-input mini-input"
id="rock-mean-height"
>
</section>
<section class="parameter-section additional-parameter">
<label for="rock-std-width">с.к.о. ширины</label>
<input
type="number"
class="parameter additional-input mini-input"
id="rock-std-width"
>
</section>
<section class="parameter-section additional-parameter">
<label for="rock-std-height">с.к.о. высоты</label>
<input
type="number"
class="parameter additional-input mini-input"
id="rock-std-height"
>
</section>
</div>
<hr/>
<section class="parameter-section additional-parameter">
<label for="landscape-number">
Количество генераций ландшафта
</label>
<input
type="number"
class="parameter additional-input"
id="landscape-number"
min="1"
>
</section>
<div class="start-simulation">
<button id="simulation">Симуляция</button>
<span class="loader">Загрузка...</span>
</div>
</div>
</div>
<div class="target-div" id="monte-carlo-3d">
</div>
<div class="target-div" id="monte-carlo-2d">
</div>
</div>
<div class="plots" id="battle-plots">
<div class="additional-parameters">
<div class="parameters add-param">
<section class="parameter-section additional-parameter">
<label for="atgm-reload-time">
Время перезарядки ПТРК, с
</label>
<input
type="number"
class="parameter additional-input"
id="atgm-reload-time"
>
</section>
<section class="parameter-section additional-parameter">
<label for="atgm-aiming-time">
Время наведения ПТРК, с
</label>
<input
type="number"
class="parameter additional-input"
id="atgm-aiming-time"
min="0"
>
</section>
<section class="parameter-section additional-parameter">
<label for="missile-number">
Количество ракет ПТРК
</label>
<input
type="number"
class="parameter additional-input"
id="missile-number"
min="0"
>
</section>
<section class="parameter-section additional-parameter">
<label for="missile-speed">
Скорость полёта ПТУРа, м/c
</label>
<input
type="number"
class="parameter additional-input"
id="missile-speed"
min="0"
>
</section>
<hr>
<section class="parameter-section additional-parameter">
<label for="tank-reload-time">
Время перезарядки танка, с
</label>
<input
type="number"
class="parameter additional-input"
id="tank-reload-time"
min="0"
>
</section>
<section class="parameter-section additional-parameter">
<label for="tank-aiming-time">
Время наведения танка, с
</label>
<input
type="number"
class="parameter additional-input"
id="tank-aiming-time"
min="0"
>
</section>
<section class="parameter-section additional-parameter">
<label for="projectile-speed">
Скорость полёта снаряда танка, м/с
</label>
<input
type="number"
class="parameter additional-input"
id="projectile-speed"
min="0"
>
</section>
<section class="parameter-section additional-parameter">
<label for="tank-reaction-time">
Скорость реакции танка, с
</label>
<input
type="number"
class="parameter additional-input"
id="tank-reaction-time"
min="0"
>
</section>
<hr>
<div class="start-simulation">
<button id="battle-button">Бой</button>
<span class="loader">Загрузка...</span>
</div>
</div>
</div>
<div id="battle-plot">
</div>
<div class="table-section">
<div class="table-wrapper">
<div class="table-buttons">
<button class="white-button" id="add-row">Добавить ряд</button>
<button class="white-button" id="add-column">Добавить столбец</button>
</div>
<p>Матрица вероятностей попаданий в ПТРК</p>
<div class="battle-table-section" id="tank-table">
</div>
</div>
<div class="table-wrapper">
<p>Матрица вероятностей попаданий в танк</p>
<div class="battle-table-section" id="atgm-table">
</div>
</div>
<div class="table-wrapper battle-parameters">
<div id="color-picker">
<p>Цвета графика</p>
<div class="battle-table-section" id="result-table">
<div>
<input class="color-input" type="color" id="battleWin" name="battleWin"
value="#ed68b4">
<label for="battleWin">1</label>
</div>
<div>
<input class="color-input" type="color" id="battleTie" name="battleTie"
value="#87e65e">
<label for="battleTie">0</label>
</div>
<div>
<input class="color-input" type="color" id="battleLose" name="battleLose"
value="#4287f5">
<label for="battleLose">-1</label>
</div>
</div>
</div>
<div>
<section class="parameter-section additional-parameter">
<label for="battlePlotName"><span id="plot-header">Заголовок графика</span></label>
<textarea
class="text-area"
id="battlePlotName"
cols="30"
rows="3"
>
</textarea>
</section>
</div>
</div>
</div>
</div>
<div id="tanks-list" class="tanks">
<div class="tank-buttons-list">
<button class="tank-button" id="t-72">Т-72</button>
<button class="tank-button" id="t-80">Т-80</button>
<button class="tank-button" id="abrams">Абрамс</button>
<button class="tank-button" id="leopard">Леопард</button>
</div>
<div id="tank-info">
<div id="t-72-info" class="tank-info" >
<div class="image-wrapper">
<img src="assets/armors/t-72/t-72_angle.jpg" alt="T-72" class="tank-photo">
</div>
<div class="tank-info-text">
<p>
Т-72 «Урал» — советский основной танк. Самый массовый танк второго поколения. Принят на вооружение в Вооружённых Силах СССР с 1973 года. Т-72 разработан и производился Уралвагонзаводом в Нижнем Тагиле.
</p>
</div>
<div class="upload-catalog-armor-wrapper">
<button class="tank-button" id="set-t72-front">Установить лобовую броню</button>
<button class="tank-button" id="set-t72-side">Установить бортовую броню</button>
</div>
</div>
<div id="t-80-info" class="tank-info">
<div class="image-wrapper">
<img src="assets/armors/t-80/tank_ugol.png" alt="T-80" class="tank-photo">
</div>
<div class="tank-info-text">
<p>
Основной танк СССР 80-х и 90-х годов. Был принят на вооружение Советской армии 6 июля 1976 года, серийно изготавливался с 1976 по 1978 годы.
</p>
</div>
<div class="upload-catalog-armor-wrapper">
<button class="tank-button" id="set-t80-front">Установить лобовую броню</button>
<button class="tank-button" id="set-t80-side">Установить бортовую броню</button>
</div>
</div>
<div id="abrams-info" class="tank-info">
<div class="image-wrapper">
<img src="assets/armors/abrams/abrams_angle.png" alt="Abrams" class="tank-photo">
</div>
<div class="tank-info-text">
<p>
M1 Abrams — основной боевой танк США, серийно выпускается с 1980 года. Стоит на вооружении армии и морской пехоты США, а также вооружённых сил Египта, Австралии, Марокко и ряда ближневосточных государств. М1 «Абрамс» в настоящее время является одним из наиболее тяжёлых танков, его боевая масса превысила 62 т.
</p>
</div>
<div class="upload-catalog-armor-wrapper">
<button class="tank-button" id="set-abrams-front">Установить лобовую броню</button>
<button class="tank-button" id="set-abrams-side">Установить бортовую броню</button>
</div>
</div>
<div id="leopard-info" class="tank-info">
<div class="image-wrapper">
<img src="assets/armors/leopard/leopard_angle.png" alt="Leopard" class="tank-photo">
</div>
<div class="tank-info-text">
<p>
Леопард 2 – это немецкий основной боевой танк, пришедший на смену устаревшему Леопарду 1. Его базовый вариант был создан в конце 1970-х, но с тех пор танк множество раз модифицировался и улучшался, и последний его вариант является, по словам многих экспертов, лучшим танком в мире. В 1977 году было заказано серийное производство второго Леопарда, и в октябре 1979 первая машина была выпущена.
</p>
</div>
<div class="upload-catalog-armor-wrapper">
<button class="tank-button" id="set-leopard-front">Установить лобовую броню</button>
<button class="tank-button" id="set-leopard-side">Установить бортовую броню</button>
</div>
</div>
</div>
<div id="set-armor-wrapper">
</div>
</div>
<div class="hit-stat" id="other-plots">
<div class="plot">
<canvas id="canvas"></canvas>
</div>
<div class="target-div">
</div>
<div class="target-buttons">
<button class="drop1 target-control">1 точка</button>
<button class="drop100 target-control">100 точек</button>
<button class="target-button target-control">Прицел</button>
</div>
<div id="armor-info-wrapper">
<div class="armor-info">
</div>
</div>
<div id="probability-table">
</div>
</div>
<div class="plots" id="settings">
<div class="settings-wrapper">
<div>
<div class="colormap-section">
<div>
<span>Строить при расчёте сетку точек</span>
<input type="checkbox" name="dots-checkbox" id="dots-checkbox">
</div>
<div>
<span>Фиксированная шкала вероятности</span>
<input type="checkbox" name="color-checkbox" id="scale-checkbox" checked>
</div>
<div>
<span>Фиксированная цветовая шкала вероятности</span>
<input type="checkbox" name="color-checkbox" id="color-checkbox" checked>
</div>
<span class="colormap-label">Выберете расцветку графиков</span>
<select name="select" id="colormap-select">
<!--Supplement an id here instead of using 'name'-->
<option value="gradient">Свой градиент</option>
<option value="Viridis">Viridis</option>
<option value="YlOrRd">YlOrRd</option>
<option value="YlGnBu">YlGnBu</option>
<option value="RdBu" selected>RdBu</option>
<option value="Portland">Portland</option>
<option value="Picnic">Picnic</option>
<option value="Jet">Jet</option>
<option value="Hot">Hot</option>
<option value="Greys">Greys</option>
<option value="Greens">Greens</option>
<option value="Electric">Electric</option>
<option value="Earth">Earth</option>
<option value="Bluered">Bluered</option>
<option value="Blackbody">Blackbody</option>
</select>
</div>
<div class="colormap-plot">
</div>
</div>
<div class="title-name-section">
<div id="gradient-buttons">
<button class="gradient-button" id="save-gradient">
Сохранить градиент
</button>
<label for="upload-gradient" class="upload_label gradient-button" id="upload-gradient-label">
Загрузить градиент
<input type="file" id="upload-gradient">
</label>
</div>
<div id="gradient-picker">
</div>
<section class="parameter-section additional-parameter">
<label for="PlotName3d">Заголовок трехмерного графика</label>
<textarea
class="text-area"
id="PlotName3d"
cols="80"
rows="5"
>
</textarea>
</section>
<section class="parameter-section additional-parameter">
<label for="PlotName2d">Заголовок двумерного графика</label>
<textarea
class="text-area"
id="PlotName2d"
cols="80"
rows="5"
>
</textarea>
</section>
<p>*Для переноса строки в названии графика вставьте в место переноса <<span>br</span>> </p>
</div>
</div>
</div>
</div>
<div class="overlay hidden">
<div class="modal">
<p>
Программа предназначена для ознакомления с лабораторными работами по эффективности.<br><hr/>
1 работа - исследование изменения вероятности поражения танка в зависимости от дистанции и угла поражения.
Для проведения расчёта выберите "Аналитический расчёт".<br><hr/>
2 работа - исследования изменения вероятности поражения танка в зависимости от театра военных действий (местности),
дистанции и угла поражения.<br>
Для одиночного расчёта в разделе "Монте-Карло" выберите количество и размер препятствий и нажмите кнопку "Расчёт Монте-Карло". <br>
Для проведения симуляции с многочисленными генерациями случайной местности выберите также количество препятствий и количество генераций (Оптимальное количество - в районе 500) и нажмите "Симуляция".
По итогу симуляции находится средняя поверхность вероятности поражения.<br><hr>
</p>
<p>
Пара моментов:<br>
- Если после загрузки фото танка окно увеличилось по высоте, то проверьте корректность введённых габаритов.<br>
- Броня сохраняется в файле armor.json в папке программы.<br>
- В разделе "Другое" можно посмотреть как работает метод Монте-Карло.<br>
- Возможна ошибка с вероятностью больше 1. В таком случае перезугрузите приложение (Ctrl + R),
поставьте ту же броню и попробуйте ещё раз.
</p>
<br>
<p>Если вдруг найдете ошибки, будут идеи, комментарии и т.д. - напишите в лс пж</p>
<br>
<button class="close-modal">Пон</button>
</div>
</div>
<script src="./renderer.js"></script>
</body>
</html>