Skip to content

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

Open
wants to merge 8 commits into
base: feature/editor
Choose a base branch
from

Conversation

janfh
Copy link
Collaborator

@janfh janfh commented Aug 3, 2025

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).

@janfh janfh self-assigned this Aug 3, 2025
@janfh janfh marked this pull request as ready for review August 4, 2025 18:06
@janfh janfh requested a review from worksofliam August 4, 2025 18:06
@janfh janfh marked this pull request as draft August 5, 2025 13:05
@janfh janfh marked this pull request as ready for review August 15, 2025 18:06
Copy link
Collaborator

@worksofliam worksofliam left a 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 janfh requested a review from worksofliam August 16, 2025 06:30
@worksofliam
Copy link
Collaborator

@janfh As part of this PR, I think you should run npm run getTsTypesForFile, which will generate the dspf.d.ts file in webui.

Comment on lines +606 to +608
getConditions(): Condition[] {
return this.conditions;
}
Copy link
Collaborator

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?
}

Copy link
Collaborator

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:

  1. The first with three indicators, the last negated
  2. The second with one indicator
  3. The last with one indicator, and with the A (and) condition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants