;-------------------------------------------------------------------------------
; $Id: trans.ini,v 1.67 2025/05/12 10:17:55 jsm Exp $
#unset INI_VERSION_2 ; this is set by TunerStudio

[MegaTune]
   MTversion      = 2.25

   versionInfo    = "r\x07\x0e\x00\x00\x00\x37"  ; Put this in the title bar.
   queryCommand   = "r\x07\x0f\x00\x00\x00\x14"  ; Verify against signature.

   signature      = "Trans 00034.9      "
                   ;"123456789.123456789"

[TunerStudio]
   iniSpecVersion = 3.24
   helpManualDownloadRoot = "http://www.msextra.com/doc/pdf/"
#if INI_VERSION_2
; ok
#else
 #error Megatune is obsolete - please upgrade to TunerStudio
#endif

#set DEBUG_LOGGING
;-------------------------------------------------------------------------------

[ReferenceTables]

    tableWriteCommand     = "w\$tsCanId%2i%2o%2c%v"
    tableBlockingFactor = 256 ;
  
    ; valid table Generator types:
    ; thermGenerator - as used for temp sensor calibration
    ; linearGenerator - as used for linear generic WB sensors
    ; Must have at least 1 solution, even it it is a reference to a generator.
    ; tableIdentifiers are expected to be numeric and in base 8 or 16
    
    referenceTable = std_ms2gentherm, "Calibrate Thermistor Tables..."
        tableIdentifier	= 000, "Local Engine Temperature Sensor", 001, "Trans Temperature Sensor"
        ; tableLimits (optional) = intentifier, min, max, defaultVal 
        ; will set the default value if value is outside the min and max limits.
        tableLimits	= 001, -40, 350, 70
#if EXPANDED_CLT_TEMP
	tableLimits = 000, -40, 400, 350
#else
	tableLimits = 000, -40, 350, 180
#endif
	adcCount 	= 1024 	; length of the table
        bytesPerAdc 	= 2 	; using shorts
        scale		= 10 	; scale by 10 before sending to controller
        ;tableGenerator = Generator type, Label 
        tableGenerator  = thermGenerator, "Thermistor Measurements"
        tableGenerator  = fileBrowseGenerator, "Browse for Inc File"
        ; thermOption	= name, resistor bias, tempPoint1(C), resPoint1, tempPoint2, resPoint2, tempPoint3, resPoint3
        thermOption 	= "GM", 	2490,    -40, 100700, 	30, 2238,     99, 177
        thermOption 	= "Chrysler 85 up", 	2490,    5.5,24500, 30.5, 8100,    88.3, 850
        thermOption 	= "Ford", 	2490,      0, 94000, 	50, 11000,    98, 2370
        thermOption 	= "Saab (Bosch)", 	2490,      0, 5800, 	80, 320,    100, 180
        thermOption 	= "Mazda", 	50000,   -40, 2022088, 	21, 68273,    99, 3715
        thermOption 	= "Mitsu", 	2490,    -40, 100490, 	30, 1875,    99, 125
        thermOption 	= "Toyota",	2490,    -40, 101890, 	30, 2268,    99, 156
        thermOption 	= "RX-7_CLT(S4 & S5)", 2490, -20, 16200, 20, 2500, 80, 300
        thermOption 	= "RX-7_MAT", 42200, 20, 41500, 50, 11850, 85, 3500
        thermOption     = "VW L-Jet Cylinder Head Temp Sensor II", 1100, -13.888, 11600, 53.888, 703, 95.555, 207
        thermOption 	= "RX-7_AFM(S5 in AFM)", 2490, -20, 16200, 20, 2500, 80, 300
        thermOption     = "BMW E30 325i",    2490,    -10, 9300,    20, 2500,     80, 335
        solution	= "3 Point Therm Generator",          thermGenerator
        solution        = "Custom inc File",    fileBrowseGenerator

[PcVariables]
    tsCanId       = bits,   U08,   [0:3], "CAN ID 0", "CAN ID 1", "CAN ID 2", "CAN ID 3", "CAN ID 4", "CAN ID 5", "CAN ID 6", "CAN ID 7", "CAN ID 8", "CAN ID 9", "CAN ID 10","CAN ID 11","CAN ID 12","CAN ID 13","CAN ID 14","INVALID"
    prefSpeedUnits   =   bits,  U08,   [0:0], "MPH", "KPH"
    prefLengthUnits  =   bits,  U08,   [0:0], "m", "in"
    gearDisplay      =   bits,  U08,   [0:2], "R", "P/N", "PRN1", "2", "3", "4", "5"

[Constants]

   ;----------------------------------------------------------------------------
   ; Constants Definition
   ; --------------------
   ;
   ; Scalar Values
   ; -------------
   ; The scaling and translation values are used as follows:
   ;    msValue   = userValue / scale - translate
   ;    userValue = (msValue + translate) * scale
   ;
   ; I've got no good way to handle a few of these things yet.
   ;
   ; Temperatures are fine, check out the Fielding IAC example (fastIdleTemp).
   ;
   ; The TPS stuff is a problem, because we have to modify the ini file for
   ; each TPS installation and again whenever we move the TPS...  I figured
   ; out a moderately palatable solution to presenting the frequency
   ; divider in the boost control values, turn it into a bit field and then
   ; enumerate the resulting frequencies.
   ;
   ; Array Values
   ; ------------
   ; Arrays are specified just like scalars, except that they have a "shape"
   ; entry in the fourth parameter.  The shape allows you to define lists or
   ; tables, for example [8] defines a list with eight values and [2x4] defines
   ; a table with eight values (two rows and four columns).  Tables may be
   ; stored in either "X-" or "Y-order."  X-order means that memory is layed
   ; out like.
   ;
   ;     [x1,y1] [x2,y1]...[xn,y1] [x1,y2]...
   ;
   ; Y-order would be
   ;
   ;     [x1,y1] [x1,y2]...[x1,yn] [x2,y1]...
   ;
   ; To use the TableEditor, you must define two lists and a table, and
   ; the lengths of the lists must correspond to the shape of the table.
   ;
   ; Bit Fields
   ; ----------
   ; Bits are numbered 0-7, the rightmost being bit zero.  The basic
   ; data word that stores bit fields must be unsigned.
   ;
   ; You need NOT supply the correct number of labels matching the
   ; number of bits you've specified (one bit requires 2 values, two
   ; bits requires 4 values and so on).  If you neglect to supply enough
   ; labels, they will be synthesized using the sequence "1", "2" and so
   ; on based upon their position in the sequence (the cltType and matType
   ; will end up with identical lists).
   ;
   ;----------------------------------------------------------------------------

   pageActivationDelay = 30 ; Milliseconds delay after burn command.
   blockReadTimeout    = 400 ; Milliseconds total timeout for reading page.
;   writeBlocks = 	off
;   interWriteDelay = 	5
   tsWriteBlocks = 	on
   interWriteDelay = 	1

   endianness          = big
   nPages              = 1
   pageSize            = 1024
   pageIdentifier      = "\x07\x04"
   burnCommand         = "b\x07\x04"
   pageReadCommand     = "r\x07\x04%2o%2c"
   pageValueWrite      = "w\x07\x04%2o%2c%v"
   pageChunkWrite      = "w\$tsCanId\x04%2o%2c%v"
   crc32CheckCommand   = "k\$tsCanId\x04\x00\x00\x00\x04"
   tableCrcCommand = "k\$tsCanId%2i%2o%2c"
   retrieveConfigError    = "r\$tsCanId\x07\x04\x00\x00\xff"

; new serial
   messageEnvelopeFormat = msEnvelope_1.0
   blockingFactor = 256 ; 256 is max read/write data size for MS2/Extra + trans

   page = 1
   ;  name            = class,  type, offset,      shape,  units,       scale, translate,    lo,      hi, digits
      divider         = scalar,  U08,      0,      "",       1, 0, 0, 255, 0                                              ; *
;spare
;gear ratios
      gear1           = scalar,  U16,      2,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes) ; customgear[] in code
      gear2           = scalar,  U16,      4,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear3           = scalar,  U16,      6,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear4           = scalar,  U16,      8,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear5           = scalar,  U16,     10,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear6           = scalar,  U16,     12,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear7           = scalar,  U16,     14,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear8           = scalar,  U16,     16,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear9           = scalar,  U16,     18,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      gear10          = scalar,  U16,     20,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      maxrpm1         = scalar,  U16,     22,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm2         = scalar,  U16,     24,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm3         = scalar,  U16,     26,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm4         = scalar,  U16,     28,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm5         = scalar,  U16,     30,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm6         = scalar,  U16,     32,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm7         = scalar,  U16,     34,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm8         = scalar,  U16,     36,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm9         = scalar,  U16,     38,     "RPM", 1, 0, 1000, 15000, 0
      maxrpm10        = scalar,  U16,     40,     "RPM", 1, 0, 1000, 15000, 0
      wheeldia        = scalar,  U16,     42,     { bitStringValue( prefLengthUnits ,  prefLengthUnits ) },   { prefLengthUnits == 0 ? 0.001 : 0.03937 }, 0, { prefLengthUnits == 0 ? 0.3 : 12 }, { prefLengthUnits == 0 ? 2 : 79 }, 3;{ prefLengthUnits == 0 ? 3 : 1 }
      fdratio         = scalar,  U16,     44,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
      tpsMin          = scalar,  S16,    46,      "ADC",      1.00000,   0.00000,    0.0, 1023.0,      0 ; * (  2 bytes)
      tpsMax          = scalar,  S16,    48,      "ADC",      1.00000,   0.00000,    0.0, 1023.0,      0 ; * (  2 bytes)
      map0            = scalar,  S16,    50,             "%",      0.10000,   0.00000,  -3276.8, 3276.7,      1 ; * (  2 bytes)
      mapmax          = scalar,  S16,    52,             "%",      0.10000,   0.00000,  -3276.8, 3276.7,      1 ; * (  2 bytes)
      lockuphyst      = scalar,  U16,    54,      { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      vss1_pos      = bits,      U08,    56, [0:2], "Wheel", "Driveline", "Pulses per mile", "Pulses per km", "Listen to CAN broadcast", "INVALID", "INVALID", "INVALID"
      lockrace_on   = bits,      U08,    57, [0:0], "Off", "On"
;      lockrace_gear = bits,      U08,    57, [1:2], "4th only", "3rd + 4th", "2nd,3rd,4th", "INVALID"
;      lockrace_shift= bits,      U08,    57, [3:3], "No", "Yes"
;      lockrace_mod  = bits,      U08,    57, [4:4], "Off", "INVALID"
      lockupmintps    = scalar,    S16,    58, "%tps",    0.1,0,-10,100,1
      lockuptps       = scalar,    S16,    60, "%tps",    0.1,0,0,105,1
      lockrace_tps = scalar,     S16,    62, "%tps",    0.1,0,0,101,1
;      lockrace_delay = scalar,   U16,    64, "s",      0.001,0,0,2.5,3
      brakesw_on    = bits,      U08,    66, [0:0], "Off", "On"
      brakesw_pol   = bits,      U08,    66, [1:1], "Low", "High"
;gap
    tcc_opth9      = bits,    U08,      68, [0:0], "Off", "On"
    tcc_opth10     = bits,    U08,      68, [1:1], "Off", "On"
    tcc_optl1      = bits,    U08,      69, [0:0], "Off", "On"
    tcc_optl2      = bits,    U08,      69, [1:1], "Off", "On"
    tcc_optl3      = bits,    U08,      69, [2:2], "Off", "On"
    tcc_optl4      = bits,    U08,      69, [3:3], "Off", "On"
    tcc_optl5      = bits,    U08,      69, [4:4], "Off", "On"
    tcc_optl6      = bits,    U08,      69, [5:5], "Off", "On"
    tcc_optl7      = bits,    U08,      69, [6:6], "Off", "On"
    tcc_optl8      = bits,    U08,      69, [7:7], "Off", "On"

    vssout_scale        = scalar, U32,     70,    "", 1, 0, 0, 300000, 0

    manual_in       = bits,    U08,  74, [0:3], "INVALID", "PE0", "PE1", "PA0", "INVALID", "INVALID", "INVALID", "INVALID", "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7"
    manual_in_ms2       = bits,    U08,  74, [0:3], "INVALID", "PE0", "PE1", "JS11", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "CLT", "TPS", "INVALID", "INVALID", "ADC6", "ADC7"
    manual_in_us       = bits,    U08,  74, [0:3], "INVALID", "FLEX", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "O2", "INVALID", "SPAREADC2"
    manual_on       = bits,    U08,  74, [6:7], "Auto", "Manual", "Manual - selectable", "INVALID"
    manual_start2  = bits,    U08,  74, [5:5], "Off", "On" ; Note - applies in auto as well as manual
    shiftret_table  = scalar,  U08,    75,      "",     1,0,0,14,0
    rpm_shift_tps = scalar,    S16,    76, "%tps",    0.1,0,50,100,1
    lowrange_in       = bits,    U08,  78, [0:3], "INVALID", "PE0", "PE1", "PA0", "INVALID", "INVALID", "INVALID", "INVALID", "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7"
    lowrange_in_ms2       = bits,    U08,  78, [0:3], "INVALID", "PE0", "PE1", "JS11", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "EGO", "ADC6", "ADC7"
    lowrange_in_us       = bits,    U08,  78, [0:3], "INVALID", "FLEX", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "O2", "INVALID", "SPAREADC2"
    lowrange_in_on       = bits,    U08,  78, [7:7], "Off", "On"
    lowrange_in_pos  = bits,    U08,   78, [6:6], "Before", "After"
    
;gap
;    shiftret_time   = scalar,  U16,    80,      "s",      0.001,  0,        0,     8,       2
    shiftret_off    = scalar,  U16,    82,      "",      1,  0,        0,     2047,       0
    vss1_can_scale_pulse= scalar, U16, 84,     "",   1, 0, 0, 65535, 0
    lockuppostdelay   = scalar,  U16,   86,      "s",      0.001,0,0,2.5,3
    lockuprpostdelay  = scalar,  U16,   88,      "s",      0.001,0,0,2.5,3
    lowrange_ratio    = scalar,  U16,   90,      ":1",      0.01,   0.00000,  0.40,  5.0,      2 ; * (  2 bytes)
    slew_rate_global   = scalar, U08,   92, "deg/tenth", 1, 0.00000, 1, 40, 0 
;gap here

      inteeth       = scalar,    U08,    94, "teeth", 1,0,0,255,0
      reluctorteeth   = scalar,  U08,    95,      "",        1, 0,0,255,0
;gap
      lockupstart     = scalar,  U08,    98,      "%",       0.3922,0,0,100,0
      lockupfull      = scalar,  U08,    99,      "%",       0.3922,0,0,100,0
      lockupend       = scalar,  U08,   100,      "%",       0.3922,0,0,100,0
      setting3_luf    = bits,    U08,   101, [0:0], "Off", "On"
      setting3_gearcustom = bits,U08,   101, [1:1], "Built-in", "Custom"
      setting3_lockshift = bits, U08,   101, [2:2], "Off", "On"
      setting3_pergeardelay=bits,U08,   101, [3:3], "Common", "Per Gear"
      setting3_lockuponoff =bits,U08,   101, [4:4], "Variable PWM", "On/Off"
      setting3_predictshift=bits,U08,   101, [5:5], "Off", "On"
      setting3_lockupload = bits,U08,   101, [6:6], "TPS", "MAP"
      setting3_lineload  = bits, U08,   101, [7:7], "TPS", "MAP"
      lockupwait      = scalar,  U16,   102,      "s",      0.001,0,0,5,3
      lockupontime    = scalar,  U16,   104,      "s",      0.001,0,0,2.5,3
      lockupofftime   = scalar,  U16,   106,      "s",      0.001,0,0,2.5,3
      mycan_id        = scalar,  U08,   108,      "",        1, 0,0,255,0
      cpu             = bits,    U08,  109, [0:2], "NOT SET", "MS2", "Microsquirt", "GPIO", "Microsquirt V3", "INVALID", "INVALID", "INVALID" ; setting 1
      loadin          = bits,    U08,  109, [3:3], "TPS", "MAP"
      lineopt         = bits,    U08,  109, [4:4], "Common", "Individual"
      epcfreq         = bits,    U08,  109, [5:5], "290Hz", "590Hz"
      setting1_rpmshift= bits,   U08,  109, [6:6], "Off", "On"
      setting1_retard = bits,    U08,  109, [7:7], "Off", "On"
      trans           = bits,    U08,  110, [0:4], "4L80E", "4L60E", "A341E", "INVALID", "4R70W analog", "4R70W switch", "4T40E", "5L40E", "E4OD analog", "E4OD switch", "W4A33", "BTR analog", "Jeep AW4", "4R44E", "ZF 4HP Range Rover", "4T65E", "ZF 4HP Porsche", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" ; setting2
;See also the setting selector for these autoboxes.
;       can_poll        = bits,    U08,  111, [0:1], "Local connection", "Remote MS2", "Listen to broadcast", "INVALID" ; obsolete setting names
       can_poll2       = bits,    U08,  111, [0:1], "Local connection", "Remote Megasquirt", "Listen to CAN broadcast", "INVALID" ; can add other types here and write firmware to poll them
      can_poll_alcan_disable = bits,    U08,  111, [2:2], "Enabled", "Disabled"
      can_poll_id     = scalar,  U08,    112,      "",     1,0,0,14,0
       
      tst_enable      = bits,    U08,    113, [0:0], "Off", "On"
      tst_lock        = scalar,  U16,    114,      "",         1,0,0,65535,0
      tst_gear        = scalar,  S08,    116,      "gear",     1,0,-1,4,0
      tst_epc         = scalar,  U08,    117,      "%",     0.3922,0,0,100,0
      tst_tcc         = scalar,  U08,    118,      "%",     0.3922,0,0,100,0
      tst_sol32       = scalar,  U08,    119,      "%",     0.3922,0,0,100,0
      predict_rpm_min = scalar,  U16,    120,     "RPM", 1,   0, 0, 15000, 0
      setting4_gearwhen = bits, U08,   122, [0:0], "End of shift", "Start of shift"
      setting4_epccorr =  bits, U08,   122, [1:1], "Off", "On"
      setting4_spk_slew = bits, U08,   122, [2:2], "Off", "On"
;gap
      gearpv        = scalar,  U16,      126,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gearrv        = scalar,  U16,      128,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gearnv        = scalar,  U16,      130,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gear1v        = scalar,  U16,      132,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gear2v        = scalar,  U16,      134,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gear3v        = scalar,  U16,      136,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gear4v        = scalar,  U16,      138,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gear5v        = scalar,  U16,      140,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      gear6v        = scalar,  U16,      142,      "V",      0.01,   0.00000,  0.00,  5.0,      2 ; * (  2 bytes)
      can_bcast_id  = scalar,  U16,      144,         "",      1,   0.00000, 0,  2047,      0
;pad
      sol4pwm_vsss     = array,  S16, 150,  [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      sol4pwm_loadvals = array,  S16, 162, [6], "%", 0.1 , 0, 0, 400, 1
      sol4pwm_duties   = array,  U08, 174, [6x6], "%", 0.392, 0, 0, 100.0, 0
    fan_opt_on     = bits,    U08,  210, [0:0], "Off", "On"
    fan_opt_engoff = bits,    U08,  210, [1:1], "Off", "On"
    fan_opt_tpsshut= bits,    U08,  210, [2:2], "Off", "On"
    fan_out_us     = bits,    U08,  211, [0:3], "INVALID", "INVALID", "INVALID", "TACHOUT", "ALED", "WLED", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
    fan_tps    = scalar,  S16,  212, "%tps",    0.1,0,50,100,1
#if CELSIUS
   fan_thresh_on  = scalar, S16, 214, "°C", 0.0555, -320, 20, 90, 1
   fan_thresh_off    = scalar, S16, 216, "°C", 0.0555, -320, 20, 90, 1
#else
   fan_thresh_on  = scalar, S16, 214, "°F", 0.1, 0, 50, 200, 1
   fan_thresh_off = scalar, S16, 216, "°F", 0.1, 0, 50, 200, 1
#endif

    epc_corr_epc = array,  U16, 218, [6], "Raw EPC%", 0.392, 0, 0, 100.0, 0 ; 12 bytes
#if CELSIUS
      epc_corr_temp = array,  S16, 230,    [6], "°C",       0.05555,  -320.000,-40.00,  150.00,      1 ; * ( 12 bytes)
#else
      epc_corr_temp = array,  S16, 230,    [6], "°F",       0.10000,   0.00000,-40.00,  300.00,      1
#endif
    epc_corr_duties   = array,  U08, 242, [6x6], "%", 0.392, 0, 0, 100.0, 0 ; 36 bytes
;next is 278
 
      post_shift_settle = scalar,  U16,    308,      "s",      0.001,  0,        0,     8,       3
      shift_settle     = scalar,  U16,    310,      "s",      0.001,  0,        0,     8,       3

    paddle_en       = bits,    U08,  312, [0:3], "Off", "PE0", "PE1", "PA0", "INVALID", "INVALID", "INVALID", "INVALID", "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7"
    paddle_en_ms2       = bits,    U08,  312, [0:3], "Off", "PE0", "PE1", "JS11", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "EGO", "INVALID", "ADC7"
    paddle_en_us       = bits,    U08,  312, [0:3], "Off", "FLEX", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "O2", "INVALID", "SPAREADC2"
    paddle_optenact = bits,    U08,  312, [7:7], "Low", "High"

    paddle_in       = bits,    U08,  313, [0:3], "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7"
    paddle_in_ms2       = bits,    U08,  313, [0:3], "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "EGO", "INVALID", "ADC7"
    paddle_in_us       = bits,    U08,  313, [0:3], "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "MAP", "INVALID", "CLT", "TPS", "INVALID", "O2", "INVALID", "SPAREADC2"

    paddle_out      = bits,    U08,  314, [0:3], "Off", "PB4", "PM2", "PM3", "PM4", "PM5", "PA0", "PE4", "PT0", "PT1", "PT2", "PT3", "PT4", "PT5", "PT6", "PT7"
    paddle_out_ms2      = bits,    U08,  314, [0:3], "Off", "INVALID", "INVALID", "D14", "D16", "D15", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "JS10", "IAC2", "IAC1"
    paddle_out_us      = bits,    U08,  314, [0:3], "Off", "INVALID", "INVALID", "TACHOUT", "ALED", "WLED", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
    vssout_opt      = bits,    U08,  315, [0:3], "Off", "PB4", "PM2", "PM3", "PM4", "PM5", "PA0", "PE4", "PT0", "PT1", "PT2", "PT3", "PT4", "PT5", "PT6", "PT7"
    vssout_opt_ms2      = bits,    U08,  315, [0:3], "Off", "INVALID", "INVALID", "D14", "D16", "D15", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "JS10", "IAC2", "IAC1"
    vssout_opt_us      = bits,    U08,  315, [0:3], "Off", "INVALID", "INVALID", "TACHOUT", "ALED", "WLED", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
    vssout_optunits=  bits,    U08,    315, [6:7], "Time", "Pulses per mile", "Pulses per km", "Mimic input"
    paddle_upv      = scalar,  U16,      316,      "V",      0.01,   0.00000,  0.00,  5.0,      2
    paddle_downv    = scalar,  U16,      318,      "V",      0.01,   0.00000,  0.00,  5.0,      2
    paddle_outv     = scalar,  U16,      320,      "V",      0.01,   0.00000,  0.00,  5.0,      2
    od_out          = bits,    U08,  322, [0:3], "Off", "PB4", "PM2", "PM3", "PM4", "PM5", "PA0", "PE4", "PT0", "PT1", "PT2", "PT3", "PT4", "PT5", "PT6", "PT7"
    od_out_ms2      = bits,    U08,  322, [0:3], "Off", "INVALID", "INVALID", "D14", "D16", "D15", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "JS10", "IAC2", "IAC1"
    od_out_us      = bits,    U08,  322, [0:3], "Off", "INVALID", "INVALID", "TACHOUT", "ALED", "WLED", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
    od_mode         = bits,    U08,  323, [0:0], "Latching", "Momentary"
;    od_mode_en      = bits,    U08,  323, [1:1], "Cancel", "Enable"
;    od_mode_light   = bits,    U08,  323, [2:2], "Cancel", "Enable"
    flashlock       = bits, U08, 324, [0:0], "Locked", "Unlocked" ; tables 0-3
;gap
      liner           = array,   U16,      326,     [6], "%",  0.3922,   0, 0, 100, 0;
      line1           = array,   U16,      338,     [6], "%",  0.3922,   0, 0, 100, 0;
      line2           = array,   U16,      350,     [6], "%",  0.3922,   0, 0, 100, 0;
      line3           = array,   U16,      362,     [6], "%",  0.3922,   0, 0, 100, 0;
      line4           = array,   U16,      374,     [6], "%",  0.3922,   0, 0, 100, 0;
      line5           = array,   U16,      386,     [6], "%",  0.3922,   0, 0, 100, 0;
      line6           = array,   U16,      398,     [6], "%",  0.3922,   0, 0, 100, 0;
      line7           = array,   U16,      410,     [6], "%",  0.3922,   0, 0, 100, 0;
      line8           = array,   U16,      422,     [6], "%",  0.3922,   0, 0, 100, 0;
      line9           = array,   U16,      434,     [6], "%",  0.3922,   0, 0, 100, 0;
      line10          = array,   U16,      446,     [6], "%",  0.3922,   0, 0, 100, 0;
      lineload        = array,   S16,      458,     [6], "%", 0.1, 0, 0, 500, 0

      shiftup12       = array,   U16,      470,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup23       = array,   U16,      482,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup34       = array,   U16,      494,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup45       = array,   U16,      506,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup56       = array,   U16,      518,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup67       = array,   U16,      530,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup78       = array,   U16,      542,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup89       = array,   U16,      554,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftup910      = array,   U16,      566,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0

      shiftdown12     = array,   U16,      578,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown23     = array,   U16,      590,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown34     = array,   U16,      602,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown45     = array,   U16,      614,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown56     = array,   U16,      626,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown67     = array,   U16,      638,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown78     = array,   U16,      650,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown89     = array,   U16,      662,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      shiftdown910    = array,   U16,      674,     [6], { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0

      shift12load      = array,   S16,      686,     [6], "%",  0.1,   0, 0, 500, 0
      shift23load      = array,   S16,      698,     [6], "%",  0.1,   0, 0, 500, 0
      shift34load      = array,   S16,      710,     [6], "%",  0.1,   0, 0, 500, 0
      shift45load      = array,   S16,      722,     [6], "%",  0.1,   0, 0, 500, 0
      shift56load      = array,   S16,      734,     [6], "%",  0.1,   0, 0, 500, 0
      shift67load      = array,   S16,      746,     [6], "%",  0.1,   0, 0, 500, 0
      shift78load      = array,   S16,      758,     [6], "%",  0.1,   0, 0, 500, 0
      shift89load      = array,   S16,      770,     [6], "%",  0.1,   0, 0, 500, 0
      shift910load     = array,   S16,      782,     [6], "%",  0.1,   0, 0, 500, 0
    tcc_rpm1     = scalar,   S16,      794,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm2     = scalar,   S16,      796,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm3     = scalar,   S16,      798,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm4     = scalar,   S16,      800,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm5     = scalar,   S16,      802,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm6     = scalar,   S16,      804,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm7     = scalar,   S16,      806,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm8     = scalar,   S16,      808,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm9     = scalar,   S16,      810,     "RPM", 1,   0, 0, 15000, 0
    tcc_rpm10    = scalar,   S16,      812,     "RPM", 1,   0, 0, 15000, 0
    tcc_vss1     = scalar,   S16,      814,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss2     = scalar,   S16,      816,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss3     = scalar,   S16,      818,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss4     = scalar,   S16,      820,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss5     = scalar,   S16,      822,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss6     = scalar,   S16,      824,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss7     = scalar,   S16,      826,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss8     = scalar,   S16,      828,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss9     = scalar,   S16,      830,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tcc_vss10    = scalar,   S16,      832,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
      sret_retard      = array,   S16,      834,     [6], "deg",  0.1, 0, 0, 15, 1
      sret_load        = array,   S16,      846,     [6], "%",    0.1, 0, 0, 500, 0
    tccr_rpm1     = scalar,   S16,      858,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm2     = scalar,   S16,      860,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm3     = scalar,   S16,      862,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm4     = scalar,   S16,      864,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm5     = scalar,   S16,      866,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm6     = scalar,   S16,      868,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm7     = scalar,   S16,      870,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm8     = scalar,   S16,      872,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm9     = scalar,   S16,      874,     "RPM", 1,   0, 0, 15000, 0
    tccr_rpm10    = scalar,   S16,      876,     "RPM", 1,   0, 0, 15000, 0
    tccr_vss1     = scalar,   S16,      878,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss2     = scalar,   S16,      880,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss3     = scalar,   S16,      882,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss4     = scalar,   S16,      884,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss5     = scalar,   S16,      886,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss6     = scalar,   S16,      888,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss7     = scalar,   S16,      890,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss8     = scalar,   S16,      892,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss9     = scalar,   S16,      894,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_vss10    = scalar,   S16,      896,     { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { outputShaftToPrefSpeed },   0.00000,  0.00,   200,      0
    tccr_opth9      = bits,    U08,      898, [0:0], "Off", "On"
    tccr_opth10     = bits,    U08,      898, [1:1], "Off", "On"
    tccr_optl1      = bits,    U08,      899, [0:0], "Off", "On"
    tccr_optl2      = bits,    U08,      899, [1:1], "Off", "On"
    tccr_optl3      = bits,    U08,      899, [2:2], "Off", "On"
    tccr_optl4      = bits,    U08,      899, [3:3], "Off", "On"
    tccr_optl5      = bits,    U08,      899, [4:4], "Off", "On"
    tccr_optl6      = bits,    U08,      899, [5:5], "Off", "On"
    tccr_optl7      = bits,    U08,      899, [6:6], "Off", "On"
    tccr_optl8      = bits,    U08,      899, [7:7], "Off", "On"

    tccr_uopth9      = bits,    U08,      900, [0:0], "Off", "On"
    tccr_uopth10     = bits,    U08,      900, [1:1], "Off", "On"
    tccr_uoptl1      = bits,    U08,      901, [0:0], "Off", "On"
    tccr_uoptl2      = bits,    U08,      901, [1:1], "Off", "On"
    tccr_uoptl3      = bits,    U08,      901, [2:2], "Off", "On"
    tccr_uoptl4      = bits,    U08,      901, [3:3], "Off", "On"
    tccr_uoptl5      = bits,    U08,      901, [4:4], "Off", "On"
    tccr_uoptl6      = bits,    U08,      901, [5:5], "Off", "On"
    tccr_uoptl7      = bits,    U08,      901, [6:6], "Off", "On"
    tccr_uoptl8      = bits,    U08,      901, [7:7], "Off", "On"

    tccr_afterdelay1 = scalar,   U16,    902, "s",      0.001,0,0,2.5,3
    tccr_afterdelay2 = scalar,   U16,    904, "s",      0.001,0,0,2.5,3
    tccr_afterdelay3 = scalar,   U16,    906, "s",      0.001,0,0,2.5,3
    tccr_afterdelay4 = scalar,   U16,    908, "s",      0.001,0,0,2.5,3
    tccr_afterdelay5 = scalar,   U16,    910, "s",      0.001,0,0,2.5,3
    tccr_afterdelay6 = scalar,   U16,    912, "s",      0.001,0,0,2.5,3
    tccr_afterdelay7 = scalar,   U16,    914, "s",      0.001,0,0,2.5,3
    tccr_afterdelay8 = scalar,   U16,    916, "s",      0.001,0,0,2.5,3
    tccr_afterdelay9 = scalar,   U16,    918, "s",      0.001,0,0,2.5,3
    tccr_afterdelay10= scalar,   U16,    920, "s",      0.001,0,0,2.5,3
    
    shiftu_pre_delay1 = scalar,   U16,    922, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay2 = scalar,   U16,    924, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay3 = scalar,   U16,    926, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay4 = scalar,   U16,    928, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay5 = scalar,   U16,    930, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay6 = scalar,   U16,    932, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay7 = scalar,   U16,    934, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay8 = scalar,   U16,    936, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay9 = scalar,   U16,    938, "s",      0.001,0,0,2.5,3
    shiftu_pre_delay10= scalar,   U16,    940, "s",      0.001,0,0,2.5,3

    shiftu_post_delay1 = scalar,   U16,    942, "s",      0.001,0,0,2.5,3
    shiftu_post_delay2 = scalar,   U16,    944, "s",      0.001,0,0,2.5,3
    shiftu_post_delay3 = scalar,   U16,    946, "s",      0.001,0,0,2.5,3
    shiftu_post_delay4 = scalar,   U16,    948, "s",      0.001,0,0,2.5,3
    shiftu_post_delay5 = scalar,   U16,    950, "s",      0.001,0,0,2.5,3
    shiftu_post_delay6 = scalar,   U16,    952, "s",      0.001,0,0,2.5,3
    shiftu_post_delay7 = scalar,   U16,    954, "s",      0.001,0,0,2.5,3
    shiftu_post_delay8 = scalar,   U16,    956, "s",      0.001,0,0,2.5,3
    shiftu_post_delay9 = scalar,   U16,    958, "s",      0.001,0,0,2.5,3
    shiftu_post_delay10= scalar,   U16,    960, "s",      0.001,0,0,2.5,3
    
    shiftd_pre_delay1 = scalar,   U16,    962, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay2 = scalar,   U16,    964, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay3 = scalar,   U16,    966, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay4 = scalar,   U16,    968, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay5 = scalar,   U16,    970, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay6 = scalar,   U16,    972, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay7 = scalar,   U16,    974, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay8 = scalar,   U16,    976, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay9 = scalar,   U16,    978, "s",      0.001,0,0,2.5,3
    shiftd_pre_delay10= scalar,   U16,    980, "s",      0.001,0,0,2.5,3

    shiftd_post_delay1 = scalar,   U16,    982, "s",      0.001,0,0,2.5,3
    shiftd_post_delay2 = scalar,   U16,    984, "s",      0.001,0,0,2.5,3
    shiftd_post_delay3 = scalar,   U16,    986, "s",      0.001,0,0,2.5,3
    shiftd_post_delay4 = scalar,   U16,    988, "s",      0.001,0,0,2.5,3
    shiftd_post_delay5 = scalar,   U16,    990, "s",      0.001,0,0,2.5,3
    shiftd_post_delay6 = scalar,   U16,    992, "s",      0.001,0,0,2.5,3
    shiftd_post_delay7 = scalar,   U16,    994, "s",      0.001,0,0,2.5,3
    shiftd_post_delay8 = scalar,   U16,    996, "s",      0.001,0,0,2.5,3
    shiftd_post_delay9 = scalar,   U16,    998, "s",      0.001,0,0,2.5,3
    shiftd_post_delay10= scalar,   U16,   1000, "s",      0.001,0,0,2.5,3

    shift_pre_delay    = scalar,   U16,   1002, "s",      0.001,0,0,2.5,3
    shift_post_delay   = scalar,   U16,   1004, "s",      0.001,0,0,2.5,3
;next is 1006

[ConstantsExtensions]
    requiresPowerCycle = cpu
    requiresPowerCycle = trans
    requiresPowerCycle = wheeldia
    requiresPowerCycle = fdratio
    requiresPowerCycle = reluctorteeth
    requiresPowerCycle = vssout_opt
    requiresPowerCycle = od_out
    requiresPowerCycle = od_mode
    requiresPowerCycle = brakesw_on
    requiresPowerCycle = setting3_luf
    requiresPowerCycle = gear1
    requiresPowerCycle = gear2
    requiresPowerCycle = gear3
    requiresPowerCycle = gear4
    requiresPowerCycle = gear5
    requiresPowerCycle = gear6
    requiresPowerCycle = gear7
    requiresPowerCycle = gear8
    requiresPowerCycle = gear9
    requiresPowerCycle = gear10
    requiresPowerCycle = lowrange_in_on
	requiresPowerCycle = fan_out_us
	requiresPowerCycle = fan_opt_on

    defaultValue = tsCanId, "CAN ID 7"
    defaultValue = prefSpeedUnits, 0
    defaultValue = prefLengthUnits, 0

[SettingContextHelp]
; constantName = "Help Text"
; tool tips tooltips
    divider = "Set this to give the correct engine RPM. Typically this is the number of cylinders. Only used when not fetching engine RPM via CAN."
    wheeldia = "The rolling diameter for wheel and tire/tyre."
    fdratio = "Final drive ratio."
    reluctorteeth = "Effective number of teeth on VSS."
    vss1_pos = "Whether speed sensor teeth are mounted\n-Directly on the wheel\n-on the driveline/trans\n-as pulses per mile\n-as pulse per km.\n-speed received over CAN from a Megasquirt ECU with 'Dash Broadcasting' enabled."
    vss1_can_scale_pulse = "Number of pulses per mile/km" 
    inteeth = "Effective number of teeth on input shaft speed sensor."
    setting3_gearcustom = "Use built-in standard gear ratios for this transmission or select custom ratios."
    setting3_pergeardelay = "Whether to enable individual delay settings for each gear to use simplified common delay numbers."
    setting3_lockuponoff = "Lockup solenoid is variable/pulsed (most) or on/off type."
    setting3_predictshift = "Under WOT conditions, uses the current acceleration rate to predict when shift RPM will be reached to reduce overshoot."
    predict_rpm_min = "Minimum RPM to use for predictive shifting, typically set to your convertor stall speed or higher."
    gear1 = "1st gear ratio."
    gear2 = "2nd gear ratio."
    gear3 = "3rd gear ratio."
    gear4 = "4th gear ratio."
    gear5 = "5th gear ratio."
    gear6 = "6th gear ratio."
    gear7 = "7th gear ratio."
    gear8 = "8th gear ratio."
    gear9 = "9th gear ratio."
    gear10 = "10th gear ratio."
    maxrpm1 = "Maximum allowed RPM in this gear. Always used as a safety check before down-shifting. If RPM based shifting is enabled this is the target shift RPM. Predictive shifting is usually also required due to delays inherent in automatics."

    shift_settle = "Time to allow conditions to settle. e.g. time to go from partial throttle to WOT. If the code reacts too quickly it can choose the wrong gear."
    post_shift_settle = "Time after a shift when another gear shift cannot start. Can be useful to prevent unexpected double-shift when using RPM-based shifting."
    cpu = "The specific hardware and wiring scheme you are using.\n\n* Most new installs use Microsquirt V3 *\n\nMS2 = Megasquirt-2 ECU\nMicrosquirt = old V1, V2 metal cased Microsquirt\nGPIO = GPIO board\nMicrosquirt V3 = current plastic cased Microsquirt."
    loadin = "Whether to use TPS or MAP as the load index in the shift curves."
    setting3_lineload = "Whether to use TPS or MAP as the load index in the line pressure curves."
    setting3_lockupload = "Whether to use TPS or MAP as the load parameter to enable lockup."
    lineopt = "Whether to use a common line pressure curve (recommended) or individual curves per gear."
    epcfreq = "Later 4L80E use 595Hz (most common), early used 297Hz"
    trans = "The automatic transmission/gearbox type in use.\nNormally, use the 'Apply common settings' dropdown to select the transmission type and assign the normal gear ratios in one go."
;    tempunit = "Temperature units."
    can_poll2 = "How TPS and engine RPM are determined:\n\nLocal connection = connected directly to the trans controller.\n\nRemote Megasquirt = fetched over CAN from a Megsquirt ECU using 29bit messaging.\n\nListen to CAN broadcast = listens for 11bit Megasquirt 'Dash broadcasting' of data over CAN and enables broadcasting of TCU data over CAN."
    can_poll_alcan_disable = "Enables or disables 29bit 'Megasquirt' CAN messaging.\n\nEnabled = allows remote tuning of the TCU via CAN through the ECU.\nDisabled = allows the Transmission Controller to be used on a CAN using other 29bit messaging, but you must tune with a direct serial connection to the TCU."
    can_poll_id = "The CANid of a Megasquirt ECU to fetch TPS and engine RPM from. Typically 0."
    can_bcast_id = "The base ID for 11bit broadcasts, default is 1500 (0x5dc)."
    mycan_id = "Set to 7 for normal operation.\nChanging this may stop serial or CAN communications."
    vssout_opt = "Enables a VSS output (for dash speedo) and selects the raw output pin to use."
    vssout_opt_ms2 = "Enables a VSS output (for dash speedo) and selects the raw output pin to use."
    vssout_opt_us = "Enables a VSS output (for dash speedo) and selects the raw output pin to use."
    vssout_optunits = "Type of output conversion.\nMimic replicates the input signal as a digital output."
    vssout_scale = "Raw scaling number used for VSS output or Pulse per Mile or Pulses per Kilometre."
    od_mode = "Selects how the OD cancel switch/button operates."
;    od_mode_en = "Selects whether the OD button is cancel or enable."
;    od_mode_light = "Selects whether the OD light is cancel or enable."
    od_out = "Enables an OD mode light output and selects the raw output pin to use."
    od_out_ms2 = "Enables an OD mode light output and selects the output pin to use."
    od_out_us = "Enables an OD mode light output and selects the output pin to use."

    lockuphyst = "Hysteresis (deadband) in wheel speed for lockup."
    lockupmintps = "Minimum TPS to lockup convertor."
    lockuptps = "Maximum TPS to lockup convertor."
    lockupwait = "Delay before starting lockup cycle.\n\nA few seconds is typical."
    lockupstart = "TCC solenoid duty at start of lockup cycle."
    lockupontime = "Time to ramp up TCC duty."
    lockupfull = "TCC solenoid duty when locked."
    lockupend = "TCC solenoid duty after unlock."
    lockupofftime = "Time to ramp down TCC duty."
    lockuppostdelay = "Time after unlock before shift starts. This allows for mechanical delays in the solenoids and lockup clutch."
    lockuprpostdelay = "Time after unlock before shift starts in race mode. This allows for mechanical delays in the solenoids and lockup clutch. Note that this may delay shifts requiring a lower shift point."
    lockrace_on = "Enables race-only lockup settings."
    lockrace_tps = "Minimum TPS to lockup convertor when in race mode."
;    lockrace_gear = "Selects which gears to allow lockup in."
;    lockrace_shift = "Whether to stay locked during shifts."
;    lockrace_delay = "Delay before re-locking after a shift"
;    lockrace_mod  = "Not used at this time."
    setting3_luf = "Enables the Lock-Up-Feel (LUF) solenoid in the 1993+ 4L60E. In this case the TCC solenoid is on/off and LUF is PWM."
    setting3_lockshift = "Whether to remain locked up during shifts, usually set to Off."

    tcc_optl1 = "Whether lockup should be allowed per gear."
    tcc_vss1 = "Minimum speed required to lockup in this gear.  (Both RPM and VSS limits must be met.)"
    tcc_rpm1 = "Minimum RPM required to lockup in this gear. (Both RPM and VSS limits must be met.)"

    tccr_optl1 = "Whether lockup should be allowed per gear in race mode."
    tccr_vss1 = "Minimum speed required to lockup in this gear in race mode.  (Both RPM and VSS limits must be met.)"
    tccr_rpm1 = "Minimum RPM required to lockup in this gear in race mode. (Both RPM and VSS limits must be met.)"
    tccr_uoptl1 = "Whether to stay locked during upshift from this gear."
    tccr_afterdelay2 = "Relocking delay after shifting INTO this gear."

    brakesw_on = "Enables brake switch input."
    brakesw_pol = "Sets active polarity of brake switch input."
    manual_in = "Input pin for manual-mode enable switch."
    manual_in_ms2 = "Input pin for manual-mode enable switch."
    manual_in_us = "Input pin for manual-mode enable switch."
    manual_start2 = "Always starts in 2nd gear (1st is not used ever)."
    manual_on = "Selects between full auto, manual and switch-enabled manual mode. In manual mode, the selector is used to choose gears instead of the shift curves."
    setting1_rpmshift = "Enables RPM-based shifting feature."
    rpm_shift_tps = "TPS threshold to enable RPM-based shifting."
    setting1_retard = "Enables timing retard during shifts.\nThis requires a compatible ECU connected via CAN and configured to receive retard data."
;    shiftret_time = "Duration of timing retard."
     shiftret_table = "CAN table in ECU. Typically set to 7."
    shiftret_off = "CAN offset in ECU.\nFor MS3 set 632\nFor MS2/Extra set to 514."
    shift_pre_delay = "Delay time in transmission from solenoid activation before it starts to change gear. Any timing retard begins after this time. Use datalogs to find actual values for your install."
    shift_post_delay = "Time it takes transmission to complete gear change. A new gear change will not be requested until after this time."
    shiftu_pre_delay2 = "Delay time in transmission from solenoid activation before it starts to change gear. Any timing retard begins after this time."
    shiftu_post_delay2 = "Time it takes transmission to complete gear change. A new gear change will not be requested until after this time."
    shiftd_pre_delay1 = "Delay time in transmission from solenoid activation before it starts to change gear. Any timing retard begins after this time."
    shiftd_post_delay1 = "Time it takes transmission to complete gear change. A new gear change will not be requested until after this time."
    setting4_gearwhen = "When should the transmission controller display the new gear when shifting. This is purely based on the delay timers you set, the TCU does not monitor RPM changes or effective gear ratio. For this to work, you need to have set the delays and times to match the actual behaviour of your transmission. The two options are:\nEnd of shift : when the shift has completed (after delay + shift time).\nStart of shift : when the shift is starting (after delay.)"
    setting4_epccorr = "Enables a table to correct EPC for fluid temperature. You will need to have added a line pressure sensor and datalogged the pressure across the operating temperature to gather the data for this table."
       epc_corr_duties = "The table contains the new EPC corrected for temperature. The EPC X axis is the 'raw' value before correction. You will need to have added a line pressure sensor and datalogged the pressure across the operating temperature to gather the data for this table. It is recommended to tune the EPC curves at normal temperature and apply the correction in this table for colder fluid temperatures."

    gearpv = "Voltage from gear position sensor for each gear."

    paddle_en = "Enables paddle-shifting and selects the 'enable' input switch."
    paddle_en_ms2 = "Enables paddle-shifting and selects the 'enable' input switch."
    paddle_en_us = "Enables paddle-shifting and selects the 'enable' input switch."
    paddle_optenact = "Selects polarity of paddle enable switch."
    paddle_in = "Selects analogue input for paddle shifter."
    paddle_in_ms2 = "Selects analogue input for paddle shifter."
    paddle_in_us = "Selects analogue input for paddle shifter."
    paddle_out = "Selects paddle output, typically this is for the horn."
    paddle_out_ms2 = "Selects paddle output, typically this is for the horn."
    paddle_out_us = "Selects paddle output, typically this is for the horn."
    paddle_upv = "Voltage on paddle input to indicate an up-shift."
    paddle_downv = "Voltage on paddle input to indicate an down-shift."
    paddle_outv = "Voltage on paddle input to indicate that the output (horn) should be operated."

    shiftup12 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup23 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup34 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup45 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup56 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup67 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup78 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup89 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."
    shiftup910 = "Up and down shift curve. Selects the speed vs. load/throttle for up-shifting."

    liner = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line1 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line2 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line3 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line4 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line5 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line6 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line7 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line8 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line9 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"
    line10 = "Line pressure vs load/throttle. 0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)"

    tst_enable = "Enables test mode."
    tst_lock = "Special code to enable test mode."
    tst_gear = "Gear to select in test mode."
    tst_epc = "EPC to use in test mode.\n0% is least line pressure, 100% is max line pressure.\n\n(Conversion to solenoid duty for transmission is handled internally.)" 
    tst_tcc = "TCC duty to use in test mode."
    tst_sol32 = "3-2 solenoid duty to use in test mode."
    flashlock = "Locks or unlocks the sensor calibration tables.\nLocked = Prevents accidental changes to the tables.\nUnlocked = Allows fresh calibrations to be written.\n\nEnsure you lock again after writing the calibration tables."

    tpsMin = "TPS ADC calibration for 0% TPS."
    tpsMax = "TPS ADC calibration for 100% TPS."
    prefSpeedUnits   =  "Chooses the speed units - either Mile-per-hour or Kilometres-per-hour\nClose the page and re-open after changing."
    prefLengthUnits  =  "Chooses the size units - either metres or inches\nClose the page and re-open after changing."
    sret_retard = "Timing retard in degrees during shift. Some weaker transmissions may require timing to be retarded during high load shifts."
	lowrange_in_on = "Enables low-range or transfer box switch."
	lowrange_in = "Input switch connection."
	lowrange_in_ms2 = "Input switch connection."
	lowrange_in_us = "Input switch connection."
	lowrange_in_pos = "Whether speed sensor is before or after low-range gears. Before means it is measuring the main gearbox output shaft speed. After means it is measuring the output from the transfer box."
	lowrange_ratio = "Low-range gear ratio."
    slew_rate_global = "The maximum increase in spark timing in degrees per tenth of a second when timing is returned after a shift."
    sol4pwm_duties = "PWM duty cycle of output for backfill solenoid. Note that for A34x transmissions this is fixed at 300Hz and has an adjustability of approx +/- 4%. Higher duty gives lower backfill pressure."
    fan_opt_on     = "Enables fluid cooler fan control."
    fan_opt_engoff = "Whether the fan can run at key-on, engine-off."
    fan_opt_tpsshut = "Enables full throttle fan shutoff, to save current draw."
    fan_out_us     = "The TCU output used to control the fan relay. Check the manual to see which (if any) outputs are free on your install. No warning will be given if you pick an already-used output."
    fan_tps    = "The fan is disabled above this throttle position."
   fan_thresh_on  = "Fan is turned on above this temperature."
   fan_thresh_off    = "Fan is turned off below this temperature. Normally this is set to a handful of degrees below the on temperature to reduce cycling."
; end tool tips tooltips

[Menu]

   ;----------------------------------------------------------------------------
   ;  There are five pre-defined values that may be used to define your menus.
   ;  The first four allow access to the "standard" dialog boxes, the last one
   ;  merely draws a separator (horizontal line) in the menu.
   ;
   ;     std_constants
   ;     std_enrichments
   ;     std_realtime
   ;     std_warmup
   ;     std_accel
   ;
   ;     std_separator
   ;
   ;  Additionally, to support MegaSquirt-II firmware, there are two standard
   ;  dialogs to generate its three embedded tables.  The first of these acts
   ;  like Roger Enns' EasyTherm, but only works for MS-II.  The second one
   ;  generates the internal AFR table required for proper closed loop operation
   ;  in MS-II.  Use these without page numbers, as they will just be ignored
   ;  in any case.
   ;
   ;     std_ms2gentherm
   ;     std_ms2geno2
   ;
   ;  If you use any of the std_constants, std_enrichments or std_warmup
   ;  editors, they may be optionally suffixed with a page number (only
   ;  useful for multi-page code variants), which causes them to edit the
   ;  specified page.  If you leave off the page specifier, they edit logical
   ;  page one as specified in the Constants section.
   ;
   ;  There are four special menu names, which when used append to the standard
   ;  menus of the same name instead of creating a new one.  The menu names
   ;  are "File", "Communications", "Tools" and "Help".
   ;
   ;----------------------------------------------------------------------------

   menuDialog = main
      menu = "Trans controller setup"
         subMenu = base_settings,   "Base Settings"
         subMenu = can_settings, "CAN Settings"
         subMenu = shiftset,   "Shift Settings"
         subMenu = shiftdelays,   "Shift Delays and Max RPMs"
         subMenu = lockup,          "Lockup Settings"
         subMenu = lockuprace,      "Lockup Race Settings"
         subMenu = gearpos,         "Gear Position", 0, {(trans == 3) || (trans == 4) || (trans == 8) || (trans == 10) || (trans == 13)}
         subMenu = paddle,          "Paddle Shifter"
         subMenu = fan_control, "Fluid Cooler Fan"

      menu = "Shift Curves"
         subMenu = shiftgear1u,   "Shift Curves 1 up"
         subMenu = shiftgear2ud,   "Shift Curve 2 up/down"
         subMenu = shiftgear3ud,   "Shift Curve 3 up/down"
         subMenu = shiftgear4d,   "Shift Curve 4 down", 0, {trans != 7}, {trans != 7} 
         subMenu = shiftgear4ud,   "Shift Curve 4 up/down", 0, {trans == 7}, {trans == 7} 
         subMenu = shiftgear5d,   "Shift Curve 5 down", 0, {trans == 7}, {trans == 7}
         subMenu = shiftt12,   "Shift Curve 1->2 (display only)"
         subMenu = shiftt23,   "Shift Curve 2->3 (display only)"
         subMenu = shiftt34,   "Shift Curve 3->4 (display only)"
         subMenu = shiftt45,   "Shift Curve 4->5 (display only)", 0, {trans == 7}, {trans == 7} 
         subMenu = shiftt56,   "Shift Curve 5->6", 0, {0}, {0}
         subMenu = shiftt67,   "Shift Curve 6->7", 0, {0}, {0}
         subMenu = shiftt78,   "Shift Curve 7->8", 0, {0}, {0}
         subMenu = shiftt89,   "Shift Curve 8->9", 0, {0}, {0}
         subMenu = shiftt910,   "Shift Curve 9->10", 0, {0}, {0}

     menu = "Line Pressure"
         subMenu = linepc,   "Line Pressure", 0, {lineopt == 0}
         subMenu = linepr,   "Line Pressure R", 0, {lineopt}
         subMenu = linep1,   "Line Pressure 1", 0, {lineopt}
         subMenu = linep2,   "Line Pressure 2", 0, {lineopt}
         subMenu = linep3,   "Line Pressure 3", 0, {lineopt}
         subMenu = linep4,   "Line Pressure 4", 0, {lineopt}
         subMenu = linep5,   "Line Pressure 5", 0, {lineopt && (trans == 7)}, {trans == 7} 
         subMenu = linepm1,   "Line Pressure Manual 1st", 0, {lineopt && (trans == 0)}, {trans == 0} 
         subMenu = linep6,   "Line Pressure 6", 0, {0}, {0}
         subMenu = linep7,   "Line Pressure 7", 0, {0}, {0}
         subMenu = linep8,   "Line Pressure 8", 0, {0}, {0}
         subMenu = linep9,   "Line Pressure 9", 0, {0}, {0}
         subMenu = linep10,   "Line Pressure 10", 0, {0}, {0}
         subMenu = sol4pwm_Tbl, "Backfill solenoid", 0, {trans == 2}, {trans == 2}
         subMenu = epc_corr_Tbl, "EPC Temperature Correction", 0, {setting4_epccorr}, {setting4_epccorr}

      menu = "Test mode"
         subMenu = testmode,   "Test Mode"

 menuDialog = main
      menu = "T&ools"
         subMenu = sensorCal,       "Calibrate MAP Sensor"
         subMenu = std_separator    ;----------------------------------------------
         subMenu = flash_unlock, "Un/Lock Calibrations"
         subMenu = std_ms2gentherm, "Calibrate T&hermistor Tables", 0, {flashlock}

;-------------------------------------------------------------------------------

[ControllerCommands]
; commandName    = command1, command2, commandn...
; command in standard ini format, a command name can be assigned to 1 to n commands that will be executed in order.
;         This dos not include any resultant protocol envelope data, only the response data itself.

; WARNING!! These commands bypass TunerStudio's normal memory synchronization. If these commands
; alter mapped settings (Constant) memory in the controller, TunerStudio will have an out of sync condition 
; and may create error messages.
; It is expected that these commands would not typically alter any ram mapped to a Constant.

cmdStopTestmode = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x00"
cmdEnterTestMode = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x01"
cmdtest2 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x02"
cmdtestg1 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x03"
cmdtestg2 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x04"
cmdtestg3 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x05"
cmdtestg4 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x06"
cmdtest7 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x07"
cmdtest8 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x08"
cmdtest9 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x09"
cmdtest10 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x0a"
cmdtest11 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x0b"
cmdtest12 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x0c"
cmdtestg5 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x0d"
cmdtestg6 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x0e"
cmdtestg7 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x0f"
cmdtestg8 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x10"
cmdtestg9 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x11"
cmdtestg10 = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x12"
cmdtestfan = "w\$tsCanId\x07\x02\x00\x00\x03\x30\x39\x80"

;-------------------------------------------------------------------------------

[UserDefined]

	dialog = fan_control, "Fluid Cooler Fan"
	field = "Enable Fan control", fan_opt_on
	field = "Output for relay", fan_out_us, {fan_opt_on}
	field = "Fan ON above", fan_thresh_on, {fan_opt_on}
	field = "Fan OFF below", fan_thresh_off, {fan_opt_on}
	field = "Run fan when engine off", fan_opt_engoff, {fan_opt_on}
	field = "W.O.T. disables fan", fan_opt_tpsshut, {fan_opt_on}
	field = "TPS% to disable fan", fan_tps, {fan_opt_on && fan_opt_tpsshut}
    commandButton = "Test fan", cmdtestfan, { fan_opt_on }

       dialog = sensorCal, "Calibrate MAP"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#mapsen"
          field = "#MAP Sensor"
#if INI_VERSION_2
          settingSelector = "Common MAP Sensors"
             settingOption = "MPX4115",  map0=10.6, mapmax=121.7
             settingOption = "MPX4250",  map0=10,   mapmax=260
             settingOption = "GM 1-BAR", map0=10,   mapmax=105
             settingOption = "GM 2-BAR", map0=8.8,  mapmax=208
             settingOption = "GM 3-BAR / MPXH6300", map0=1.1,  mapmax=315.5
             settingOption = "MPXH6400", map0=3.5,  mapmax=416.5
             settingOption = "AEM 3.5 BAR", map0=-42.3,  mapmax=386.3
             settingOption = "AEM 5.0 BAR", map0=-64.6,  mapmax=581.7
#endif
          field =    "Value At 0.0 Volts",   map0
          field =    "Value At 5.0 Volts",   mapmax

    dialog = flash_unlock, "Un/Lock calibrations"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#unlockcal"
        field = "Sensor Calibrations", flashlock
        field = "Always re-lock after use"

   dialog = base_left_top, ""
      field = "No. Cylinders / rpm divider", divider
      field = "Hardware in use", cpu
    settingSelector = "Apply common settings:"
    settingOption = "4L80E",        trans=0, gear1=2.48, gear2=1.48, gear3=1.00, gear4=0.75, gear5=1.00, gear6=1.00
    settingOption = "4L60E",        trans=1, gear1=3.06, gear2=1.63, gear3=1.00, gear4=0.70, gear5=1.00, gear6=1.00
    settingOption = "A341E",        trans=2, gear1=2.53, gear2=1.53, gear3=1.00, gear4=0.71, gear5=1.00, gear6=1.00
;option 3 was 41TE
    settingOption = "4R70W analog", trans=4, gear1=2.84, gear2=1.55, gear3=1.00, gear4=0.70, gear5=1.00, gear6=1.00
    settingOption = "4R70W switch", trans=5, gear1=2.84, gear2=1.55, gear3=1.00, gear4=0.70, gear5=1.00, gear6=1.00
    settingOption = "4T40E",        trans=6, gear1=2.95, gear2=1.62, gear3=1.00, gear4=0.68, gear5=1.00, gear6=1.00
    settingOption = "5L40E",        trans=7, gear1=3.42, gear2=2.21, gear3=1.60, gear4=1.00, gear5=0.75, gear6=1.00
    settingOption = "E4OD analog",  trans=8, gear1=2.71, gear2=1.54, gear3=1.00, gear4=0.71, gear5=1.00, gear6=1.00
    settingOption = "E4OD switch",  trans=9, gear1=2.71, gear2=1.54, gear3=1.00, gear4=0.71, gear5=1.00, gear6=1.00
    settingOption = "W4A33",        trans=10, gear1=2.55, gear2=1.49, gear3=1.00, gear4=0.69, gear5=1.00, gear6=1.00
    settingOption = "BTR analog",   trans=11, gear1=2.39, gear2=1.35, gear3=1.00, gear4=0.68, gear5=1.00, gear6=1.00
    settingOption = "Jeep AW4",     trans=12, gear1=2.80, gear2=1.53, gear3=1.00, gear4=0.75, gear5=1.00, gear6=1.00
    settingOption = "4R44E",        trans=13, gear1=2.47, gear2=1.47, gear3=1.00, gear4=0.75, gear5=1.00, gear6=1.00
    settingOption = "ZF 4HP Range Rover",trans=14, gear1=2.48, gear2=1.48, gear3=1.00, gear4=0.73, gear5=1.00, gear6=1.00
    settingOption = "4T65E",       trans=15, gear1=2.921, gear2=1.568, gear3=1.00, gear4=0.705, gear5=1.00, gear6=1.00
    settingOption = "ZF 4HP Porsche",trans=16, gear1=2.48, gear2=1.48, gear3=1.00, gear4=0.73, gear5=1.00, gear6=1.00

      field = "Transmission type", trans
      field = "Load input for shift curves", loadin
      field = "Load input for line pressure", setting3_lineload
      field = "Line pressure curves", lineopt
      field = "EPC Frequency", epcfreq, {trans == 0}
      field = "EPC Temperature correction", setting4_epccorr
      field = "Brake switch enable", brakesw_on
      field = "Brake switch polarity", brakesw_pol, {brakesw_on}
      field = "Use CAN for TPS/RPM/CLT", can_poll2
      field = "Preferred Speed Units", prefSpeedUnits
      field = "Preferred Length Units", prefLengthUnits

    dialog = base_od3, ""
        field = "OD/cancel button mode", od_mode, { (trans == 4) || (trans == 5) || (trans == 8) || (trans == 9) || (trans == 10) }
        field = "OD/cancel light", od_out, { ((trans == 4) || (trans == 5) || (trans == 8) || (trans == 9) || (trans == 10)) }

    dialog = base_od01, ""
        field = "OD/cancel button mode", od_mode, { (trans == 4) || (trans == 5) || (trans == 8) || (trans == 9) || (trans == 10) }
        field = "OD/cancel light", od_out_ms2, { ((trans == 4) || (trans == 5) || (trans == 8) || (trans == 9) || (trans == 10)) }

    dialog = base_od24, ""
        field = "OD/cancel button mode", od_mode, { (trans == 4) || (trans == 5) || (trans == 8) || (trans == 9) || (trans == 10) }
        field = "OD/cancel light", od_out_us, { ((trans == 4) || (trans == 5) || (trans == 8) || (trans == 9) || (trans == 10)) }

    dialog = base_left_bot, "OD button", card
    panel = base_od3, Center, {cpu == 3}
    panel = base_od01, Center, {cpu < 2}
    panel = base_od24, Center, {(cpu == 2) || (cpu == 4)}

    dialog = base_left, ""
    panel = base_left_top, North
    panel = base_left_bot 

   dialog = base_right, ""
      field = "VSS Position/Type", vss1_pos
      field = "Wheel diameter", wheeldia
      field = "Final drive ratio", fdratio
      field = "Pulses", vss1_can_scale_pulse, { (vss1_pos == 2) || (vss1_pos == 3) }
      field = "Trans speed sensor #teeth", reluctorteeth, { (vss1_pos < 2) }
      field = "Input speed sensor #teeth", inteeth, {can_poll2 && (trans != 1)}

;      field = "Ratio choice", setting3_gearcustom
      field = "1st gear ratio", gear1
      field = "2nd gear ratio", gear2
      field = "3rd gear ratio", gear3
      field = "4th gear ratio", gear4, {(numgears >= 4)}
      field = "5th gear ratio", gear5, {(numgears >= 5)}
      field = "6th gear ratio", gear6, {(numgears >= 6)}
;      field = "7th gear ratio", gear7, {(numgears >= 7)}
;      field = "8th gear ratio", gear8, {(numgears >= 8)}
;      field = "9th gear ratio", gear9, {(numgears >= 9)}
;      field = "10th gear ratio", gear10, {(numgears >= 10)}
		field = "Low range switch enable", lowrange_in_on
		field = "Low range switch in", lowrange_in, {lowrange_in_on}, {cpu == 3} 
		field = "Low range switch in", lowrange_in_ms2, {lowrange_in_on}, {cpu == 1} 
		field = "Low range switch in", lowrange_in_us, {lowrange_in_on}, {(cpu == 0) || (cpu == 2) || (cpu == 4)} 
		field = "Low range gear ratio", lowrange_ratio, {lowrange_in_on}
		field = "Speed sensor position", lowrange_in_pos, {lowrange_in_on}
        field = "VSS Output", vssout_opt, {cpu == 3}, {cpu == 3}
        field = "VSS Output", vssout_opt_ms2, {cpu == 1}, {cpu == 1}
        field = "VSS Output", vssout_opt_us, {(cpu == 2) || (cpu == 4)}, {(cpu == 0) || (cpu == 2) || (cpu == 4)}
        field = "VSSout Units", vssout_optunits, { vssout_opt }
        field = "Scale", vssout_scale, { vssout_opt && (vssout_optunits < 3) }

   dialog = base_settings, "Base Settings", xAxis
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#base"
    panel = base_left
    panel = base_right

    dialog = can_settings, "CAN Settings"
      field = "My CAN/serial ID (caution!)", mycan_id
      field = "Base broadcast ID", can_bcast_id
      field = "Megasquirt 29bit CAN", can_poll_alcan_disable
      field = "Remote CAN ID", can_poll_id, {can_poll2 == 1}
      field = "Shift retard table", shiftret_table, {can_poll2 == 1}
      field = "Shift retard offset", shiftret_off, {can_poll2 == 1}

    dialog = shiftleft, "Settings"
      field = "Automatic / manual mode", manual_on
      field = "Manual switch input", manual_in, {(manual_on == 2) && (cpu == 3)}, {cpu == 3}
      field = "Manual switch input", manual_in_ms2, {(manual_on == 2) && (cpu < 2)}, {cpu < 2}
      field = "Manual switch input", manual_in_us, {(manual_on == 2) && ((cpu == 2) || (cpu == 4))}, {(cpu == 2) || (cpu == 4)}
      field = "2nd gear start", manual_start2
      field = "RPM based up-shifting", setting1_rpmshift
      field = "TPS threshold", rpm_shift_tps, {setting1_rpmshift}
      field = "Predictive up-shifting", setting3_predictshift, { setting1_rpmshift }
      field = "Minimum RPM for predictive", predict_rpm_min, { setting1_rpmshift && setting3_predictshift }
      field = "Settle time before shift", shift_settle
      field = "Settle time after shift", post_shift_settle
      field = "Retard timing during shifts", setting1_retard
      field = "Max slew rate", slew_rate_global, { setting1_retard }

dialog = shiftdelays1, "", yAxis
      field = "Up-shift delay"
      field = " 1", shiftu_pre_delay1,{0}
      field = " 2", shiftu_pre_delay2
      field = " 3", shiftu_pre_delay3
      field = " 4", shiftu_pre_delay4, {numgears >=4 }
      field = " 5", shiftu_pre_delay5, {numgears >=5 }
      field = " 6", shiftu_pre_delay6, {numgears >=6 }
;      field = " 7", shiftu_pre_delay7, {numgears >=7 }
;      field = " 8", shiftu_pre_delay8, {numgears >=8 }
;      field = " 9", shiftu_pre_delay9, {numgears >=9 }
;      field = "10", shiftu_pre_delay10, {numgears >=10 }

dialog = shiftdelays2, "", yAxis
      field = "Up-shift time"
      field = "", shiftu_post_delay1,{0}
      field = "", shiftu_post_delay2
      field = "", shiftu_post_delay3
      field = "", shiftu_post_delay4, {numgears >=4 }
      field = "", shiftu_post_delay5, {numgears >=5 }
      field = "", shiftu_post_delay6, {numgears >=6 }
;      field = "", shiftu_post_delay7, {numgears >=7 }
;      field = "", shiftu_post_delay8, {numgears >=8 }
;      field = "", shiftu_post_delay9, {numgears >=9 }
;      field = "", shiftu_post_delay10, {numgears >=10 }

dialog = shiftdelays3, "", yAxis
      field = "Down-shift delay"
      field = " 1", shiftd_pre_delay1
      field = " 2", shiftd_pre_delay2
      field = " 3", shiftd_pre_delay3
      field = " 4", shiftd_pre_delay4, {numgears >4 }
      field = " 5", shiftd_pre_delay5, {numgears >5 }
      field = " 6", shiftd_pre_delay6, {numgears >6 }
;      field = " 7", shiftd_pre_delay7, {numgears >7 }
;      field = " 8", shiftd_pre_delay8, {numgears >8 }
;      field = " 9", shiftd_pre_delay9, {numgears >9 }
;      field = "10", shiftd_pre_delay10, {numgears >10 }

dialog = shiftdelays4, "", yAxis
      field = "Down-shift time"
      field = "", shiftd_post_delay1
      field = "", shiftd_post_delay2
      field = "", shiftd_post_delay3
      field = "", shiftd_post_delay4, {numgears >4 }
      field = "", shiftd_post_delay5, {numgears >5 }
      field = "", shiftd_post_delay6, {numgears >6 }
;      field = "", shiftd_post_delay7, {numgears >7 }
;      field = "", shiftd_post_delay8, {numgears >8 }
;      field = "", shiftd_post_delay9, {numgears >9 }
;      field = "", shiftd_post_delay10, {numgears >10 }
      
         dialog = revlims, "", yAxis
         field = "Max RPM"
      field = "", maxrpm1
      field = "", maxrpm2
      field = "", maxrpm3
      field = "", maxrpm4, {numgears >=4 }
      field = "", maxrpm5, {numgears >=5 }
      field = "", maxrpm6, {numgears >=6 }
;      field = "", maxrpm7, {numgears >=7 }
;      field = "", maxrpm8, {numgears >=8 }
;      field = "", maxrpm9, {numgears >=9 }
;      field = "", maxrpm10, {numgears >=10 }
      
   dialog = shiftdelaysb, "", xAxis
	panel = shiftdelays1, {setting3_pergeardelay}
	panel = shiftdelays2, {setting3_pergeardelay}
	panel = shiftdelays3, {setting3_pergeardelay}
	panel = shiftdelays4, {setting3_pergeardelay}
	panel = revlims

   dialog = shiftdelayst, "", xAxis
   field = "Common or individual delays", setting3_pergeardelay
   field = "Delay before shift", shift_pre_delay, {!setting3_pergeardelay}
   field = "Shift time", shift_post_delay, {!setting3_pergeardelay}

   dialog = shiftdelaysn, "", yAxis
   field = "Delays and times apply to the gear you are changing into."

   dialog = shiftdelaysg1, "", yAxis
	field = "Gear display changes", setting4_gearwhen

   dialog = shiftdelaysg2, "", yAxis
	field = ""

   dialog = shiftdelaysg, "", xAxis
	panel = shiftdelaysg1, West
	panel = shiftdelaysg2, Center
	   
   dialog = shiftdelays, "Shift Delays and Max RPM", yAxis
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftdel"
	panel = shiftdelayst
	panel = shiftdelaysg
	panel = shiftdelaysb
	panel = shiftdelaysn
	
    dialog = shiftset, "Shift Settings", xAxis
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shift"
    panel = shiftleft, West
    panel = shiftretard, East, { setting1_retard }

   dialog = lockupa, "Settings", yAxis
      field = "VSS hysteresis", lockuphyst
      field = "Load input for lockup", setting3_lockupload
      field = "Lockup min load", lockupmintps
      field = "Lockup max load", lockuptps
      field = "(enter 100 to allow lockup always)"
      field = "Lockup solenoid type", setting3_lockuponoff
      field = "Lockup wait time", lockupwait
      field = "Lockup start duty", lockupstart, {!setting3_lockuponoff}
      field = "Lockup rise time", lockupontime, {!setting3_lockuponoff}
      field = "Lockup full duty", lockupfull, {!setting3_lockuponoff}
      field = "Lockup end duty", lockupend, {!setting3_lockuponoff}
      field = "Lockup decay time", lockupofftime, {!setting3_lockuponoff}
      field = "Locked during shifts", setting3_lockshift
      field = "Unlock delay before shift", lockuppostdelay, {setting3_lockshift == 0}

    dialog = lockupbo, "", yAxis
    field = "Enable"
    field = "1", tcc_optl1
    field = "2", tcc_optl2
    field = "3", tcc_optl3
    field = "4", tcc_optl4, {numgears >=4 }
    field = "5", tcc_optl5, {numgears >=5 }
    field = "6", tcc_optl6, {numgears >=6 }
;    field = "7", tcc_optl7, {numgears >=7 }
;    field = "8", tcc_optl8, {numgears >=8 }
;    field = "9", tcc_opth9, {numgears >=9 }
;    field = "10", tcc_opth10, {numgears >=10 }

    dialog = lockupbt, "", yAxis
    field = "Min RPM"
    field = "", tcc_rpm1
    field = "", tcc_rpm2
    field = "", tcc_rpm3
    field = "", tcc_rpm4, {numgears >=4 }
    field = "", tcc_rpm5, {numgears >=5 }
    field = "", tcc_rpm6, {numgears >=6 }
;    field = "", tcc_rpm7, {numgears >=7 }
;    field = "", tcc_rpm8, {numgears >=8 }
;    field = "", tcc_rpm9, {numgears >=9 }
;    field = "", tcc_rpm10, {numgears >=10 }

    dialog = lockupbv, "", yAxis
    field = "Min VSS"
    field = "", tcc_vss1
    field = "", tcc_vss2
    field = "", tcc_vss3
    field = "", tcc_vss4, {numgears >=4 }
    field = "", tcc_vss5, {numgears >=5 }
    field = "", tcc_vss6, {numgears >=6 }
;    field = "", tcc_vss7, {numgears >=7 }
;    field = "", tcc_vss8, {numgears >=8 }
;    field = "", tcc_vss9, {numgears >=9 }
;    field = "", tcc_vss10, {numgears >=10 }

    dialog = lockupb, "Lockup per Gear", xAxis
    panel = lockupbo
    panel = lockupbt
    panel = lockupbv

    dialog = lockupd, "Trans specific", yAxis
    field = "Use LUF solenoid (1993 up)", setting3_luf, { trans == 1 }

    dialog = lockupaa, "", yAxis
    panel = lockupa, West
    panel = lockupd, East

    dialog = lockup, "Lockup settings", xAxis
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#lockup"
    panel = lockupaa, West
    panel = lockupb, East


    dialog = lockuprc, "", yAxis
      field = "Race settings for advanced use only"
      field = "Race mode", lockrace_on
      field = "Min TPS for race mode", lockrace_tps, {lockrace_on}
      field = "Unlock delay before shift", lockuprpostdelay, {lockrace_on}

    dialog = lockuprd, "", yAxis
    field = ""

    dialog = lockupc, "", xAxis
    panel = lockuprc, West
    panel = lockuprd, Center
    panel = lockuprd, East

    dialog = lockuprbo, "", yAxis
    field = "Lockup"
    field = "1", tccr_optl1
    field = "2", tccr_optl2
    field = "3", tccr_optl3
    field = "4", tccr_optl4, {numgears >=4 }
    field = "5", tccr_optl5, {numgears >=5 }
    field = "6", tccr_optl6, {numgears >=6 }
;    field = "7", tccr_optl7, {numgears >=7 }
;    field = "8", tccr_optl8, {numgears >=8 }
;    field = "9", tccr_opth9, {numgears >=9 }
;    field = "10", tccr_opth10, {numgears >=10 }

    dialog = lockuprbt, "", yAxis
    field = "Min RPM"
    field = "", tccr_rpm1
    field = "", tccr_rpm2
    field = "", tccr_rpm3
    field = "", tccr_rpm4, {numgears >=4 }
    field = "", tccr_rpm5, {numgears >=5 }
    field = "", tccr_rpm6, {numgears >=6 }
;    field = "", tccr_rpm7, {numgears >=7 }
;    field = "", tccr_rpm8, {numgears >=8 }
;    field = "", tccr_rpm9, {numgears >=9 }
;    field = "", tccr_rpm10, {numgears >=10 }

    dialog = lockuprbv, "", yAxis
    field = "Min VSS"
    field = "", tccr_vss1
    field = "", tccr_vss2
    field = "", tccr_vss3
    field = "", tccr_vss4, {numgears >=4 }
    field = "", tccr_vss5, {numgears >=5 }
    field = "", tccr_vss6, {numgears >=6 }
;    field = "", tccr_vss7, {numgears >=7 }
;    field = "", tccr_vss8, {numgears >=8 }
;    field = "", tccr_vss9, {numgears >=9 }
;    field = "", tccr_vss10, {numgears >=10 }

    dialog = lockuprbu, "", yAxis
    field = "Locked during upshift"
    field = "", tccr_uoptl1
    field = "", tccr_uoptl2
    field = "", tccr_uoptl3
    field = "", tccr_uoptl4, {numgears >4 }
    field = "", tccr_uoptl5, {numgears >5 }
    field = "", tccr_uoptl6, {numgears >6 }
;    field = "", tccr_uoptl7, {numgears >7 }
;    field = "", tccr_uoptl8, {numgears >8 }
;    field = "", tccr_uopth9, {numgears >9 }
;    field = "", tccr_uopth10, {numgears >10 }

    dialog = lockuprbud, "", yAxis
    field = "Lockup delay"
    field = "", tccr_afterdelay1, {0}
    field = "", tccr_afterdelay2
    field = "", tccr_afterdelay3
    field = "", tccr_afterdelay4, {numgears >=4 }
    field = "", tccr_afterdelay5, {numgears >=5 }
    field = "", tccr_afterdelay6, {numgears >=6 }
;    field = "", tccr_afterdelay7, {numgears >=7 }
;    field = "", tccr_afterdelay8, {numgears >=8 }
;    field = "", tccr_afterdelay9, {numgears >=9 }
;    field = "", tccr_afterdelay10, {numgears >=10 }

    dialog = lockuprb, "Lockup per Gear", xAxis
    panel = lockuprbo
    panel = lockuprbt
    panel = lockuprbv
    panel = lockuprbu
    panel = lockuprbud

    dialog = lockuprace, "Lockup Race Settings", yAxis
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#lockuprace"
    panel = lockupc, North
    panel = lockuprb, Center, { lockrace_on }

   dialog = gearpos, "Analogue gear position"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#gearpos"
    field = "Park voltage",  gearpv
    field = "Reverse voltage",  gearrv
    field = "Neutral voltage",  gearnv
    field = "1st gear voltage", gear1v
    field = "2nd gear voltage", gear2v
    field = "3rd gear voltage", gear3v
    field = "4th gear voltage", gear4v, {numgears >=4 }
    field = "5th gear voltage", gear5v, {numgears >=5 }
    field = "6th gear voltage", gear6v, {numgears >=6 }

    dialog = paddle, "Paddle shifter"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#paddle"
    field = "Enable input", paddle_en, {cpu == 3}, {cpu == 3}
    field = "Enable input", paddle_en_ms2,{cpu < 2}, {cpu < 2}
    field = "Enable input", paddle_en_us, {(cpu == 2) || (cpu == 4)}, {(cpu == 2) || (cpu == 4)}
    field = "Active high/low", paddle_optenact, {paddle_en}
    field = "Output e.g. horn", paddle_out, {paddle_en}, {cpu == 3}
    field = "Output e.g. horn", paddle_out_ms2, {paddle_en}, {cpu < 2}
    field = "Output e.g. horn", paddle_out_us, {paddle_en}, {(cpu == 2) || (cpu == 4)}
;    field = "Active high/low",  paddle_optoutact, {paddle_en && paddle_out}
    field = "Paddle input", paddle_in, {paddle_en && (cpu == 3)}, {cpu == 3}
    field = "Paddle input", paddle_in_ms2, {paddle_en && (cpu < 2)}, {cpu < 2}
    field = "Paddle input", paddle_in_us, {paddle_en && ((cpu == 2) || (cpu == 4))}, {(cpu == 2) || (cpu == 4)}
    field = "Voltage for UP", paddle_upv, {paddle_en}
    field = "Voltage for DOWN", paddle_downv, {paddle_en}
    field = "Voltage for OUT", paddle_outv, {paddle_en}

    dialog = outputTestbuttons1a, "", xAxis
        ;commandButton = "Label Text", command, { Enabled Condition }, optionalFlags
        ; The rem > 0 expression is just for testing.. It works when the MS is on the Stim with rpm.
        ; a status bit there would be the expected real expression
        commandButton = "Enable Test Mode", cmdEnterTestMode, { (!(status3 & 8))} ; zero RPM isn't a requirement

        ; if clickOnCloseIfEnabled is set, then the command assigned to this button will be run on the 
        ; dialog close, but only if the enable condition is true
        ; valid click flags are:
        ; clickOnCloseIfEnabled - the command will be sent on dialog close if active condition is true
        ; clickOnCloseIfDisabled - the command will be sent on dialog close if active condition is false
        ; clickOnClose - the command will be sent on dialog close always
        commandButton = "Disable Test Mode", cmdStopTestmode, { status3 & 8 }, clickOnCloseIfEnabled

    dialog = outputTestbuttons1b, ""
      field = "!DO NOT USE ON A MOVING VEHICLE - SERIOUS RISK OF INJURY IF MISUSED"

    dialog = outputTestbuttons1, "Test Mode Controls", yAxis
        panel = outputTestbuttons1a
        panel = outputTestbuttons1b

    dialog = outputtest9, "Gear Selection", xAxis
        commandButton = "Stop test", cmdtest2, { status3 & 8 }
        commandButton = "PRN1", cmdtestg1, { status3 & 8 }
        commandButton = "2", cmdtestg2, { status3 & 8 }
        commandButton = "3", cmdtestg3, { status3 & 8 }
        commandButton = "4", cmdtestg4, { status3 & 8 }
    dialog = outputtest9a, "", xAxis
        commandButton = "5", cmdtestg5, { (status3 & 8) && (trans == 7) }
        commandButton = "6", cmdtestg6, { (status3 & 8) && 0 }
        commandButton = "7", cmdtestg7, { (status3 & 8) && 0 }
        commandButton = "8", cmdtestg8, { (status3 & 8) && 0 }
        commandButton = "9", cmdtestg9, { (status3 & 8) && 0 }
        commandButton = "10",cmdtestg10,{ (status3 & 8) && 0 }

      dialog = outputtest10, "Line pressure", xAxis
        commandButton = "Stop", cmdtest7, { status3 & 8 }
        commandButton = "Start", cmdtest8, { status3 & 8 }
      field = "EPC pressure", tst_epc

      dialog = outputtest11, "Lockup", xAxis
        commandButton = "Stop", cmdtest9, { status3 & 8 }
        commandButton = "Start", cmdtest10, { status3 & 8 }
      field = "LU duty cycle", tst_tcc

      dialog = outputtest12, "3-2 / backfill solenoid", xAxis
        commandButton = "Off", cmdtest11, { (status3 & 8) && (trans != 7) }
        commandButton = "On", cmdtest12, { (status3 & 8) && (trans != 7) }
          field = "Duty cycle", tst_sol32, { (trans != 7) }

        dialog = outputtest_io1, "Outputs", yAxis
            panel = outputtest9
            panel = outputtest9a
            panel = outputtest10
            panel = outputtest11
            panel = outputtest12

        dialog = testmode, "", yAxis
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#testmode"
            panel = outputTestbuttons1
            panel = outputtest_io1

;-------------------------------------------------------------------------------

[TableEditor]
       table = sol4pwm_Tbl, sol4pwm_duties_map, "Backfill Solenoid PWM"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#backfill"
          xBins       = sol4pwm_vsss, vehicle_speed
          yBins       = sol4pwm_loadvals, load
          zBins       = sol4pwm_duties
          upDownLabel = "HIGHER", "LOWER"
          gridOrient = 250, 0, 340
          
       table = epc_corr_Tbl, epc_corr_map, "EPC Temperature correction"
;         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#backfill"
          xBins       = epc_corr_epc, epc_raw
          yBins       = epc_corr_temp, transtemp
          zBins       = epc_corr_duties
          upDownLabel = "HIGHER", "LOWER"
          gridOrient = 250, 0, 340
          

[CurveEditor]
   curve = linepc, "Line Pressure - Common"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = liner

   curve = linepr, "Line Pressure - Reverse"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = liner

   curve = linep1, "Line Pressure - First"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line1

   curve = linep2, "Line Pressure - Second"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line2

   curve = linep3, "Line Pressure - Third"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line3

   curve = linep4, "Line Pressure - Fourth"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line4

   curve = linep5, "Line Pressure - Fifth"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line5

   curve = linepm1, "Line Pressure - Manual 1st"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line5

   curve = linep6, "Line Pressure - Sixth"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line6

   curve = linep7, "Line Pressure - Seventh"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line7

   curve = linep8, "Line Pressure - Eighth"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line8

   curve = linep9, "Line Pressure - Ninth"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line9

   curve = linep10, "Line Pressure - Tenth"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#linepress"
      columnLabel = "%load", "%pressure"
      xAxis       = 0, 100, 6
      yAxis       = 0, 100, 6
      xBins       = lineload, load_epc
      yBins       = line10

   curve = shiftgear1u, "Shift Curve 1 up"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftcurves"
      columnLabel = "%load", "Up"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift12load, load
      yBins       = shiftup12, vss1

   curve = shiftgear2ud, "Shift Curve 2 up/down"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift23load, load
      yBins       = shiftup23, vss1
      yBins       = shiftdown12, vss1

   curve = shiftgear3ud, "Shift Curve 3 up/down"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift34load, load
      yBins       = shiftup34
      yBins       = shiftdown23

   curve = shiftgear4ud, "Shift Curve 4 up/down"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift45load, load
      yBins       = shiftup45
      yBins       = shiftdown34

   curve = shiftgear4d, "Shift Curve 4 down"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftcurves"
      columnLabel = "%load", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift45load, load
      yBins       = shiftdown34

   curve = shiftgear5d, "Shift Curve 5 down"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.2.pdf#shiftcurves"
      columnLabel = "%load", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift45load, load
      yBins       = shiftdown45

; Now a set of display-only curves for a different visualisation

   curve = shiftt12, "Shift Curve 1->2 display only"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 100 : 160 }, 6
      xBins       = shift12load, load
      xBins       = shift23load, load
      yBins       = shiftup12
      yBins       = shiftdown12

   curve = shiftt23, "Shift Curve 2->3 display only"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift23load, load
      xBins       = shift34load, load
      yBins       = shiftup23
      yBins       = shiftdown23

   curve = shiftt34, "Shift Curve 3->4 display only"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift34load, load
      xBins       = shift45load, load
      yBins       = shiftup34
      yBins       = shiftdown34

   curve = shiftt45, "Shift Curve 4->5"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift45load, load
      yBins       = shiftup45
      yBins       = shiftdown45

   curve = shiftt56, "Shift Curve 5->6"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift56load, load
      yBins       = shiftup56
      yBins       = shiftdown56

   curve = shiftt67, "Shift Curve 6->7"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift67load, load
      yBins       = shiftup67
      yBins       = shiftdown67

   curve = shiftt78, "Shift Curve 7->8"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift78load, load
      yBins       = shiftup78
      yBins       = shiftdown78

   curve = shiftt89, "Shift Curve 8->9"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Speed"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift89load, load
      yBins       = shiftup89
      yBins       = shiftdown89

   curve = shiftt910, "Shift Curve 9->10"
         topicHelp = "file://$getProjectsDirPath()/docs/Trans_Control-1.0.pdf#shiftcurves"
      columnLabel = "%load", "Up", "Down"
      xAxis       = 0, 100, 6
      yAxis       =  0, { prefSpeedUnits == 0 ? 150 : 240 }, 6
      xBins       = shift910load, load
      yBins       = shiftup910
      yBins       = shiftdown910

   curve = shiftretard, "Shift Retard"
      columnLabel = "%load", "Retard deg"
      xAxis       = 0, 100, 6
      yAxis       = 0, 10, 6
      xBins       = sret_load, load
      yBins       = sret_retard

;-------------------------------------------------------------------------------

[GaugeConfigurations]

   ;-------------------------------------------------------------------------------
   ;  Notes on some of the gauges.
   ;
   ;  The accelEnrichGauge is now a composite of both acceleration enrichment
   ;  and deceleration enleanment numbers.  See the definition of the variable
   ;  accDecEnrich in the OutputChannels section.
   ;
   ;  David Hooke contributed the lambda gauge and associated transfer
   ;  function files.
   ;
   ;  The lambda gauge is the best way (my opinion) to report data from a
   ;  wide band EGO gauge, it standardizes the output irrespective of fuel
   ;  or mix of fuels, so you needn't do any brainwork to know if your 75%
   ;  gasoline and 25% methanol is rich at 10:1 or not.
   ;
   ;  Use the file WBlambda100AVR.inc, if using a standard ADC (e.g., AVR cpu).
   ;  Use the file WBlambda100MOT.inc, if using a biased ADC (e.g., MOT cpu).
   ;-------------------------------------------------------------------------------
   ; Define a gauge's characteristics here, then go to a specific layout
   ; block (Tuning or FrontPage) and use the name you've defined here to
   ; display that gauge in a particular position.
   ;
   ; Name  = Case-sensitive, user-defined name for this gauge configuration.
   ; Var   = Case-sensitive name of variable to be displayed, see the
   ;         OutputChannels block in this file for possible values.
   ; Title = Title displayed at the top of the gauge.
   ; Units = Units displayed below value on gauge.
   ; Lo    = Lower scale limit of gauge.
   ; Hi    = Upper scale limit of gauge.
   ; LoD   = Lower limit at which danger color is used for gauge background.
   ; LoW   = Lower limit at which warning color is used.
   ; HiW   = Upper limit at which warning color is used.
   ; HiD   = Upper limit at which danger color is used.
   ; vd    = Decimal places in displayed value
   ; ld    = Label decimal places for display of Lo and Hi, above.

   ;Name               Var            Title                 Units     Lo     Hi     LoD    LoW   HiW   HiD vd ld

   clockGauge        = seconds,       "Clock",              "Seconds", 0,   255,     10,    10,  245,  245, 0, 0
   deadGauge         = deadValue,     "---",                "",        0,     1,     -1,    -1,    2,    2, 0, 0
   tachometer_trans  = rpm,           "Engine Speed",       "RPM",     0,  8000,    300,   600, 3000, 5000, 0, 0
   vehiclespeed     = vss1, "Vehicle Speed", { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, 0, { prefSpeedUnits == 0 ? 200 : 300 }, 1000, 1000, 1000, 1000, 0, 0
   tpsGauge          = tps,            "TPS",        "%",       0,  100,    -1,   -1, 100, 100, 0, 0
   mapGauge          = map,            "MAP",        "kPa",     0,  100,    -1,   -1, 400, 400, 0, 0
   loadGauge         = load,           "Load",       "%",       0,  100,    -1,   -1, 400, 400, 0, 0
   adc0Gauge         = adc0,           "adc0",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   adc1Gauge         = adc1,           "adc1",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   adc2Gauge         = adc2,           "adc2",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   tpsADCGauge       = adc3,           "adc3",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   adc4Gauge         = adc4,           "adc4",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   adc5Gauge         = adc5,           "adc5",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   adc6Gauge         = adc6,           "adc6",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0
   adc7Gauge         = adc7,           "adc7",       "raw",     0,  1023,    0,   0, 1023, 1023, 0, 0

   ;Name               Var            Title                 Units     Lo     Hi     LoD    LoW   HiW   HiD vd ld

#if CELSIUS
   enginetempGauge   = enginetemp,      "Engine Temp",      "°C",   {cltlowlim},   {clthighlim},    -100,     -100,   {clthighwarn},  {clthighdang}, 0, 0
   transtempGauge    = transtemp,       "Trans Temp",  "°C",    -40,   110,    -15,     0,   95,  100, 0, 0
#else
   enginetempGauge   = enginetemp,      "Engine Temp",      "°F",    {cltlowlim},   {clthighlim},      -100,    -100,  {clthighwarn},  {clthighdang}, 0, 0
   transtempGauge    = transtemp,       "Trans Temp", "°F",    -40,   215,      0,    30,  200,  210, 0, 0
#endif

   selectorGauge     = selector, "Selector","", -1, 10, -2,-2,256,256,0,0
   gearselinGauge    = gearselin, "Gear sel bits","", 0, 15, 0,0,256,256,0,0
   gearsel_voltsGauge     = gearsel_volts, "Gear Sel. Volts","V", 0, 5, 0,0,5,5,2,2
   gearGauge         = gear, "Active Gear", "", -1, 10, -2,-2,255,255,0,0

   status1           = status1, "status1","", 0, 255
   status2           = status2, "status2","", 0, 255
   status3           = status3, "status3","", 0, 255
   status4           = status4, "status4","", 0, 255
   epc               = epc,     "line pressure", "%", 0, 100,-1,-1,100,100,0,0
   epc_raw           = epc_raw, "line pressure raw", "%", 0, 100,-1,-1,100,100,0,0
   tcc               = tcc,     "tcc",           "%", 0, 100,-1,-1,100,100,0,0
   status5           = status5, "status5","", 0, 4294967296
   status6           = status6, "status6","", 0, 4294967296
   sol32             = sol32,   "3-2 backfill solenoid", "%", 0, 100,-1,-1,100,100,0,0
   inprpm            = inprpm,  "Input RPM",  "RPM",     0,  8000,    300,   600, 3000, 5000, 0, 0
   outrpm            = outrpm,  "Output RPM", "RPM",     0,  8000,    300,   600, 3000, 5000, 0, 0
   slip_conv         = slip_conv, "Convertor Slip", "%",     -100,   100,    100,   100, 100, 100, 0, 0
   slip_trans        = slip_trans, "Trans Slip",    "%",     -100,   100,    100,   100, 100, 100, 0, 0
   shift_retard      = shift_retard, "Shift Retard", "deg",     0,    10,     10,    10,  10,  10, 1, 1

;------------------------------------------------------------------------------

[FrontPage]
;   egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.

   ; Gauges are numbered left to right, top to bottom.
   ;
   ;    1  2  3  4
   ;    5  6  7  8

   gauge1 = tachometer_trans
   gauge2 = vehiclespeed
   gauge3 = transtempGauge
   gauge4 = enginetempGauge
   gauge5 = selectorGauge
   gauge6 = tpsGauge
   gauge7 = epc
   gauge8 = tcc

;   gauge7 = status3
;   gauge8 = status4

;gauge1 = adc0Gauge
;gauge2 = adc1Gauge
;gauge3 = adc2Gauge
;gauge4 = adc3Gauge
;gauge5 = selectorGauge
;gauge6 = tpsADCGauge
;gauge7 = adc6Gauge
;gauge8 = clockGauge

   ;----------------------------------------------------------------------------
   ; Indicators
   ;               expr         off-label          on-label, off-bg, off-fg, on-bg, on-fg
   ;   indicator = { tpsaen }, "Not Accelerating", "AE",     cyan,   white,  red,   black
   ;
   ; Look in the new colors24b.ini for the basic ones, add more or tell me what to add.

; shows selector position
;   indicator = { selector == -1     }, "-", "R",    white, black, green, black
;   indicator = { selector == 0      }, "-", "P/N",    white, black, green, black
;   indicator = { selector == 4      }, "-", "OD",   white, black, green, black
;   indicator = { selector == 3      }, "-", "D",    white, black, green, black
;   indicator = { selector == 2      }, "-", "2",    white, black, green, black
;   indicator = { selector == 1      }, "-", "1",    white, black, green, black
;   indicator = { selector == 128    }, "-",   "Selector",   white, black, red,   black
;   indicator = { selector == 128    }, "-",   "Fault",   white, black, red,   black

; shows commanded gear
;   indicator = { gear == 255    }, "R", "R",    white, black, green, black
;   indicator = { gear == 0      }, "P/N", "P/N",    white, black, green, black
;   indicator = { gear == 1      }, "PRN1", "PRN1",    white, black, green, black
;   indicator = { gear == 2      }, "2", "2",    white, black, green, black
;   indicator = { gear == 3      }, "3", "3",    white, black, green, black
;   indicator = { gear == 4      }, "4", "4",   white, black, green, black
;   indicator = { gear == 5      }, "5", "5",   white, black, green, black
   indicator = { gear%2 }, "Gear: bitStringValue( gearDisplay , gear+1  )",   "Gear: bitStringValue( gearDisplay , gear+1  )",  white, black, green, black
   indicator = { selector == -5}, "-",   "Sel Fault",    white, black, red,   black
   indicator = { status1 & 0x10 }, "brake",   "BRAKE",   white, black, red,   black
   indicator = { status1 & 0x40 }, "lockup", "LOCKUP",   white, black, green, black
   indicator = { status1 & 0x80 }, "OD ENABLE", "OD CANCEL", green, black, cyan, black
   indicator = { cpu == 0       }, "OK",   "CPU UNSET",  white, black, red,   black
   indicator = { status3 & 0x01 }, "fan off", "FAN ON",  white, black, green, black
   indicator = { status3 & 0x02 }, "manual", "MANUAL",  white, black, green, black
   indicator = { status3 & 0x04 }, "low-range", "LOW-RANGE",  white, black, green, black
   indicator = { status3 & 0x10 }, "paddle mode", "PADDLE MODE",  white, black, green, black

   indicator = { solstat & 0x01    }, "sol1", "SOL1",    white, black, green, black
   indicator = { solstat & 0x02    }, "sol2", "SOL2",    white, black, green, black
   indicator = { solstat & 0x04    }, "sol3", "SOL3",    white, black, green, black
   indicator = { solstat & 0x08    }, "sol4", "SOL4",    white, black, green, black
   indicator = { solstat & 0x10    }, "sol5", "SOL5",    white, black, green, black
;-------------------------------------------------------------------------------

[OutputChannels]
    deadValue        = { 0 } ; Convenient unchanging value.
    ochBlockSize     = 71
    ochGetCommand    = "r\$tsCanId\x07%2o%2c"

   seconds          = scalar, U16,    0, "s",   1.000, 0.0
   secl = { seconds % 256 }, "s" ; For runtime screen.

   rpm              = scalar, U16,    2, "RPM", 1.000, 0.0
   vss1             = scalar, U16,    4, { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { msToPrefUnitsScale }, 0.0
   tps              = scalar, S16,    6, "", 0.1,1
   map              = scalar, S16,    8, "", 0.1,1
#if CELSIUS
   transtemp        = scalar, S16,   10, "°C",  0.05555, -320.0
   enginetemp       = scalar, S16,   12, "°C",  0.05555, -320.0
#else
   transtemp        = scalar, S16,   10, "°F", 0.1,0
   enginetemp       = scalar, S16,   12, "°F", 0.1,0
#endif
   selector         = scalar, S08,   14, "", 1,0
   gear             = scalar, S08,   15, "", 1,0
   adc0             = scalar, U16,   16, "", 1,0
   adc1             = scalar, U16,   18, "", 1,0
   adc2             = scalar, U16,   20, "", 1,0
   adc3             = scalar, U16,   22, "", 1,0
   adc4             = scalar, U16,   24, "", 1,0
   adc5             = scalar, U16,   26, "", 1,0
   adc6             = scalar, U16,   28, "", 1,0
   adc7             = scalar, U16,   30, "", 1,0
   status1          = scalar, U08,   32, "", 1,0
   status2          = scalar, U08,   33, "", 1,0
   status3          = scalar, U08,   34, "", 1,0
   status4          = scalar, U08,   35, "", 1,0
   epc              = scalar, U08,   36, "", 0.392,0
   tcc              = scalar, U08,   37, "", 0.392,0
   status5          = scalar, U32,   38, "", 1,0
   status6          = scalar, U32,   42, "", 1,0
   sol32            = scalar, U08,   46, "", 0.392,0
   solstat          = scalar, U08,   47, "", 1,0
   inprpm           = scalar, U16,   48, "RPM", 1.000, 0.0
   outrpm           = scalar, U16,   50, "RPM", 1.000, 0.0
   gearselin        = scalar, U08,   52, "", 1,0
   slip_conv        = scalar, S08,   53, "", 1,0
   slip_trans       = scalar, S08,   54, "", 1,0
   targ_gear        = scalar, S08,   55, "", 1,0
   shift_retard     = scalar, S16,   56, "deg", 0.1,0
   load             = scalar, S16,   58, "%", 0.1,0
   gearstate        = scalar, U08,   60, "", 1,0
   lockupmode       = scalar, U08,   61, "", 1,0
   gear_timer       = scalar, U16,   62, "", 1,0
   lockupcount      = scalar, U16,   64, "", 1,0
   rpmdot_slow      = scalar, S16,   66, "", 1,0
   gearsel_volts    = scalar, U16,   68, "V", 0.01, 0
   epc_raw          = scalar, U08,   70, "", 0.392,0

    time = { timeNow }
    tpsADC = { adc3 }
    msToPrefUnitsScale = { prefSpeedUnits == 0 ?  0.22369 :  0.36 }, ""
    clt_exp = { 0 } ; not used at this time
#if CELSIUS
    cltlowlim   = { clt_exp ? -40 : -40 }
    clthighlim  = { clt_exp ? 230 : 120 }
    cltlowdang  = { clt_exp ? 65 : 10 }
    cltlowwarn  = { clt_exp ? 93 : 65 }
    clthighwarn = { clt_exp ? 162 : 93 }
    clthighdang = { clt_exp ? 176 : 104 }
    mathigh = { 110 }
#else ; fahrenheit
    cltlowlim   = { clt_exp ? -40 : -40 }
    clthighlim  = { clt_exp ? 450 : 250 }
    cltlowdang  = { clt_exp ? 150 : 50 }
    cltlowwarn  = { clt_exp ? 200 : 150 }
    clthighwarn = { clt_exp ? 325 : 200 }
    clthighdang = { clt_exp ? 350 : 220 }
    mathigh = { 215 }
#endif

    numgears = { (trans) == 7 ? 5 : 4 } ; only support 4 and 5 speed at the moment
    wheelDiaM = { prefLengthUnits == 0 ? wheeldia : wheeldia * 0.0254 }, "m", hidden
    outputShaftToPrefSpeed = { prefSpeedUnits == 0 ? wheelDiaM / (fdratio * 8.538) : 0.18854 * wheelDiaM / fdratio }, "", hidden ; 8.538 = (1 mile in m) / ( Pi * 60 ), 0.18854 = 1.609/8.538 for KPH
    vehicle_speed = { outputShaftToPrefSpeed }
    load_epc = { setting3_lineload == 0 ? tps : map }

;-------------------------------------------------------------------------------
;--  The entries are saved in the datalog file in the order in which they     --
;--  appear in the list below.                                                --
;--                                                                           --
;--   Channel - Case sensitive name of output channel to be logged.           --
;--   Label   - String written to header line of log.  Be careful             --
;--             about changing these, as programs like MSLVV and              --
;--             MSTweak key off specific column names.                        --

;--   Type    - Data type of output, converted before writing.                --
;--   Format  - C-style output format of data.                                --

[Datalog]
   ;       Channel          Label          Type    Format
   ;       --------------   ----------     -----   ------
    entry = time,            "Time",        float,  "%.3f"
    entry = seconds,         "SecL",        int,    "%d"
    entry = rpm,             "RPM",         int,    "%d"
    entry = inprpm,          "Input RPM",   int,    "%d"
    entry = outrpm,          "Output RPM",  int,    "%d"
    entry = vss1,            "VSS1",        float,  "%.1f"
    entry = tps,             "TPS",         float,  "%.1f"
    entry = load,            "Load",        float,  "%.1f"
    entry = map,             "MAP",         float,  "%.1f"
    entry = transtemp,       "Trans temp",  float,  "%.1f"
    entry = enginetemp,      "CLT",         float,  "%.1f"
    entry = selector,        "Selector pos",int,    "%d"
    entry = gear,            "Gear",        int,    "%d"
    entry = epc,             "EPC%",        int,    "%d"
    entry = epc_raw,         "EPC% raw",    int,    "%d"
    entry = tcc,             "TCC%",        int,    "%d"
    entry = sol32,           "Sol3-2%",     int,    "%d"
    entry = solstat,        "solstat",      int,    "%d"
    entry = gearselin,      "gearselin",    int,    "%d"
    entry = slip_conv,      "Convertor Slip",int,   "%d"
    entry = slip_trans,     "Transmission Slip",int,"%d"
    entry = shift_retard,   "Shift Retard", float,  "%.1f"

    entry = adc0,           "ADC 0",        int,    "%d"
    entry = adc1,           "ADC 1",        int,    "%d"
    entry = adc2,           "ADC 2",        int,    "%d"
    entry = adc3,           "ADC 3",        int,    "%d"
    entry = adc4,           "ADC 4",        int,    "%d"
    entry = adc5,           "ADC 5",        int,    "%d"
    entry = adc6,           "ADC 6",        int,    "%d"
    entry = adc7,           "ADC 7",        int,    "%d"

    entry = status1,        "Status1", int, "%d"
    entry = status3, "Status3", int, "%d"
#ifdef DEBUG_LOGGING
    entry = status2, "Status2", int, "%d"
    entry = status4, "Status4", int, "%d"
    entry = status5, "Status5", int, "%d"
    entry = status6, "Status6", int, "%d"
	entry = gearstate, "gearstate", int, "%d"
	entry = lockupmode, "lockupmode", int, "%d"
	entry = gear_timer, "gear_timer", int, "%d"
	entry = lockupcount, "lockupcount", int, "%d"
	entry = targ_gear, "Target gear", int, "%d"
    entry = rpmdot_slow, "RPMdot slow", int, "%d"
#endif
;-------------------------------------------------------------------------------
