mirror of https://github.com/hyper-tuner/ini.git
Handle triple condition in dialog field (#150)
This commit is contained in:
parent
952db1d3f0
commit
529b55a6fb
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/node": "^18.11.12",
|
||||
"@types/node": "^18.11.13",
|
||||
"@types/parsimmon": "^1.10.6",
|
||||
"rome": "^11.0.0",
|
||||
"typescript": "^4.9.4"
|
||||
|
@ -115,9 +115,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "18.11.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.12.tgz",
|
||||
"integrity": "sha512-FgD3NtTAKvyMmD44T07zz2fEf+OKwutgBCEVM8GcvMGVGaDktiLNTDvPwC/LUe3PinMW+X6CuLOF2Ui1mAlSXg==",
|
||||
"version": "18.11.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.13.tgz",
|
||||
"integrity": "sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/parsimmon": {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/node": "^18.11.12",
|
||||
"@types/node": "^18.11.13",
|
||||
"@types/parsimmon": "^1.10.6",
|
||||
"rome": "^11.0.0",
|
||||
"typescript": "^4.9.4"
|
||||
|
|
14
src/ini.ts
14
src/ini.ts
|
@ -639,7 +639,19 @@ export class INI implements ParserInterface {
|
|||
['condition', this.expression],
|
||||
];
|
||||
|
||||
const fieldResult = P.seqObj<any>(...fieldWithDoubleCondition, P.all)
|
||||
// field = "!Warning: The board you have selected may not have enough channels for sequential fuel!", {}, {}, { injLayout == 3 && !sequentialFuelAvailable }
|
||||
const fieldWithTripleCondition = [
|
||||
...fieldBase,
|
||||
...this.delimiter,
|
||||
P.regexp(/{.*?}/),
|
||||
...this.delimiter,
|
||||
P.regexp(/{.*?}/),
|
||||
...this.delimiter,
|
||||
['condition', this.expression],
|
||||
];
|
||||
|
||||
const fieldResult = P.seqObj<any>(...fieldWithTripleCondition, P.all)
|
||||
.or(P.seqObj<any>(...fieldWithDoubleCondition, P.all))
|
||||
.or(P.seqObj<any>(...fieldWithCondition, P.all))
|
||||
.or(P.seqObj<any>(...fieldWithName, P.all))
|
||||
.or(P.seqObj<any>(...fieldBase, P.all))
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -58746,6 +58746,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -59728,6 +59729,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -59854,6 +59856,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -58920,6 +58920,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -59907,6 +59908,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -60039,6 +60041,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -61906,6 +61906,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -62893,6 +62894,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -63052,6 +63054,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -62754,6 +62754,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -63761,6 +63762,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -63920,6 +63922,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -62754,6 +62754,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -63761,6 +63762,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -63920,6 +63922,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -65109,6 +65109,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -66120,6 +66121,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -66278,8 +66280,10 @@ dialogs:
|
|||
fields:
|
||||
- name: _fieldText_
|
||||
title: In open loop mode, the values in this table are duty cycle %
|
||||
condition: '{ boostType == 0 }'
|
||||
- name: _fieldText_
|
||||
title: In closed loop mode, the values in this table are boost targets in kPa
|
||||
condition: '{ boostType == 1 }'
|
||||
boostLoad:
|
||||
title: ''
|
||||
panels:
|
||||
|
@ -66313,6 +66317,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
|
@ -58746,6 +58746,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -59728,6 +59729,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -59854,6 +59856,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
|
@ -58920,6 +58920,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -59907,6 +59908,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -60039,6 +60041,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
|
@ -61906,6 +61906,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -62893,6 +62894,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -63052,6 +63054,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
|
@ -62754,6 +62754,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -63761,6 +63762,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -63920,6 +63922,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
|
@ -62754,6 +62754,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -63761,6 +63762,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -63920,6 +63922,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
|
@ -65109,6 +65109,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential fuel!
|
||||
condition: '{ injLayout == 3 && !sequentialFuelAvailable }'
|
||||
engine_constants:
|
||||
title: ''
|
||||
layout: border
|
||||
|
@ -66120,6 +66121,7 @@ dialogs:
|
|||
title: >-
|
||||
!Warning: The board you have selected may not have enough channels for
|
||||
sequential ignition!
|
||||
condition: '{ sparkMode == 3 && !sequentialIgnitionAvailable }'
|
||||
- name: ignAlgorithm
|
||||
title: Ignition load source
|
||||
- name: sparkMode
|
||||
|
@ -66278,8 +66280,10 @@ dialogs:
|
|||
fields:
|
||||
- name: _fieldText_
|
||||
title: In open loop mode, the values in this table are duty cycle %
|
||||
condition: '{ boostType == 0 }'
|
||||
- name: _fieldText_
|
||||
title: In closed loop mode, the values in this table are boost targets in kPa
|
||||
condition: '{ boostType == 1 }'
|
||||
boostLoad:
|
||||
title: ''
|
||||
panels:
|
||||
|
@ -66313,6 +66317,7 @@ dialogs:
|
|||
title: Rev Limiter
|
||||
- name: _fieldText_
|
||||
title: '!Soft limiter only available with ignition cut'
|
||||
condition: '{ engineProtectType == 2 }'
|
||||
- name: SoftRevLim
|
||||
title: Soft rev limit
|
||||
condition: '{ engineProtectType == 1 || engineProtectType == 3 }'
|
||||
|
|
Loading…
Reference in New Issue