Esempio n. 1
0
        public ErrorSurfaceProperty(XmlNode nodProperty, Surface surf)
        {
            Name = nodProperty.SelectSingleNode("Name").InnerText;

            XmlNode nodUni = nodProperty.SelectSingleNode("UniformValue");
            XmlNode nodAss = nodProperty.SelectSingleNode("AssociatedSurface");
            XmlNode nodFIS = nodProperty.SelectSingleNode("FISRuleFile");

            if (nodUni is XmlNode)
            {
                UniformValue = decimal.Parse(nodUni.InnerText, CultureInfo.InvariantCulture);
            }
            else if (surf is DEMSurvey)
            {
                DEMSurvey dem = ((DEMSurvey)surf);

                if (nodFIS is XmlNode)
                {
                    FileInfo fisFile = ProjectManager.Project.GetAbsolutePath(nodFIS.InnerText);
                    FISRuleFile = new ErrorCalculation.FIS.FISLibraryItem(fisFile.FullName, ErrorCalculation.FIS.FISLibrary.FISLibraryItemTypes.Project);

                    foreach (XmlNode nodInput in nodProperty.SelectNodes("FISInputs/Input"))
                    {
                        AssocSurface assoc = dem.AssocSurfaces.First <AssocSurface>(x => string.Compare(nodInput.SelectSingleNode("AssociatedSurface").InnerText, x.Name, true) == 0);
                        FISInputs.Add(new FISInput(nodInput.SelectSingleNode("Name").InnerText, assoc));
                    }
                }
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
 /// <summary>
 /// Constructor for deserializing FIS items from project XML
 /// </summary>
 /// <param name="sFISInputName"></param>
 /// <param name="assoc"></param>
 public FISInput(string sFISInputName, AssocSurface assoc)
 {
     FISInputName      = sFISInputName;
     AssociatedSurface = assoc;
 }
Esempio n. 4
0
 public bool IsAssocNameUnique(string name, AssocSurface ignore)
 {
     return(AssocSurfaces.Count <AssocSurface>(x => x != ignore && string.Compare(name, x.Name, true) == 0) == 0);
 }