Fix null dereferencing issue. Fix sensor mode changed not clearing cached control.
This commit is contained in:
@ -5,6 +5,7 @@ namespace pxsim {
|
||||
|
||||
protected mode: number;
|
||||
protected valueChanged: boolean;
|
||||
protected modeChanged: boolean;
|
||||
|
||||
constructor(port: number) {
|
||||
super(port);
|
||||
@ -24,6 +25,8 @@ namespace pxsim {
|
||||
|
||||
setMode(mode: number) {
|
||||
this.mode = mode;
|
||||
this.changed = true;
|
||||
this.modeChanged = true;
|
||||
}
|
||||
|
||||
getMode() {
|
||||
@ -44,6 +47,12 @@ namespace pxsim {
|
||||
return res;
|
||||
}
|
||||
|
||||
modeChange() {
|
||||
const res = this.modeChanged;
|
||||
this.modeChanged = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
setChangedState() {
|
||||
this.changed = true;
|
||||
this.valueChanged = false;
|
||||
|
Reference in New Issue
Block a user