diff --git a/HTML_SRC/.vscode/launch.json b/HTML_SRC/.vscode/launch.json new file mode 100644 index 0000000..7f26288 --- /dev/null +++ b/HTML_SRC/.vscode/launch.json @@ -0,0 +1,14 @@ + { + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Open index.html", + "file": "h:\\DiveProMe+\\SRC\\index.html" + } + ] + } \ No newline at end of file diff --git a/HTML_SRC/.vscode/settings.json b/HTML_SRC/.vscode/settings.json new file mode 100644 index 0000000..c150523 --- /dev/null +++ b/HTML_SRC/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "search.followSymlinks": true +} diff --git a/HTML_SRC/build_dive.js b/HTML_SRC/build_dive.js index 9d228fb..3236b1b 100644 --- a/HTML_SRC/build_dive.js +++ b/HTML_SRC/build_dive.js @@ -79,11 +79,6 @@ function build_dive(){ tmp_lvl_arr = []; tmp_lvl_mix_arr = []; - //var rate_asc = document.getElementById("opt_rate_asc"); - //var rate_asc_idx = rate_asc.options[rate_asc.selectedIndex].value; - //var rate_dsc = document.getElementById("opt_rate_dsc"); - //var rate_dsc_idx = rate_dsc.options[rate_dsc.selectedIndex].value; - //calculate ascending numbers for potentially deco stops for (i = 0; i < lvl_arr.length/3; i++) { @@ -762,11 +757,6 @@ function upd_lvl_opt_arr(){ //upd_lvl_list(); upd_all(); } - - - - - //Dec time equal to real time format xx:xx function time_dec_to_time(tmp_time){ tmp_time_hi = Math.floor(tmp_time); @@ -828,46 +818,11 @@ function src_to_5_arr(tmp_arr, flag_full){ var pln_style_val = $("#tn_plan_style option:selected").val(); runtime = 0; - var blns = 0; for (var i = 0; i < tmp_arr.length; i++) { dp_end1 = tmp_arr[i].endDepth*1.0; dp_start1 = tmp_arr[i].startDepth*1.0; dp_c_time = tmp_arr[i].time*1.0; - //make plan time rounded if classic style selected - /*if (pln_style_val == 2){ - if(dp_start1 == dp_end1){ - //levels or stops - if(blns >= 1){ - dp_c_time = Math.ceil(dp_c_time + blns); - blns = 0; - } - //dp_c_time = Math.ceil(dp_c_time); - } - else{ - //transition balances between levels or stops - if(blns >= 1){ - //dp_c_time = Math.ceil(dp_c_time + blns); - //blns = 0; - //console.log("ADD!") - } - else{ - blns = blns + dp_c_time; - dp_c_time = 0; - } - //console.log(blns); - } - //fix start and exit to surface. Every time this make round to ceil. This add two more minutes to detailed plan anyway - if(i == 0 || i == tmp_arr.length-1){ - dp_c_time = Math.ceil(tmp_arr[i].time*1.0); - } - //final update - runtime = runtime + (dp_c_time); - } - else{ - runtime = runtime + (dp_c_time); - }*/ - runtime = runtime + (dp_c_time); dp_c_mix = tmp_arr[i].gasName; @@ -1095,34 +1050,6 @@ function GasBreakInsert(main_arr) { return main_arr; } -//ADD extra stops for gas changing -function ExtraStops(output) { - var tn_cng_time = document.getElementById("opt_cng_time"); - var tn_cng_time_idx = parseInt(tn_cng_time.options[tn_cng_time.selectedIndex].value); - -//if changing mix time === 0 we need add some time for property dive plan computation. - if(tn_cng_time_idx === 0) - { - //!!!need deep test! changed from 0.0 to 0.00001 after v9.11 - //it is important. if 0.0 then crash app. need more testing and resolve this strange work - tn_cng_time_idx = 0.00001; - } - - for(c = 1 ; c < output.length ; c++){ - if(output[c].gasName != output[c-1].gasName){ - output.splice(c,0, - { - endDepth: output[c].startDepth, - startDepth: output[c].startDepth, - time: tn_cng_time_idx, - gasName: output[c].gasName - } - ); - } - } - return output; -} - //return max depth in meters from lvl list array function PlanMaxDepth(plan_array){ var a = 0; diff --git a/HTML_SRC/cookie_settings.js b/HTML_SRC/cookie_settings.js index 61d45cc..de97b88 100644 --- a/HTML_SRC/cookie_settings.js +++ b/HTML_SRC/cookie_settings.js @@ -7,7 +7,7 @@ deleteCookie("mdls_usr1"); */ var deco_mix_arr = [50,0,100,0,20,30,18,45,15,50,12,60,8,70,40,0,80,0,21,35]; var deco_mix_depth_arr = [0,0,0,0,0,0,0,0,0,0]; -var travel_mix_depth_arr = [0,0,0,0,0,0,0,0,0,0]; +var travel_mix_depth_arr = [402,402,402,402,402,402,402,402,402,402]; var travel_mix_arr = [21,0,20,30,18,45,15,50,12,60,8,70,40,0,80,0,21,35,100,0]; var lvl_arr = [1,40,20]; @@ -89,7 +89,7 @@ var opt_calc_cur_ex_rate_yuan_usr = 6; var opt_calc_cur_ex_rate_fyn_usr = 45; //new3_0 -var plan_style_usr = 1; +var plan_style_usr = 2; var plan_ccr_usr = 1; //new4_0 @@ -118,7 +118,7 @@ var opt_saul_percent_usr = 0.3; function default_set(){ deco_mix_arr = [50,0,100,0,20,30,18,45,15,55,12,60,10,70,21,35,30,30,60,0]; deco_mix_depth_arr = [0,0,0,0,0,0,0,0,0,0]; - travel_mix_depth_arr = [0,0,0,0,0,0,0,0,0,0]; + travel_mix_depth_arr = [402,402,402,402,402,402,402,402,402,402]; travel_mix_arr = [21,0,20,30,18,45,15,50,12,60,8,70,40,0,80,0,21,35,100,0]; lvl_arr = [1,39,20]; lvl_mix_arr = [21,0]; @@ -197,7 +197,7 @@ function default_set(){ opt_calc_cur_ex_rate_fyn_usr = 45; //new3_0 - plan_style_usr = 1; + plan_style_usr = 2; plan_ccr_usr = 1; //new4_0 @@ -1406,7 +1406,7 @@ function create_html(){ create_option("tn_rmv_bt", "opt_rmv_bt", 3, 60, opt_rmv_bt_usr , 1 , 0 , "vol"); del_html_elem("tn_cng_time"); - create_option("tn_cng_time", "opt_cng_time", 0, 3, opt_cng_time_usr , 1 , 0 , "none"); + create_option("tn_cng_time", "opt_cng_time", 0, 2, opt_cng_time_usr , 1 , 0 , "none"); del_html_elem("tn_lst_stop"); create_option("tn_lst_stop", "opt_lst_stop", 3, 6, opt_lst_stop_usr , 3 , 0 , "depth"); del_html_elem("tn_slevel"); @@ -1789,7 +1789,7 @@ create_option("tn_rate_asc_surf", "opt_rate_asc_surf", 1, 10, opt_rate_asc_surf_ create_option("tn_rate_asc_deco", "opt_rate_asc_deco", 1, 20, opt_rate_asc_deco_usr , 1 , 0, "depth"); create_option("tn_rmv_deco", "opt_rmv_deco", 3, 60, opt_rmv_deco_usr , 1 , 0, "vol"); create_option("tn_rmv_bt", "opt_rmv_bt", 3, 60, opt_rmv_bt_usr , 1 , 0 , "vol"); -create_option("tn_cng_time","opt_cng_time", 0, 3, opt_cng_time_usr , 1 , 0 , "none"); +create_option("tn_cng_time","opt_cng_time", 0, 2, opt_cng_time_usr , 1 , 0 , "none"); create_option("tn_lst_stop", "opt_lst_stop", 3, 6, opt_lst_stop_usr , 3 , 0 , "depth"); create_option("tn_slevel", "opt_slevel", 0, 4000, opt_slevel_usr , 100 , 0 , "depth"); create_option("tn_celsus", "opt_celsus", 0, 50, opt_celsus_usr , 2 , 0 , "temper"); diff --git a/HTML_SRC/dive_comp.js b/HTML_SRC/dive_comp.js index 5d89b0a..3543c31 100644 --- a/HTML_SRC/dive_comp.js +++ b/HTML_SRC/dive_comp.js @@ -889,16 +889,44 @@ return s})({"/dive_comp.js":[function(require,module,exports){ //console.log("Start Ceiling:" + ceiling + " with GF:" + gfLow) //you can get first deco stop here! + + //DiveProMe interface + var tn_cng_time = document.getElementById("opt_cng_time"); + var tn_cng_time_idx = parseInt(tn_cng_time.options[tn_cng_time.selectedIndex].value); + while (ceiling > 0) { var currentDepth = ceiling; var nextDecoDepth = (ceiling - 3); var time = 0; + + //DiveProMe interface + newGasName = this.addDecoDepthChange(nextDecoDepth, ceiling, maxppO2, maxEND, currentGasName); + var gf = gfLow + (gfChangePerMeter * (distanceToSurface - ceiling)); //console.log("GradientFactor:"+gf + " Next decoDepth:" + nextDecoDepth); while (ceiling > nextDecoDepth && time <= 10000) { this.addFlat(currentDepth, currentGasName, 1); time++; - ceiling = this.getCeiling(gf); + ceiling = this.getCeiling(gf); + } + + //DiveProMe interface + //Add extra time for gas changing + if ($("#tn_plan_ccr").val() == 1) { + //OC + if(newGasName != currentGasName && tn_cng_time_idx*1.0 > 0){ + this.addFlat(currentDepth, currentGasName, tn_cng_time_idx*1.0); + //console.log(currentGasName,tn_cng_time_idx); + } + } else { + //CCR + if(opt_blt_dln == 2){ + //nothing + } + //CCR Bailout + else{ + console.log("bail"); + } } //console.log("Held diver at " + currentDepth + " for " + time + " minutes on gas " + currentGasName + "."); @@ -908,7 +936,6 @@ return s})({"/dive_comp.js":[function(require,module,exports){ if (!maintainTissues) { this.resetTissues(origTissues); } - return dive.collapseSegments(this.segments); }; diff --git a/HTML_SRC/index.html b/HTML_SRC/index.html index 867eb7a..b79183f 100644 --- a/HTML_SRC/index.html +++ b/HTML_SRC/index.html @@ -87,7 +87,7 @@ background: repeating-linear-gradient(0deg, #ff9966, #ff5e62); background: repeating-linear-gradient(45deg, #3d203e, #b90037); background: repeating-linear-gradient(45deg, #04101f, #4684ee); - + background: repeating-linear-gradient(45deg, #04101f, #3db0e6); animation: gradient 4s ease infinite; -webkit-transition: opacity 200ms ease-in-out; -moz-transition: opacity 200ms ease-in-out; @@ -1426,8 +1426,8 @@ --> -