
[GaugeConfigurations]
gaugeCategory = "VE Analyze Gauges"

    egoCorrGaugeVeTable1   = avgEgoCor,   "EGO Correction VE1",    "%",      50,   150,     90,    99,  101,  110, 1, 1
    egoCorrGaugeVeTable2   = avgEgoCor2,  "EGO Correction VE2",    "%",      50,   150,     90,    99,  101,  110, 1, 1
#if LAMBDA
    lambdaGaugeVeTable1    = avgLambda,   "Lambda VE1",            "",      0.5,   1.5,    0.5,   0.7,    2,  1.1, 2, 2
    lambdaGaugeVeTable2    = avgLambda2,  "Lambda VE2",            "",      0.5,   1.5,    0.5,   0.7,    2,  1.1, 2, 2
#else
    afrGaugeVeTable1       = avgAfr,      "Air:Fuel Ratio VE1",    "",       10,  19.4,     12,    13,   15,   16, 2, 2
    afrGaugeVeTable2       = avgAfr2,     "Air:Fuel Ratio VE2",    "",       10,  19.4,     12,    13,   15,   16, 2, 2
#endif

[OutputChannels]
#if   NARROW_BAND_EGO
     avgEgoVolts = { egonum == 0 ? 14.7 : egonum == 1 ? egov1 : egonum == 2 ? (egov1+egov2)/2 : egonum == 3 ? (egov1+egov2+egov3)/egonum : egonum == 4 ? (egov1+egov2+egov3+egov4)/egonum : egonum == 5 ? (egov1+egov2+egov3+egov4+egov5)/egonum : egonum == 6 ? (egov1+egov2+egov3+egov4+egov5+egov6)/egonum : egonum == 7 ? (egov1+egov2+egov3+egov4+egov5+egov6+egov7)/egonum : (egov1+egov2+egov3+egov4+egov5+egov6+egov7+egov8)/8 }, "V"
     ; if running dual table with 2 sensors
     avgEgoV2 = { ((dualfuel_sw_on ==1) && (dualfuel_opt_mode == 1) && (egonum == 2)) ?  egov2 : avgEgoVolts }, "V";

    avgAfr = { table( avgEgoVolts, "nb.inc" ) }, ":1"
    avgAfr2 = { table( avgEgoV2, "nb.inc" ) }, ":1"

#elif LAMBDA
     avgLambda = { egonum == 0 ? 1.0 : egonum == 1 ? lambda1 : egonum == 2 ? (lambda1+lambda2)/2 : egonum == 3 ? (lambda1+lambda2+lambda3)/egonum : egonum == 4 ? (lambda1+lambda2+lambda3+lambda4)/egonum : egonum == 5 ? (lambda1+lambda2+lambda3+lambda4+lambda5)/egonum : egonum == 6 ? (lambda1+lambda2+lambda3+lambda4+lambda5+lambda6)/egonum : egonum == 7 ? (lambda1+lambda2+lambda3+lambda4+lambda5+lambda6+lambda7)/egonum : (lambda1+lambda2+lambda3+lambda4+lambda5+lambda6+lambda7+lambda8)/8 }, "lambda"
     avgLambda2= { ((dualfuel_sw_on ==1) && (dualfuel_opt_mode == 1) && (egonum == 2)) ?  lambda2 : avgLambda } ;
#else
     avgAfr = { egonum == 0 ? 14.7 : egonum == 1 ? afr1 : egonum == 2 ? (afr1+afr2)/2 : egonum == 3 ? (afr1+afr2+afr3)/egonum : egonum == 4 ? (afr1+afr2+afr3+afr4)/egonum : egonum == 5 ? (afr1+afr2+afr3+afr4+afr5)/egonum : egonum == 6 ? (afr1+afr2+afr3+afr4+afr5+afr6)/egonum : egonum == 7 ? (afr1+afr2+afr3+afr4+afr5+afr6+afr7)/egonum : (afr1+afr2+afr3+afr4+afr5+afr6+afr7+afr8)/8 }, "AFR"
     ; if running dual table with 2 sensors
     avgAfr2 = { ((dualfuel_sw_on ==1) && (dualfuel_opt_mode == 1) && (egonum == 2)) ?  afr2 : avgAfr }, ":1";
#endif
     avgEgoCor = { egonum == 0 ? 100 : egonum == 1 ? egocor1 : egonum == 2 ? (egocor1+egocor2)/2 : egonum == 3 ? (egocor1+egocor2+egocor3)/egonum : egonum == 4 ? (egocor1+egocor2+egocor3+egocor4)/egonum : egonum == 5 ? (egocor1+egocor2+egocor3+egocor4+egocor5)/egonum : egonum == 6 ? (egocor1+egocor2+egocor3+egocor4+egocor5+egocor6)/egonum : egonum == 7 ? (egocor1+egocor2+egocor3+egocor4+egocor5+egocor6+egocor7)/egonum : (egocor1+egocor2+egocor3+egocor4+egocor5+egocor6+egocor7+egocor8)/8 }, "egocor"
     avgEgoCor2 = { ((dualfuel_sw_on ==1) && (dualfuel_opt_mode == 1) && (egonum == 2)) ?  egocor2 : avgEgoCor }, "%";


[VeAnalyze]
	;    tableName,  lambdaTargetTableName, lambdaChannel, egoCorrectionChannel, activeCondition
#if   NARROW_BAND_EGO
     veAnalyzeMap = veTable1Tbl, afrTSCustom, avgAfr, avgEgoCor, { !(status1 & 0b00100000) }
#elif LAMBDA
     veAnalyzeMap = veTable1Tbl, afrTable1Tbl, avgLambda, avgEgoCor, { !(status1 & 0b00100000) }
#else
     veAnalyzeMap = veTable1Tbl, afrTable1Tbl, avgAfr, avgEgoCor, { !(status1 & 0b00100000) }
#endif
         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl, afrTSCustom
         
         ; Optional Lambda targets to over-ride the afr table lookups
         lambdaTargetChannels = afrtgt1, afrtgt2
         
         ; All Available ecoCorrectionChannels
         egoCorrectionChannels = egocor1, egocor2, egocor3, egocor4, egocor5, egocor6, egocor7, egocor8
         
         

       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
        filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
       ;  filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels
#if NARROWBAND
#elif NARROW_BAND_EGO
#else
        filter = std_DeadLambda ; Auto build
#endif

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         ; this works, just another way to skin a cat
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = overrunFilter, "Overrun"    , pulseWidth1,  =       , 0,        , false
         filter = tBrakeFilter,  "T-Brake/Launch"  , status2,         &     ,   8,      , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         filter = std_Custom ; Standard Custom Expression Filter.
         filter = std_Expression, "Table Inactive"    , { (status1 & 0b00100000)}, false
         filter = idleVeTable, "Idle VE Active", status6,     &       , 16,       , false
         
         
    ; Table 2
#if   NARROW_BAND_EGO
     veAnalyzeMap = veTable2Tbl, afrTSCustom, avgAfr2, avgEgoCor2, { !(status1 & 0b00100000) }
#elif LAMBDA
     veAnalyzeMap = veTable2Tbl, afrTable2Tbl, avgLambda2, avgEgoCor2, { !(status1 & 0b00100000) }
#else
     veAnalyzeMap = veTable2Tbl, afrTable2Tbl, avgAfr2, avgEgoCor2, {  !(status1 & 0b00100000) }
#endif
         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl, afrTSCustom, 
         ; Optional Lambda targets to over-ride the afr table lookups
         lambdaTargetChannels = afrtgt1, afrtgt2
       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
       ; filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
         filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels
#if NARROWBAND
#elif NARROW_BAND_EGO
#else
         filter = std_DeadLambda ; Auto build
#endif

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         filter = aseFilter,   "ASE Flag"   , engine,         &       , 4,        , false
         filter = std_Expression, "Overrun"  , {pulseWidth1 == 0 && pulseWidth2 == 0}  , true
         ;filter = std_Expression, "Table Inactive"    , { !((dualTable ) || (algorithm2 != 0)) }, false
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = tBrakeFilter,  "T-Brake/Launch"  , status2,         &     ,   8,      , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         filter = std_Custom ; Standard Custom Expression Filter.
         filter = idleVeTable, "Idle VE Active", status6,     &       , 16,       , false


    ; Table 3
#if   NARROW_BAND_EGO
     veAnalyzeMap = veTable3Tbl, afrTSCustom, avgAfr, avgEgoCor; , { (status1 & 0b00100000) }
#elif LAMBDA
     veAnalyzeMap = veTable3Tbl, afrTable1Tbl, avgLambda, avgEgoCor; , { (status1 & 0b00100000) }
#else
     veAnalyzeMap = veTable3Tbl, afrTable1Tbl, avgAfr, avgEgoCor; , { (status1 & 0b00100000) }
#endif
         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl, afrTSCustom, 
         ; Optional Lambda targets to over-ride the afr table lookups
         lambdaTargetChannels = afrtgt1, afrtgt2
       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
       ; filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
         filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels
#if NARROWBAND
#elif NARROW_BAND_EGO
#else
         filter = std_DeadLambda ; Auto build
#endif

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         ; this works, just another way to skin a cat
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = overrunFilter, "Overrun"   , pulseWidth1,   =       , 0,        , false
         ;filter = std_Expression, "Table Inactive"    , { !(status1 & 0b00100000) }, false
         filter = tBrakeFilter,  "T-Brake/Launch"  , status2,         &     ,   8,      , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         filter = std_Custom ; Standard Custom Expression Filter.
         filter = idleVeTable, "Idle VE Active", status6,     &       , 16,       , false
         
 ; Table 4
#if   NARROW_BAND_EGO
     veAnalyzeMap = veTable4Tbl, afrTSCustom, avgAfr2, avgEgoCor2, { (status1 & 0b00100000) }
#elif LAMBDA
     veAnalyzeMap = veTable4Tbl, afrTable2Tbl, avgLambda2, avgEgoCor2, { (status1 & 0b00100000) }
#else
     veAnalyzeMap = veTable4Tbl, afrTable2Tbl, avgAfr2, avgEgoCor2, { (status1 & 0b00100000) }
#endif
         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl, afrTSCustom, 
         ; Optional Lambda targets to over-ride the afr table lookups
         lambdaTargetChannels = afrtgt1, afrtgt2
       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
       ; filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
         filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels
#if NARROWBAND
#else
         filter = std_DeadLambda ; Auto build
#endif

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         ; this works, just another way to skin a cat
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = overrunFilter, "Overrun"  , pulseWidth2,    =       , 0,        , false
         ;filter = std_Expression, "Table Inactive"    , { !((dualTable ) || (algorithm2 != 0)) }, false
         filter = tBrakeFilter,  "T-Brake/Launch"  , status2,         &     ,   8,      , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         filter = std_Custom ; Standard Custom Expression Filter.
         filter = idleVeTable, "Idle VE Active", status6,     &       , 16,       , false

 ; Table Idle VE
#if   NARROW_BAND_EGO
     veAnalyzeMap = idleve1Tbl, afrTSCustom, avgAfr, avgEgoCor, { (status6 & 16) }
#elif LAMBDA
     veAnalyzeMap = idleve1Tbl, afrTable1Tbl, avgLambda, avgEgoCor, { (status6 & 16) }
#else
     veAnalyzeMap = idleve1Tbl, afrTable1Tbl, avgAfr, avgEgoCor, { (status6 & 16) }
#endif
         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl, afrTSCustom, 
       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
       ; filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
         filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels
