From 8f44ff37f36e107acf33b5b1467037e20023b4f3 Mon Sep 17 00:00:00 2001 From: jjophi Date: Mon, 16 Oct 2023 20:41:59 +0530 Subject: [PATCH] Battery app updates --- battery-calcuator/index.html | 96 +++++++++++++++++++++++++++++------- css/style.css | 24 ++++++--- 2 files changed, 97 insertions(+), 23 deletions(-) diff --git a/battery-calcuator/index.html b/battery-calcuator/index.html index 1f16eb8..fcd4ffc 100644 --- a/battery-calcuator/index.html +++ b/battery-calcuator/index.html @@ -5,24 +5,33 @@
-

Battery Capacity Requirement Calculator for SWIS - ADCP Edition

- +

+ SWIS - ADCP Edition + Battery Capacity Requirement Calculator +

+
+ + +
+
-

To use this calculator, follow these steps:

+

To use this program, follow these steps:

    -
  1. Specify distance between the topside and seabed modems (slant range) in meters (and select modem if required). Current acceptable range is 1 - 1500 meters.
  2. -
  3. Provide calculated filesize (in kilobytes) from the ADCP software.
  4. -
  5. Enter the number of times to transfer per day or week (minimum 1 per day or week, maximum 12 times a day of week)
  6. -
  7. Enter the expected idle duration for each transmission (minimum 10 minutes, maximum 60 minutes)
  8. -
  9. The program recommends the modem to be used, calculates data rate, transmission power, and durations.
  10. -
  11. NOTE: Maximum 12-hour total transmission duration.
  12. -
  13. Battery capacity: Estimated daily, weekly, and monthly battery capacity requirements.
  14. +
  15. SDistance: Enter the distance between the topside and seabed modem (slant range) in meters.
  16. +
  17. File Size: Provide the calculated file size (in kilobytes) obtained from the ADCP software.
  18. +
  19. Number of Transmissions: Specify the number of times you need to transfer per day/week/month.
  20. +
  21. Interpret Results: The program will recommend the modem, calculate the data rate, transmission power, and various durations based on the inputs.
  22. +
  23. Transmission Limits: The program imposes certain limits to optimize power consumption.
  24. +
  25. Battery Capacity: The program will present the estimated battery capacity requirements for your deployment on a daily, weekly, and monthly basis.
+

Remember to use the tool as a guidance tool rather than a definitive source, and consider consulting experts and conducting additional analysis for accurate battery capacity estimations.

@@ -100,7 +109,6 @@

To use this calculator, follow these steps:

-
[[ commonError ]]
@@ -296,7 +304,6 @@
Additional Info
recommended.value = null; } }); - const revisedTransitTimes = computed(() => { downloadTimes.value = 1; return Number(donwloadFrequency.value); @@ -377,7 +384,6 @@
Additional Info
const tx_duration = file_size * 1000 / data_rate; resultValues.txduration = Math.round(tx_duration); - //find total seconds let total_seconds = 24 * 60 * 60; if(Number(donwloadFrequency.value) == 7) { @@ -390,7 +396,6 @@
Additional Info
const rx_duration = setupVars.IDLE_TIME * 60; //Converting to seconds resultValues.rxduration = rx_duration; - if(tx_duration > setupVars.MAX_TOTAL_TX_DURATION) { commonError.value = errors.commonError01; noErrors.value = false; @@ -454,6 +459,7 @@
Additional Info
if(el) { el.scrollIntoView({ behavior: "smooth" }) } + generateURL(); }) } @@ -475,7 +481,7 @@
Additional Info
} } - const txpower = (range, fc) => { + const txpower = (range, fc) => { if(range < 1) return none; if (fc == setupVars.MF ) { @@ -505,6 +511,61 @@
Additional Info
return `${inputInSeconds} seconds (${inputInHours} hrs)`; } + const generateURL = () => { + const newParams = new URLSearchParams(); + newParams.set('range', distanceInput.value ); + newParams.set('speed', recommended.value); + newParams.set('size', filesizeInput.value); + newParams.set('freq', donwloadFrequency.value); + newParams.set('times', downloadTimes.value); + + const newUrl = `${window.location.pathname}?${newParams.toString()}`; + window.history.pushState({}, '', newUrl); + } + + const copyURL = () => { + let tempEl = document.createElement('input'); + let elText = window.location.href; + document.body.appendChild(tempEl); + tempEl.value = elText; + tempEl.select(); + document.execCommand('copy'); + document.body.removeChild(tempEl); + } + + onMounted(() => { + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + let range, speed, filesize, frequency, times; + + range = urlParams.get('range'); + speed = urlParams.get('speed'); + filesize = urlParams.get('size'); + frequency = urlParams.get('freq'); + times = urlParams.get('times'); + + if(range && speed && filesize && frequency && times ) { + distanceInput.value = range; + recommended.value = speed; + filesizeInput.value = filesize; + + if(frequency == 4 || frequency == 7 || frequency == 15) { + donwloadFrequency.value = frequency; + }else{ + donwloadFrequency.value = 4; + } + + if(times > 15) { + times = 1; + } + + nextTick(() => { + downloadTimes.value = times; + calculateBattery(); + }) + } + }) + return { showHelp, rangeError, @@ -522,6 +583,7 @@
Additional Info
updatedOutputText, revisedTransitTimes, downloadTimesColor, + copyURL, }; } diff --git a/css/style.css b/css/style.css index 042d5c3..f7c83d6 100755 --- a/css/style.css +++ b/css/style.css @@ -4148,23 +4148,31 @@ p.small-title { padding: 100px 1.6rem 1.6rem; } .bc-header { - display: flex; - justify-content: center; - align-content: center; - gap: 10px; + position: relative; padding: 3.4rem 0 2rem; } .bc-header .page-title { margin: 0; padding: 0; } +.bc-header .page-title .subtext{ + display: block; + font-size: 1.8rem; + color: #e6782f; +} + +.bc-button-group { + position: absolute; + bottom: 0; + right: 0; +} .bc-header button { background: transparent; border: none; width: auto; height: auto; padding: 0; - margin: 0; + margin: 4px; } .bc-header .fa { color: #545454; @@ -4219,7 +4227,7 @@ p.small-title { color: #808080; } .bc-wrapper .bc-button-row { - padding: 1.6rem 0.8rem; + padding: 1.5rem 0.8rem 0.6rem; text-align: center; } .bc-wrapper .bc-btn { @@ -4227,6 +4235,7 @@ p.small-title { font-size: 18px; font-weight: 500; padding: 16px 52px; + margin: 0; cursor: pointer; border: none; text-transform: uppercase; @@ -4359,6 +4368,9 @@ input[type="range"]::-webkit-slider-thumb { padding: 1.6rem; font-size: 16px; } +.bc-wrapper .common-errors:empty { + display: none; +} .output-section { scroll-margin-top: 100px; }