コード例 #1
0
        /// <summary>
        /// Add an event to our user space
        /// </summary>
        /// <param name="EventTime"></param>
        /// <param name="Elem"></param>
        /// <param name="Action"></param>
        /// <param name="NewValue"></param>
        /// <param name="OldValue"></param>
        public void AddEvent(DateTime EventTime, MM_Element Elem, String Action, String OldValue, String NewValue)
        {
            if (lvHistory.InvokeRequired)
            {
                lvHistory.Invoke(new SafeAddEvent(AddEvent), EventTime, Elem, Action, OldValue, NewValue);
            }
            else
            {
                lvHistory.Items.Add(new MM_UserInteraction(AssociatedEvent.EventTime = EventTime, Elem, Action, OldValue, NewValue));
                lvHistory.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                AssociatedEvent.Text = (Elem.Substation == null ? "" : Elem.Substation.Name + " ") + Elem.ElemType.Name + " " + Name;
                AssociatedEvent.ViolatedElement.Substation = MM_Repository.Substations[Elem.Substation.Name];
                if (PriorEvent)
                {
                    Data_Integration.UpdateViolation(AssociatedEvent, AssociatedEvent.Text, EventTime);
                }
                //else

                //   Data_Integration.RemoveViolation(AssociatedEvent);
                //AssociatedEvent.ViolatedElement.Substation = MM_Repository.Substations[Station];
                //AssociatedEvent.ViolatedElement.Operator = AssociatedEvent.ViolatedElement.Substation.Operator;
                //AssociatedEvent.ViolatedElement.Owner= AssociatedEvent.ViolatedElement.Substation.Owner;
                Data_Integration.CheckAddViolation(AssociatedEvent);
                PriorEvent = true;
            }
        }
コード例 #2
0
 /// <summary>
 /// Update our transformer outage data
 /// </summary>
 /// <param name="TransformerOutageData"></param>
 public void UpdateTransformerOutageData(MM_Outage_Transformer_Data[] TransformerOutageData)
 {
     foreach (MM_Outage_Transformer_Data TransformerData in TransformerOutageData)
     {
         Data_Integration.UpdateViolation(MM_Server_Interface.CreateViolation(TransformerData));
     }
     MM_Server_Interface.UpdateTimestamp(typeof(MM_Outage_Transformer_Data));
 }
コード例 #3
0
 /// <summary>
 /// Update our unit outage data
 /// </summary>
 /// <param name="UnitOutageData"></param>
 public void UpdateUnitOutageData(MM_Outage_Unit_Data[] UnitOutageData)
 {
     foreach (MM_Outage_Unit_Data UnitData in UnitOutageData)
     {
         Data_Integration.UpdateViolation(MM_Server_Interface.CreateViolation(UnitData));
     }
     MM_Server_Interface.UpdateTimestamp(typeof(MM_Outage_Unit_Data));
 }
コード例 #4
0
 /// <summary>
 /// Update our contingency violation data
 /// </summary>
 /// <param name="ContingencyData"></param>
 public void UpdateContingencyViolationData(MM_Contingency_Violation_Data[] ContingencyData)
 {
     foreach (MM_Contingency_Violation_Data Contingency in ContingencyData)
     {
         Data_Integration.UpdateViolation(MM_Server_Interface.CreateViolation(Contingency));
     }
     MM_Server_Interface.UpdateTimestamp(typeof(MM_Contingency_Violation_Data));
 }
コード例 #5
0
 /// <summary>
 /// Update our basecase violation data
 /// </summary>
 /// <param name="BasecaseData"></param>
 public void UpdateBasecaseViolationData(MM_Basecase_Violation_Data[] BasecaseData)
 {
     foreach (MM_Basecase_Violation_Data Basecase in BasecaseData)
     {
         Data_Integration.UpdateViolation(MM_Server_Interface.CreateViolation(Basecase));
     }
     MM_Server_Interface.UpdateTimestamp(typeof(MM_Basecase_Violation_Data));
 }
コード例 #6
0
        /// <summary>
        /// Update our line outage data
        /// </summary>
        /// <param name="LineOutageData"></param>
        public void UpdateLineOutageData(MM_Outage_Line_Data[] LineOutageData)
        {
            foreach (MM_Outage_Line_Data LineData in LineOutageData)
            {
                Data_Integration.UpdateViolation(MM_Server_Interface.CreateViolation(LineData));
            }

            MM_Server_Interface.CheckForOutagedLines();

            MM_Server_Interface.UpdateTimestamp(typeof(MM_Outage_Line_Data));
        }