export class Count { Start: number = 0; //Pieces in container before Counting Starts Packing: number = 0; //Amount of Pieces in the container after Counting has finished. Return: number = 0; //Holds the sum of Pieces currently in the container Count: number = 0; //Pieces counted by the Frame TimeStamp: string; //Timestamp only used for Saving Counts state: number = 0; //0, wenn Return < Packing; 1, wenn Return === Packing, 2 wenn Return > Packing constructor() { } get start() {return this.Start;} //sets the start value and therefore also the return value, because return = start + count. Also calls check() set start(value) {this.Start = value; this.return = this.Count + value; this.check();} get packing() {return this.Packing;} //Everytime a new Packing value gets set it calls check() set packing(value) {this.Packing = value; this.check();} get return() {return this.Return;} //everytime a new return value is set it calls check() set return(value) {this.Return = value; this.check();} get count() {return this.Count;} //everytime a new count value is set, the return value gets updated. set count(value) {this.Count=value; this.return = this.count + this.start;} /*constructor(start: number, packing: number, returnValue:number, count: number) { this.Start = start; this.Packing = packing; this.Return = returnValue; this.Count = count; this.timeStamp = new Date(Date.now()).toJSON(); }*/ //checks if return is equal, smaller, bigger than packing check() { if(this.packing > 0) { if(this.return===this.packing) { this.state = 1; //countService.mainDivColor="var(--ion-color-success)"; } if(this.return>this.packing) { this.state = 2; //nativeAudio.play('danger'); //countService.mainDivColor="var(--ion-color-danger)"; } if(this.return