コード例 #1
0
 private void SerchAsArea_Click(object sender, EventArgs e)
 {
     if (ComboCentral.Text == string.Empty || Street.Text == string.Empty)
     {
         if (ComboCentral.Text == string.Empty)
         {
             MessageBox.Show("اختار السنترال", "Erorr", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else if (Street.Text == string.Empty)
         {
             MessageBox.Show("ادخل عنوان للبحث", "Erorr", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         Numcent = pr.GetNumber(ComboCentral.Text);
         var DBonWork   = new DB.SmartCentralDB(Properties.Settings.Default.ConctToDataBase);
         var selectdata = from p in DBonWork.Centrals
                          where p.IDcentral == Numcent
                          from d in DBonWork.Cabels
                          where d.IDcentral == p.IDcentral
                          from c in DBonWork.Cabinas
                          where c.IDCable == d.IDCable && c.Area.Contains(Street.Text)
                          select new { p.CentralName, d.CableNumber, c.ODU, c.CABINA, c.Area, d.PunctuationBG, d.PunctuationEN };
         this.dataGridView1.DataSource = null;
         this.dataGridView1.DataSource = selectdata;
     }
     Street.Clear();
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Dingo-K/OOP2
 private void ClearInput()
 {
     Firstname.Clear();
     _Name.Clear();
     Secondname.Clear();
     comboBox1.SelectedIndex = 0;
     Ball.Clear();
     City.Clear();
     Street.Clear();
     Build.Clear();
     Flat.Clear();
     Group.Value          = 1;
     Course.Value         = 1;
     radioButton1.Checked = false;
     radioButton2.Checked = false;
     label16.Text         = "1";
     label15.Text         = "1";
 }
コード例 #3
0
ファイル: UserTestForm.cs プロジェクト: PerFrost/P2Projekt
        private void NewCards()
        {
            Player1Cards.Clear();
            Player2Cards.Clear();
            Street.Clear();
            CardsInPlay.Clear();

            AiDrawGuessLabel.Visible    = false;
            AiPlayer1GuessLabel.Visible = false;
            AiPlayer2GuessLabel.Visible = false;

            if (RandomPlayerCards)
            {
                for (int x = 0; x < 2; x++)
                {
                    NewCard = new Card(CardsInPlay);
                    CardsInPlay.Add(NewCard);
                    Player1Cards.Add(NewCard);
                }

                for (int x = 0; x < 2; x++)
                {
                    NewCard = new Card(CardsInPlay);
                    CardsInPlay.Add(NewCard);
                    Player2Cards.Add(NewCard);
                }
            }
            else
            {
                Player1Cards.Add(new Card(Suit.Hearts, Rank.Ace));
                Player1Cards.Add(new Card(Suit.Spades, Rank.Ace));
                CardsInPlay.Add(Player1Cards[0]);
                CardsInPlay.Add(Player1Cards[1]);

                Player2Cards.Add(new Card(Suit.Diamonds, Rank.Ace));
                Player2Cards.Add(new Card(Suit.Diamonds, Rank.King));
                CardsInPlay.Add(Player2Cards[0]);
                CardsInPlay.Add(Player2Cards[1]);
            }

            for (int x = 0; x < 5; x++)
            {
                NewCard = new Card(CardsInPlay);
                CardsInPlay.Add(NewCard);
                Street.Add(NewCard);
            }

            foreach (Card card in CardsInPlay)
            {
                card.LoadImage();
            }

            Player1pictureBox1.Image = Player1Cards[0].Image;
            Player1pictureBox2.Image = Player1Cards[1].Image;

            Player2pictureBox1.Image = Player2Cards[0].Image;
            Player2pictureBox2.Image = Player2Cards[1].Image;

            StreetCard1ImageBox.Image = Street[0].Image;
            StreetCard2ImageBox.Image = Street[1].Image;
            StreetCard3ImageBox.Image = Street[2].Image;
            StreetCard4ImageBox.Image = Street[3].Image;
            StreetCard5ImageBox.Image = Street[4].Image;

            AiResult = winCalc.WhoWins(Player1Cards.Concat(Street).ToList(), Player2Cards.Concat(Street).ToList());
        }
コード例 #4
0
    IEnumerator ProceduralLocal()
    {
        msg.Stop(Job.StartProcedural);
        msg.Start(Job.ProceduralPreparation);
        SimpleClient.jobStatus[jobNumber] = msg;

        this.transform.position = TilePosition - new Vector3((float)TileManager.TileWidth * (float)TileManager.Scaling / 2f, 0f, (float)TileManager.TileWidth * (float)TileManager.Scaling / 2f);
        terrain = this.gameObject.GetOrAddComponent <Terrain>();
        tC      = this.gameObject.GetOrAddComponent <TerrainCollider>();

        Building.Clear();
        Intersection.Clear();
        Street.Clear();
        Water.Clear();
        River.Clear();
        Bridge.Clear();

        unusedWays.Clear();
        streets.Clear();

        streetPolygons.Clear();

        msg.Stop(Job.ProceduralPreparation);

        #region LOD0
        if (lOD == 0)
        {
            Console.AddMessage("Procedural lod 0");
            Debug.Log("Procedural lod 0");
            #region terrain
            TerrainData terrainData = new TerrainData();

            //HeightMap
            terrainData.heightmapResolution = 257;
            float[,] heights = new float[257, 257];
            for (int x = 0; x < heights.GetLength(0); x++)
            {
                for (int y = 0; y < heights.GetLength(1); y++)
                {
                    heights[x, y] = 1f;
                }
            }

            terrainData.SetHeights(0, 0, heights);
            terrainData.size = new Vector3((float)TileManager.TileWidth * (float)TileManager.Scaling, 10f, (float)TileManager.TileWidth * (float)TileManager.Scaling);

            ////SplatPrototypes
            //SplatPrototype[] splatPrototypes = new SplatPrototype[1];
            //splatPrototypes[0] = new SplatPrototype();
            ////splatPrototypes[0].texture = (Texture2D)Resources.Load("Textures/White1px");
            //splatPrototypes[0].texture = (Texture2D)Resources.Load("Textures/Terrain/Grass (Hill)");

            //terrainData.splatPrototypes = splatPrototypes;

            terrain.terrainData = terrainData;
            tC.terrainData      = terrainData;
            #endregion terrain
            #region mesh
            TileMesh.Clear();

            Vertex[] tileQuadVertices = new Vertex[4];
            tileQuadVertices[0] = new Vertex(new Vector3((float)(-TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(-TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);
            tileQuadVertices[1] = new Vertex(new Vector3((float)(-TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);
            tileQuadVertices[2] = new Vertex(new Vector3((float)(TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);
            tileQuadVertices[3] = new Vertex(new Vector3((float)(TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(-TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);

            new Quad(tileQuadVertices, TileMesh, MaterialManager.GetMaterial("diffuseBrown"));

            TileMesh.FillMeshDivideMaterialsKeepMeshStructure(transform, true);
            #endregion
            Debug.Log("Procedural lod 0 - Done");
        }
        #endregion

        #region LOD5
        if (lOD == 5)
        {
            msg.Start(Job.CreateTerrain);
            SimpleClient.jobStatus[jobNumber] = msg;

            #region terrain
            if (terrain.terrainData == null)
            {
                terrain.terrainData = new TerrainData();
            }
            //HeightMap
            terrain.terrainData.heightmapResolution = 257;
            terrain.terrainData.alphamapResolution  = 257;

            float height = 0f;

            terrain.terrainData.SetHeights(0, 0, SRTMHeightProvider.GetInterpolatedTerrain(this.Query.BoundingBox, out height));
            terrain.terrainData.size = new Vector3((float)TileManager.TileWidth * (float)TileManager.Scaling, height, (float)TileManager.TileWidth * (float)TileManager.Scaling);

            tC.terrainData = terrain.terrainData;

            msg.Stop(Job.CreateTerrain);
            #endregion terrain
            #region mesh
            msg.Start(Job.MeshPreparation);
            SimpleClient.jobStatus[jobNumber] = msg;
            TileMesh.Clear();

            if (BackgroundMesh != null)
            {
                BackgroundMesh.Clear();
            }
            else
            {
                BackgroundMesh = new ModularMesh(TileMesh, "BackgroundMesh");
            }

            if (BuildingMesh != null)
            {
                BuildingMesh.Clear();
            }
            else
            {
                BuildingMesh = new ModularMesh(TileMesh, "BuildingMesh");
            }

            if (StreetMesh != null)
            {
                StreetMesh.Clear();
            }
            else
            {
                StreetMesh = new ModularMesh(TileMesh, "StreetMesh");
            }

            if (OtherMesh != null)
            {
                OtherMesh.Clear();
            }
            else
            {
                OtherMesh = new ModularMesh(TileMesh, "OtherMesh");
            }

            msg.Stop(Job.MeshPreparation);

            msg.Start(Job.TileQuad);
            SimpleClient.jobStatus[jobNumber] = msg;

            Vertex[] tileQuadVertices = new Vertex[4];
            tileQuadVertices[0] = new Vertex(new Vector3((float)(-TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(-TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);
            tileQuadVertices[1] = new Vertex(new Vector3((float)(-TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);
            tileQuadVertices[2] = new Vertex(new Vector3((float)(TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);
            tileQuadVertices[3] = new Vertex(new Vector3((float)(TileManager.TileWidth * TileManager.Scaling / 2d), 0f, (float)(-TileManager.TileWidth * TileManager.Scaling / 2d)) + TilePosition);

            new Quad(tileQuadVertices, BackgroundMesh, MaterialManager.GetMaterial("diffuseBlack"));
            msg.Stop(Job.TileQuad);


            yield return(null);

            msg.Start(Job.River);
            SimpleClient.jobStatus[jobNumber] = msg;

            //Create Domain Objects
            ///Relations
            foreach (KeyValuePair <long, OSMRelation> kV in Query.OSM.relations)
            {
                OSMRelation relation = kV.Value;

                River.TryCreateFromOSM(relation, this);
                yield return(null);
            }
            msg.Stop(Job.River);

            msg.Start(Job.Ways);
            SimpleClient.jobStatus[jobNumber] = msg;

            ///Ways
            foreach (KeyValuePair <long, OSMWay> kV in Query.OSM.ways)
            {
                OSMWay way = kV.Value;

                if (!way.FirstInBounds(Query.BoundingBox, Query.OSM))
                {
                    continue;
                }

                if (!Building.TryCreateFromOSM(way, this))
                {
                    if (!Intersection.TryCreateFromOSM(way, this))
                    {
                        if (!Water.TryCreateFromOSM(way, this))
                        {
                        }
                    }
                }

                yield return(null);
            }
            msg.Stop(Job.Ways);

            //Nodes!?
            //foreach (KeyValuePair<long, OSMNode> kV in Query.OSM.nodes)
            //{
            //    OSMNode node = kV.Value;
            //    TrafficSignal.TryCreateFromOSM(node, this);
            //}

            //Debug.Log("CreateStreets");
            ////Create Streets (and Bridges)
            //Street.CreateStreets(this);



            //CreateTheMeshes
            //Debug.Log("CreateAllMeshes StreetMesh");
            //Street.CreateAllMeshes(StreetMesh);

            //Debug.Log("CreateAllMeshes StreetMesh Bridge");
            //Bridge.CreateAllMeshes(StreetMesh);
            //Debug.Log("CreateAllMeshes StreetMesh Intersection");
            //Intersection.CreateAllMeshes(StreetMesh);

            //Debug.Log("CreateAllMeshes StreetMesh Street");
            //Street.CreateAllMeshes(StreetMesh); // A second time, cause Intersections change streetproperties
            msg.Start(Job.CreateBuildingMesh);
            SimpleClient.jobStatus[jobNumber] = msg;

            Building.CreateAllMeshes(BuildingMesh);
            msg.Stop(Job.CreateBuildingMesh);
            //Debug.Log("CreateAllMeshes Water");
            //Water.CreateAllMeshes(OtherMesh);
            //Debug.Log("CreateAllMeshes TrafficSignal");
            //TrafficSignal.CreateAllMeshes(OtherMesh);

            //StreetPolygon currentStreetPolygon;
            //bool hasLeftPolygon = false;
            //bool hasRightPolygon = false;
            //for (int i = 0; i < streets.Count; i++)
            //{
            //    for (int j = 0; j < streetPolygons.Count; j++)
            //    {
            //        hasLeftPolygon = streetPolygons[j].IsLefthandPolygonOf(streets[i]);
            //        hasRightPolygon = streetPolygons[j].IsRighthandPolygonOf(streets[i]);
            //    }
            //    if (!hasLeftPolygon)
            //    {
            //        if (StreetPolygon.GetLefthandStreetPolygon(streets[i], out currentStreetPolygon))
            //            streetPolygons.Add(currentStreetPolygon);
            //    }
            //    if (!hasRightPolygon)
            //    {
            //        if (StreetPolygon.GetRighthandStreetPolygon(streets[i], out currentStreetPolygon))
            //            streetPolygons.Add(currentStreetPolygon);
            //    }

            //    hasLeftPolygon = false;
            //    hasRightPolygon = false;
            //}

            //for (int i = 0; i < streetPolygons.Count; i++)
            //{
            //    streetPolygons[i].Triangulate(StreetMesh , MaterialManager.GetMaterial("error"));
            //}


            msg.Start(Job.FillMeshDivideMaterials);
            SimpleClient.jobStatus[jobNumber] = msg;
            TileMesh.FillMeshDivideMaterialsKeepMeshStructure(transform, true);
            msg.Stop(Job.FillMeshDivideMaterials);
            #endregion
        }
        #endregion

        msg.Start(Job.GarbageCollection);
        SimpleClient.jobStatus[jobNumber] = msg;
        System.GC.Collect();
        msg.Stop(Job.GarbageCollection);

        yield return(null);

        msg.Start(Job.ProceduralDone);
        SimpleClient.jobStatus[jobNumber] = msg;
        OnProceduralDoneLocal();
        msg.Stop(Job.Worker);
        msg.Stop();

        yield return(true);
    }
コード例 #5
0
ファイル: PropertyDetails.cs プロジェクト: hnlord/A
        internal void GetDataFromExcel()
        {
            try
            {
                // Populating the data from Excel
                ExcelLib.PopulateInCollection(Base.ExcelPath, "PropertyDetails");

                //Edit name textbox
                PropertyName.Clear();
                Thread.Sleep(1000);
                PropertyName.SendKeys(ExcelLib.ReadData(2, "Property Name"));

                //Edit description textbox
                Description.Clear();
                Thread.Sleep(1000);
                Description.SendKeys(ExcelLib.ReadData(2, "Description"));

                //Edit Number textbox
                StreetNumber.Clear();
                Thread.Sleep(1000);
                StreetNumber.SendKeys(ExcelLib.ReadData(2, "Number"));

                //Edit Street textbox
                Street.Clear();
                Thread.Sleep(1000);
                Street.SendKeys(ExcelLib.ReadData(2, "Street"));

                //Edit Suburb  textbox
                // Suburb.Clear();
                // Thread.Sleep(1000);
                // Suburb.SendKeys(ExcelLib.ReadData(2, "Suburb"));

                //Edit City textbox
                City.Clear();
                Thread.Sleep(1000);
                City.SendKeys(ExcelLib.ReadData(2, "City"));

                //Edit Postcode  textbox
                Postcode.Clear();
                Thread.Sleep(1000);
                Postcode.SendKeys(ExcelLib.ReadData(2, "Postcode"));

                //Edit Region   textbox
                Region.Clear();
                Thread.Sleep(1000);
                Region.SendKeys(ExcelLib.ReadData(2, "Region"));


                //Select Year in Year Built
                YearBuilt.SendKeys(ExcelLib.ReadData(2, "YearBuilt"));
                Thread.Sleep(1000);


                //Edit Target Rent  textbox
                TargetRent.Clear();
                Thread.Sleep(1000);
                TargetRent.SendKeys(ExcelLib.ReadData(2, "Target Rent"));

                //Edit Bed rooms textbox
                Bedrooms.Clear();
                Thread.Sleep(1000);
                Bedrooms.SendKeys(ExcelLib.ReadData(2, "Bedrooms"));

                //Edit Bath rooms textbox
                Bathrooms.Clear();
                Thread.Sleep(1000);
                Bathrooms.SendKeys(ExcelLib.ReadData(2, "Bathrooms"));


                //Edit Carparks textbox
                Carparks.Clear();
                Thread.Sleep(1000);
                Carparks.SendKeys(ExcelLib.ReadData(2, "Carparks"));
                Carparks.SendKeys(Keys.Enter);
                Thread.Sleep(1000);

                //Click on the "Next" button
                NextButton.Click();
                Thread.Sleep(2000);
            }
            catch (Exception e)
            {
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Add Property Details Unsuccessfull", e.Message);
            }
        }
コード例 #6
0
        //Edit a property from Excel data
        internal void EditAPropertyFromExcelData()
        {
            try
            {
                // Populating the data from Excel
                ExcelLib.PopulateInCollection(Base.ExcelPath, "PropertyDetails");

                //Edit name textbox
                PropertyName.Clear();
                Thread.Sleep(1000);
                PropertyName.SendKeys(ExcelLib.ReadData(2, "Property Name"));

                //Edit description textbox
                Description.Clear();
                Thread.Sleep(1000);
                Description.SendKeys(ExcelLib.ReadData(2, "Description"));

                //Edit Number textbox
                StreetNumber.Clear();
                Thread.Sleep(1000);
                StreetNumber.SendKeys(ExcelLib.ReadData(2, "Number"));

                //Edit Street textbox
                Street.Clear();
                Thread.Sleep(1000);
                Street.SendKeys(ExcelLib.ReadData(2, "Street"));

                //Edit Suburb  textbox
                Suburb.Clear();
                Thread.Sleep(1000);
                Suburb.SendKeys(ExcelLib.ReadData(2, "Suburb"));

                //Edit City textbox
                City.Clear();
                Thread.Sleep(1000);
                City.SendKeys(ExcelLib.ReadData(2, "City"));

                //Edit Postcode  textbox
                Postcode.Clear();
                Thread.Sleep(1000);
                Postcode.SendKeys(ExcelLib.ReadData(2, "Postcode"));

                //Edit Region   textbox
                Region.Clear();
                Thread.Sleep(1000);
                Region.SendKeys(ExcelLib.ReadData(2, "Region"));


                //Select Year in Year Built
                YearBuilt.Click();
                Thread.Sleep(1000);
                var selectElement = new SelectElement(YearBuilt);

                //select by text
                string sYear = ExcelLib.ReadData(2, "YearBuilt");
                //Debug.Assert(sYear == "1977");
                selectElement.SelectByText(sYear);
                Thread.Sleep(1000);


                //Edit Target Rent  textbox
                TargetRent.Clear();
                Thread.Sleep(1000);
                TargetRent.SendKeys(ExcelLib.ReadData(2, "Target Rent"));

                //Edit Bed rooms textbox
                Bedrooms.Clear();
                Thread.Sleep(1000);
                Bedrooms.SendKeys(ExcelLib.ReadData(2, "Bedrooms"));

                //Edit Bath rooms textbox
                Bathrooms.Clear();
                Thread.Sleep(1000);
                Bathrooms.SendKeys(ExcelLib.ReadData(2, "Bathrooms"));


                //Edit Carparks textbox
                Carparks.Clear();
                Thread.Sleep(1000);
                Carparks.SendKeys(ExcelLib.ReadData(2, "Carparks"));


                //Click on the "Save" button
                SaveButton.Click();
                Thread.Sleep(2000);
            }
            catch (Exception e)
            {
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Edit Unsuccessfull", e.Message);
            }
        }