You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
543 B
26 lines
543 B
7 years ago
|
import { observable } from "mobx";
|
||
|
import { Duration } from "./Duration";
|
||
|
import { SprinklersDevice } from "./SprinklersDevice";
|
||
|
|
||
|
export class Section {
|
||
|
device: SprinklersDevice;
|
||
|
|
||
|
@observable
|
||
|
name: string = "";
|
||
|
|
||
|
@observable
|
||
|
state: boolean = false;
|
||
|
|
||
|
constructor(device: SprinklersDevice) {
|
||
|
this.device = device;
|
||
|
}
|
||
|
|
||
|
run(duration: Duration) {
|
||
|
return this.device.runSection(this, duration);
|
||
|
}
|
||
|
|
||
|
toString(): string {
|
||
|
return `Section{name="${this.name}", state=${this.state}}`;
|
||
|
}
|
||
|
}
|