Example #1
0
        ///
        public LogRMC(string[] filenames)
        {
            Hashtable methods = new Hashtable();
            methods["StatusInvalid"] = false;
            methods["NullValues"]    = false;
            methods["InvalidCoords"] = false;
            methods["ValidChecksum"] = false;

            LogRMC[] rmcLogs = new LogRMC[filenames.Length];

            for (int i = 0; i < filenames.Length; i++)
            {
                rmcLogs[i] = new LogRMC();
                rmcLogs[i].ReadFile(filenames[i]);
                rmcLogs[i].Clean(methods);
            }

            Array.Sort(rmcLogs);

            this.logBegin = rmcLogs[0].logBegin;
            this.logEnd   = rmcLogs[0].logEnd;
            this.rmcData  = new ArrayList();

            foreach (LogRMC rmc in rmcLogs)
            {
                if (this.logBegin > rmc.logBegin)
                    this.logBegin = rmc.logBegin;

                if (this.logEnd < rmc.logEnd)
                    this.logEnd = rmc.logEnd;

                foreach (Hashtable fields in rmc.rmcData)
                    this.rmcData.Add(this.GetRMCSentence(fields));
            }
        }
Example #2
0
        private void saveFileOk(object sender, CancelEventArgs e)
        {
            SaveFileDialog senderDialog = (SaveFileDialog)sender;

            //LogRMC saveRMC = this.rmcInstance.GetSegment(this.dateBegin.Value, this.dateEnd.Value);
            //saveRMC.WriteLog(senderDialog.FileName);

            foreach (int index in this.tourSelect.CheckedIndices)
            {
                LogRMC log = (LogRMC)this.tourLogs[index];
                log = log.GetSegment(this.dateBegin.Value, this.dateEnd.Value);
                log.WriteLog(senderDialog.FileName, true);
            }
        }
Example #3
0
        ///
        public LogRMC(string[] filenames)
        {
            Hashtable methods = new Hashtable();

            methods["StatusInvalid"] = false;
            methods["NullValues"]    = false;
            methods["InvalidCoords"] = false;
            methods["ValidChecksum"] = false;

            LogRMC[] rmcLogs = new LogRMC[filenames.Length];

            for (int i = 0; i < filenames.Length; i++)
            {
                rmcLogs[i] = new LogRMC();
                rmcLogs[i].ReadFile(filenames[i]);
                rmcLogs[i].Clean(methods);
            }

            Array.Sort(rmcLogs);

            this.logBegin = rmcLogs[0].logBegin;
            this.logEnd   = rmcLogs[0].logEnd;
            this.rmcData  = new ArrayList();

            foreach (LogRMC rmc in rmcLogs)
            {
                if (this.logBegin > rmc.logBegin)
                {
                    this.logBegin = rmc.logBegin;
                }

                if (this.logEnd < rmc.logEnd)
                {
                    this.logEnd = rmc.logEnd;
                }

                foreach (Hashtable fields in rmc.rmcData)
                {
                    this.rmcData.Add(this.GetRMCSentence(fields));
                }
            }
        }
Example #4
0
        private void FilterSource()
        {
            Hashtable methods = new Hashtable();

            methods["StatusInvalid"] = this.filterList.GetItemCheckState(0) == CheckState.Checked;
            methods["NullValues"]    = this.filterList.GetItemCheckState(1) == CheckState.Checked;
            methods["InvalidCoords"] = this.filterList.GetItemCheckState(2) == CheckState.Checked;
            methods["ValidChecksum"] = this.filterList.GetItemCheckState(3) == CheckState.Checked;

            if (this.sourceFiles != null)
            {
                this.rmcInstance = new LogRMC(this.sourceFiles);
            }

            else if (this.clipCont != null)
            {
                this.rmcInstance = new LogRMC(this.clipCont);
            }

            this.rmcInstance.Clean(methods);

            this.minDate = this.rmcInstance.logBegin;
            this.maxDate = this.rmcInstance.logEnd;
        }
Example #5
0
        private void FilterSource()
        {
            Hashtable methods = new Hashtable();
            methods["StatusInvalid"] = this.filterList.GetItemCheckState(0) == CheckState.Checked;
            methods["NullValues"]    = this.filterList.GetItemCheckState(1) == CheckState.Checked;
            methods["InvalidCoords"] = this.filterList.GetItemCheckState(2) == CheckState.Checked;
            methods["ValidChecksum"] = this.filterList.GetItemCheckState(3) == CheckState.Checked;

            if (this.sourceFiles != null)
            {
                this.rmcInstance = new LogRMC(this.sourceFiles);
            }

            else if (this.clipCont != null)
            {
                this.rmcInstance = new LogRMC(this.clipCont);
            }

            this.rmcInstance.Clean(methods);

            this.minDate = this.rmcInstance.logBegin;
            this.maxDate = this.rmcInstance.logEnd;
        }
Example #6
0
        ///
        public int CompareTo(object rhs)
        {
            LogRMC rmc = (LogRMC)rhs;

            return(rmc.logBegin.CompareTo(rmc.logBegin));
        }
Example #7
0
        private void UpdateDateSelect(object sender, ItemCheckEventArgs e)
        {
            if (e.NewValue == CheckState.Checked)
            {
                LogRMC log = (LogRMC)this.tourLogs[e.Index];

                if (this.dateBegin.Value > log.logBegin)
                {
                    this.dateBegin.MinDate = log.logBegin;
                    this.dateBegin.Value   = log.logBegin;
                }

                if (this.dateEnd.Value < log.logEnd)
                {
                    this.dateEnd.MaxDate = log.logEnd;
                    this.dateEnd.Value   = log.logEnd;
                }

                if (this.tourSelect.CheckedIndices.Count == 0)
                {
                    this.dateBegin.MinDate = log.logBegin;
                    this.dateBegin.Value   = log.logBegin;

                    this.dateEnd.MaxDate = log.logEnd;
                    this.dateEnd.Value   = log.logEnd;
                }
            }

            if (e.NewValue == CheckState.Unchecked)
            {
                DateTime lowMark  = this.dateBegin.Value;
                DateTime highMark = this.dateEnd.Value;
                int      i        = 0;

                foreach (int index in this.tourSelect.CheckedIndices)
                {
                    // The index that was unchecked won´t be used.
                    if (index == e.Index)
                    {
                        continue;
                    }

                    LogRMC log = (LogRMC)this.tourLogs[index];

                    if (i == 0)
                    {
                        lowMark = log.logBegin;
                    }

                    if (i == this.tourSelect.CheckedIndices.Count - 2)
                    {
                        highMark = log.logEnd;
                    }

                    if (this.tourSelect.CheckedIndices.Count == 1)
                    {
                        lowMark  = log.logBegin;
                        highMark = log.logEnd;
                    }

                    i++;
                }

                this.dateBegin.MinDate = lowMark;
                this.dateBegin.Value   = lowMark;

                this.dateEnd.MaxDate = highMark;
                this.dateEnd.Value   = highMark;
            }
        }