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
        static void Main(string[] args)
        {
            Joey    joey    = new Joey();
            Karl    malone  = new Karl();
            Larry   bird    = new Larry();
            Magic   johnson = new Magic();
            Michael jordan  = new Michael();
            Patrick ewing   = new Patrick();

            List <IDreamteam> serverSide = new List <IDreamteam>();

            serverSide.Add(joey);
            serverSide.Add(malone);
            serverSide.Add(bird);

            List <IDreamteam> clientSide = new List <IDreamteam>();

            clientSide.Add(johnson);
            clientSide.Add(jordan);
            clientSide.Add(ewing);


            foreach (var server in serverSide)
            {
                server.work();
            }
            foreach (var client in clientSide)
            {
                client.work();
            }
        }
 private void txtGridSpacingY_TextChanged(object sender, EventArgs e)
 {
     project.VertSpaceGlo = txtGridSpacingY.Text;
     Michael.propertyGrid1.Refresh();
     if (FirstRefresh == false)
     {
         Michael.CreateGridPole(false);
         updateLblNumPanels();
         //CreateGridPole(false);
     }
 }
 private void pvPanelPoleGridCtl1_Paint_1(object sender, PaintEventArgs e)
 {
     if (FirstRefresh == false)
     {
         project.GridRotAngGlo = Convert.ToString(pvPanelPoleGridCtl1.RotationAngle);
         Michael.propertyGrid1.Refresh();
         Michael.CreateGridPole(false);
         updateLblNumPanels();
         //CreateGridPole(false);
     }
     FirstRefresh = false;
 }
Beispiel #5
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 #6
0
 private void btnSaveBuilding_Click(object sender, EventArgs e)
 {
     if (project.Path != "")
     {
         if (util.getLayerHdl("Solar Radiation Rose", pvMap) == -1)
         {
             Michael.CentroidAsSite(project.LyrBuildingName, pvMap);
         }
     }
     Michael.drawBuildingShadow();
     Michael.ExportBldgAndTrr2SketchUp.Enabled = true;
     Michael.EnableBuildingEdit();
     this.Close();
 }
Beispiel #7
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();
        }
Beispiel #8
0
        private void btnCloseDrawTree_Click(object sender, EventArgs e)
        {
            if (project.Path != "")
            {
                if (util.getLayerHdl("Solar Radiation Rose", pvMap) == -1)
                {
                    Michael.CentroidAsSite(project.LyrTreeName, pvMap);
                }
            }

            this.Close();
            Michael.EnableTreeEditing();
            //Michael.SolarObstuctionVerification();
            //Draw tree shadows
            Michael.DrawTreeShadow();
            Michael.ExportBldgAndTrr2SketchUp.Enabled = true;
        }
Beispiel #9
0
        public static void Main(String[] args)
        {
            // one way to use them is to declare their full qualified name.
            // System.IO.StreamReader sr = new System.IO.StreamReader();

            // alternatively, we can add using System.IO above, and use this:
            // StreamReader sr = new StreamReader();

            // sometimes, however, there may be conflicting using statements,
            // i.e. two namespaces might have the same class defined. In that
            // case, user the full qualified name.

            // Refer to the class within the custom namespace.
            Michael mDLL = new Michael();

            Console.WriteLine(mDLL.Lookup("http://www.learnvisualstudio.net"));

            Console.ReadLine();
        }
Beispiel #10
0
 private void cmdUpdateShape_Click(object sender, EventArgs e)
 {
     if (ProjectFile.LyrTree != -1)
     {
         IMapFeatureLayer TreeFe = PvMap.Layers[ProjectFile.LyrTree] as IMapFeatureLayer;
         List <IFeature>  lstFe  = new List <IFeature>();
         ISelection       selFe  = TreeFe.Selection;
         lstFe = selFe.ToFeatureList();
         int iRow = 0;
         foreach (IFeature fs in lstFe)
         {
             try
             {
                 fs.DataRow.BeginEdit();
                 fs.DataRow["Height"]   = grdTreeAttribute.Rows[iRow].Cells["Height"].Value;
                 fs.DataRow["Diameter"] = grdTreeAttribute.Rows[iRow].Cells["Diameter"].Value;
                 fs.DataRow["Type"]     = grdTreeAttribute.Rows[iRow].Cells["Type"].Value;
                 fs.DataRow.EndEdit();
                 iRow++;
                 double Radius = Convert.ToDouble(fs.DataRow["Diameter"]) / 2;
                 //short numVertx = 36;
                 //Michael.kDrawTreeCircle(Convert.ToDouble(fs.DataRow['X']), Convert.ToDouble(fs.DataRow['Y']), Convert.ToDouble(fs.DataRow["Diameter"]), numVertx, pvMap, Color.Green);
             }
             catch { }
         }
         if (Michael.SolarObstuctionVerification())
         {
             TreeFe.Selection.Clear();
             this.Close();
             Michael.DrawTreeShadow();
         }
         else
         {
             MessageBox.Show("There is an error in the edited properties.");
         }
     }
 }
 private void pvPanelPoleGridCtl1_Paint(object sender, PaintEventArgs e)
 {
     Michael.CreateGridPole();
 }
 private void cmdPole_in_Area_Click(object sender, EventArgs e)
 {
     Michael.CreateGridPole(true);
     updateLblNumPanels();
     //CreateGridPole(true);
 }
Beispiel #13
0
 private void btnCancelMove_Click(object sender, EventArgs e)
 {
     Michael.resetMapAct();
     this.Close();
 }
Beispiel #14
0
 private void btnRedrawAlignment_Click(object sender, EventArgs e)
 {
     util.removeDupplicateLyr(Michael.cmbAlignmentLyr.Text, pvMap);
     this.Close();
     Michael.DrawAlignment();
 }