예제 #1
0
        public FormTimerOutputIRsignal(IRedRat3 _RedRat3, Int32 _Interval, IRPacket _OutputIR = null, bool _folderOutput = false, string _pathToFolder = "", FileInfo[] _fileInfos = null)
        {
            InitializeComponent();
            RedRat3      = _RedRat3;
            interval     = _Interval;
            OutputIR     = _OutputIR;
            folderOutput = _folderOutput;
            pathToFolder = _pathToFolder;
            fileInfos    = _fileInfos;

            if (folderOutput == false)
            {
                timer1.Interval = interval;
                timer1.Start();
            }
            else
            {
                foreach (FileInfo file in fileInfos)
                {
                    OutputIR = SO.ConvertingBINARYorXMLtoIRsignal(pathToFolder + "\\" + file.Name);
                    if ((RedRat3 != null) && (OutputIR != null))
                    {
                        SO.OutputOneIRsignal(RedRat3, OutputIR);
                        Thread.Sleep(interval);
                    }
                    else
                    {
                        MessageBox.Show("Ошибка. Проверьте ввеленные значения интервала, или Подключение RedRat3, или плохо записан сигнал.");
                    }
                }
            }
        }
예제 #2
0
 // Кнопка вывода одиночного сигнала
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         if ((RedRat3 != null) && (OutputIR != null))
         {
             SignalOutput SO = new SignalOutput();
             SO.OutputOneIRsignal(RedRat3, OutputIR);
         }
         else if (OutputIR == null)
         {
             MessageBox.Show("Захватите сигнал.", "Вывод сигнала", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }