public static TimeSpan Span(this Session sess) { DateTime earliest, latest; List <TrackerMessage> beginMessages = sess.Lookup("Game Message"); earliest = sess.Messages[1].TimeStamp; // index 0 is somehow garbage... for (int i = 0; i < beginMessages.Count; i++) { EnableString v = beginMessages[i].Value as EnableString; if (v.Value.Equals("Game begin")) { earliest = beginMessages[i].TimeStamp; break; } } TrackerMessage latestMessage; int z = sess.Messages.Count - 1; latestMessage = sess.Messages[z]; while (excludedReplayEndpoints.Contains(latestMessage.Key)) { z--; latestMessage = sess.Messages[z]; } latest = sess.Messages[z].TimeStamp; TimeSpan span = latest.Subtract(earliest); return(span); }
/// <summary> /// 设置值 /// </summary> /// <param name="enabledVal"></param> public void SetEnabledValue(EnableString enabledVal) { if (enabledVal == null) { return; } this.textBox_value.Text = enabledVal.Value + ""; this.checkBox_enabled.Checked = enabledVal.Enabled; }
/// <summary> /// 构造函数 /// </summary> public ObsFileConvertOption() { this.ObsCodes = new List <string>() { "P1" }; this.TimePeriod = new TimePeriod(Time.MinValue, Time.MaxValue); this.IsEnableInterval = false; this.IsEnableMinObsCodeAppearRatio = false; this.MinObsCodeAppearRatio = 0.5; this.Version = 3.02; this.Interval = 30; this.SatelliteTypes = new List <SatelliteType>() { SatelliteType.G }; ObsTypes = new List <ObsTypes>() { Gnsser.ObsTypes.C, Gnsser.ObsTypes.P, Gnsser.ObsTypes.L }; NotVacantCodeList = new List <string>() { "L1", "L2" }; this.EnabledSection = new EnableFloat(24 * 60, false); this.OnlyCodes = new List <string>() { "L1", "L2", "C1", "P1", "P2" }; SatsToBeRemoved = new List <SatelliteNumber>(); this.MinEpochCount = 10; this.IsEnableMinEpochCount = false; this.MaxBreakCount = 3; this.SatCutOffAngle = new EnableFloat(10, false); IsEnableRinexVertion = false; StrOfFrequenceNumToBeRemoved = "5,6,7,8"; IndicatedEphemeris = new EnableString(); RinexNameType = RinexNameType.保持不变; SiteNameLength = new EnableInteger(8); IsUpperFileName = true; IsUpperSiteName = true; }
// runs a series of tests for the api private IEnumerator TestAPI() { Authenticate("*****@*****.**", "test", "Kollect"); yield return(new WaitForSeconds(2f)); //TestEndpoint(); //yield return new WaitForSeconds(2f); CreateNewSession(EnableAPI.Instance.Game, EnableAPI.Instance.Version); yield return(new WaitForSeconds(2f)); EnableString handString1 = new EnableString("(2.5, 2.5, 5.0) (2.0, 2.0, 5.0)"); TrackerMessage handData1 = new TrackerMessage("Hand Game Position", handString1); PushSessionData(handData1.SerializedValue); EnableString handString2 = new EnableString("(1.5, 3.5, -5.0) (3.0, 3.0, 5.0)"); TrackerMessage handData2 = new TrackerMessage("Hand Game Position", handString2); PushSessionData(handData2.SerializedValue); /* * // create test session data json * Dictionary<string, object> postData = new Dictionary<string, object>(); * Dictionary<string, object> handData = new Dictionary<string, object>(); * Dictionary<string, object> skeletonData = new Dictionary<string, object>(); * Dictionary<string, object> jointDictionary = new Dictionary<string, object>(); * Dictionary<string, object> spinebaseData = new Dictionary<string, object>(); * Dictionary<string, object> spinemidData = new Dictionary<string, object>(); * Dictionary<string, object> position1 = new Dictionary<string, object>(); * Dictionary<string, object> orientation1 = new Dictionary<string, object>(); * Dictionary<string, object> position2 = new Dictionary<string, object>(); * Dictionary<string, object> orientation2 = new Dictionary<string, object>(); * * Action ClearDBs = () => { * postData.Clear(); * handData.Clear(); * skeletonData.Clear(); * jointDictionary.Clear(); * spinebaseData.Clear(); * spinemidData.Clear(); * position1.Clear(); * orientation1.Clear(); * position2.Clear(); * orientation2.Clear(); * }; * * ClearDBs(); * handData.Add("Value", "(2.5, 2.5, 5.0) (2.0, 2.0, 5.0)"); * handData.Add("$type", "EnableString"); * postData.Add("timestamp", GetTimestamp()); * postData.Add("key", "Hand Game Position"); * postData.Add("value", handData); * PushSessionData(postData); * yield return new WaitForSeconds(.3f); * * ClearDBs(); * handData.Add("Value", "(1.5, 3.5, -5.0) (3.0, 3.0, 5.0)"); * handData.Add("$type", "EnableString"); * postData.Add("timestamp", GetTimestamp()); * postData.Add("key", "Hand Game Position"); * postData.Add("value", handData); * PushSessionData(postData); * yield return new WaitForSeconds(.3f); * * ClearDBs(); * position1.Add("x", 1.1); * position1.Add("y", 2.2); * position1.Add("z", 3.3); * orientation1.Add("x", 0.1); * orientation1.Add("y", 0.2); * orientation1.Add("z", 0.3); * orientation1.Add("w", 0.4); * spinebaseData.Add("position", position1); * spinebaseData.Add("orientation", orientation1); * position2.Add("x", 6.6); * position2.Add("y", 7.7); * position2.Add("z", 8.8); * orientation2.Add("x", 0.6); * orientation2.Add("y", 0.7); * orientation2.Add("z", 0.8); * orientation2.Add("w", 0.9); * spinemidData.Add("position", position2); * spinemidData.Add("orientation", orientation2); * skeletonData.Add("SpineBase", spinebaseData); * skeletonData.Add("SpineMid", spinemidData); * jointDictionary.Add("jointDictionary", skeletonData); * postData.Add("timestamp", GetTimestamp()); * postData.Add("key", "Player Skeleton"); * postData.Add("value", jointDictionary); * PushSessionData(postData); */ }