#if NARROWBAND
#else
         filter = std_DeadLambda ; Auto build
#endif

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         ; this works, just another way to skin a cat
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = overrunFilter, "Overrun"  , pulseWidth2,    =       , 0,        , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         ;filter = std_Expression, "Table Inactive"    , { !((dualTable ) || (algorithm2 != 0)) }, false
         filter = std_Custom ; Standard Custom Expression Filter.

; Trim tables 16 channel
	;    tableName,  lambdaTargetTableName, lambdaChannel, egoCorrectionChannel, activeCondition
#if NARROWBAND
; NARROWBAND not supported, let's be serious...
#elif NARROW_BAND_EGO
#else

#if LAMBDA
     trimAnalyzeMap = inj_trimaTbl, afrTable1Tbl, lambda1, egocor1, { hardware_fuel && sequential_trim_on_off  }
#else
     trimAnalyzeMap = inj_trimaTbl, afrTable1Tbl, afr1, egocor1, { hardware_fuel && sequential_trim_on_off  }
#endif

         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl
         
         ; Optional Lambda targets to over-ride the afr table lookups
         lambdaTargetChannels = afrtgt1, afrtgt2
         
         ;lambdaChannels = afr1, afr2, afr3, afr4, afr5, afr6, afr7, afr8, afr9, afr10, afr11, afr12, afr13, afr14, afr15, afr16 
#if LAMBDA
         lambdaChannels = lambda1, lambda2, lambda3, lambda4, lambda5, lambda6, lambda7, lambda8
#else
         lambdaChannels = afr1, afr2, afr3, afr4, afr5, afr6, afr7, afr8
#endif
         
         ; All Available ecoCorrectionChannels
#if CYL_12_16_SUPPORT
         egoCorrectionChannels = egocor1, egocor2, egocor3, egocor4, egocor5, egocor6, egocor7, egocor8, egocor9, egocor10, egocor11, egocor12 ;, egocor13, egocor14, egocor15, egocor16
#else
         egoCorrectionChannels = egocor1, egocor2, egocor3, egocor4, egocor5, egocor6, egocor7, egocor8
#endif         
         ; Optional field. If used, the lambdaChannels and egoCorrectionChannels will be hidden and this selection will put those both to the same index.
         pickListSelection = EGO1, EGO2, EGO3, EGO4, EGO5, EGO6, EGO7, EGO8, EGO9, EGO10, EGO11, EGO12 ;, EGO13, EGO14, EGO15, EGO16
         
         option = disableMaxPercentLimit 
         zAxisTransform = 100
         
        ;trimTable = tableName, label, afrChannel, egoCorr,  enableCondition
        ; or
        ;trimTable = tableName, label, egoSensorIndexEpression,  enableCondition
         trimTable = inj_trimaTbl, "Cyl #1", { egomap1 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 0)     } 
         trimTable = inj_trimbTbl, "Cyl #2", { egomap2 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 1)     } 
         trimTable = inj_trimcTbl, "Cyl #3", { egomap3 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 2)     } 
         trimTable = inj_trimdTbl, "Cyl #4", { egomap4 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 3)     } 
         trimTable = inj_trimeTbl, "Cyl #5", { egomap5 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 4)     } 
         trimTable = inj_trimfTbl, "Cyl #6", { egomap6 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 5)     } 
         trimTable = inj_trimgTbl, "Cyl #7", { egomap7 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 6)     } 
         trimTable = inj_trimhTbl, "Cyl #8", { egomap8 }, { hardware_fuel && sequential_trim_on_off && (nInjectors > 7)     } 
         
         ;trimTable = inj_trimaTbl, "Cyl #1", afr1, egocor1, { hardware_fuel && sequential_trim_on_off && (nInjectors > 0)     } 
         ;trimTable = inj_trimbTbl, "Cyl #2", afr2, egocor2, { hardware_fuel && sequential_trim_on_off && (nInjectors > 1)     } 
         ;trimTable = inj_trimcTbl, "Cyl #3", afr3, egocor3, { hardware_fuel && sequential_trim_on_off && (nInjectors > 2)     } 
         ;trimTable = inj_trimdTbl, "Cyl #4", afr4, egocor4, { hardware_fuel && sequential_trim_on_off && (nInjectors > 3)     } 
         ;trimTable = inj_trimeTbl, "Cyl #5", afr5, egocor5, { hardware_fuel && sequential_trim_on_off && (nInjectors > 4)     } 
         ;trimTable = inj_trimfTbl, "Cyl #6", afr6, egocor6, { hardware_fuel && sequential_trim_on_off && (nInjectors > 5)     } 
         ;trimTable = inj_trimgTbl, "Cyl #7", afr7, egocor7, { hardware_fuel && sequential_trim_on_off && (nInjectors > 6)     } 
         ;trimTable = inj_trimhTbl, "Cyl #8", afr8, egocor8, { hardware_fuel && sequential_trim_on_off && (nInjectors > 7)     } 
