Example #1
0
        /// <summary>
        /// initializes the form, loads up all its widgets with data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DispatchDERForm_Load(object sender, System.EventArgs e)
        {
            _log = new XMLForm();
            string DERGroupName = DERMSInterface.CIMData.operations.dispatchDER.ToString();

            DERMSInterface.CIMData.header header = _cim.DispatchDERHeader;
            this.endPointText.Text        = header.EndPoint;
            this.messageTypeText.Text     = "Dispatch DER";
            this.replyAddressText.Text    = header.ReplyAddress;
            this.userIDText.Text          = header.UserID;
            this.organizationText.Text    = header.UserOrganization;
            this.contextText.Text         = header.Context;
            this.verbText.Text            = header.Verb;
            this.ackRequiredCheck.Checked = header.AckRequired;
            this.commentText.Text         = header.Comment;

            // set to real by default. Why not?
            this.realRadio.Checked = true;
            DERMSInterface.CIMData.DERGroup group = this.group;
            DERGroupMRIDText.Text  = group.Mrid;
            realValue              = group.getWattCapacity();
            reactiveValue          = group.getVarCapacity();
            realValueText.Text     = realValue.ToString();
            reactiveValueText.Text = reactiveValue.ToString();
        }
Example #2
0
 /// <summary>
 /// binds the DER Group and DER Members to the group passed
 /// </summary>
 /// <param name="group"></param>
 private void bindDevices(DERMSInterface.CIMData.DERGroup group)
 {
     if (group == null)
     {
         dERGroupBindingSource.DataSource = null;
         DERView.DataSource = null;
         dERGroupBindingSource.Clear();
     }
     else
     {
         if (group.Devices == null)
         {
             group.Devices = new List <DERMSInterface.CIMData.device>();
         }
         dERGroupBindingSource            = new BindingSource();
         dERGroupBindingSource.DataSource = group.Devices;
         DERView.DataSource = dERGroupBindingSource;
         dERGroupBindingSource.ResetBindings(false);
     }
 }
Example #3
0
        /// <summary>
        /// populate screen with values
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetDERStatusForm_Load(object sender, EventArgs e)
        {
            string DERGroupName = DERMSInterface.CIMData.operations.getDERStatus.ToString();

            DERMSInterface.CIMData.header header = _cim.GetDERStatusHeader;
            this.endPointText.Text        = header.EndPoint;
            this.messageTypeText.Text     = "Get DER Status";
            this.replyAddressText.Text    = header.ReplyAddress;
            this.userIDText.Text          = header.UserID;
            this.organizationText.Text    = header.UserOrganization;
            this.contextText.Text         = header.Context;
            this.verbText.Text            = header.Verb;
            this.ackRequiredCheck.Checked = header.AckRequired;
            this.commentText.Text         = header.Comment;

            this.realRadio.Checked = true;


            DERMSInterface.CIMData.DERGroup group = _group;
            DERGroupNameText.Text = group.GroupName;
            DERGroupMRIDText.Text = group.Mrid;
        }
Example #4
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="cim"></param>
 /// <param name="row"></param>
 public CreateDERForm(DERMSInterface.CIMData cim, DERMSInterface.CIMData.DERGroup group)
 {
     _cim = cim;
     _group = group;
     InitializeComponent();
 }
Example #5
0
 /// <summary>
 ///  constructor
 /// </summary>
 /// <param name="cim">the config data object</param>
 /// <param name="row">the row of data from the object to be sent</param>
 public DispatchDERForm(DERMSInterface.CIMData cim, DERMSInterface.CIMData.DERGroup group)
 {
     _cim   = cim;
     _group = group;
     InitializeComponent();
 }
Example #6
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="cim">CIMData object</param>
 /// <param name="row">currently selected DERGroup row</param>
 public GetDERStatusForm(DERMSInterface.CIMData cim, DERMSInterface.CIMData.DERGroup group)
 {
     _cim = cim;
     _group = group;
     InitializeComponent();
 }
Example #7
0
        /// <summary>
        /// initializes the form, loads the on screen widgets with data
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormLoad(object sender, System.EventArgs e)
        {
            DERMSInterface.CIMData.header header = _cim.CreateDERHeader;


            // header info
            this.endPointText.Text        = header.EndPoint;
            this.messageTypeText.Text     = "Create DER";
            this.replyAddressText.Text    = header.ReplyAddress;
            this.userIDText.Text          = header.UserID;
            this.organizationText.Text    = header.UserOrganization;
            this.contextText.Text         = header.Context;
            this.verbText.Text            = header.Verb;
            this.ackRequiredCheck.Checked = header.AckRequired;
            this.commentText.Text         = header.Comment;

            // group widgets
            DERMSInterface.CIMData.DERGroup group = _group;
            DERGroupNameText.Text     = group.GroupName;
            DERGroupMRIDText.Text     = group.Mrid;
            DERGroupRevisionText.Text = group.Revision;
            DERGroupSubText.Text      = group.Substation;
            DERGroupFeederText.Text   = group.Feeder;
            DERGroupSegmentText.Text  = group.Segment;
            // TODO : we do not set count, reactive and total power values, they are derived

            int    deviceCount   = 0;
            double realPower     = 0.0;
            double reactivePower = 0.0;

            // bind datasource to the currently selected DER group row
            bs                 = new BindingSource();
            bs.DataSource      = group.Devices;
            DERView.DataSource = bs;
            bs.ResetBindings(false);

            // we allow editing/adding to DER members
            DERView.CellValueChanged += new DataGridViewCellEventHandler(DERCellValue_Updated);
            DERView.CellValidating   += new DataGridViewCellValidatingEventHandler(DERCell_Validating);

            // first time, set the read-only sum/count vars for DERGRoup based
            // on the DER members
            group.Devices.ForEach(x =>
            {
                deviceCount++;
                realPower     += x.WattCapacity;
                reactivePower += x.VarCapacity;
            });

            // editing for DER members, no edit on derived DER Group fields
            DERView.ReadOnly = false;
            DERGroupDeviceCountText.Enabled = false;
            DERGroupRealText.Enabled        = false;
            DERGroupReactiveText.Enabled    = false;

            // intialize readonly vars
            DERGroupDeviceCountText.Text = group.Devices.Count.ToString();
            DERGroupReactiveText.Text    = group.getVarCapacity().ToString();
            DERGroupRealText.Text        = group.getWattCapacity().ToString();

            // if (_editDER == true)
            //     DERView.CellValueChanged += new DataGridViewCellEventHandler(CellValue_Changed);
        }
Example #8
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="cim">CIMData object</param>
 /// <param name="row">currently selected DERGroup row</param>
 public GetDERStatusForm(DERMSInterface.CIMData cim, DERMSInterface.CIMData.DERGroup group)
 {
     _cim   = cim;
     _group = group;
     InitializeComponent();
 }