Skip to content

Commit

Permalink
Merge pull request #7330 from ORNL-AMO/issue-7313
Browse files Browse the repository at this point in the history
Issue 7313: fixed validation bug in PF Triangle calc and graph
  • Loading branch information
nbintertech authored Feb 13, 2025
2 parents 1b9748d + 0ab4d9d commit fbe3b06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ export class PowerFactorTriangleResultsComponent implements OnInit {
xaxis: {
range: [0, 1.05 * this.results.realPower],
scaleratio: 1,
dtick: 10,
},
yaxis: {
range: [-1, 1.05 * this.results.reactivePower],
scaleratio: 1,
dtick: 10,
},
margin: { t: 25, b: 25, l: 25, r: 25 },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export class PowerFactorTriangleService {
form.controls.apparentPower.setValidators([Validators.required, Validators.min(form.controls.reactivePower.value)]);
form.controls.reactivePower.setValidators([Validators.required, , Validators.min(0), Validators.max(form.controls.apparentPower.value)]);

} else if (form.controls.mode.value != 1 && form.controls.mode.value != 2 ){
form.controls.apparentPower.setValidators(Validators.required);
form.controls.realPower.setValidators([Validators.required, Validators.min(0)]);
form.controls.reactivePower.setValidators([Validators.required, , Validators.min(0)]);

}


form.controls.apparentPower.updateValueAndValidity();
form.controls.realPower.updateValueAndValidity();
form.controls.reactivePower.updateValueAndValidity();
Expand Down

0 comments on commit fbe3b06

Please sign in to comment.