Exemplo n.º 1
0
        public DEMSurvey(XmlNode nodDEM)
            : base(nodDEM, false, false)
        {
            //SurveyDateTime surveyDT = null;
            XmlNode nodSurveyDate = nodDEM.SelectSingleNode("SurveyDate");

            if (nodSurveyDate is XmlNode)
            {
                SurveyDate = new SurveyDateTime();
                if (!string.IsNullOrEmpty(nodDEM.SelectSingleNode("SurveyDate/Year").InnerText))
                {
                    SurveyDate.Year = ushort.Parse(nodDEM.SelectSingleNode("SurveyDate/Year").InnerText);
                }

                if (!string.IsNullOrEmpty(nodDEM.SelectSingleNode("SurveyDate/Month").InnerText))
                {
                    SurveyDate.Month = byte.Parse(nodDEM.SelectSingleNode("SurveyDate/Month").InnerText);
                }

                if (!string.IsNullOrEmpty(nodDEM.SelectSingleNode("SurveyDate/Day").InnerText))
                {
                    SurveyDate.Day = byte.Parse(nodDEM.SelectSingleNode("SurveyDate/Day").InnerText);
                }

                if (!string.IsNullOrEmpty(nodDEM.SelectSingleNode("SurveyDate/Hour").InnerText))
                {
                    SurveyDate.Hour = short.Parse(nodDEM.SelectSingleNode("SurveyDate/Hour").InnerText);
                }

                if (!string.IsNullOrEmpty(nodDEM.SelectSingleNode("SurveyDate/Minute").InnerText))
                {
                    SurveyDate.Minute = short.Parse(nodDEM.SelectSingleNode("SurveyDate/Minute").InnerText);
                }
            }

            //read Chronological Order, if set
            XmlNode nodChronologicalOrder = nodDEM.SelectSingleNode("ChronologicalOrder");

            if (nodChronologicalOrder is XmlNode)
            {
                string  sChronologicalOrder = nodChronologicalOrder.InnerText;
                int     iChronologicalOrder;
                Boolean bParseSuccessful = int.TryParse(sChronologicalOrder, out iChronologicalOrder);
                if (bParseSuccessful)
                {
                    ChronologicalOrder = iChronologicalOrder;
                }
            }

            AssocSurfaces = new naru.ui.SortableBindingList <AssocSurface>();
            foreach (XmlNode nodAssoc in nodDEM.SelectNodes("AssociatedSurfaces/AssociatedSurface"))
            {
                AssocSurface assoc = new AssocSurface(nodAssoc, this);
                AssocSurfaces.Add(assoc);
            }

            // Load the error surfaces now that the associated surfaces have been loaded
            LoadErrorSurfaces(nodDEM);
            LoadLinearExtractions(nodDEM);
        }
Exemplo n.º 2
0
        public DEMSurvey(string name, SurveyDateTime surveyDate, FileInfo rasterPath, FileInfo hillshadePath)
            : base(name, rasterPath, hillshadePath)
        {
            SurveyDate = surveyDate;

            AssocSurfaces = new naru.ui.SortableBindingList <AssocSurface>();
        }