Exemplo n.º 1
0
        private void PerformLogWrite()
        {
            DateTime timeNow = DateTime.Now;

            tbLastLogTime.Text = timeNow.ToString("HH:mm:ss.f");
            tbNextLogTime.Text = timeNow.Add(loggingTimer.Interval).ToString("HH:mm:ss.f");

            btnLog.IsEnabled = false;

            for (int i = 0; i < aiFilters.Length; i++)
            {
                logToFile.BufferEntry(aiFilters[i].output.ToString("F3"));
            }

            foreach (Sensor s in daqSim.di)
            {
                logToFile.BufferEntry(s.valStr);
            }

            if (logToFile.WriteEntry())
            {
                tbLogEntryCount.Text = logToFile.NumEntries.ToString();
                loggingTimer.Go();
            }
            else
            {
                tbLogEntryCount.Text = logToFile.NumEntries.ToString() + " !--ERR--!";
            }
        }
Exemplo n.º 2
0
        //////////////////////////////////////////////////////
        // Datalog functions
        private void LogInitialize()
        {
            logToFile      = new DataLog(Config.Charkey("dataLogDelim", ','));
            tbLogPath.Text = logToFile.FilePath;

            tbLogEntryCount.Text = logToFile.NumEntries.ToString();

            logToFile.BufferEntry("Timestamp");

            foreach (Sensor s in daqSim.ai)
            {
                logToFile.BufferEntry(s.name);
            }

            foreach (Sensor s in daqSim.di)
            {
                logToFile.BufferEntry(s.name);
            }

            logToFile.WriteEntry(tStamp: false, incrCtr: false);
        }