In this section
- GIS Single-Line Diagram (SLD) V4 Finance electrical · globalgrid2050 / solar-bess-topology-v4/gis-sld-v4-finance.js lines 1–262
- GIS Single-Line Diagram (SLD) V4 Helpers geodesy · globalgrid2050 / solar-bess-topology-v4/gis-sld-v4-helpers.js lines 1–75
- GIS Single-Line Diagram (SLD) V4 Map electrical · globalgrid2050 / solar-bess-topology-v4/gis-sld-v4-map.js lines 1–216
- GIS Single-Line Diagram (SLD) V4 State electrical · globalgrid2050 / solar-bess-topology-v4/gis-sld-v4-state.js lines 1–28
- GIS Single-Line Diagram (SLD) V4 Substations electrical · globalgrid2050 / solar-bess-topology-v4/gis-sld-v4-substations.js lines 1–83
GIS Single-Line Diagram (SLD) V4 Finance
A JavaScript file in GlobalGrid2050 that sets finance label (`setFinanceLabel`), applies development stage defaults (`applyDevelopmentStageDefaults`) and renders finance warnings (`renderFinanceWarnings`) (units: MW, MWh). Served with the page at https://globalgrid2050.com/solar-bess-topology-v4/.
electricalglobalgrid2050 / solar-bess-topology-v4/gis-sld-v4-finance.js · lines 1–262 of 262 · Entry point · pattern renderFinanceWarnings (shared by 4 files)
- What it does
- It draws battery storage (BESS). Defines 8 functions or classes, including setFinanceLabel, convertLargeDefaultToWp, setFinanceInputDefaultsForWp, migrateFinanceUnitsToWp, applyDevelopmentStageDefaults. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS).
- Downstream impact
- Used directly by 6 files: Indexforgis Single-Line Diagram (SLD) V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html); Indexforgis Single-Line Diagram (SLD) V5 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v5/indexforgis-sld-v5.html); Solar Battery Energy Storage System (BESS) Topology V6 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v6/gis-sld-financial-sandbox/); Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/gis-sld-financial-sandbox/); and 2 more. Reached from 168 other entry points, including Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/); Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/); Cable Geometry Visualiser V5 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v5/cable-geometry-visualiser-v5.html). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v4/.
- What it achieves
- It sets finance label (`setFinanceLabel`), converts large default wp (`convertLargeDefaultToWp`) and sets finance input defaults wp (`setFinanceInputDefaultsForWp`). Defines `setFinanceLabel`, `convertLargeDefaultToWp`, `setFinanceInputDefaultsForWp` and 5 more. It responds to DOMContentLoaded events.
- Why it matters
- Loaded by the Indexforgis Single-Line Diagram (SLD) V4 page at https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html and 5 other pages.
- Application
- globalgrid2050 · solar-bess-topology-v4 · script
- Uses
- none found
- Used by
- loaded by Indexforgis Single-Line Diagram (SLD) V4 (script src), loaded by Indexforgis Single-Line Diagram (SLD) V5 (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V6 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (script src)
- Produces
- setFinanceLabel, convertLargeDefaultToWp, setFinanceInputDefaultsForWp, migrateFinanceUnitsToWp, applyDevelopmentStageDefaults, computeFinance, renderFinance, renderFinanceWarnings
- Defines here
- setFinanceLabel, convertLargeDefaultToWp, setFinanceInputDefaultsForWp, migrateFinanceUnitsToWp, applyDevelopmentStageDefaults, computeFinance, renderFinance, renderFinanceWarnings
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v4/gis-sld-v4-finance.js:1-262 · blob bdd51b6a34366317e60b049d67bf8a2bc4160c9f · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
"use strict";
// FINANCIALS
// ============================================================
function setFinanceLabel(inputId, labelText) {
const input = $(inputId);
if (!input) return;
const group = input.closest(".input-group");
const label = group ? group.querySelector("label") : null;
if (label) label.textContent = labelText;
}
function convertLargeDefaultToWp(inputId) {
const input = $(inputId);
if (!input) return;
const value = parseFloat(input.value);
if (!Number.isFinite(value)) return;
if (value > 10) {
input.value = (value / 1_000_000).toFixed(3).replace(/0+$/, "").replace(/\.$/, "");
}
}
function setFinanceInputDefaultsForWp(prefix) {
const stage = $(prefix + "_dev_stage");
if (stage) {
const stageValues = ["0.003", "0.015", "0.035", "0.055", "0.070", "0.080", "0.100"];
Array.from(stage.options).forEach((option, idx) => {
if (stageValues[idx]) option.value = stageValues[idx];
});
if (parseFloat(stage.value) > 10) stage.value = "0.100";
}
setFinanceLabel(prefix + "_dev_cost_mw", "Development Cost £/Wp");
setFinanceLabel(prefix + "_dev_module_mwp", "Module Supply Cost £/Wp");
setFinanceLabel(prefix + "_dev_epc_mw", "EPC Cost £/Wp");
setFinanceLabel(prefix + "_dev_owner_mw", "Other Owner Costs £/Wp");
setFinanceLabel(prefix + "_dev_grid_mw", "Grid Connection Cost £/Wp");
setFinanceLabel(prefix + "_dev_exit_mwp", "Target Exit Value £/Wp");
setFinanceLabel(prefix + "_dev_npv_mwp", "Operating Asset Net Present Value (NPV) £/Wp");
setFinanceLabel(prefix + "_bess_spread", "BESS Revenue per MWh £/MWh");
convertLargeDefaultToWp(prefix + "_dev_cost_mw");
convertLargeDefaultToWp(prefix + "_dev_module_mwp");
convertLargeDefaultToWp(prefix + "_dev_epc_mw");
convertLargeDefaultToWp(prefix + "_dev_owner_mw");
convertLargeDefaultToWp(prefix + "_dev_grid_mw");
convertLargeDefaultToWp(prefix + "_dev_exit_mwp");
convertLargeDefaultToWp(prefix + "_dev_npv_mwp");
const stepMap = {
_dev_cost_mw: "0.005",
_dev_module_mwp: "0.01",
_dev_epc_mw: "0.025",
_dev_owner_mw: "0.025",
_dev_grid_mw: "0.025",
_dev_exit_mwp: "0.05",
_dev_npv_mwp: "0.05"
};
Object.entries(stepMap).forEach(([suffix, step]) => {
const el = $(prefix + suffix);
if (el) el.step = step;
});
}
function migrateFinanceUnitsToWp() {
setFinanceInputDefaultsForWp("fin_string");
setFinanceInputDefaultsForWp("fin_central");
}
function applyDevelopmentStageDefaults(prefix) {
const stage = $(prefix + "_dev_stage");
const cost = $(prefix + "_dev_cost_mw");
if (!stage || !cost) return;
cost.value = stage.value;
const success = $(prefix + "_dev_success");
const successByStage = {
"0.003": 10,
"0.015": 15,
"0.035": 30,
"0.055": 55,
"0.070": 70,
"0.080": 80,
"0.100": 95
};
if (success && successByStage[stage.value] !== undefined) {
success.value = successByStage[stage.value];
}
}
function computeFinance(prefix, stats) {
const dc_mwp = stats.dc_mwp, ac_mw = stats.ac_mw;
const price = num(prefix + "_price");
const other = num(prefix + "_other");
const yieldVal = num(prefix + "_yield");
const bifacial = num(prefix + "_bifacial");
const baseLoss = num(prefix + "_losses");
const deg = num(prefix + "_deg");
const opexRate = num(prefix + "_opex");
const epcEx = num(prefix + "_epc_ex");
const floodAdder = checked(prefix + "_flood") ? num(prefix + "_flood_rate") : 0;
const modules = num(prefix + "_modules");
const otherCapex = num(prefix + "_other_capex");
const fixedCapex = num(prefix + "_fixed_capex");
const cont = num(prefix + "_cont");
const lossExtras = num(prefix + "_loss_dc_string") + num(prefix + "_loss_lv_dc") +
num(prefix + "_loss_lv_ac") + num(prefix + "_loss_tx") + num(prefix + "_loss_other");
const totalLoss = baseLoss + lossExtras;
const bessMw = num(prefix + "_bess_mw");
const bessMwh = num(prefix + "_bess_mwh");
const bessCapexRate = num(prefix + "_bess_capex");
const bessCycles = num(prefix + "_bess_cycles");
const bessRevenuePerMwh = num(prefix + "_bess_spread");
const bessEff = num(prefix + "_bess_eff") / 100;
const safeLoss = Math.min(Math.max(totalLoss, 0), 100);
const safeBessEff = Math.min(Math.max(bessEff, 0), 1);
const effectiveYield = yieldVal * (1 + bifacial / 100);
const year1Gen = dc_mwp * effectiveYield * (1 - safeLoss / 100);
let gen25 = 0, gen35 = 0;
for (let y = 1; y <= 35; y++) {
const yr = year1Gen * Math.pow(1 - deg / 100, y - 1);
if (y <= 25) gen25 += yr;
gen35 += yr;
}
const annualSolarRevenue = year1Gen * (price + other);
const bessAnnualValue = bessMwh * bessCycles * bessRevenuePerMwh * safeBessEff;
const annualRevenue = annualSolarRevenue + bessAnnualValue;
const revenue25 = gen25 * (price + other) + bessAnnualValue * 25;
const revenue35 = gen35 * (price + other) + bessAnnualValue * 35;
const annualOpex = ac_mw * opexRate;
const baseCapexWp = epcEx + modules + otherCapex + floodAdder;
const baseCapex = dc_mwp * 1_000_000 * baseCapexWp;
const contingency = baseCapex * (cont / 100);
const bessCapex = bessMwh * bessCapexRate;
const totalCapex = baseCapex + contingency + fixedCapex + bessCapex;
const capexPerWp = dc_mwp > 0 ? totalCapex / (dc_mwp * 1_000_000) : 0;
const surplus25 = revenue25 - annualOpex * 25 - totalCapex;
const surplus35 = revenue35 - annualOpex * 35 - totalCapex;
const devCostPerMw = num(prefix + "_dev_cost_mw");
const devModulePerMwp = num(prefix + "_dev_module_mwp");
const devEpcPerMw = num(prefix + "_dev_epc_mw");
const devOwnerPerMw = num(prefix + "_dev_owner_mw");
const devGridPerMw = num(prefix + "_dev_grid_mw");
const devExitPerMwp = num(prefix + "_dev_exit_mwp");
const devNpvPerMwp = num(prefix + "_dev_npv_mwp");
const devSuccessPct = num(prefix + "_dev_success");
const devYears = num(prefix + "_dev_years");
const devStageEl = $(prefix + "_dev_stage");
const devStage = devStageEl ? devStageEl.options[devStageEl.selectedIndex]?.text || "Manual" : "Manual";
const wpCapacity = dc_mwp * 1_000_000;
const devCapitalAtRisk = wpCapacity * devCostPerMw;
const devModuleCost = wpCapacity * devModulePerMwp;
const devEpcCost = wpCapacity * devEpcPerMw;
const devOwnerCost = wpCapacity * devOwnerPerMw;
const devGridCost = wpCapacity * devGridPerMw;
const devTotalBuildCost = devCapitalAtRisk + devModuleCost + devEpcCost + devOwnerCost + devGridCost;
const devExitValue = wpCapacity * devExitPerMwp;
const devOperatingNpv = wpCapacity * devNpvPerMwp;
const devGrossMargin = devExitValue - devTotalBuildCost;
const devRiskAdjustedValue = devGrossMargin * (devSuccessPct / 100);
const devReturnMultiple = devCapitalAtRisk > 0 ? devGrossMargin / devCapitalAtRisk : 0;
return {
annualRevenue, revenue25, revenue35, totalCapex, capexPerWp, surplus25, surplus35,
devStage, devCostPerMw, devModulePerMwp, devEpcPerMw, devOwnerPerMw, devGridPerMw, devExitPerMwp, devNpvPerMwp, devSuccessPct, devYears,
devCapitalAtRisk, devModuleCost, devEpcCost, devOwnerCost, devGridCost, devTotalBuildCost, devExitValue, devOperatingNpv,
devGrossMargin, devRiskAdjustedValue, devReturnMultiple,
price, other, yieldVal, bifacial, baseLoss, deg, opexRate,
epcEx, floodActive: checked(prefix + "_flood"), floodRate: num(prefix + "_flood_rate"),
modules, otherCapex, fixedCapex, cont, totalLoss,
bessMw, bessMwh, bessCapexRate, bessCycles, bessSpread: bessRevenuePerMwh, bessEff: num(prefix + "_bess_eff"),
epcIncModules: epcEx + modules
};
}
function renderFinance(prefix, fin) {
setText(prefix + "_annual_rev", money(fin.annualRevenue));
setText(prefix + "_25_rev", money(fin.revenue25));
setText(prefix + "_35_rev", money(fin.revenue35));
setText(prefix + "_capex", money(fin.totalCapex));
setText(prefix + "_capex_wp", "£" + fin.capexPerWp.toFixed(2) + "/Wp");
setText(prefix + "_surplus_25", money(fin.surplus25));
setText(prefix + "_surplus_35", money(fin.surplus35));
setText(prefix + "_dev_capital", money(fin.devCapitalAtRisk));
setText(prefix + "_dev_module_cost", money(fin.devModuleCost));
setText(prefix + "_dev_epc_cost", money(fin.devEpcCost));
setText(prefix + "_dev_owner_cost", money(fin.devOwnerCost));
setText(prefix + "_dev_grid_cost", money(fin.devGridCost));
setText(prefix + "_dev_total_cost", money(fin.devTotalBuildCost));
setText(prefix + "_dev_exit_value", money(fin.devExitValue));
setText(prefix + "_dev_operating_npv", money(fin.devOperatingNpv));
setText(prefix + "_dev_margin", money(fin.devGrossMargin));
setText(prefix + "_dev_risk_value", money(fin.devRiskAdjustedValue));
setText(prefix + "_dev_multiple", fin.devReturnMultiple.toFixed(2) + "x");
}
function renderFinanceWarnings(prefix, fin, stats) {
const w = [];
if (fin.price < 0) w.push("Energy price cannot be negative.");
if (fin.opexRate < 0) w.push("OPEX cannot be negative.");
if (fin.totalLoss < 0) w.push("Losses cannot be negative.");
if (fin.epcIncModules < 0) w.push("EPC cannot be negative.");
if (fin.capexPerWp < 0) w.push("CAPEX cannot be negative.");
if (fin.bessMwh < 0 || fin.bessMw < 0) w.push("BESS size cannot be negative.");
if (fin.bessMwh > 0 && fin.bessEff / 100 <= 0) w.push("BESS efficiency missing.");
if (fin.bessEff / 100 > 1) w.push("BESS efficiency above 100 percent.");
if (fin.price < 50) w.push("Low energy price case.");
if (fin.price > 85) w.push("High energy price case.");
if (fin.epcIncModules < 0.42) w.push("Aggressive EPC pricing.");
if (fin.capexPerWp > 1.00) w.push("Full project cost territory.");
if (fin.capexPerWp > 1.25) w.push("Complex project or asset value territory.");
if (fin.devCostPerMw > 0.10) w.push("Development cost is above typical EPC signature range.");
if (fin.devModulePerMwp < 0.10 && fin.devModulePerMwp > 0) w.push("Module supply cost may be aggressive.");
if (fin.devEpcPerMw < 0.55 && fin.devEpcPerMw > 0) w.push("EPC cost may be aggressive against UK benchmark range.");
if (fin.devEpcPerMw > 0.85) w.push("EPC cost is above typical non BESS UK benchmark range.");
if (fin.devNpvPerMwp < 0.90 && fin.devNpvPerMwp > 0) w.push("Operating asset Net Present Value (NPV) assumption is below current screening range.");
if (fin.devNpvPerMwp > 1.40) w.push("Operating asset Net Present Value (NPV) assumption is above current screening range and may require strong evidence.");
if (stats.dc_mwp > 100) w.push("Project capacity is above 100 megawatts peak. Nationally Significant Infrastructure Project (NSIP) and Development Consent Order (DCO) planning assumptions may apply and development cost, timescale and owner cost defaults may be too low.");
if (fin.devGridPerMw > 1.00) w.push("Grid connection cost assumption is very high and may indicate major reinforcement, transmission interface or abnormal connection risk.");
if (fin.devGridPerMw < 0.10 && fin.devGridPerMw > 0) w.push("Grid connection cost assumption is low and should be checked against the project specific connection scope.");
if (fin.devSuccessPct < 8) w.push("Development success probability is below typical greenfield to EPC outcome range.");
if (fin.devSuccessPct > 25) w.push("Development success probability may be optimistic unless project is already materially de risked.");
if (fin.opexRate < 10000 && fin.opexRate >= 0) w.push("OPEX may be unrealistically low.");
if (fin.totalLoss > 6) w.push("High loss assumption.");
if (fin.bifacial > 12) w.push("Aggressive bifacial gain assumption.");
if (fin.bessMwh > 0 && fin.bessMw <= 0) w.push("BESS MW missing.");
if (fin.bessMw > 0 && fin.bessMwh / fin.bessMw > 8) w.push("Unusually long BESS duration.");
if (fin.bessCycles > 365) w.push("Aggressive storage cycling assumption.");
const elecZero = num(prefix + "_loss_dc_string") + num(prefix + "_loss_lv_dc") +
num(prefix + "_loss_lv_ac") + num(prefix + "_loss_tx") + num(prefix + "_loss_other");
if (elecZero === 0) w.push("Specialist electrical loss fields are blank or zero. Revenue may be overstated until verified.");
const gf = state.activeTab === "string" ? num("gross_factor") : num("gross_factor_c");
if (gf < 1.15) w.push("Gross site factor may be too low for roads, buffers, substations, drainage and ecology.");
if (stats.mods_pallet <= 0 || stats.mods_container <= 0) w.push("Module logistics assumptions are missing.");
const el = $(prefix + "_warnings");
if (el) el.innerHTML = w.join("<br>");
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", migrateFinanceUnitsToWp);
} else {
migrateFinanceUnitsToWp();
}
// ============================================================GIS Single-Line Diagram (SLD) V4 Helpers
A JavaScript file in GlobalGrid2050 that sets class (`setClass`), picks prop (`pickProp`) and sets fetch status (`setFetchStatus`). Served with the page at https://globalgrid2050.com/solar-bess-topology-v4/.
Set aside from the main view: 91% of its lines are the same as feature_requests/003_extract_v2_helpers/files/solar-bess-topology-v2/gis-sld-v2-helpers.js (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 91% of lines shared with GIS Single-Line Diagram (SLD) V5 Helpers; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.913 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 feature_requests/003_extract_v2_helpers/files/solar-bess-topology-v2/gis-sld-v2-helpers.js:1-75 3fe3702efbfab7b20e83e2e2f8113e55b3da2324
- sha256 d652631a243a6d51c2de404a14a600a7ee17f3db9c1937b655cb1c04de455c9c
- target sha256 ecacdadc1dcdda92a551a0ec31344c4b9cb96958f8e35bf92a2896355fdd49b6
- group of 6 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
- re-pointed by apply.py version rule from file 134 to file 256; similarity was measured to file 134
geodesyglobalgrid2050 / solar-bess-topology-v4/gis-sld-v4-helpers.js · lines 1–75 of 75 · Entry point · pattern setFetchStatus (shared by 7 files)
- What it does
- Defines 11 functions or classes, including $, num, intVal, checked, setText. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
- Downstream impact
- Used directly by 2 files: Indexforgis Single-Line Diagram (SLD) V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html); Module Layout V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/module-layout-v4.html). Reached from 3 other entry points, including GlobalGrid2050 — Solar Battery Energy Storage System (BESS) Topology V4 Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/); GlobalGrid2050 Clone V3 to V4 Once Workflow (globalgrid2050); GlobalGrid2050 Clone V3 to V4 (globalgrid2050). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v4/.
- What it achieves
- It sets text (`setText`), sets class (`setClass`) and picks prop (`pickProp`). GIS SLD Financial Sandbox V4. Helpers extracted by GridBot feature 003.
- Why it matters
- Loaded by the Indexforgis Single-Line Diagram (SLD) V4 page at https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html and 1 other page.
- Application
- globalgrid2050 · solar-bess-topology-v4 · script
- Uses
- none found
- Used by
- loaded by Indexforgis Single-Line Diagram (SLD) V4 (script src), loaded by Module Layout V4 (script src)
- Produces
- $, num, intVal, checked, setText, setClass, money, debounce, isValidLngLat, pickProp, setFetchStatus
- Defines here
- $, num, intVal, checked, setText, setClass, money, debounce, isValidLngLat, pickProp, setFetchStatus
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v4/gis-sld-v4-helpers.js:1-75 · blob a7e31ba27b9cac76be2a36929daa18a3d8395871 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
"use strict";
// GIS SLD Financial Sandbox V4
// Helpers extracted by GridBot feature 003.
// Must load after gis-sld-v4-config.js and before the inline app script.
const $ = (id) => document.getElementById(id);
const num = (id) => {
const el = $(id);
return el ? (parseFloat(el.value) || 0) : 0;
};
const intVal = (id, fallback = 0) => {
const el = $(id);
return el ? (parseInt(el.value, 10) || fallback) : fallback;
};
const checked = (id) => {
const el = $(id);
return el ? !!el.checked : false;
};
const setText = (id, val) => {
const el = $(id);
if (el) el.textContent = val;
};
const setClass = (id, cls) => {
const el = $(id);
if (el) el.className = cls;
};
function money(v) {
const rounded = Math.round(v);
if (rounded < 0) return "-£" + Math.abs(rounded).toLocaleString();
return "£" + rounded.toLocaleString();
}
function debounce(fn, ms) {
let t = null;
return function(...args) {
clearTimeout(t);
t = setTimeout(() => fn.apply(this, args), ms);
};
}
function isValidLngLat(c) {
return Array.isArray(c) && c.length >= 2
&& Number.isFinite(+c[0]) && Number.isFinite(+c[1])
&& +c[0] >= -180 && +c[0] <= 180 && +c[1] >= -90 && +c[1] <= 90;
}
function pickProp(obj, keys, fallback = null) {
for (const k of keys) {
if (obj && obj[k] !== undefined && obj[k] !== null && obj[k] !== "") return obj[k];
}
return fallback;
}
function setFetchStatus(msg, isError) {
const el = $("fetch_status");
if (!el) return;
if (!msg) {
el.style.display = "none";
el.textContent = "";
el.classList.remove("error");
return;
}
el.textContent = msg;
el.style.display = "block";
el.classList.toggle("error", !!isError);
}GIS Single-Line Diagram (SLD) V4 Map
A JavaScript file in GlobalGrid2050 that maps sat s, l sat, l subs and topology. Served with the page at https://globalgrid2050.com/solar-bess-topology-v4/.
electricalglobalgrid2050 / solar-bess-topology-v4/gis-sld-v4-map.js · lines 1–216 of 216 · Entry point · pattern onCableRoutePinClick (shared by 3 files)
- What it does
- It maps sat s, l sat, l subs and topology. Defines 7 functions or classes, including initMap, onMapLoad, showPopup, onSubstationClick, onInverterClick. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: 33kV.
- Inputs & outputs
- In: JSON file style.json. Out: interactive map. Voltage levels named: 33kV.
- Downstream impact
- Used directly by 2 files: Indexforgis Single-Line Diagram (SLD) V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html); Indexforgis Single-Line Diagram (SLD) V5 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v5/indexforgis-sld-v5.html). Reached from 107 other entry points, including Cable Geometry Visualiser V5 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v5/cable-geometry-visualiser-v5.html); DC AC LV Topology Review V5 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v5/dc-ac-lv-topology-review-v5.html); GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v4/.
- What it achieves
- It shows popup (`showPopup`) and is built from the init map helper (`initMap`) and the on map load helper (`onMapLoad`). Defines `initMap`, `onMapLoad`, `showPopup` and 4 more.
- Why it matters
- Loaded by the Indexforgis Single-Line Diagram (SLD) V4 page at https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html and 1 other page.
- Application
- globalgrid2050 · solar-bess-topology-v4 · script
- Uses
- none found
- Used by
- loaded by Indexforgis Single-Line Diagram (SLD) V4 (script src), loaded by Indexforgis Single-Line Diagram (SLD) V5 (script src)
- Produces
- initMap, onMapLoad, showPopup, onSubstationClick, onInverterClick, onCableRoutePinClick, onPoiClick
- Defines here
- initMap, onMapLoad, showPopup, onSubstationClick, onInverterClick, onCableRoutePinClick, onPoiClick
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v4/gis-sld-v4-map.js:1-216 · blob 5d8f0681ed0f8822df19292baf7ed04e0103d9e1 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
"use strict";
// MAP
// ============================================================
let map = null;
function initMap() {
if (typeof maplibregl === "undefined") {
setFetchStatus("MapLibre failed to load. Check network.", true);
console.error("maplibregl is undefined");
return;
}
if (typeof turf === "undefined") {
setFetchStatus("Turf failed to load. Check network.", true);
console.error("turf is undefined");
return;
}
map = new maplibregl.Map({
container: "map",
style: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",
center: CONSTANTS.DEFAULT_CENTER,
zoom: CONSTANTS.DEFAULT_ZOOM
});
map.on("error", (e) => console.error("MapLibre error:", e && e.error ? e.error : e));
map.on("load", onMapLoad);
}
function onMapLoad() {
map.addSource("sat-s", {
type: "raster",
tiles: ["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],
tileSize: 256
});
map.addLayer({ id: "l-sat", type: "raster", source: "sat-s", layout: { visibility: "none" } });
map.addSource("src-subs", { type: "geojson", data: { type: "FeatureCollection", features: [] } });
map.addLayer({
id: "l-subs", type: "circle", source: "src-subs",
paint: {
"circle-color": "#ffffff",
"circle-radius": ["interpolate", ["linear"], ["zoom"], 5, 3, 10, 5, 14, 10, 18, 22],
"circle-stroke-width": 1, "circle-stroke-color": "#ff3333", "circle-opacity": 0.8
}
});
map.addSource("topology", { type: "geojson", data: state.currentGeoJSON });
map.addLayer({
id: "overall_boundary_fill", type: "fill", source: "topology",
filter: ["==", "type", "array_boundary"],
paint: { "fill-color": "#0066ff", "fill-opacity": 0.25 }
});
map.addLayer({
id: "overall_boundary_line", type: "line", source: "topology",
filter: ["==", "type", "array_boundary"],
paint: { "line-color": "#0066ff", "line-width": 2, "line-dasharray": [4, 4] }
});
map.addLayer({
id: "footprints", type: "fill", source: "topology",
filter: ["in", ["get", "type"], ["literal", ["skid_footprint", "central_footprint", "bess_footprint"]]],
paint: {
"fill-color": ["match", ["get", "type"],
"skid_footprint", "#00ffff", "central_footprint", "#ff9900", "bess_footprint", "#ff00aa", "#000"],
"fill-opacity": 0.15
}
});
map.addLayer({
id: "footprints_outline", type: "line", source: "topology",
filter: ["in", ["get", "type"], ["literal", ["skid_footprint", "central_footprint", "bess_footprint"]]],
paint: {
"line-color": ["match", ["get", "type"],
"skid_footprint", "#00ffff", "central_footprint", "#ff9900", "bess_footprint", "#ff00aa", "#000"],
"line-width": 1
}
});
map.addLayer({
id: "export_cable", type: "line", source: "topology",
filter: ["==", "type", "export_cable"],
paint: { "line-color": "#ff3333", "line-width": 2, "line-dasharray": [4, 4] }
});
map.addLayer({
id: "radial_spine", type: "line", source: "topology",
filter: ["==", "type", "33kv_radial"],
paint: { "line-color": "#00ffff", "line-width": 2 }
});
map.addLayer({
id: "export_cable_pins", type: "circle", source: "topology",
filter: ["==", "type", "export_cable_pin"],
paint: {
"circle-color": ["case", ["==", ["get", "committed_to_route"], true], "#ff3333", "#ff9900"],
"circle-radius": ["interpolate", ["linear"], ["zoom"], 8, 4, 14, 6, 18, 10],
"circle-stroke-color": "#ffffff",
"circle-stroke-width": 1.5,
"circle-opacity": 0.95
}
});
map.addLayer({
id: "inverters", type: "circle", source: "topology",
filter: ["in", ["get", "type"], ["literal", ["string_substation", "central_inverter", "mv_station", "bess_compound"]]],
paint: {
"circle-color": ["match", ["get", "type"],
"string_substation", "#ffff00", "central_inverter", "#ff9900",
"mv_station", "#6633ff", "bess_compound", "#ff00aa", "#fff"],
"circle-radius": ["match", ["get", "type"],
"string_substation", 4, "central_inverter", 6, "mv_station", 4, "bess_compound", 6, 3],
"circle-stroke-color": "#000", "circle-stroke-width": 1
}
});
map.addLayer({
id: "substation", type: "circle", source: "topology",
filter: ["in", ["get", "type"], ["literal", ["poi", "private_sub"]]],
paint: {
"circle-color": ["match", ["get", "type"], "poi", "#ff3333", "private_sub", "#00ff88", "#fff"],
"circle-radius": 8, "circle-stroke-color": "#fff", "circle-stroke-width": 2
}
});
// Map clicks
map.on("click", "l-subs", onSubstationClick);
map.on("mouseenter", "l-subs", () => map.getCanvas().style.cursor = "pointer");
map.on("mouseleave", "l-subs", () => map.getCanvas().style.cursor = "");
map.on("click", "inverters", onInverterClick);
map.on("mouseenter", "inverters", () => map.getCanvas().style.cursor = "pointer");
map.on("mouseleave", "inverters", () => map.getCanvas().style.cursor = "");
map.on("click", "export_cable_pins", onCableRoutePinClick);
map.on("mouseenter", "export_cable_pins", () => map.getCanvas().style.cursor = "pointer");
map.on("mouseleave", "export_cable_pins", () => map.getCanvas().style.cursor = "");
map.on("click", "substation", onPoiClick);
map.on("mouseenter", "substation", () => map.getCanvas().style.cursor = "pointer");
map.on("mouseleave", "substation", () => map.getCanvas().style.cursor = "");
loadSubstations();
updateLegend();
recalcAll();
}
function showPopup(coords, html) {
if (state.activePopup) state.activePopup.remove();
state.activePopup = new maplibregl.Popup().setLngLat(coords).setHTML(html).addTo(map);
state.activePopup.on("close", () => { state.activePopup = null; });
}
// ============================================================
// MAP CLICK HANDLERS
// ============================================================
function onSubstationClick(e) {
const f = e.features && e.features[0];
if (!f || !f.geometry) return;
const coords = f.geometry.coordinates.slice();
const p = f.properties || {};
state.selectedSubstation = {
name: p.name_clean || pickProp(p, ["name","Name","SiteName","Site Name","substation","Substation"], "Selected Substation"),
voltage: p.voltage_clean || pickProp(p, ["voltage","Voltage","kv","kV","KV"], "Unknown"),
properties: p,
coordinates: coords
};
state.activeDrawCenter = coords;
updateSelectedSubstationDisplay();
computeAndDraw();
showPopup(coords, `
<div style="margin-bottom:5px;color:#ff3333;font-weight:bold;font-size:13px;text-transform:uppercase;">Grid Node</div>
<div class="popup-row"><span>Name:</span><span class="popup-val" style="color:#fff;">${state.selectedSubstation.name}</span></div>
<div class="popup-row"><span>Voltage:</span><span class="popup-val" style="color:#fff;">${state.selectedSubstation.voltage}</span></div>
<div class="popup-row"><span>Lon:</span><span class="popup-val" style="color:#fff;">${Number(coords[0]).toFixed(6)}</span></div>
<div class="popup-row"><span>Lat:</span><span class="popup-val" style="color:#fff;">${Number(coords[1]).toFixed(6)}</span></div>
`);
}
function onInverterClick(e) {
const prop = e.features[0].properties;
const coords = e.features[0].geometry.coordinates.slice();
const colourMap = {
central_inverter: "#ff9900", string_substation: "#ffff00",
bess_compound: "#ff00aa", mv_station: "#6633ff"
};
const colour = colourMap[prop.type] || "#00ffff";
let html = `<div style="margin-bottom:5px;color:${colour};font-weight:bold;font-size:13px;text-transform:uppercase;">Block Info</div>
<div class="popup-row"><span>Type:</span><span class="popup-val" style="color:#fff;">${prop.type}</span></div>`;
if (prop.type === "bess_compound" && prop.mwh !== undefined) {
html += `<div class="popup-row"><span>Capacity:</span><span class="popup-val" style="color:#fff;">${prop.mwh} MWh</span></div>`;
}
showPopup(coords, html);
}
function onCableRoutePinClick(e) {
const prop = e.features[0].properties;
const coords = e.features[0].geometry.coordinates.slice();
const idx = prop.pin_index || "?";
showPopup(coords, `
<div style="margin-bottom:5px;color:#ff9900;font-weight:bold;font-size:13px;text-transform:uppercase;">Cable Route Pin</div>
<div class="popup-row"><span>Pin:</span><span class="popup-val" style="color:#fff;">${idx}</span></div>
<div class="popup-row"><span>Status:</span><span class="popup-val" style="color:#fff;">${prop.committed_to_route ? "Committed to cable route" : "Dropped but not drawn"}</span></div>
<div class="popup-row"><span>Lon:</span><span class="popup-val" style="color:#fff;">${Number(coords[0]).toFixed(6)}</span></div>
<div class="popup-row"><span>Lat:</span><span class="popup-val" style="color:#fff;">${Number(coords[1]).toFixed(6)}</span></div>
`);
}
function onPoiClick(e) {
const prop = e.features[0].properties;
const coords = e.features[0].geometry.coordinates.slice();
const title = prop.type === "poi" ? "Point of Interconnection" : "Customer Substation";
const colour = prop.type === "poi" ? "#ff3333" : "#00ff88";
let html = `<div style="margin-bottom:5px;color:${colour};font-weight:bold;font-size:13px;text-transform:uppercase;">${title}</div>`;
if (prop.selected_substation_name) html += `<div class="popup-row"><span>Name:</span><span class="popup-val" style="color:#fff;">${prop.selected_substation_name}</span></div>`;
if (prop.selected_substation_voltage) html += `<div class="popup-row"><span>Voltage:</span><span class="popup-val" style="color:#fff;">${prop.selected_substation_voltage}</span></div>`;
showPopup(coords, html);
}
// ============================================================GIS Single-Line Diagram (SLD) V4 State
A JavaScript file in GlobalGrid2050. Served with the page at https://globalgrid2050.com/solar-bess-topology-v4/.
Set aside from the main view: Near copy of solar-bess-topology-v5/gis-sld-v4-state.js (globalgrid2050), which stays: reachable first, then the higher version. (near-copy-of, proposed by families.py). 92% of lines shared with GIS Single-Line Diagram (SLD) V4 State; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9231 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v4/gis-sld-v4-state.js:1-28 1f6efb433fba3bb7000bdc62ab0e50d6d06da13f
- sha256 9cc0dd7a0bd22570bc74e91b7cdc8ab2932a17972e7f710650b7f271e95c964f
- target sha256 70cbdfce2b8c2e73e65ad3bed9b25bf9505957b6473851560e9ad686351d62da
- group of 2 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
- re-pointed by apply.py version rule (was canonical)
electricalglobalgrid2050 / solar-bess-topology-v4/gis-sld-v4-state.js · lines 1–28 of 28 · Entry point
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
- Downstream impact
- Used directly by 1 file: Indexforgis Single-Line Diagram (SLD) V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html). Reached from 4 other entry points, including GlobalGrid2050 — Solar Battery Energy Storage System (BESS) Topology V4 Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/); Module Layout V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/module-layout-v4.html); GlobalGrid2050 Clone V3 to V4 Once Workflow (globalgrid2050). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v4/.
- What it achieves
- GIS SLD Financial Sandbox V4. State extracted by GridBot feature 004.
- Why it matters
- Loaded by the Indexforgis Single-Line Diagram (SLD) V4 page at https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html.
- Application
- globalgrid2050 · solar-bess-topology-v4 · script
- Uses
- none found
- Used by
- loaded by Indexforgis Single-Line Diagram (SLD) V4 (script src)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v4/gis-sld-v4-state.js:1-28 · blob 1f6efb433fba3bb7000bdc62ab0e50d6d06da13f · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
"use strict";
// GIS SLD Financial Sandbox V4
// State extracted by GridBot feature 004.
// Must load after config and helpers, and before the inline app script.
const state = {
activeTab: "string",
currentGeoJSON: { type: "FeatureCollection", features: [] },
activeDrawCenter: null,
selectedSubstation: null,
subsVisible: true,
satActive: false,
activePopup: null,
lastStats: null,
lastFinance: { fin_string: null, fin_central: null },
arrayMoveMode: false,
arrayOverrideCenter: null,
arrayRotationDeg: 0,
exportCableLengthKm: 0,
cableRoutePinMode: false,
cableRoutePins: [],
cableRouteCommitted: false,
suppressNextMapFit: false,
// Legacy aliases retained for older export and drawing logic if needed.
cableRouteMode: false,
cableRouteWaypoints: []
};GIS Single-Line Diagram (SLD) V4 Substations
A JavaScript file in GlobalGrid2050 that fetches substations. Served with the page at https://globalgrid2050.com/solar-bess-topology-v4/. It normalises substations (`normaliseSubstations`) and loads substations (`loadSubstations`).
Set aside from the main view: 96% of its lines are the same as feature_requests/005_extract_v2_substation_data/files/solar-bess-topology-v2/gis-sld-v2-substations.js (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 96% of lines shared with GIS Single-Line Diagram (SLD) V5 Substations; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9643 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 feature_requests/005_extract_v2_substation_data/files/solar-bess-topology-v2/gis-sld-v2-substations.js:1-83 914c0ad9fd2b1b3006858ad3b20e5d328252e85d
- sha256 882daa115967c0e25f6b4b003d7b4bc0f3ebfc6d26c01ac3f7f553eed505c625
- target sha256 f73fc672ab0d11720a53279d0663d6f2ad9f525d3aa0535608aa7031a72e9c41
- group of 6 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
- re-pointed by apply.py version rule from file 136 to file 259; similarity was measured to file 136
electricalglobalgrid2050 / solar-bess-topology-v4/gis-sld-v4-substations.js · lines 1–83 of 83 · Entry point · pattern normaliseSubstations (shared by 7 files)
- What it does
- It fetches substations. Defines normaliseSubstations, loadSubstations. Side effects: makes network requests.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: substations.
- Downstream impact
- Used directly by 1 file: Indexforgis Single-Line Diagram (SLD) V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html). Reached from 4 other entry points, including GlobalGrid2050 — Solar Battery Energy Storage System (BESS) Topology V4 Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/); Module Layout V4 (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v4/module-layout-v4.html); GlobalGrid2050 Clone V3 to V4 Once Workflow (globalgrid2050). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v4/.
- What it achieves
- GIS SLD Financial Sandbox V4. Substation data loading extracted by GridBot feature 005.
- Why it matters
- Loaded by the Indexforgis Single-Line Diagram (SLD) V4 page at https://globalgrid2050.com/solar-bess-topology-v4/indexforgis-sld-v4.html.
- Application
- globalgrid2050 · solar-bess-topology-v4 · script
- Uses
- none found
- Used by
- loaded by Indexforgis Single-Line Diagram (SLD) V4 (script src)
- Produces
- normaliseSubstations, loadSubstations
- Defines here
- normaliseSubstations, loadSubstations
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v4/gis-sld-v4-substations.js:1-83 · blob d3348ec6f68e2ea3c93d5102a31bcd24098faba1 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: ingest · effects: network · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
"use strict";
// GIS SLD Financial Sandbox V4
// Substation data loading extracted by GridBot feature 005.
// Must load after config, helpers and state, and before the inline app script.
function normaliseSubstations(raw) {
if (!raw) throw new Error("Empty dataset");
let features = [];
if (raw.type === "FeatureCollection" && Array.isArray(raw.features)) {
features = raw.features;
} else if (Array.isArray(raw)) {
features = raw.map(item => ({
type: "Feature",
geometry: item.geometry || {
type: "Point",
coordinates: [
item.lon ?? item.lng ?? item.longitude ?? item.Longitude ?? item.X,
item.lat ?? item.latitude ?? item.Latitude ?? item.Y
]
},
properties: item.properties || item
}));
} else {
throw new Error("Not a FeatureCollection or array");
}
const cleaned = features
.filter(f => f && f.geometry && f.geometry.type === "Point")
.map(f => {
const c = f.geometry.coordinates.map(Number);
if (!isValidLngLat(c)) return null;
const p = f.properties || {};
return {
type: "Feature",
geometry: { type: "Point", coordinates: [c[0], c[1]] },
properties: {
...p,
name_clean: pickProp(
p,
["name", "Name", "site_name", "SiteName", "Site Name", "substation", "Substation", "substation_name", "Substation Name"],
"Substation"
),
voltage_clean: pickProp(
p,
["voltage", "Voltage", "kv", "kV", "KV", "voltage_kv", "Voltage kV"],
"Unknown"
)
}
};
})
.filter(Boolean);
return { type: "FeatureCollection", features: cleaned };
}
async function loadSubstations() {
setFetchStatus("Loading substations…", false);
try {
const url = SUBSTATIONS_URL + (SUBSTATIONS_URL.includes("?") ? "&" : "?") + "v=" + Date.now();
const res = await fetch(url);
if (!res.ok) throw new Error("HTTP " + res.status);
const raw = await res.json();
const cleaned = normaliseSubstations(raw);
const src = map.getSource("src-subs");
if (src) src.setData(cleaned);
console.log("Substations loaded:", cleaned.features.length);
setFetchStatus(`${cleaned.features.length.toLocaleString()} substations loaded`, false);
setTimeout(() => setFetchStatus("", false), 2500);
} catch (err) {
console.error("Substation load failed:", err);
setFetchStatus(`Substations unavailable: ${err.message}. Check SUBSTATIONS_URL.`, true);
}
}