Beispiel #1
0
        public List <DateTime> findBreakPoints(double first, double second, int samplesBefore)
        {
            analyzer a      = new analyzer();
            var      breaks = a.FindDebugBreakPoints(samples, first, second, samplesBefore);

            return(breaks);
        }
Beispiel #2
0
        public static void processFile(string filePath)
        {
            // read file
            inout io = new inout();

            io.readCSV(filePath);
            List <signal> signals = io.getSignals();

            // get breakpoints
            foreach (var signal in signals)
            {
                if (signal.name.Contains(triggerSignal))
                {
                    breakPoints = signal.findBreakPoints(first_trigger, second_triger, samples_before);
                }
            }

            // use breakpoints to set cycle
            foreach (var signal in signals)
            {
                signal.makeCycles(breakPoints, ignoreStart);
            }

            // info dump
            Console.WriteLine("/////////////////////////////////////////////////////////////////////");
            Console.WriteLine("Csv Data file:  " + filePath);
            Console.WriteLine("Signals count : " + signals.Count);
            Console.WriteLine("Trigger Signal: " + triggerSignal);
            Console.WriteLine("/////////////////////////////////////////////////////////////////////");

            foreach (var signal in signals)
            {
                signal.printInfo();
            }


            // trim the signal
            List <signal> trimmedSignals = new List <signal>();

            foreach (var signal in signals)
            {
                analyzer a = new analyzer();
                trimmedSignals.Add(a.trimEndTime(signal, new TimeSpan(0, 0, 10)));
            }

            foreach (var signal in signals)
            {
            }


            foreach (var signal in signals)
            {
                if (signal.name.Contains("A1Atom.Actual"))
                {
                    List <analyzerSample> analyzedSamples = new List <analyzerSample>();

                    analyzer a = new analyzer();
                    analyzedSamples = a.getVarianceArray(signal);
                    io.writeAnalyzedSignalsToCSV(analyzedSamples, filePath, false);
                }
            }

            // write signal CSV file for each signal with overlapping cycles
            //foreach (var signal in signals)
            foreach (var signal in trimmedSignals)
            {
                //io.writeCSV(signal,filePath,csvType.Excel);
            }
        }