public Fan(int number) { this.fanSpeed = new FanSpeed(number, 2000); this.fanCooling = new FanCooling(number, 2000); this.fanTemp = new FanTemp(number, 2000); }
override public void parse(string reply) { FanCooling temp = new FanCooling(this.fanNumber); DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(FanCooling)); MemoryStream stream1 = new MemoryStream(); StreamWriter writer = new StreamWriter(stream1); writer.Write(reply); writer.Flush(); stream1.Position = 0; temp = (FanCooling)ser.ReadObject(stream1); this.coolDemand = temp.coolDemand; this.ratio = temp.ratio; this.coolOutput = temp.coolOutput; }