private void btnSavePoleArea_Click(object sender, EventArgs e)
 {
     if (chkUseDefaultPnlProp.Checked)
     {
         project.PvHeightGlo   = lblHeight2.Text;
         project.PvWidthGlo    = lblWidth2.Text;
         project.HorzSpaceGlo  = txtGridSpacingX.Text;
         project.VertSpaceGlo  = txtGridSpacingY.Text;
         project.PvTiltGlo     = lblTilt2.Text;
         project.PvAzimuthGlo  = lblAzimuth2.Text;
         project.GridRotAngGlo = Convert.ToString(pvPanelPoleGridCtl1.RotationAngle);
         project.pvHeightEdit  = lblHeight2.Text;
         project.pvWidthEdit   = lblWidth2.Text;
         project.pvTiltEdit    = lblTilt2.Text;
         project.pvAzimuthEdit = lblAzimuth2.Text;
         Michael.CreateGridPole(true, true);
         Michael.CreatePvPanel();
     }
     else
     {
         project.HorzSpaceGlo  = txtGridSpacingX.Text;
         project.VertSpaceGlo  = txtGridSpacingY.Text;
         project.GridRotAngGlo = Convert.ToString(pvPanelPoleGridCtl1.RotationAngle);
         Michael.CreateGridPole(true, false);
     }
     Michael.propertyGrid1.Refresh();
     Michael.cmdPvPanelAngle.Enabled   = true;
     Michael.btnMovePanels.Enabled     = true;
     Michael.cmdExportSketchUp.Enabled = true;
     this.Close();
 }
Beispiel #2
0
        private void cmdApplyAllPanel_Click(object sender, EventArgs e)
        {
            project.PvHeight = Convert.ToDouble(txtPvHeight.Text);
            project.PvWidth  = Convert.ToDouble(txtPvWidth.Text);
            Michael.CreatePvPanel();

            /*
             * List<IFeature> ls1 = new List<IFeature>();
             * FeatureLayer fl1 = pvMap.Layers[project.LyrPole] as FeatureLayer;
             * ISelection il1 = fl1.Selection;
             * FeatureSet FeSet = il1.ToFeatureSet();
             *
             *
             * for (int i = 0; i < FeSet.NumRows();i++ )
             * {
             *  IFeature fs = FeSet.GetFeature(i);
             *  try
             *  {
             *      fs.DataRow.BeginEdit();
             *      fs.DataRow["H"] = Convert.ToDouble(txtPvHeight.Text);
             *      fs.DataRow["W"] = Convert.ToDouble(txtPvWidth.Text);
             *      fs.DataRow.EndEdit();
             *  }
             *  catch { }
             * }
             */
            if (Project.LyrPole != -1)
            {
                IMapFeatureLayer pvPositionFe = PvMap.Layers[Project.LyrPole] as IMapFeatureLayer;
                List <IFeature>  lstFe        = new List <IFeature>();
                ISelection       selFe        = pvPositionFe.Selection;
                lstFe = selFe.ToFeatureList();
                int iRow = 0;
                foreach (IFeature fs in lstFe)
                {
                    try
                    {
                        fs.DataRow.BeginEdit();
                        fs.DataRow["h"] = Convert.ToDouble(txtPvHeight.Text);
                        fs.DataRow["W"] = Convert.ToDouble(txtPvWidth.Text);
                        fs.DataRow.EndEdit();
                        iRow++;
                    }
                    catch { }
                }
                this.Close();
            }
            MessageBox.Show("Data updated successfully");
            this.Close();
        }
Beispiel #3
0
        private void cmdUpdateShape_Click(object sender, EventArgs e)
        {
            project.PvHeightEdit  = lblPvHeight.Text;
            project.PvWidthEdit   = lblPvWidth.Text;
            project.PvTiltEdit    = lblTilt.Text;
            project.PvAzimuthEdit = lblAzimuth.Text;

            /*
             * try
             * {
             *   tabControl1.SelectedTab = tabPage0;
             *   for (int iRow = 0; iRow < grdPvPoleSelected.RowCount; iRow++)
             *   {
             *       grdPvPoleSelected.Rows[iRow].Cells["Ele_Angle"].Value = lblTilt.Text;
             *       grdPvPoleSelected.Rows[iRow].Cells["Azimuth"].Value = lblAzimuth.Text;
             *       grdPvPoleSelected.Rows[iRow].Cells["w"].Value = lblPvWidth.Text;
             *       grdPvPoleSelected.Rows[iRow].Cells["h"].Value = lblPvHeight.Text;
             *   }
             * }
             * catch { }
             */
            if (Project.LyrPole != -1)
            {
                IMapFeatureLayer LocationFe = PvMap.Layers[Project.LyrPole] as IMapFeatureLayer;
                List <IFeature>  lstFe      = new List <IFeature>();
                ISelection       selFe      = LocationFe.Selection;
                lstFe = selFe.ToFeatureList();

                int iRow = 0;
                foreach (IFeature fs in lstFe)
                {
                    try
                    {
                        fs.DataRow.BeginEdit();
                        fs.DataRow["Ele_Angle"] = grdPvPoleSelected.Rows[iRow].Cells["Ele_Angle"].Value;
                        fs.DataRow["Azimuth"]   = grdPvPoleSelected.Rows[iRow].Cells["Azimuth"].Value;
                        fs.DataRow["h"]         = grdPvPoleSelected.Rows[iRow].Cells["h"].Value;
                        fs.DataRow["w"]         = grdPvPoleSelected.Rows[iRow].Cells["w"].Value;
                        fs.DataRow["x"]         = grdPvPoleSelected.Rows[iRow].Cells["x"].Value;
                        fs.DataRow["y"]         = grdPvPoleSelected.Rows[iRow].Cells["y"].Value;
                        fs.DataRow.EndEdit();
                        iRow++;
                    }
                    catch { }
                }
                this.Close();
            }
            Michael.CreatePvPanel();
        }