-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1192 lines (913 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
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Vessel mechineries">
<meta name="author" content="Azibodusi Osain">
<title>Ship mechineries analysis and emission prediction base on the mechineries</title>
<!-- Bootstrap Core CSS -->
<!--<link href="libs/bootstrap.min.css" rel="stylesheet"> -->
<!-- Bootstrap Core JavaScript -->
<!-- <script src="libs/bootstrap.min.js"></script> -->
<!--Import master script-->
<script src="machinery.js"></script>
<!--Import library-->
<!-- <script src="../build/vessel.js"></script> -->
</head>
<body>
<style>
/* Nav bar */
.topnav {
overflow: hidden;
background-color: #333;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav a.active {
background-color: #4CAF50;
color: white;
}
.container {
margin: auto;
text-align: center;
padding: auto;
}
.form{
display: block;
margin: auto;
}
.hide {
display: none;
}
.border {
border: solid gray 2px;
}
.row{
display: flex;
}
.mainContainer {
margin-top: 20px;
border: solid gray 2px;
/* background-color: */
/* display: flex; */
}
.libDisplay {
align-items: center;
margin-top: 15px;
margin-bottom:15px;
}
table,td,th {
border: 1px solid #ddd;
/* padding: 1px; */
}
thead{
background-color: blueviolet;
text-align: center;
text-transform: uppercase;
text-decoration-color: #f2f2f2;
column-span: all;
-webkit-column-span: 2;
}
tr:nth-child(even){background-color: #f2f2f2;}
tr:hover {background-color: #ddd;}
/* */
#myTable1, #myTable2, #myTable3, #myTable4, #myTable5{
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
/* border-collapse: collapse; */
border-spacing: 1px;
margin: 2px;
width: 100%;
}
.myTable1, .myTable2, .myTable3, .myTable4, .myTable5{
/* border-collapse: collapse; */
border-spacing: 1px;
border: 1px solid rgb(102, 79, 79);
margin: 10px;
}
/* .myTable1, .myTable2,.myTable3{
width: 50%;
} */
#libHeader{
width: 100%;
}
.gridrow{
display: grid;
grid-template-rows: 1fr;
grid-template-columns: auto;
grid-auto-flow: column;
}
.myTable4{
grid-row: 2;
grid-column: 1;
}
.myTable5 {
grid-row: 2;
grid-column: 2;
}
.update{
border: solid red 5px;
margin: auto;
}
button{
margin-left: 50%;
margin-bottom: 20px;
}
.propulsion {
margin-left: 35%;
}
h3, h2,p {
text-align: center;
}
.notics{
background-color: red;
text-align: center;
}
.column {
flex: 50%;
padding: 40px;
}
.range {
width: 60%;
margin: auto;
}
p {
padding-left: 10%;
}
.inputValue {
padding-left: 15px;
}
</style>
<div class="topnav">
<a class="active" href="#home">Home</a>
<a href="https://github.com/osain-az/Vessel-Machinery">GitHub Rep</a>
<a href="introduction/">Introduction </a>
<a href="Flowchat/"> Flowchat and Status </a>
<!-- <a href="#about"></a> -->
</div>
<div class="col-md-12 text-center">
</div>
<div class="container" >
<h1>Ship machinery and analysis </h1>
</div>
<div class="border">
<h4>this section is used for analysis and estimation of required volume of tank, fuel consumption in tonnes, and the requied power for propulsion based on the information provided . This is a Preliminary stage, digital twins of the machinery will be added for complex interaction of machinery </h4>
<form id="simple_form" class="form">
<p class="P_range">Ship resistance kN: <input type="range" max="10000" min="10" id="resistance" class="range" onchange="getValues(event)"> or
<input type="text" onchange="getValues(event)" id="resistanceInput"><span class="inputValue"id="resistanceValue"> </span><br> </p>
<p> Ship speed Knots: <input type="range" max="60" min="5"id="speed" class="range" onchange="getValues(event)"> or
<input type="text" onchange="getValues(event)" id="speedinput"><span class="inputValue" id="speedValue"> </span><br> </p>
<p> max voyage in days: <input type="range" max="20" min="0.5" id="voyage" class="range" onchange="getValues(event)">or
<input type="text" onchange="getValues(event)" id="voyageInput"><span class="inputValue" id="voyageValue"> </span> </p>
</form>
<div class="column " id="">
<select id="choosefuel" onchange="sellectFuel(event)">
<option value="" selected>Fuel Alternative</option>
<option value="LNG">LNG</option>
<option value="hydrogen">Hydrogen</option>
<option value="MGO">MGO</option>
<option value="MDO">MDO</option>
<option value="HFO">HFO</option>
</select>
</div>
</div>
</div>
<div class="">
<h3>choose the propulsion system that apply to your vessel to display relevant machinery library </h3>
<div class="propulsion column" id="propulsion">
<select onchange="choosePropulsion(event)" id="propulsion" >
<option value="" selected>Type of Propulsion system </option>
<option value="diesel">Diesel Propulsion</option>
<option value="dieselElectric">Diesel-Electric Propulsion</option>
<option value="LNG">LNG propulsion</option>
<option value="Hybrid">Hybrid Propulsion</option>
<option value="battery">battery Propulsion</option>
</select>
</div>
</div>
</div>
<div class="mainContainer hide" id="mainContainer">
<h3 class="machinery_h3">Machery library</h3>
<div class=" row ">
<div class="BMS column " onchange="batteryLibray(event)" id="BMS">
<strong><p>choose the battery supplier and the model </p></strong>
<select>
<option value="" selected>choose battery supplier</option>
<option value="orcaPower">Corvus/Orca Power</option>
<option value="orcaEnergy">Corvus Orca Energy</option>
<option value="PBESPB1">PBES PB1</option>
<option value="blueWhale">Blue Whale</option>
</select>
</div>
<div class="engine column" onchange="libraryDisplay(event)" id="engine" >
<strong><p>choose engine supplier</p></strong>
<select >
<option value="" selected><strong>Choose engine supplier</strong> </option>
<option value="kongsberg">Kongsberg</option>
<option value="wartsilaEngine">Wartsila</option>
<!-- <option value=""></option>
<option value=""></option> -->
</select>
</div>
<div class="genSet column hide" id="genSet">
<strong><p>Choose the avaliable GenSet supplier</p></strong>
<select onchange="libraryDisplay(event)">
<option value="" selected>Genset</option>
<option value="kongsbergGenset">Kongsberg</option>
<option value="wartsilaGenset">Wartsila</option>
<!-- <option value=""></option> -->
<!-- <option value=""></option> -->
</select>
</div>
<div class="propellers column" id="propellers">
<strong><p>Choose the avaliable Propeller supplier</p></strong>
<select onchange="libraryDisplay(event)">
<option value="" selected>Propeller supplier </option>
<option value="ABBProp">ABB</option>
<!-- <option value="RRMProp">RRM</option> -->
<option value="kongsbergProp">Kongsberg</option>
<!-- <option value="wartsilaProp">Wartsila</option> -->
</select>
</div>
<div class="thruster column " id="thruster">
<strong><p>Choose the avaliable thrsuter supplier<p></strong>
<select onchange="libraryDisplay(event)">
<option value="" selected>thruster suppler </option>
<option value="ABBthruster">ABB</option>
<!-- <option value="RRMthruster">RRM</option> -->
<option value="kongsbergthruster">Kongsberg</option>
<option value="wartsilathruster">Wartsila</option>
</select>
</div>
<div class="column" >
<strong><p>Choose the avaliable fuel type </p></strong>
<select id="" onchange="sellectFuel(event)">
<option value="" selected>Fuel Alternative</option>
<option value="LNG">LNG</option>
<option value="hydrogen">Hydrogen</option>
<option value="MGO">MGO</option>
<option value="MDO">MDO</option>
<option value="HFO">HFO</option>
</select>
</div>
</div>
</div>
<div class="libDisplay">
<div id="libHeader" ></div>
<div class="gridrow">
<div id="divMyTable1" class="myTable1 hide">
<table id="myTable1" class=" hide">
<thead>
<th colspan="12">The table header</th>
</thead>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
<div id="divMyTable2" class="myTable2 hide ">
<table id="myTable2" class="hide">
<thead>
<th colspan="2">The table header</th>
</thead>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
<div id="divMyTable3" class="myTable3 hide">
<table id="myTable3" class="hide myTable3">
<thead>
<th colspan="12">The table header</th>
</thead>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
<div id="divMyTable4" class="myTable4 hide">
<table id="myTable4" class="hide myTable4">
<thead>
<th colspan="12">The table header</th>
</thead>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
<div id="divMyTable5" class="myTable5 hide">
<table id="myTable5" class="hide myTable5">
<thead>
<th colspan="12">The table header</th>
</thead>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</div>
</div>
</div>
<div class="border">
<div class=" row" >
<div class="Scrubber column">
<h4>install Scrubber </h4>
yes:<input type="radio" name="Scrubber" value="yes"><br>
no: <input type="radio" name="Scrubber" value="no"><br>
</div >
<div class="column" >
<h4>IMO Regulation</h4>
<select>
<option value="" selected>regulations that apply</option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
</select>
</div>
</div>
</div>
<div class="">
</div>
<div class="update">
<h2>The project has been changed , check the link here </h2>
<button ><a href="https://osain-az.github.io/Vessel-Machinery-Configuration/">
<h2> Check new project</h2></a>
</button>
</div>
<div class="result_container row" id="result_container">
<div class="column" id="tank_volume">
</div>
<div class="column" id="mass" >
</div>
<div class="column" id="power">
</div>
</div>
<p></p>
</div>
</body>
<html>
<script>
var resistance, speed, voyage, fuel_Consumption, fuelName, propulsion_name, battery;
const requirePower = new Machineries();
// console.log(lng.calculatePower.speed)
// Get the speed and the resistance that was input by the user
function getValues(event){
//speed = document.getElementById('speedinput').value
//resistance = document.getElementById('resistance').value
//resistance = document.getElementById('resistanceInput').value
//voyage = document.getElementById('voyage').value
const EventID = event.target.id;
if (EventID ==='speed' || EventID === 'speedinput') {
speed = event.target.value
console.log("the new speed ", speed)
document.getElementById('speedValue').innerHTML=speed + " knots"
if (EventID ==='speedinput') {
document.getElementById(EventID).value = ""
}
}
else if (EventID === 'resistance'|| EventID === 'resistanceInput' ) {
resistance = event.target.value
document.getElementById('resistanceValue').innerHTML=resistance + " kN"
if (EventID==='resistanceInput') {
document.getElementById(EventID).value = ""
}
console.log("the new resistance", resistance )
}
else if (EventID === 'voyage' || EventID ==='voyageInput' ) {
voyage = event.target.value
document.getElementById('voyageValue').innerHTML=voyage + " days"
if (EventID === 'voyageInput') {
document.getElementById(EventID).value = ""
}
console.log("the new voyage ", voyage)
}
if(speed && resistance && voyage){
requirePower.calculatePower(speed,resistance,voyage)
}
else if (speed && resistance) {
requirePower.calculatePower(speed,resistance)
}
if (fuelName==='LNG') {
sellectFuel();
}
}
function sellectFuel(event){
// const EventID = event.target.value;
//console.log(EventID)
fuelName = document.getElementById("choosefuel").value;
console.log(fuelName)
//document.getElementById("demo").innerHTML =
if (!speed || !resistance) {
alert("input the speed and resistance of the ship to start the analysis ")
//document.getElementById("choosefuel").reset();
}
else if (fuelName === "LNG"){
// create new instance for LNG fuel.
fuel_Consumption = new Machineries();
fuel_Consumption.fuelConsumption(LNG.density, LNG.LHV, LNG.HHV, LNG.SFC,requirePower.power,LNG.fuelName,requirePower.voyage);
document.getElementById("mass").innerHTML = "the total mass of " + LNG.fuelName + " is <br> " + "<strong>" +fuel_Consumption.mass + " tons</strong>"
//fuel_Consumption.tank_volume = fuel_Consumption.tank_volume.toFixed(1);
document.getElementById("tank_volume").innerHTML = "The required tank volume using " + LNG.fuelName + " is <br>" + "<strong>" + fuel_Consumption.tank_volume + " m^3</strong>"
document.getElementById("power").innerHTML = " The minimum propulsion power of the ship is <br>" + "<strong>" + requirePower.power + "kW <strong>"
}
else if (fuelName==="MGO") {
// create new instance for LNG fuel.
fuel_Consumption = new Machineries();
fuel_Consumption.fuelConsumption(MGO.density, MGO.LHV,MGO.HHV, MGO.SFC,requirePower.power,MGO.fuelName,requirePower.voyage);
document.getElementById("mass").innerHTML = "the total mass of " + MGO.fuelName + " is <br> " + "<strong>" +fuel_Consumption.mass + " tons</strong>"
//fuel_Consumption.tank_volume = fuel_Consumption.tank_volume.toFixed(1);
document.getElementById("tank_volume").innerHTML = "The required tank volume using " + MGO.fuelName + " is <br>" + "<strong>" + fuel_Consumption.tank_volume + " m^3</strong>"
document.getElementById("power").innerHTML = " The minimum propulsion power of the ship is <br>" + "<strong>" + requirePower.power + "kW <strong>"
console.log(fuelName)
}
else if (fuelName==="MDO") {
// create new instance for LNG fuel.
fuel_Consumption = new Machineries();
fuel_Consumption.fuelConsumption(MDO.density, MDO.LHV,MDO.HHV, MDO.SFC,requirePower.power,MDO.fuelName,requirePower.voyage);
document.getElementById("mass").innerHTML = "the total mass of " + MDO.fuelName + " is <br> " + "<strong>" +fuel_Consumption.mass + " tons</strong>"
//fuel_Consumption.tank_volume = fuel_Consumption.tank_volume.toFixed(1);
document.getElementById("tank_volume").innerHTML = "The required tank volume using " + MDO.fuelName + " is <br>" + "<strong>" + fuel_Consumption.tank_volume + " m^3</strong>"
document.getElementById("power").innerHTML = " The minimum propulsion power of the ship is <br>" + "<strong>" + requirePower.power + "kW <strong>"
console.log(fuelName)
}
else if (fuelName==="hydrogen") {
fuel_Consumption = new Machineries();
fuel_Consumption.fuelConsumption(H2.density, H2.LHV,LNG.HHV,H2.SFC,requirePower.power,H2.fuelName,requirePower.voyage);
document.getElementById("mass").innerHTML = "the total mass of " + H2.fuelName + " is <br> " + "<strong>" +fuel_Consumption.mass + " tons</strong>"
//fuel_Consumption.tank_volume = fuel_Consumption.tank_volume.toFixed(1);
document.getElementById("tank_volume").innerHTML = "The required tank volume using " + H2.fuelName + " is <br>" + "<strong>" + fuel_Consumption.tank_volume + " m^3</strong>"
document.getElementById("power").innerHTML = " The minimum propulsion power of the ship is <br>" + "<strong>" + requirePower.power + "kW <strong>"
// create new instance for Hydrogen fuel.
console.log(fuelName)
}
else if (fuelName==="HFO") {
// create new instance for HFO fuel.
fuel_Consumption = new Machineries();
fuel_Consumption.fuelConsumption(HFO.density, HFO.LHV, HFO.HHV,HFO.SFC,requirePower.power,HFO.fuelName,requirePower.voyage);
document.getElementById("mass").innerHTML = "the total mass of " + HFO.fuelName + " is <br> " + "<strong>" +fuel_Consumption.mass + " tons</strong>"
//fuel_Consumption.tank_volume = fuel_Consumption.tank_volume.toFixed(1);
document.getElementById("tank_volume").innerHTML = "The required tank volume using " + HFO.fuelName + " is <br>" + "<strong>" + fuel_Consumption.tank_volume + " m^3</strong>"
document.getElementById("power").innerHTML = " The minimum propulsion power of the ship is <br>" + "<strong>" + requirePower.power + "kW <strong>"
console.log(fuelName)
}
}
function choosePropulsion(event){
const EventID = event.target.value;
//console.log("testing the test",EventID)
if (EventID=== "battery"){
document.getElementById("mainContainer").style.display= "block";
document.getElementById("engine").style.display= "block";
document.getElementById("propellers").style.display= "block";
document.getElementById("thruster").style.display= "block";
document.getElementById("choosefuel").style.display= "none";
document.getElementById("BMS").style.display= "block";
document.getElementById("genSet").style.display = "none";
}
else if (EventID==="diesel") {
document.getElementById("mainContainer").style.display= "block";
document.getElementById("engine").style.display= "block";
document.getElementById("propellers").style.display= "block";
document.getElementById("thruster").style.display= "block";
document.getElementById("choosefuel").style.display= "block";
document.getElementById("BMS").style.display= "none ";
document.getElementById("genSet").style.display = "none";
}
else if (EventID=== "dieselElectric") {
console.log(document.getElementById("propellers"))
document.getElementById("mainContainer").style.display= "block";
document.getElementById("engine").style.display= "block";
document.getElementById("propellers").style.display= "block";
document.getElementById("thruster").style.display= "block";
document.getElementById("choosefuel").style.display= "block";
document.getElementById("BMS").style.display= "block";
document.getElementById("genSet").style.display = "block";
}
else if (EventID ==="LNG") {
document.getElementById("mainContainer").style.display= "block";
document.getElementById("engine").style.display= "block";
document.getElementById("propellers").style.display= "block";
document.getElementById("thruster").style.display= "block";
document.getElementById("choosefuel").style.display= "block";
document.getElementById("BMS").style.display= "none";
document.getElementById("genSet").style.display = "block";
}
else if (EventID=== "Hybrid") {
document.getElementById("mainContainer").style.display= "block";
document.getElementById("engine").style.display= "block";
document.getElementById("propellers").style.display= "block";
document.getElementById("thruster").style.display= "block";
document.getElementById("choosefuel").style.display= "block";
document.getElementById("BMS").style.display= "block";
document.getElementById("genSet").style.display = "block";
}
// propulsion_name = document.getElementById("propulsion").value;
// console.log(propulsion_name)
console.log(EventID)
//
// }
}
battery = Machinery.batterySystem
function batteryLibray(event) {
//document.getElementById("myP").style.visibility = "hidden";
console.log(battery.supplier.corvus1)
//
// let corvus1 = battery.supplier.corvus1
// let corvus2 = battery.supplier.corvus2
// let pbes = battery.supplier.PBES
const table = document.getElementById("myTable1");
let i = 0
let row, batteryDetails;
const EventID = event.target.value
console.log(EventID)
if (EventID==="PBESPB1"){
while (table.hasChildNodes()) {
table.removeChild(table.firstChild);
}
console.log(EventID==="PBESPB1")
batteryDetails= battery.supplier.PBES
}
else if (EventID==="orcaPower") {
while (table.hasChildNodes()) {
table.removeChild(table.firstChild);
}
batteryDetails = battery.supplier.corvus1
}
else if (EventID ==="orcaEnergy") {
while (table.hasChildNodes()) {
table.removeChild(table.firstChild);
}
batteryDetails = battery.supplier.corvus2
}
else if (EventID ==="blueWhale") {
while (table.hasChildNodes()) {
table.removeChild(table.firstChild);
}
batteryDetails = battery.supplier.corvus3
}
document.getElementById("divMyTable1").classList.remove("hide");
for (let [key, value] of Object.entries(batteryDetails)) {
console.log(`${key}: ${value}`);
let table = document.getElementById("myTable1");
table.classList.remove("hide")
row = table.insertRow(i)
console.log(row)
row.insertCell(0).innerHTML =`<strong>`+`${key}:</strong> `;
row.insertCell(1).innerHTML = `<strong>` +`${value}`+ "</strong>";
i++;
}
// console.log( corvus1.supplier)
}
let hide = 0 // this is used the initialize or active removing of hide class
function libraryDisplay(event) {
let table1 = document.getElementById("myTable1");
let table2 = document.getElementById("myTable2");
let table3 = document.getElementById("myTable3");
let table4 = document.getElementById("myTable4");
let table5 = document.getElementById("myTable5");
// hide the tables to ensure that only
document.getElementById("divMyTable1").classList.add("hide");
document.getElementById("divMyTable2").classList.add("hide");
document.getElementById("divMyTable3").classList.add("hide");
document.getElementById("divMyTable4").classList.add("hide");
document.getElementById("divMyTable5").classList.add("hide");
// Hide the
// table1.classList.add("hide");
// table2.classList.add("hide");
// table3.classList.add("hide");
// table4.classList.add("hide");
// table5.classList.add("hide");
while (table1.hasChildNodes()) {
table1.removeChild(table1.firstChild);
}
while (table2.hasChildNodes()) {
table2.removeChild(table2.firstChild);
}
while (table3.hasChildNodes()) {
table3.removeChild(table3.firstChild);
}
while (table4.hasChildNodes()) {
table4.removeChild(table4.firstChild);
}
while (table5.hasChildNodes()) {
table5.removeChild(table5.firstChild);
}
// for (var j = 0 ; j < table.rows.length; j++) {
// // table1.deleteRow(j)
// while (table.hasChildNodes()) {
// table.removeChild(table.firstChild);
// }
// }
// table1.classList.add("hide");
// table2.classList.add("hide");
// table3.classList.add("hide");
kongsbergEngine
//
let i = 0;
let I;
let ends;
let libraryCount;
let library, productType, productSupplier;
let myTable ;
//Main Engine suppliers
let kongsberg1 = kongsbergEngine.kongsberg1;
let kongsberg2 = kongsbergEngine.kongsberg2;
let kongsberg3 = kongsbergEngine.kongsberg3;
let wartsila1 = wartsilaEngine.wartsila1
let wartsila2 = wartsilaEngine.wartsila2
let wartsila3 = wartsilaEngine.wartsila3
// GENSET FOR Disel Electric propulsion
let wartsilaGensetDE1 = wartsilaGensetDE.GenSet1
let wartsilaGensetDE2 = wartsilaGensetDE.GenSet2
let wartsilaGensetDE3 = wartsilaGensetDE.GenSet3
let kongsbergGensetDE1 = kongsbergGensetDE.GenSet1
let kongsbergGensetDE2 = kongsbergGensetDE.GenSet2
let kongsbergGensetDE3 = kongsbergGensetDE.GenSet3
// propulsion data
let ABBprop1 = ABBProp.azipod
let ABBprop2 = ABBProp.azipod1
let ABBprop3 = ABBProp.azipod2
let ABBprop4 = ABBProp.azipod3
// let ABBprop3 = ABBPr
let kongsbergProp1 = kongsbergProp.eLegance
let kongsbergProp2 = kongsbergProp.mermaid
let kongsbergProp3 = kongsbergProp.mermaid1
//Thruster
let kongsbergThruster1 = kongsbergThruster.FP2000
let kongsbergThruster2 = kongsbergThruster.azipull
// let kongsbergThruster3 = kongsbergThruster.azipull
let ABBthruster1 = ABBthruster.azipodCZ
let ABBthruster2 = ABBthruster.azipodCZ1
let ABBthruster3 = ABBthruster.azipodDZ
let wartsilaThruster1 = wartsilaThruster.WST_28
let wartsilaThruster2 = wartsilaThruster.WST_16
let wartsilaThruster3 = wartsilaThruster.WST_18
let wartsilaThruster4 = wartsilaThruster.LMT_FS3500MNR
let wartsilaThruster5 = wartsilaThruster.LMT_CS
const EventID = event.target.value
if (EventID ==="kongsberg" || EventID ==="wartsilaEngine" ||
EventID ==="kongsbergGenset" || EventID ==="wartsilaGenset"|| EventID ==="wartsilaProp" ||
EventID ==="kongsbergthruster" || EventID ==="ABBProp"|| EventID ==="kongsbergProp"
|| EventID ==="ABBthruster"|| EventID ==="wartsilathruster" ) {
ends = 3
// count how many machinery did every given suplier have on any given product
if(EventID ==="kongsberg"){
//konsgberg engine
productSupplier = "Konsberg Maritime";
productType = "Propulsion Engine"
libraryCount = Object.keys(kongsbergEngine).length
}
else if(EventID ==="wartsilaEngine"){
//wartsila engine
productSupplier = "Wartsila";
productType = "Propulsion Engine"
libraryCount = Object.keys(kongsbergEngine).length
}
else if(EventID ==="kongsbergGenset"){
// konsgberg genset
productSupplier = "Konsberg Maritime";
productType = "Generator set";
libraryCount = Object.keys(kongsbergEngine).length
console.log("engine",libraryCount)
}
else if(EventID ==="wartsilaGenset"){
//wartsila Genset
productSupplier = "Wartsila";
productType = "Generator set"
libraryCount = Object.keys(kongsbergEngine).length
}
else if(EventID ==="ABBProp"){
//ABB proppeller
productSupplier = "ABB";
productType = "Propellers"
libraryCount = Object.keys(ABBProp).length
}
else if(EventID ==="kongsbergProp"){
//kongsberg proppeller
productSupplier = "Konsberg";
productType = "Propellers"
libraryCount = Object.keys(kongsbergProp).length
}
// else if(EventID ==="wartsilaProp"){
// //wartsilar proppeller
// libraryCount = Object.keys(kongsbergEngine).length
// }
else if(EventID ==="ABBthruster"){
//ABB thruster
productSupplier = "ABB";
productType = "Thrusters"
libraryCount = Object.keys(ABBthruster).length
}
else if(EventID ==="kongsbergthruster"){
//kongsberg thrsuter
productSupplier = "Konsberg";
productType = "Thrusters"
libraryCount = Object.keys(kongsbergThruster).length
}
else if(EventID ==="wartsilathruster"){
//wartsilar thruster
productSupplier = "Wartsila";
productType = "Thrusters"
libraryCount = Object.keys(wartsilaThruster).length
}
const header = document.getElementById("libHeader");
header.innerHTML = `<h2>sellect the avaliable ${ productType} from ${productSupplier}</h2>`
console.log("count", libraryCount)
for ( I = 0; I < libraryCount; I++) {
if (I === 0) {
if (EventID ==="kongsberg" ) {
library = kongsberg1
}
else if(EventID ==="wartsilaEngine"){
library= wartsila1
}
else if(EventID ==="wartsilaGenset"){
library= wartsilaGensetDE1
}
else if(EventID ==="kongsbergGenset"){
library= kongsbergGensetDE1
}
else if(EventID ==="kongsbergProp"){
library= kongsbergProp1
}
else if(EventID ==="ABBProp"){
library= ABBprop1
}
else if(EventID ==="ABBthruster"){
library= ABBthruster1
}
else if(EventID ==="kongsbergthruster"){
library= kongsbergThruster1