static public AOUStateData GetRandomStateData(uint time_ms) { AOUStateData stateData; AOUDataTypes.Time_ms_to_AOUModelTimeSecX10(time_ms, out stateData.time_hours, out stateData.time_sek_x_10_of_hour); stateData.UIButtons = 0; stateData.Mode = 0; stateData.IMM = 0; stateData.Valves = 0; stateData.seqState = 0; stateData.Power = 0; stateData.Energy = 0; /* Only temperature values will be set */ stateData.bufHotTemp = RealToWordX100(ValueGenerator.GetTBufferHotValue()); stateData.bufMidTemp = RealToWordX100(ValueGenerator.GetTBufferMidValue()); stateData.bufColdTemp = RealToWordX100(ValueGenerator.GetTColdTankValue()); stateData.coldTankTemp = RealToWordX100(ValueGenerator.GetTColdTankValue()); stateData.hotTankTemp = RealToWordX100(ValueGenerator.GetTHotTankValue()); stateData.retTemp = RealToWordX100(ValueGenerator.GetTReturnValveValue()); stateData.coolerTemp = RealToWordX100(ValueGenerator.GetValveCoolantValue()); stateData.heaterTemp = RealToWordX100(ValueGenerator.GetTheaterOilOutValue()); stateData.BearHot = RealToWordX100(ValueGenerator.GetTHotTankValue()); return(stateData); }
/* * public static bool ParseWordTime(string textline, out UInt16 time_min_of_week, out UInt16 time_ms_of_min) * { * long time_ms = 0; * if (ParseLong(tagSubTagTime, textline, out time_ms)) * { * if (time_ms > 283200) * { * long t2 = time_ms; * } * AOUDataTypes.AOUModelTimeSecX10_to_TimeMs(time_ms, out time_min_of_week, out time_ms_of_min); * return true; * } * else * { * time_min_of_week = 0; * time_ms_of_min = 0; * return false; * } * } */ public static bool ParseWordTime_sek_x_10(string textline, out UInt16 time_hours, out UInt16 time_sek_x_10) { long time_s_x_10 = 0; if (ParseLong(tagSubTagTime, textline, out time_s_x_10)) { AOUDataTypes.Time_ms_to_AOUModelTimeSecX10(time_s_x_10 * 100, out time_hours, out time_sek_x_10); return(true); } else { time_sek_x_10 = 0; time_hours = 0; return(false); } }