void UpdateMat(Mat mat) { if (State == TrackerType.StandBy) { _state = TrackerType.Enable; } if (State == TrackerType.Enable) { try { IList <Vector3> KeyVectors; MatOfFloat Descriptors = new MatOfFloat(); Utils.ORBPointFeature(mat, out KeyVectors, Descriptors); if (MapDescriptors == null || MapKeyVectors == null) { _state = TrackerType.StandBy; throw new OutLookARException("MapDescriptors & MapKeyVectors :初期化されていません。"); } IList <DMatch> matches; Macher(KeyVectors, Descriptors, out matches); List <Vector3> FromPointL = new List <Vector3>(); List <Vector3> ToPointL = new List <Vector3>(); foreach (DMatch match in matches) { FromPointL.Add(MapKeyVectors[match.queryIdx]); ToPointL.Add(KeyVectors[match.trainIdx]); } } catch (OutLookARException e) { Debug.Log(e); } } }
public void SelectTracker(TrackerType tracker_type) { if (tracker_type == TrackerType.Boosting) { monotracker = TrackerBoosting.create(); } if (tracker_type == TrackerType.MIL) { monotracker = TrackerMIL.create(); } if (tracker_type == TrackerType.KCF) { monotracker = TrackerKCF.create(); } if (tracker_type == TrackerType.TLD) { monotracker = TrackerTLD.create(); } if (tracker_type == TrackerType.MedianFlow) { monotracker = TrackerMedianFlow.create(); } if (tracker_type == TrackerType.CSRT) { monotracker = TrackerCSRT.create(); } if (tracker_type == TrackerType.MOSSE) { monotracker = TrackerMOSSE.create(); } }
public object UpdateModel(object model, string[] fields) { if (!Item.Changed) { if (Item.OldValue == null) { return(model); } Item.Value = Item.OldValue; } if (model == null) { Type allListType = typeof(List <string>).GetGenericTypeDefinition().MakeGenericType(TrackerType); model = allListType.GetConstructor(new Type[0]).Invoke(new object[0]); } object toAdd = Item; if (ListType != typeof(TItem) && TrackerType != typeof(object)) { toAdd = TrackerType.GetConstructor( new Type[] { typeof(object), typeof(object), typeof(bool) }) .Invoke(new object[] { Item.OldValue, Item.Value, Item.Changed }); } (model as IList).Add(toAdd); return(model); }
public Tracker (TrackerType trackerType) { TrackerType = trackerType; // Details = new BugDetails (); Keychain = new Keychain<TrackerType> (trackerType); // TrackerDetails = new Dictionary<int, BugDetails.DetailType> (); }
public bool Init(TrackerType trackerType) { string type = "KCF"; // default switch (trackerType) { case TrackerType.BOOSTING: type = "BOOSTING"; break; case TrackerType.CSRT: type = "CSRT"; break; case TrackerType.KCF: type = "KCF"; break; case TrackerType.MOSSE: type = "MOSSE"; break; case TrackerType.TLD: type = "TLD"; break; default: type = "KCF"; break; } return(CVTracker_Init(out cvTracker, type)); }
public static int GetMaxScore(TrackerType type) { switch (type) { case TrackerType.Asthma: if (_asthmaJsonObjectList.Count > 0) { return(_asthmaJsonObjectList[0].GetMaxScore()); } else { // just create a dummy instance to calculate max score return(new AsthmaData(DateTime.Today).GetMaxScore()); } break; case TrackerType.Symptom: if (_symptomJsonObjectList.Count > 0) { return(_symptomJsonObjectList[0].GetMaxScore()); } else { // just create a dummy instance to calculate max score return(new SymptomData(DateTime.Today).GetMaxScore()); } break; case TrackerType.CSU: if (_csuJsonObjectList.Count > 0) { return(_csuJsonObjectList[0].GetMaxScore()); } else { // just create a dummy instance to calculate max score return(new CSUData(DateTime.Today).GetMaxScore()); } break; case TrackerType.UAS: if (_uasJsonObjectList.Count > 0) { return(_uasJsonObjectList[0].GetMaxScore()); } else { // just create a dummy instance to calculate max score return(new UASData(DateTime.Today).GetMaxScore()); } break; } return(0); }
public D1100TrackedAsset(byte[] buffer) { int offset = 0; Position = new PositionType(buffer, ref offset); Altitude = BitConverter.ToSingle(buffer, offset); offset += 4; Time = new DateTimeOffset(1989, 12, 31, 0, 0, 0, TimeSpan.FromSeconds(0)).AddSeconds(BitConverter.ToUInt32(buffer, offset)).ToLocalTime(); offset += 4; uint status = BitConverter.ToUInt32(buffer, offset); offset += 4; DogStatus = (DogStatus)(status & 0x0f); Platform = (PlatformType)((status >> 4) & 0x1f); TrackerType = (TrackerType)((status >> 8) & 0x07); StatusFlags = (StatusFlags)((status >> 11) & 0x1f); Symbol = (SymbolType)BitConverter.ToUInt16(buffer, offset); offset += 2; CollarId = BitConverter.ToUInt16(buffer, offset); offset += 2; Color = buffer[offset++]; Battery = buffer[offset++]; Gps = buffer[offset++]; Comm = buffer[offset++]; Channel = buffer[offset++]; SquelchCode = buffer[offset++]; Index = buffer[offset++]; StringBuilder sb = new StringBuilder(); for (int i = 0; i < 37; i++) { if (buffer[offset + i] == 0) { break; } sb.Append((char)buffer[offset + i]); } offset += 37; Identifier = sb.ToString(); sb.Clear(); for (int i = 0; i < 31; i++) { if (buffer[offset + i] == 0) { break; } sb.Append((char)buffer[offset + i]); } offset += 31; Message = sb.ToString(); }
IEnumerator Init(IList <Vector3> baseKeyVectors, MatOfFloat baseDescriptors, Quaternion baseRotation) { _ekfModel = new EKF(ekfError); _trackerModel = new Tracker(confidence, outlier); EKFModel.OnUpdate += UpdateEKF; yield return(StartCoroutine(EKFModel.AddEnumerator(baseRotation, 0.01f, baseKeyVectors, baseDescriptors))); _state = TrackerType.StandBy; }
public void SaveSignData(IEnumerable <WFTrackerTable> trackerTables, TrackerType trackerType) { ApplicationUser userTable = _AccountService.FirstOrDefault(x => x.UserName == HttpContext.Current.User.Identity.Name); foreach (var trackerTable in trackerTables) { trackerTable.SignDate = DateTime.UtcNow; trackerTable.SignUserId = userTable.Id; trackerTable.TrackerType = trackerType; _WorkflowTrackerService.SaveDomain(trackerTable); } }
void Macher(IList <Vector3> KeyVector, MatOfFloat Descriptors, out IList <DMatch> matches) { if (KeyVector.Count != Descriptors.rows() || Descriptors.rows() <= 0) { _state = TrackerType.Disable; throw new OutLookARException("KeyVectorとDescriptorsの数が合いません"); } matches = Utils.CrossMatcher(MapDescriptors, Descriptors).LowPassFilter(); if (matches.Count <= 0) { throw new OutLookARException("マッチしませんでした"); } }
/// <summary> /// Request particular day entry. /// </summary> /// <param name="date">Date must be formatted to Date only</param> /// <returns>Return new data if doesn't exists and previously created otherwise</returns> public static QuestionBasedTrackerData GetData(DateTime date, TrackerType type, bool generateNew = true) { LogData logData = GetLogData(date); // if there is not log data yet if (logData == null) { return(generateNew ? GenerateNewData(date, type) : null); } else { switch (type) { case TrackerType.Asthma: if (logData.asthmaData != null) { return(logData.asthmaData); } break; case TrackerType.Symptom: if (logData.symptomData != null) { return(logData.symptomData); } break; case TrackerType.CSU: if (logData.csuData != null) { return(logData.csuData); } break; case TrackerType.UAS: if (logData.uasData != null) { return(logData.uasData); } break; } return(generateNew ? GenerateNewData(date, type) : null); } }
private bool ParseTrackerType() { try { trackerType = (TrackerType)Enum.Parse(typeof(TrackerType), configData.Tracker.TrackerType, true); trackerName = trackerType == TrackerType.RustServers ? "Rust-Servers" : trackerType == TrackerType.Beancan ? "BeancanIO" : "TopRustServers"; return(true); } catch { PrintError("Invalid tracker type set in the config. Either use \"TopRustServers\", \"RustServers\" or \"Beancan\""); Interface.Oxide.UnloadPlugin(Title); return(false); } }
/// <summary> /// Request particular day entry score. /// </summary> /// <param name="date">Date must be formatted to Date only</param> /// <returns>Return null if doesn't exists</returns> public static int GetScore(DateTime date, TrackerType type) { // Debug.Log($"_trackerDictionary contains entry for date: {date.ToShortDateString()}? {_trackerDictionary.ContainsKey(date)}. Requesting type: {type}"); if (_trackerDictionary.ContainsKey(date)) { LogData logData = _trackerDictionary[date]; switch (type) { case TrackerType.Asthma: if (logData.asthmaData != null) { return(logData.asthmaData.GetScore()); } break; case TrackerType.Symptom: if (logData.symptomData != null) { return(logData.symptomData.GetScore()); } break; case TrackerType.CSU: if (logData.csuData != null) { return(logData.csuData.GetScore()); } break; case TrackerType.UAS: if (logData.uasData != null) { return(logData.uasData.GetScore()); } break; } } return(0); }
private static QuestionBasedTrackerData GenerateNewData(DateTime date, TrackerType type) { switch (type) { case TrackerType.Asthma: return(new AsthmaData(date)); case TrackerType.Symptom: return(new SymptomData(date)); case TrackerType.CSU: return(new CSUData(date)); case TrackerType.UAS: return(new UASData(date)); } return(null); }
/// <summary> /// Grab all existing data by type /// </summary> /// <param name="type"></param> /// <returns></returns> public static List <DateTime> GetDataDateRange(TrackerType type) { List <DateTime> dates = new List <DateTime>(); // find a 1st entry date DateTime firstDate = DateTime.MinValue; for (int i = 0; i < _logDataList.Count; i++) { QuestionBasedTrackerData data = _logDataList[i].TryGetData(type); if (data != null) { firstDate = data.GetDate(); break; } } Debug.Log("First date: " + firstDate); // if there is no entry at all if (firstDate == DateTime.MinValue || firstDate.IsSameDay(DateTime.Today)) { Debug.LogWarning("There is no dates with data to return. Adding Yesterday to Today to make 2 Dates"); firstDate = DateTime.Today.AddDays(-1); } // get total days count TimeSpan total = DateTime.Today.Subtract(firstDate); // Debug.Log($"First date: {firstDate}, type requesting: {type}, Total days: {total.Days}"); for (int i = 0; i < total.Days + 1; i++) { dates.Add(firstDate.Date); firstDate = firstDate.AddDays(1); } return(dates); }
public void SendFatherType(Type t) { FatherType = t; Type[] gArgs = FatherType.GetGenericArguments(); if (gArgs.Length == 0) { TrackerType = typeof(object); ListType = typeof(object); } else { TrackerType = gArgs[0]; ListType = TrackerType.GetGenericArguments()[0]; } if (!ListType.IsAssignableFrom(typeof(TItem))) { throw new NotSupportedException(string.Format( ControlsResources.NotCompatibleTypes, typeof(TItem).FullName, ListType.FullName)); } }
public async Task <Unit> Handle(CreateTrackerTypeCommand request, CancellationToken cancellationToken) { var user = _userAccessor.GetUser(); var userId = Guid.Parse(user.FindFirst(ClaimTypes.NameIdentifier).Value); var entity = new TrackerType { ActivityTypeId = request.ActivityTypeId, }; entity.CreateEnd(Guid.NewGuid(), request.Name, userId); if (request.Active) { entity.Activate(); } else { entity.Deactivate(); } _context.TrackerTypes.Add(entity); await _context.SaveChangesAsync(cancellationToken); // Notifications var notification = new TrackerTypeCreated { PrimaryEntityId = entity.Id, PrimaryEntityName = entity.Name, UserName = user.Identity.Name }; await _mediator.Publish(notification, cancellationToken); return(Unit.Value); }
public static string GetPath(TrackerType type) { string fileName = ""; if (type == TrackerType.Asthma) { fileName = ASTHMA_TEST_LOG; } else if (type == TrackerType.Symptom) { fileName = SYMPTOM_LOG; } else if (type == TrackerType.CSU) { fileName = CSU_LOG; } else if (type == TrackerType.UAS) { fileName = UAS_LOG; } return(Path.Combine(Helper.GetDataPath(), LOGS_FOLDER, fileName)); }
public TrackerLimitAttribute(TrackerType type) { Type = type; Limit = Program.TrackerLimits[type.ToString()]["TrackersPerServer"]; }
public void TrackerInfoHandle(Packet _packet) { Dictionary <TrackerType, int> typeToIndex = new Dictionary <TrackerType, int>() { { TrackerType.HC_Origin, 0 }, { TrackerType.Player1, 1 }, { TrackerType.Player2, 2 }, { TrackerType.Player3, 3 }, { TrackerType.Shifty, 4 }, { TrackerType.Shifty_Cartridge, 5 }, { TrackerType.Panel, 6 }, { TrackerType.Vive_Controller_Left, 7 }, { TrackerType.Vive_Controller_Right, 8 }, { TrackerType.Controller_Cartridge, 9 }, { TrackerType.Gun, 10 }, { TrackerType.Gun_Cartridge, 11 }, { TrackerType.Shield, 12 }, { TrackerType.Shield_Cartridge, 13 } }; int trackerNum = _packet.ReadInt(); for (int i = 0; i < trackerNum; ++i) { TrackerType type = (TrackerType)_packet.ReadInt(); Vector3 pos = _packet.ReadVector3(); Quaternion rot = _packet.ReadQuaternion(); trackers[typeToIndex[type]] = new Tracker(pos, rot); // TODO: Move following parts to tennis club. /* * if (type == TrackerType.HC_Origin) * { * } * else if (type == TrackerType.Player1) { * // Camera * Vector3 trackerEuler = rot.eulerAngles; * //Debug.Log("Get player1 transform"); * Vector3 cameraEuler = new Vector3(0f, 0f, 0f); * cameraEuler[0] = trackerEuler[2]; * cameraEuler[1] = trackerEuler[1]; * cameraEuler[2] = -trackerEuler[0]; * instance.player.transform.rotation = Quaternion.Euler(cameraEuler); * } * else if (type == TrackerType.Vive_Controller_Left) * { * // Controller * //Debug.Log("Get controller transform"); * if(isFirstPosition) { * refPosition = pos; * isFirstPosition = false; * } else { * Vector3 dPos = pos - refPosition; * instance.gun.position += dPos; * instance.gun.rotation = rot; * } * } */ } //GameManager.instance.OnTrackerInfoReady(); }
/// <summary> /// Bulid and get search dictionary from sites /// </summary> /// <typeparam name="T"></typeparam> /// <param name="sites"></param> /// <param name="dictionaryType"></param> /// <returns></returns> public static IEnumerable <T> GetSearchDictionary <T>(this IEnumerable <ISite> sites, TrackerType dictionaryType) { IEnumerable <T> results = new T[0]; foreach (ISite site in sites) { dynamic db = null; switch (dictionaryType) { case TrackerType.Endpoint: db = site.GetEndpoints(); break; case TrackerType.ConnectionString: db = site.GetDBConnectionStrings(); break; default: break; } if (db != null && ((IEnumerable <T>)db).Count() > 0) { results = results.Union((IEnumerable <T>)db); if (dictionaryType == TrackerType.Endpoint) { results = results.Distinct(new EndpointComparer() as IEqualityComparer <T>); } else if (dictionaryType == TrackerType.ConnectionString) { results = results.Distinct(new ConnectionStringComparer() as IEqualityComparer <T>); } } } return(results); }
public static TrackerTypeDetailModel Create(TrackerType trackerType) { return(Projection.Compile().Invoke(trackerType)); }
public BtTrackerActivity(TrackerType trackerType) { this.trackerType = trackerType; title = trackerType.ToString(); icon = UIImage.FromBundle(trackerType.ActivityImageName()); }
protected AchievementTracker(TrackerType type) => _type = type;
/// <summary> /// Trackers the has auth credentials. /// </summary> /// <returns>the dictionary if the keys needed are in the keychain, <c>null</c> otherwise.</returns> /// <param name="trackerType">Tracker type.</param> public Dictionary<DataKeys, string> TrackerHasAuthCredentials (TrackerType trackerType) { var storedValues = new Keychain<TrackerType> (trackerType).GetStoredKeyValues(); return trackerType.Valid(storedValues) ? storedValues : null; }
public Tracker GetTrackerInstance (TrackerType trackerType) { if (trackers.ContainsKey(trackerType)) return trackers[trackerType]; switch (trackerType) { case TrackerType.DoneDone: trackers[trackerType] = new DoneDoneTracker (trackerType); break; case TrackerType.PivotalTracker: trackers[trackerType] = new PivotalTracker (trackerType); break; case TrackerType.JIRA: trackers[trackerType] = new JiraTracker (trackerType); break; default: return null; } return trackers[trackerType]; }
public void ResetAndRemoveCurrentTracker () { CurrentTracker.TrackerState.Reset(); trackerType = TrackerType.None; }
/// <summary> /// Sets the type of the current tracker. /// </summary> /// <returns><c>true</c>, if the keys needed are in the keychain, <c>false</c> otherwise.</returns> /// <param name="trackerType">Tracker type.</param> public bool SetCurrentTrackerType (TrackerType trackerType) { this.trackerType = trackerType; return trackerType == TrackerType.None || TrackerHasAuthCredentials(trackerType) != null; }
public TrackerLimitAttribute(int limit, TrackerType type) { Limit = limit; Type = type; }
public void LoadAOrCompleteInstance(Guid _documentId, DocumentState _state, TrackerType _trackerType, IDictionary <string, object> documentData) { var documentTable = _DocumentService.Find(_documentId); IEnumerable <WFTrackerTable> bookmarks; IDictionary <string, object> inputArguments = new Dictionary <string, object>(); inputArguments.Add("inputStep", _state); inputArguments.Add("inputCurrentUser", HttpContext.Current.User.Identity.Name); inputArguments.Add("documentData", documentData); WorkflowApplication application = new WorkflowApplication(activity); application.InstanceStore = instanceStore; application.Extensions.Add(new WFTrackingParticipant()); #region Workflow Delegates application.PersistableIdle = (e) => { var ex = e.GetInstanceExtensions <WFTrackingParticipant>(); outputParameters = ex.Last().Outputs; //instanceUnloaded.Set(); return(PersistableIdleAction.Unload); }; application.Completed = (e) => { outputParameters = e.Outputs; }; application.Unloaded = (workflowApplicationEventArgs) => { instanceUnloaded.Set(); }; #endregion Workflow Delegates application.Load(documentTable.WWFInstanceId); bookmarks = _DocumentService.GetCurrentSignStep(_documentId, HttpContext.Current.User.Identity.Name); if (bookmarks != null) { foreach (var bookmark in bookmarks) { application.ResumeBookmark(bookmark.ActivityName, inputArguments); application.Persist(); instanceUnloaded.WaitOne(); } } _DocumentService.SaveSignData(bookmarks, _trackerType); documentTable.WWFInstanceId = application.Id; documentTable.DocumentState = (DocumentState)outputParameters["outputStep"]; _DocumentService.UpdateDocument(documentTable); if (documentTable.DocumentState == DocumentState.Closed) { _EmailService.SendInitiatorClosedEmail(documentTable.Id); } }
protected AchievementTracker(TrackerType type) { this._type = type; }
public TrackerEngine(string authToken, TrackerType trackerType) : base(authToken) { _trackerType = trackerType; }