-
Notifications
You must be signed in to change notification settings - Fork 6
Support for conditions/indicators #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/editor
Are you sure you want to change the base?
Conversation
# Conflicts: # src/tests/dspf.test.ts
…if conditional is active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly there are soms issues during runtime and I also an issue with the frontend code.
Uncaught TypeError: Cannot read properties of undefined (reading '0')
at editKeyword (main.js:1264:79)
@janfh As part of this PR, I think you should run |
getConditions(): Condition[] { | ||
return this.conditions; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand this API very well. It returns the following interface as an array:
interface Condition {
indicators: Indicator[];
}
but I don't quite understand it, and it could be me. Is this because each condition line can have 3 indicators, and each line is actually a unique condition (because you can use and or or when testing each condition right?)
Perhaps condition also needs an additional property to handle when O
is specified?
interface Condition {
indicators: Indicator[];
operator?: `and`|`or`; //and is default?
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, here is some DDS for a constant:
A 01 02N03 8 3'One, Two, not Three'
A 01
AA 02
Does this read as three conditions:
- The first with three indicators, the last negated
- The second with one indicator
- The last with one indicator, and with the
A
(and) condition?
Implemented support for conditions/indicators. New class
Conditional
with support for 9 conditions (OR-groups), each with max 9 indicators (grouping by AND) as described in the DDS reference manual.isActive
evaluates if conditions are met by given indicator status (DisplayFileIndicators
).