Ejemplo n.º 1
0
        private void LoadIniFile(string iniFilePath)
        {
            IniFile iniFile = new IniFile(iniFilePath);

            string[] sectionName = iniFile.GetSectionNames();
            if (sectionName.Length != 0)
            {
                signalTower = new SignalTower[sectionName.Length];
                for (int i = 0; i < sectionName.Length; i++)
                {
                    signalTower[i] = new SignalTower();

                    signalTower[i].Status      = sectionName[i];
                    signalTower[i].Description = iniFile.GetString(sectionName[i], "Description", "");

                    signalTower[i].RedLightType    = (SignalTower.BlinkMode)iniFile.GetInt32(sectionName[i], "Red", (int)SignalTower.BlinkMode.OFF);
                    signalTower[i].YellowLightType = (SignalTower.BlinkMode)iniFile.GetInt32(sectionName[i], "Yellow", (int)SignalTower.BlinkMode.OFF);
                    signalTower[i].GreenLightType  = (SignalTower.BlinkMode)iniFile.GetInt32(sectionName[i], "Green", (int)SignalTower.BlinkMode.OFF);
                    signalTower[i].BlueLightType   = (SignalTower.BlinkMode)iniFile.GetInt32(sectionName[i], "Blue", (int)SignalTower.BlinkMode.OFF);
                    signalTower[i].BuzzerType      = (SignalTower.BlinkMode)iniFile.GetInt32(sectionName[i], "Buzzer", (int)SignalTower.BlinkMode.OFF);
                }

                dataGridView.Rows.Add(sectionName.Length);
                for (int i = 0; i < sectionName.Length; i++)
                {
                    dataGridView.Rows[i].SetValues(i + 1, sectionName[i], signalTower[i].Description,
                                                   hashTable[signalTower[i].RedLightType], hashTable[signalTower[i].YellowLightType], hashTable[signalTower[i].GreenLightType], hashTable[signalTower[i].BlueLightType], hashTable[signalTower[i].BuzzerType]);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// aaaaa
 /// </summary>
 /// <remarks>hggfhgfhg</remarks>
 /// <returns>bbbbb</returns>
 public void SetSignal(SignalTower signalTower)
 {
     for (int i = 0; i < signal.Count; i++)
     {
         blinkCounter[i] = 0;
     }
     this.signalTower = signalTower;
 }
Ejemplo n.º 3
0
 public void SetSignal(SignalTower signalTower)
 {
     this.signalTowerUnitControl.SetSignal(signalTower);
 }