Skip to content

Commit

Permalink
Fixed precession with last stop on 6 meters parameter
Browse files Browse the repository at this point in the history
Fixed precession with last stop on 6 meters parameter
Fixed naming inside XLS tables with CNS and TTS
  • Loading branch information
VlasovAlexey committed May 18, 2024
1 parent 219de32 commit 03fa44a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 85 deletions.
8 changes: 2 additions & 6 deletions HTML_SRC/build_dive.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,7 @@ function ShortStop(mn_plan){
//Recombine plan if last stop changed from 3 meters to 6 meters
//post changes
function LastStopUpd (plan){
for (var i = 0; i < plan.length; i++) {

}


if($( "#opt_lst_stop" ).val() == 6){
/*if($( "#opt_lst_stop" ).val() == 6){
//plan is 6 meters las stop. We need some magic
var add_time = plan[plan.length - 2].time + plan[plan.length - 4].time;
Expand All @@ -963,6 +958,7 @@ function LastStopUpd (plan){
else{
//last stop is 3 meters and nothing will be changed
}
*/
return plan;
}
//Insert gas break in to the plan
Expand Down
76 changes: 18 additions & 58 deletions HTML_SRC/dive_comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function ret_deco_sorted (dec_arr, dec_depth){
var abs_press = [1.0];
var comp_tiss_arr =[];
var first_ascent = 0;

require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;
if(!u&&a)return a(o,!0);
if(i)return i(o,!0);
Expand Down Expand Up @@ -929,15 +930,17 @@ 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
//if last stop is 6 meters we need change nextDepth(it is last depth now) to 0 meters!
if($( "#opt_lst_stop" ).val() == 6 && currentDepth == 6){
nextDecoDepth = 0;
}
//diveprome interface end

//DiveProMe interface
newGasName = this.addDecoDepthChange(nextDecoDepth, ceiling, maxppO2, maxEND, currentGasName);

Expand All @@ -948,57 +951,13 @@ return s})({"/dive_comp.js":[function(require,module,exports){
time++;
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{
//create array of all used gases
//first get all deco gasses
cnt = 0;
var all_gas = [];//final array all used gases
var mix_gas_cur = [];
for (c = 0; c < $("#opt_deco").val(); c++){
mix_gas_cur = [deco_mix_arr[cnt] , deco_mix_arr[cnt + 1]];
all_gas.push(mix_to_txt_arr(mix_gas_cur));
cnt = cnt + 2;
}
//add travel and all used main levels gases
cnt3 = 0;
for(j = 0 ; j < (lvl_arr.length/3) ; j++){
mix_gas_cur = [travel_mix_arr[(lvl_arr[cnt3])*2-2], travel_mix_arr[(lvl_arr[cnt3])*2+1-2]];
all_gas.push(mix_to_txt_arr(mix_gas_cur));
cnt3 = cnt3 + 3;
}
//compare used gas list and currentGasName
alien_gas = 1;
alien_gas_new = 1;
for(j = 0 ; j < (all_gas.length) ; j++){
if(all_gas[j] == newGasName ){alien_gas_new = 0;}
if(all_gas[j] == currentGasName ){alien_gas = 0;}
}
if(newGasName != currentGasName && tn_cng_time_idx*1.0 > 0 && alien_gas == 0 && alien_gas_new == 0){
this.addFlat(currentDepth, currentGasName, tn_cng_time_idx*1.0);
}
}
}
*/
//diveprome interface end

//console.log("Held diver at " + currentDepth + " for " + time + " minutes on gas " + currentGasName + ".");
//console.log("Moving diver from current depth " + currentDepth + " to next ceiling of " + ceiling);



currentGasName = this.addDecoDepthChange(currentDepth, ceiling, maxppO2, maxEND, currentGasName);
}
if (!maintainTissues) {
Expand Down Expand Up @@ -1038,23 +997,24 @@ return s})({"/dive_comp.js":[function(require,module,exports){
}
}


//take us to the ceiling at 30fpm or 10 mpm (the fastest ascent rate possible.)
var depthdiff = fromDepth - ceiling;

//diveprome interface code
if (first_ascent == 0){
//first ascent from bottom to first deco stop with custom ascending speed
var rate_asc = document.getElementById("opt_rate_asc");
var rate_asc_idx = rate_asc.options[rate_asc.selectedIndex].value;

var depthdiff = fromDepth - ceiling;

var time = depthdiff/(rate_asc_idx*1.0);

first_ascent = 1;
} else {
//all other deco stops with deco ascending speed
var rate_asc_deco = document.getElementById("opt_rate_asc_deco");
var rate_asc_deco_idx = rate_asc_deco.options[rate_asc_deco.selectedIndex].value;

var depthdiff = fromDepth - ceiling;

var time = depthdiff/(rate_asc_deco_idx*1.0);
}

Expand Down
36 changes: 18 additions & 18 deletions HTML_SRC/lng_fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -2020,13 +2020,13 @@

if(val == "ch_lnkClipboard"){val = "The share link is in your clipboard!"}

if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "Diluent "}

if(val == "t_zoom"){val = "Reset Zoom"}

if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}

if(val == "ld_tis"){val = "Leading Tissue"}
if(val == "amb_pres"){val = "Ambient Pressure"}
Expand Down Expand Up @@ -2125,12 +2125,12 @@
if(td_lng == 2){
if(val == "ch_lnkClipboard"){val = "Ссылка на ваш план скопирована в буфер обмена!"}

if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "Дилуэнт "}
if(val == "t_zoom"){val = "Сбросить масштаб"}

if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}

if(val == "ld_tis"){val = "Лидирующая ткань"}
if(val == "amb_pres"){val = "Атмосферное давление"}
Expand Down Expand Up @@ -2229,11 +2229,11 @@
}
if(td_lng == 3){
if(val == "ch_lnkClipboard"){val = "El enlace de su plan se ha copiado en el portapapeles!"}
if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "Diluyente "}
if(val == "t_zoom"){val = "Reinicializar Acercamiento"}
if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}

