Skip to content

Commit

Permalink
Updated GitHub repo with latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VlasovAlexey committed Dec 19, 2023
1 parent b8b84f3 commit 46074ab
Show file tree
Hide file tree
Showing 23 changed files with 667 additions and 266 deletions.
Binary file modified Android_SRC/app/release/app-release.aab
Binary file not shown.
Binary file added Android_SRC/app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions Android_SRC/app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 24,
"versionName": "13.4",
"versionCode": 25,
"versionName": "14.0",
"outputFile": "app-release.apk"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 1 addition & 78 deletions Android_SRC/app/src/main/assets/build_dive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {

Expand Down Expand Up @@ -306,12 +301,8 @@ function build_dive_segment(levels_segment_arr , levels_mix_segment_arr){

//Add Bottom/travel gases
if($( "#tn_plan_ccr" ).val() == 1){

//OC Dive
//and we need hide consumption first
//element_id_show("t_total_cons");
//element_id_show("7-header");
//element_id_show("7-content");

aaa = 0;
for(c = 0 ; c < levels_mix_segment_arr.length/2 ; c++){
ff = [levels_mix_segment_arr[aaa] , levels_mix_segment_arr[aaa+1]];
Expand Down Expand Up @@ -762,11 +753,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);
Expand Down Expand Up @@ -828,46 +814,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;

Expand Down Expand Up @@ -1095,34 +1046,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;
Expand Down
8 changes: 4 additions & 4 deletions Android_SRC/app/src/main/assets/cookie_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
101 changes: 83 additions & 18 deletions Android_SRC/app/src/main/assets/dive_comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,11 +824,7 @@ return s})({"/dive_comp.js":[function(require,module,exports){

plan.prototype.getCeiling = function (gf) {
gf = gf || 1.0;
var ceiling = 0;
//diveprome interface selector
tn_lst_stop1 = document.getElementById("opt_lst_stop");
tn_lst_stop1_idx = parseFloat(tn_lst_stop1.options[tn_lst_stop1.selectedIndex].value);

var ceiling = 0;
for (var i = 0; i < this.tissues.length; i++) {
var tissueCeiling = this.tissues[i].calculateCeiling(gf);
if (!ceiling || tissueCeiling > ceiling) {
Expand Down Expand Up @@ -889,16 +885,73 @@ 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{
//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);
}
}
}

//console.log("Held diver at " + currentDepth + " for " + time + " minutes on gas " + currentGasName + ".");
Expand All @@ -908,7 +961,6 @@ return s})({"/dive_comp.js":[function(require,module,exports){
if (!maintainTissues) {
this.resetTissues(origTissues);
}

return dive.collapseSegments(this.segments);
};

Expand Down Expand Up @@ -976,9 +1028,8 @@ return s})({"/dive_comp.js":[function(require,module,exports){
var candidateGas = this.decoGasses[gasName];
var mod = 0;
var end = 0;
//diveprome interface


//diveprome interface
var mix_current_mod = 0;
for( var c = 0 ; c < mix_mod_arr.length ; c++){

Expand All @@ -989,32 +1040,46 @@ return s})({"/dive_comp.js":[function(require,module,exports){
}
}

var mode_selector_val = 0;

if(mix_current_mod == 0){
//automatic MOD and END detection
mod = Math.round(candidateGas.modInMeters(maxppO2, this.isFreshWater));
end = Math.round(candidateGas.endInMeters(depth, this.isFreshWater));
mode_selector_val = 0;
}
else{
//manual MOD and END selection
mod = mix_current_mod;
end = mix_current_mod;
mode_selector_val = 1;
}

//console.log("Found candidate deco gas " + gasName + ": " + (candidateGas.fO2) + "/" + (candidateGas.fHe) + " with mod " + mod + " and END " + end);
if (depth <= mod && end <= maxEND) {
//console.log("Candidate " + gasName + " fits within MOD and END limits.");
if (typeof winner == 'undefined' || //either we have no winner yet
if(mode_selector_val = 1){
if (depth <= mod){
//console.log("Candidate " + gasName + " fits within MOD and END limits.");
if (typeof winner == 'undefined' || //either we have no winner yet
winner.fO2 < candidateGas.fO2) { //or previous winner is a lower O2
//console.log("Replaced winner: " + candidateGas);
winner = candidateGas;
winnerName = gasName;
}
}

}
}
if(mode_selector_val = 0){
if (depth <= mod && end <= maxEND){
//console.log("Candidate " + gasName + " fits within MOD and END limits.");
if (typeof winner == 'undefined' || //either we have no winner yet
winner.fO2 < candidateGas.fO2) { //or previous winner is a lower O2
//console.log("Replaced winner: " + candidateGas);
winner = candidateGas;
winnerName = gasName;
}
}
}
}


return winnerName;
return winnerName;
}

plan.prototype.ndl = function (depth, gasName, gf) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 46074ab

Please sign in to comment.