public SmartPonds(PondSize pondSize) { this.pondSize = pondSize; if (this.pondSize == PondSize.BIG) { sensor_arr_data = new Sensor[BIGPONDSENSORS]; this.totalTempData = 5; this.totalPHData = 5; this.totalData = 10; } else if (this.pondSize == PondSize.MEDIUM) { sensor_arr_data = new Sensor[MIDPONDSENSORS]; this.totalTempData = 3; this.totalPHData = 3; this.totalData = 6; } else { sensor_arr_data = new Sensor[SMALLPONDSENSORS]; this.totalTempData = 2; this.totalPHData = 2; this.totalData = 4; } }
//create a constructor that will accept the size of the pond so that the array size can be determined public SmartPondsWithFiles(PondSize sz, SmartFishFarm2.io.ISensorIO io) { this.mysize = sz; this.ioobj = io; //BIG will have sensor data array with 10 elements //MEDIUM will have sensor data array with 6 elements //SMALL will have sensor data array with 4 element if (this.mysize == PondSize.BIG) { this.totalTempData = 5; this.totalPHData = 5; this.totalData = 10; } else if (this.mysize == PondSize.MEDIUM) { this.totalTempData = 3; this.totalPHData = 3; this.totalData = 6; } else { this.totalTempData = 2; this.totalPHData = 2; this.totalData = 4; } //check if data file exists - if not, then create it if (!File.Exists(SENSOR_FILE)) { File.Create(SENSOR_FILE); } }
//create a constructor that will accept the size of the pond so that the array size can be determined public SmartPonds(PondSize sz) { this.mysize = sz; //BIG will have sensor data array with 10 elements //MEDIUM will have sensor data array with 6 elements //SMALL will have sensor data array with 4 element if (this.mysize == PondSize.BIG) { sensor_data = new Sensor[BIGPONDSENSORS]; this.totalTempData = 5; } else if (this.mysize == PondSize.MEDIUM) { sensor_data = new Sensor[MEDIUMPONDSENSORS]; this.totalTempData = 3; } else { sensor_data = new Sensor[SMALLPONDSENSORS]; this.totalTempData = 2; } }