public MissionSearchResult(int curNode, int curStatement, string text, TreeNode node, MissionStatement statement) { CurNode = curNode; CurStatement = curStatement; if (text == null) { Text = null; Valid = false; } else if (node == null) { Text = text; NodeText = null; Valid = false; } else { //string node_text = node.Text.Length > 25 ? node.Text.Substring(0, 25 - 3) + "..." : string.Format("{0,-25}", node.Text); NodeText = node.Text; //Text = "(" + node_text + ") " + text; Text = text; Valid = true; } Node = node; Statement = statement; Event = null; }
public MissionSearchResult(int curNode, int curStatement, string text, TreeNode node, MissionStatement statement) { CurNode = curNode; CurStatement = curStatement; if (text == null) { Text = null; Valid = false; } else if (node == null) { Text = text; NodeText = null; Valid = false; } else { //string node_text = node.Text.Length > 25 ? node.Text.Substring(0, 25 - 3) + "..." : string.Format("{0,-25}", node.Text); NodeText = node.Text; //Text = "(" + node_text + ") " + text; Text = text; Valid = true; } Node = node; Statement = statement; Event = null; }
public DependencyPrecursor GetPrecursor(DependencyEvent _event) { foreach (DependencyPrecursor item in Precursors) if (item.Event == _event) return item; return null; }
public DependencyPrecursor(DependencyEvent _event, int seconds = 0, double probability = 1.0, int count = 0, MissionStatement statement = null) { Event = _event; Seconds = seconds; Probability = probability; Count = count; Statement = statement; }
public DependencyPrecursor(DependencyEvent _event, int seconds = 0, double probability = 1.0, int count = 0, MissionStatement statement = null) { Event = _event; Seconds = seconds; Probability = probability; Count = count; Statement = statement; }
public DependencyPrecursor GetPrecursor(DependencyEvent _event) { foreach (DependencyPrecursor item in Precursors) { if (item.Event == _event) { return(item); } } return(null); }
public MissionSearchResult() { CurNode = -1; CurStatement = -1; Text = null; NodeText = null; Valid = false; Node = null; Statement = null; Event = null; }
public MissionSearchResult(string prefix, string suffix, TreeNode node) { CurNode = -1; CurStatement = -1; //string node_text = node.Text.Length > 25 ? node.Text.Substring(0, 25 - 3) + "..." : string.Format("{0,-25}", node.Text); string node_text = node.Text.Length > 25 ? node.Text.Substring(0, 25 - 3) + "..." : string.Format("{0,-25}", node.Text); Text = prefix + node_text + suffix; Valid = true; Node = node; Statement = null; Event = null; }
/// <summary> Fill this event's list of precursors with other event where event actions are applying </summary> public void Fill(DependencyEvent item) { double p = 1.0; int s = 0; int statisfied = 0; foreach (DependencyCondition condition in Conditions) statisfied += condition.CheckAgainstEvent(item, ref s, ref p); if (statisfied > 0) Precursors.Add(new DependencyPrecursor(item, s, p, statisfied)); }
public MissionSearchResult(string prefix, string suffix, TreeNode node) { CurNode = -1; CurStatement = -1; //string node_text = node.Text.Length > 25 ? node.Text.Substring(0, 25 - 3) + "..." : string.Format("{0,-25}", node.Text); string node_text = node.Text.Length > 25 ? node.Text.Substring(0, 25 - 3) + "..." : string.Format("{0,-25}", node.Text); Text = prefix + node_text + suffix; Valid = true; Node = node; Statement = null; Event = null; }
/// <summary> Fill this event's list of precursors with other event where event actions are applying </summary> public void Fill(DependencyEvent item) { double p = 1.0; int s = 0; int statisfied = 0; foreach (DependencyCondition condition in Conditions) { statisfied += condition.CheckAgainstEvent(item, ref s, ref p); } if (statisfied > 0) { Precursors.Add(new DependencyPrecursor(item, s, p, statisfied)); } }
/// <summary> Check if any action from event statisfies the condition, add event as a precursor if it does </summary> public int CheckAgainstEvent(DependencyEvent item, ref int seconds, ref double probability) { double p = 1.0; int s = 0; foreach (DependencyAction action in item.Actions) { if (IsActionStatisfying(action, ref s, ref p)) { Precursors.Add(new DependencyPrecursor(item, s, p, 0, action.Statement)); seconds = Math.Max(seconds, s); probability *= p; return(1); } } return(0); }
/// <summary> Activate the current mission result, selecting the corresponding node and statement </summary> public void Activate(DependencyEvent item, bool highlightActions) { if (!Valid) { return; } Mission.Current.SelectNode(Node); Mission.Current.SelectStatement(Statement, true); if (highlightActions) { Mission.Current.ApplyHighlighting(Event, item, highlightActions); } else { Mission.Current.ApplyHighlighting(item, Event, highlightActions); } }
/// <summary> /// Applies highlighting based on the results of a dependency scan /// </summary> public void ApplyHighlighting(DependencyEvent precursorEvent, DependencyEvent selectedEvent, bool highlightActions) { TreeViewNodes.HighlightedTagList.Clear(); TreeViewStatements.HighlightedTagList.Clear(); foreach (DependencyCondition condition in selectedEvent.Conditions) { DependencyPrecursor dp = condition.GetPrecursor(precursorEvent); if (dp != null) { if (highlightActions) { TreeViewStatements.HighlightedTagList.Add(dp.Statement); if (TreeViewStatements.SelectedNode == null) GetStatementNode(dp.Statement).EnsureVisible(); } else { TreeViewStatements.HighlightedTagList.Add(condition.Statement); if (TreeViewStatements.SelectedNode == null) GetStatementNode(condition.Statement).EnsureVisible(); } } } TreeViewNodes.Invalidate(); TreeViewStatements.Invalidate(); }
public MissionSearchResult() { CurNode = -1; CurStatement = -1; Text = null; NodeText = null; Valid = false; Node = null; Statement = null; Event = null; }
public MissionSearchResult(string prefix, string suffix, DependencyEvent _event, int sortOrder = 0) : this(prefix, suffix, _event.Node) { Event = _event; SortOrder = sortOrder; }
public MissionSearchResult(string prefix, string suffix, DependencyEvent _event, int sortOrder = 0) : this(prefix, suffix, _event.Node) { Event = _event; SortOrder = sortOrder; }
/// <summary> Activate the current mission result, selecting the corresponding node and statement </summary> public void Activate(DependencyEvent item, bool highlightActions) { if (!Valid) return; Mission.Current.SelectNode(Node); Mission.Current.SelectStatement(Statement, true); if (highlightActions) Mission.Current.ApplyHighlighting(Event, item, highlightActions); else Mission.Current.ApplyHighlighting(item, Event, highlightActions); }