#if CYL_12_16_SUPPORT
         trimTable = inj_trimiTbl, "Cyl #9", afr9, egocor9, { hardware_fuel && sequential_trim_on_off && (nInjectors > 8)     } 
         trimTable = inj_trimjTbl, "Cyl #10", afr10, egocor10, { hardware_fuel && sequential_trim_on_off && (nInjectors > 9)  } 
         trimTable = inj_trimkTbl, "Cyl #11", afr11, egocor11, { hardware_fuel && sequential_trim_on_off && (nInjectors > 10) } 
         trimTable = inj_trimlTbl, "Cyl #12", afr12, egocor12, { hardware_fuel && sequential_trim_on_off && (nInjectors > 11) } 
         ;trimTable = inj_trimmTbl, "Cyl #13", afr13, egocor13, { hardware_fuel && sequential_trim_on_off && (nInjectors > 12) } 
         ;trimTable = inj_trimnTbl, "Cyl #14", afr14, egocor14, { hardware_fuel && sequential_trim_on_off && (nInjectors > 13) } 
         ;trimTable = inj_trimoTbl, "Cyl #15", afr15, egocor15, { hardware_fuel && sequential_trim_on_off && (nInjectors > 14) } 
         ;trimTable = inj_trimpTbl, "Cyl #16", afr16, egocor16, { hardware_fuel && sequential_trim_on_off && (nInjectors > 15) } 
#endif         

       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
        filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
       ;  filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels

         filter = std_DeadLambda ; Auto build

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         filter = tBrakeFilter,  "T-Brake/Launch"  , status2,         &     ,   8,      , false
         ; this works, just another way to skin a cat
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = overrunFilter, "Overrun"    , pulseWidth1,  =       , 0,        , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         filter = std_Custom ; Standard Custom Expression Filter.
         ;filter = std_Expression, "Table Inactive"    , { (status1 & 0b00100000)}, false
         filter = idleVeTable, "Idle VE Active", status6,     &       , 16,       , false
         
#endif ; end NARROWBAND if


; Trim tables Dual Table
	;    tableName,  lambdaTargetTableName, lambdaChannel, egoCorrectionChannel, activeCondition
#if NARROWBAND
; NARROWBAND not supported, let's be serious...
#elif NARROW_BAND_EGO
#else

#if LAMBDA
     trimAnalyzeMap = inj_trimiTbl, afrTable1Tbl, lambda1, egocor1, { (hardware_fuel==0) && sequential_trim_on_off  }
#else
     trimAnalyzeMap = inj_trimiTbl, afrTable1Tbl, afr1, egocor1, { (hardware_fuel==0) && sequential_trim_on_off }
#endif

         lambdaTargetTables = afrTable1Tbl, afrTable2Tbl
         
         ; Optional Lambda targets to over-ride the afr table lookups
         lambdaTargetChannels = afrtgt1, afrtgt2
         
