示例#1
0
文件: DataHandler.cs 项目: oisy/scada
        private void OnSetTime(string msg)
        {
            string qn = Value.Parse(msg, "QN");
            this.SendReplyPacket(qn);

            string time = Value.Parse(msg, "SystemTime");
            DateTime dt = DeviceTime.Parse(time);

            this.agent.OnTimeChanged(dt);

            if (this.CanHandleSetTime)
            {
                SystemTime st = new SystemTime();

                st.wYear = (ushort)dt.Year;
                st.wMonth = (ushort)dt.Month;
                st.wDay = (ushort)dt.Day;
                st.whour = (ushort)dt.Hour;
                st.wMinute = (ushort)dt.Minute;
                st.wSecond = (ushort)dt.Second;
                st.wMilliseconds = 0;

                SetLocalTime(st);
            }
            this.SendResultPacket(qn);
        }
示例#2
0
文件: DataHandler.cs 项目: oisy/scada
 public static extern void SetLocalTime(SystemTime st);