private void HeartBeatLoop(object state)
        {
            while (true)
            {
                foreach (UasMessage m in UavState.GetHeartBeatObjects())
                {
                    SendMessage(m);
                }

                Thread.Sleep(HeartBeatUpdateRateMs);
            }
        }
Beispiel #2
0
        public override string ToString()
        {
            this.Init__jsonIgnore();
            string json = string.Concat(
                __jsonIgnore.ContainsKey("UavGUID") ? string.Empty : string.Format(", UavGUID : {0}", UavGUID == null ? "null" : string.Format("'{0}'", UavGUID.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("UavEMail") ? string.Empty : string.Format(", UavEMail : {0}", UavEMail == null ? "null" : string.Format("'{0}'", UavEMail.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("UavFlag") ? string.Empty : string.Format(", UavFlag : {0}", UavFlag == null ? "null" : UavFlag.ToString()),
                __jsonIgnore.ContainsKey("UavGate") ? string.Empty : string.Format(", UavGate : {0}", UavGate == null ? "null" : string.Format("'{0}'", UavGate.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("UavGateSrc") ? string.Empty : string.Format(", UavGateSrc : {0}", UavGateSrc == null ? "null" : string.Format("'{0}'", UavGateSrc.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("UavNumber") ? string.Empty : string.Format(", UavNumber : {0}", UavNumber == null ? "null" : UavNumber.ToString()),
                __jsonIgnore.ContainsKey("UavState") ? string.Empty : string.Format(", UavState : {0}", UavState == null ? "null" : UavState.ToString()),
                __jsonIgnore.ContainsKey("UavTime1") ? string.Empty : string.Format(", UavTime1 : {0}", UavTime1 == null ? "null" : UavTime1.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()),
                __jsonIgnore.ContainsKey("UavTime2") ? string.Empty : string.Format(", UavTime2 : {0}", UavTime2 == null ? "null" : UavTime2.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()), " }");

            return(string.Concat("{", json.Substring(1)));
        }