Add next batch of calculators and AWG support

This commit is contained in:
Codex Agent
2026-03-08 01:49:50 +00:00
parent 68bc636af8
commit e9e5adce42
5 changed files with 128 additions and 45 deletions

View File

@@ -118,8 +118,13 @@ def process():
c_type = 'standard'
factor_val = "1"
offset_val = "0"
if '1/x' in factor_raw:
# Special-case calculator families that require custom math beyond simple factors.
if 'awg' in slug:
c_type = 'awg'
elif 'brinell-to-rockwell-c' == slug or 'rockwell-c-to-brinell' == slug:
c_type = 'brinell-rockwell'
elif '1/x' in factor_raw:
c_type = 'inverse'
factor_val = "1"
elif 'Multi-Variable' in factor_raw:
@@ -296,7 +301,7 @@ def process():
# Ensure types are right
# write to TS
out = """// THIS FILE IS AUTO-GENERATED BY migrate.py
export type CalcType = 'standard' | 'inverse' | '3col' | '3col-mul' | 'base' | 'text-bin' | 'bin-text' | 'dms-dd' | 'dd-dms' | 'dec-frac' | 'db-int' | 'db-spl' | 'db-v' | 'db-w';
export type CalcType = 'standard' | 'inverse' | '3col' | '3col-mul' | 'base' | 'text-bin' | 'bin-text' | 'dms-dd' | 'dd-dms' | 'dec-frac' | 'db-int' | 'db-spl' | 'db-v' | 'db-w' | 'awg' | 'brinell-rockwell';
export interface CalculatorDef {
slug: string;