if(val == "ld_tis"){val = "Carga Compartimentos"}
if(val == "amb_pres"){val = "Presión Ambiente"}
Expand Down Expand Up @@ -2332,11 +2332,11 @@
if(td_lng == 4){
if(val == "ch_lnkClipboard"){val = "A ligação do seu plano é copiada para a área de transferência!"}

if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "Diluente "}
if(val == "t_zoom"){val = "Reset Zoom"}
if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}
if(val == "ld_tis"){val = "Tecido Director"}
if(val == "amb_pres"){val = "Pressão Ambiente"}
if(val == "t_tiss_wrn"){val = "Este Plano Não Exige Paragens Descompressivas. Os Compartimentos dos Tecidos serão Ocultados."}
Expand Down Expand Up @@ -2422,11 +2422,11 @@
}
if(td_lng == 5){
if(val == "ch_lnkClipboard"){val = "您的计划链接已复制到剪贴板!"}
if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "稀释气 "}
if(val == "t_zoom"){val = "重置缩放"}
if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}
if(val == "ld_tis"){val = "领先的组织"}
if(val == "amb_pres"){val = "环境压力"}
if(val == "t_tiss_wrn"){val = "这个计划没有包含减压停留。组织腔隔会被隐藏"}
Expand Down Expand Up @@ -2514,7 +2514,7 @@
if(td_lng == 6) {
if(val == "ch_lnkClipboard"){val = "Връзката с вашия план е копирана в клипборда!"}

if(val == "tab_tr_TTS"){val = "ТТС" + lng_min}
if(val == "tab_tr_TTS"){val = "ТТС"}
if (val == "t_diluent") {
val = "Смесител "
}
Expand All @@ -2525,7 +2525,7 @@
val = "ЕКТ"
}
if (val == "tab_tr_CNS") {
val = "ЦНС%"
val = "ЦНС, %"
}
if (val == "ld_tis") {
val = "Водеща тъкан"
Expand Down Expand Up @@ -2758,7 +2758,7 @@
if(td_lng == 7) {
if(val == "ch_lnkClipboard"){val = "Le lien avec votre plan a été copié dans le presse-papiers !"}

if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if (val == "t_diluent") {
val = "Diluent "
}
Expand All @@ -2769,7 +2769,7 @@
val = "OTU"
}
if (val == "tab_tr_CNS") {
val = "CNS%"
val = "CNS, %"
}
if (val == "ld_tis") {
val = "Leading Tissue"
Expand Down Expand Up @@ -3002,11 +3002,11 @@
if(td_lng == 8){
if(val == "ch_lnkClipboard"){val = "요금제 링크가 클립보드에 복사되었습니다!"}

if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "Diluent "}
if(val == "t_zoom"){val = "줌 재설정"}
if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}
if(val == "ld_tis"){val = "선도 조직"}
if(val == "amb_pres"){val = "주변 압력"}
if(val == "t_tiss_wrn"){val = "이 계획에는 감압 정지가 없습니다. 조직 구획이 숨겨집니다."}
Expand Down Expand Up @@ -3092,11 +3092,11 @@
if(td_lng == 9){
if(val == "ch_lnkClipboard"){val = "Il link al piano è stato copiato negli appunti!"}

if(val == "tab_tr_TTS"){val = "TTS" + lng_min}
if(val == "tab_tr_TTS"){val = "TTS"}
if(val == "t_diluent"){val = "Diluente "}
if(val == "t_zoom"){val = "Azzera lo Zoom"}
if(val == "tab_tr_OTU"){val = "OTU"}
if(val == "tab_tr_CNS"){val = "CNS%"}
if(val == "tab_tr_CNS"){val = "CNS, %"}
if(val == "ld_tis"){val = "Tessuto principale"}
if(val == "amb_pres"){val = "Pressione ambientale "}
if(val == "t_tiss_wrn"){val = "Questa pianificazione non ha soste decompressive. I compartimenti tissutali saranno nascosti."}
Expand Down
2 changes: 1 addition & 1 deletion HTML_SRC/lvl_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function btn_export_xls(){
raw : true
}
);
XLSX.utils.book_append_sheet(wb, ws, plan_lng("tab_tr_OTU") + "," + plan_lng("tab_tr_CNS")+ "," + plan_lng("tab_tr_TTS"));
XLSX.utils.book_append_sheet(wb, ws, plan_lng("tab_tr_OTU") + ", " + plan_lng("tab_tr_CNS")+ ", " + plan_lng("tab_tr_TTS") + lng_min);


//save xls
Expand Down
4 changes: 2 additions & 2 deletions HTML_SRC/tables_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ function total_cns_otu(tmp_arr) {

td = document.createElement("td");
//td.setAttribute("class", "tab_black");
td.innerHTML = plan_lng("tab_tr_TTS");
pdf_table_otu_cns_arr.push(plan_lng("tab_tr_TTS"));
td.innerHTML = plan_lng("tab_tr_TTS") + lng_min;
pdf_table_otu_cns_arr.push(plan_lng("tab_tr_TTS") + lng_min);
tr.appendChild(td);

table.appendChild(tr);
Expand Down

0 comments on commit 03fa44a

Please sign in to comment.