From 6d374b5fb3a370d1211dc9cd20c2cee636b386d6 Mon Sep 17 00:00:00 2001 From: Nexan Date: Thu, 16 Jul 2026 21:28:49 -0500 Subject: [PATCH] First Major Commit - Notes Just a Notes/Information Gathering stage for now, as well as adding some files for organization later. * Updated Readme to have some more information on the project - This will be updated frequently * Products.py - adding sample code from AI; this will not be used in the final product * Config.py - No code, only some notes * Main.py - sample code to see if QT is working or not. That code will be removed, and the Main.py file will become the program launcher/glue for the application * Formulas.md - lots of notes. This will also be updated regularly and referenced frequently until the project is finished. As a note, I will be trying to keep up with comments in the code so I don't lose my own place. ADHD is a bitch. --- README.md | 7 ++++++- config.py | 9 +++++++++ formulas.md | 28 ++++++++++++++++++++++++++++ main.py | 16 ++++++++++++++++ products.py | 17 +++++++++++++++++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 config.py create mode 100644 formulas.md create mode 100644 main.py create mode 100644 products.py diff --git a/README.md b/README.md index 238c4e8..2f182cd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # Pool-Calculator -Simple calculator for balancing pool chemistry using various products and the ability to select multiple chlorine options \ No newline at end of file +Simple calculator for balancing pool chemistry using various products and the ability to select multiple chlorine options. + +## NOTES + +- "Calculations" or "Math" folder of some kind that has three main files: Base, Pool, and Spa. Base has all the base formulas for pools and spas, scaling to the actual pool volume, and converting granular to liquid or vice-versa; The Pool File handles chlorine demand calcs, does "granular landing zones" (if using granular or a mix to defeat ammonia), and tracks "cya lockout" risk levels; The Spa file simply scales the math down to spa-size, has bromine-conversion multipliers, and would trigger warnings for high bather load risks or high-temp off-gassing +- diff --git a/config.py b/config.py new file mode 100644 index 0000000..906881e --- /dev/null +++ b/config.py @@ -0,0 +1,9 @@ +This is where you store hardcoded industry numbers. If a manufacturer changes a formula or you want to adjust your store's default targets, you only edit this one file. + + What it holds: + + Liquid chlorine concentration factor (e.g., LIQUID_REDUCTION_FACTOR = 0.75 for your 12.5% logic). + + Standard target landing zone (e.g., TARGET_LANDING_FC = 3.0). + + Volume baselines (POOL_BASE_VOLUME = 10000, SPA_BASE_VOLUME = 100). \ No newline at end of file diff --git a/formulas.md b/formulas.md new file mode 100644 index 0000000..4f862ca --- /dev/null +++ b/formulas.md @@ -0,0 +1,28 @@ +## Stabilizer +CYA Increase (ppm) = [Pounds of Stabilizer X 12] / (Pool Gallons / 10,000) + +## Adding Stabilizer +Target CYA = Current FC / 0.075 + +## For Salt Pools +Target CYG (saltwater) = Current FC / 0.05 + +## Dry Acid to Muriatic +1 pound of Dry Acid = 26 fl oz of 31.45% Muriatic +1.25 pounds of Dry Acid = 1 quart (32oz) of Muriatic +5 pounds of Dry Acid = 1 Gallon of Muriatic + +## Alkalinity Raising +Pounds of Sodium Bicarbonate (BP100) = [Desired TA Increase (ppm) * 1.4] / (Pool Gallons / 10,000) + +## TA Lowering + + +## Total Alkalinity and Adjusted Alkalinity +Total Alkalinity is water's ability to resist pH changes. TA is the sum of all the concentrations of chemical ion species in your pool water that can react with (or consume) a hydrogen ion (H+). +Adjusted Alkalinity is the Total Alkalinity minus the CYA multiplied by Correction Factor, which is based on the pH. + +However, since pools are usually between 7.2 and 8.2 pH, just use the following to get Adjusted Alkalinity: +AA = TA - (CYA * 0.33) + +Basically, keep TA at around 80-120 during the winter, and 60-90 during the season \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..5b5c5de --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + self.setWindowTitle("Hello, World!") + + button = QPushButton("Exit") + button.pressed.connect(self.close) + + self.setCentralWidget(button) + self.show() + +app = QApplication([]) +window = MainWindow() +app.exec() \ No newline at end of file diff --git a/products.py b/products.py new file mode 100644 index 0000000..ff3020c --- /dev/null +++ b/products.py @@ -0,0 +1,17 @@ +Possible Structure of Code in this File + +class BioGuardProduct: + def __init__(self, name, active_ingredient, fc_factor, cya_factor, ch_factor, weight_unit="lb"): + self.name = name + self.active_ingredient = active_ingredient + self.fc_factor = fc_factor # ppm change per unit in 10k gal + self.cya_factor = cya_factor # ppm change per unit in 10k gal + self.ch_factor = ch_factor # ppm change per unit in 10k gal + self.weight_unit = weight_unit + +# Instantiated store inventory: +INVENTORY = { + "burn_out_73": BioGuardProduct("Burn Out 73", "Cal-Hypo", fc_factor=8.7, cya_factor=0, ch_factor=6.1), + "super_soluble": BioGuardProduct("Super Soluble", "Dichlor", fc_factor=6.7, cya_factor=6.0, ch_factor=0), + # Add Low 'N Slow, Stabilizer 100, etc. +} \ No newline at end of file