Handle triple condition in dialog field (#150)

This commit is contained in:
Piotr Rogowski 2022-12-11 18:41:33 +01:00 committed by GitHub
parent 952db1d3f0
commit 529b55a6fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 70 additions and 18 deletions

8
package-lock.json generated
View File

@ -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": {

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 }'

View File

@ -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 }'

View File

@ -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 }'

View File

@ -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 }'

View File

@ -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 }'

View File

@ -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 }'

View File

@ -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 }'