I went looking for an article that explains the relationships between the factors that make up the saturation index, but no luck in a quick search.
In a nutshell, CSI works like that:
The product of the concentrations of Carbonate and Calcium ions divided by the solubility of Calcium Carbonate is 1 in equilibrium (that's essentially how the solubility is defined).
Take the logarithm and the one turns to zero, and the product and division become a sum of the logarithms of Calcium and Carbonate ion concentrations minus (which is a "negative plus") the logarithm of the solubility. That sum of the logs will be negative when undersaturated and positive when oversaturated. You start recognising our CSI here. It's the product of both, Calcium and Carbonate ion concentrations, that matters. Or the sum of the logarithms.
Now you want to express the carbonate and calcium ion concentrations by parameters you get from pool tests. The concentrations are actually "activities", considering ionic strengths, which is where the TDS comes in, basically to describe "shielding" of carbonate and calcium ions by other ions. High TDS basically means that Calcium and Carbonate ions are more shielded and you need more of them to reach saturation.
The temperature comes in via the Calcium Carbonate solubility. At lower temperatures more Calcium Carbonate can remain dissolved in water, i.e. reducing the CSI (that's why kettles scale up when heating up water in them).
The Carbonate ion concentration can be calculated from Carbonate Alkalinity, which is where pH comes in - at high pH Carbonate Alkalinity is nearly all Carbonate ion, at lower pH is us nearly all Bicarbonate ion, at very low pH there is no Carbonate Alkalinity left, all the Carbonates are essentially dissolved CO2 (which doesn't contribute to Alkalinity) at this point which mostly outgasses while pH is low.
Carbonate Alkalinity can be calculated from Total Alkalinity by subtracting CYA- and Borate Alkalinities, which is where CYA and BOR come in, and another pH dependency.
By the way: This is the only place that "corrected" Alkalinity has, it is just required as an intermediate value to calculate CSI - pool stores reporting this "corrected" Alkalinity to their customers, and sometimes even still call it "total", is utter nonsense that simply creates confusion (including amongst pool store staff). No one wants to do these calculations manually these days, that's what computers are for. Most customers don't want to do the calculation at all, they just want to know if their water is OK. But they end up buying overpriced baking soda because their "corrected Total" Alkalinity is "low". Even though CYA-Alkalinity has to be subtracted to calculate CSI, it still provides buffering and has its place in Total Alkalinity. End of rant, back to CSI.
Calcium ion concentration gets approximated by CH.
That's really it, plus a lot of unit juggling between PPMs and moles. And a couple of approximations and assumptions which other ions are in the water at a given TDS, CH, etc. to calculate the ionic strengths.
If you are interested in the details, then do a forum search for chem geek's Pool Equations spreadsheet, he shows the full derivation of the CSI at the bottom of the sheet.
And regarding scaling in the SWG cell: The best thing to combat this are Borates. They are the best of our available buffers at higher pH, and are quite efficient at limiting the pH rise right next to the cell cathode plates, and therefore keep the local cell CSI in check.