#if LAMBDA
         lambdaChannels = lambda1, lambda2, lambda3, lambda4, lambda5, lambda6, lambda7, lambda8
#else
         lambdaChannels = afr1, afr2, afr3, afr4, afr5, afr6, afr7, afr8
#endif
         
         ; All Available ecoCorrectionChannels
         egoCorrectionChannels = egocor1, egocor2;, egocor3, egocor4, egocor5, egocor6, egocor7, egocor8
         
         ; Optional field. If used, the lambdaChannels and egoCorrectionChannels will be hidden and this selection will put those both to the same index.
         pickListSelection = EGO1, EGO2, EGO3, EGO4, EGO5, EGO6, EGO7, EGO8, EGO9, EGO10, EGO11, EGO12 ;, EGO13, EGO14, EGO15, EGO16
         
         zAxisTransform = 100
         option = disableMaxPercentLimit 
         
        ;trimTable = tableName, label, afrChannel, egoCorr,  enableCondition
        ; or
        ;trimTable = tableName, label, egoSensorIndexEpression,  enableCondition
         trimTable = inj_trim1Tbl, "Bank 1", { egomap1 }, { (hardware_fuel==0) && sequential_trim_on_off  } 
         trimTable = inj_trim2Tbl, "Bank 2", { egomap2 }, { (hardware_fuel==0) && sequential_trim_on_off  } 
         

       ; filter =  Name,        "DisplayName", outputChannel, operator, defaultVal, userAdjustable
        filter = minRPMFilter, "Minimum RPM", rpm,           <       , 500,      , true
       ; filter = maxRPMFilter, "Maximum RPM", rpm,           >       , 18000,    , true
       
       ;  filter = std_xAxisMin ; Auto build with appropriate axis channels
         filter = std_xAxisMax ; Auto build with appropriate axis channels
         filter = std_yAxisMin ; Auto build with appropriate axis channels
         filter = std_yAxisMax ; Auto build with appropriate axis channels

         filter = std_DeadLambda ; Auto build

#if CELSIUS          
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 71,       , true
#else
         filter = minCltFilter, "Minimum CLT", coolant,       <       , 160,      , true
#endif
         filter = accelFilterTp, "TP Accel Enrich"  , engine,         &     , 16,       , false
         filter = decelFilterTp, "TP Decel Enrich"  , engine,         &     , 32,       , false
         filter = accelFilterMap,"MAP Accel Enrich" , engine,         &     , 64,       , false
         filter = decelFilterMap,"MAP Decel Enrich" , engine,         &     , 128,      , false
         filter = tBrakeFilter,  "T-Brake/Launch"  , status2,         &     ,   8,      , false
         filter = spkCutFilter,  "Spark Cut"  , status2,         &     ,   32,      , false
         filter = fuelCutFilter,  "Fuel Cut"  , status3,         &     ,   1,      , false
         ; this works, just another way to skin a cat
         ;filter = decelFilter, "Decel Flag" , tpsaccden,         >       , 0,        , false
         filter = overrunFilter, "Overrun"    , pulseWidth1,  =       , 0,        , false
         filter = std_Custom ; Standard Custom Expression Filter.
         ;filter = std_Expression, "Table Inactive"    , { (status1 & 0b00100000)}, false
         filter = idleVeTable, "Idle VE Active", status6,     &       , 16,       , false
         
#endif ; end NARROWBAND if

[Datalog]
#if NARROWBAND
; NARROWBAND not supported, let's be serious...
#elif NARROW_BAND_EGO
#else

#if LAMBDA
   entry = avgLambda,    "Avg Lambda",       float,  "%.1f", { egonum > 1 }
#else
   entry = avgAfr,       "Avg AFR",       float,  "%.1f", { egonum > 1 }
#endif
   entry = avgEgoCor,    "Avg EGO Corr",  float,  "%.1f", { egonum > 1 }
