Add next batch of calculators and AWG support
This commit is contained in:
11
migrate.py
11
migrate.py
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user