Fix condition combining
All checks were successful
E2E Testing / test (push) Successful in 1m35s

This commit is contained in:
Sebastian Böckelmann 2024-03-19 16:07:58 +01:00
parent 4a7c87ecea
commit 03bc18e679
7 changed files with 72 additions and 4 deletions

View File

@ -62,7 +62,7 @@
<td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplayWithExpand.length"> <td mat-cell *matCellDef="let element" [attr.colspan]="columnsToDisplayWithExpand.length">
<div class="example-element-detail" <div class="example-element-detail"
[@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'"> [@detailExpand]="element == expandedElement ? 'expanded' : 'collapsed'">
<p>Expanded Row</p> <app-scriptaccount-condition-editor [enableEditiong]="false" [conditions]="element.scriptAccountConditions" ></app-scriptaccount-condition-editor>
</div> </div>
</td> </td>
</ng-container> </ng-container>

View File

@ -26,7 +26,7 @@ export class ScriptAccountCondition {
combineCondition(condition: ScriptAccountCondition) { combineCondition(condition: ScriptAccountCondition) {
if(condition.scriptAccount === this.scriptAccount) { if(condition.scriptAccount === this.scriptAccount) {
const scriptAccount = new ScriptAccountCondition(this.scriptAccount, this.minValue, this.maxValue); const scriptAccount = new ScriptAccountCondition(this.scriptAccount, this.minValue, this.maxValue);
scriptAccount.combineCondition(condition); scriptAccount.extendCondition(condition);
return scriptAccount; return scriptAccount;
} }
return undefined; return undefined;

View File

@ -0,0 +1,32 @@
{
"componentName": "A",
"componentDescription": "",
"states": [
{
"initial": false,
"conditions": [],
"stateLabel": "A",
"stateDescription": ""
},
{
"initial": false,
"conditions": [],
"stateLabel": "B",
"stateDescription": ""
}
],
"transitions": [
{
"scriptAccountActions": [],
"scriptAccountConditions": [
{
"scriptAccount": "Temperature",
"minValue": 0,
"maxValue": "10"
}
],
"startingState": "A",
"endingState": "B"
}
]
}

View File

@ -0,0 +1,32 @@
{
"componentName": "Numbers",
"componentDescription": "",
"states": [
{
"initial": false,
"conditions": [],
"stateLabel": "1",
"stateDescription": ""
},
{
"initial": false,
"conditions": [
{
"scriptAccount": "Luftfeuchtigkeit",
"minValue": 0,
"maxValue": "5"
}
],
"stateLabel": "2",
"stateDescription": ""
}
],
"transitions": [
{
"scriptAccountActions": [],
"scriptAccountConditions": [],
"startingState": "1",
"endingState": "2"
}
]
}

View File

@ -0,0 +1,4 @@
{
"componentName": "ParentTestSystem",
"componentDescription": ""
}

View File

@ -3,7 +3,7 @@
"componentDescription": "Ein simples Gamesystem zur Modellierung verschiedener Jahreszeiten und deren Übergänge", "componentDescription": "Ein simples Gamesystem zur Modellierung verschiedener Jahreszeiten und deren Übergänge",
"states": [ "states": [
{ {
"initial": true, "initial": false,
"conditions": [ "conditions": [
{ {
"scriptAccount": "Temperature", "scriptAccount": "Temperature",

View File

@ -3,7 +3,7 @@
"componentDescription": "A small Gamesystem about local weather events", "componentDescription": "A small Gamesystem about local weather events",
"states": [ "states": [
{ {
"initial": true, "initial": false,
"conditions": [], "conditions": [],
"stateLabel": "Sonne", "stateLabel": "Sonne",
"stateDescription": "" "stateDescription": ""