Пример #1
0
 private void h_DrawController()
 {
     for (int ii = 0; ii < _testController.Sensors.Count; ii++)
     {
         AirSensor pSensor = _testController.Sensors[ii];
         h_DrawPictureBox(ii, pSensor);
     }
 }
Пример #2
0
        private void h_DrawPictureBox(int ii, AirSensor pSensor)
        {
            const int  Width      = 40;
            int        iX         = ii * Width + 20;
            int        iY         = 20;
            PictureBox pictureBox = new PictureBox();

            pictureBox.Location = new System.Drawing.Point(iX, iY);
            pictureBox.Size     = new System.Drawing.Size(Width, Width);
            // TODO:
            Controls.Add(this.pictureBox);
        }
Пример #3
0
        /// <summary>
        /// Creates air sensors for the purpose of simulation.
        /// </summary>
        /// <returns>List of <see cref="AirSensor"/></returns>
        private List <AirSensor> CreateAirSensorList()
        {
            var sensorList = new List <AirSensor>();

            for (int i = 101; i <= 200; i++)
            {
                Zone zone   = _zones[_rand.Next(0, _zones.Count)];
                var  sensor = new AirSensor(i, zone);

                sensorList.Add(sensor);
                zone.airSensors.Add(sensor);
            }

            return(sensorList);
        }