コード例 #1
0
ファイル: MavLinkHelper.cs プロジェクト: zaprog/MavLink4Net
        public static Data.MavLink LoadMavLink(string messageDefinitionPath)
        {
            DefaultTransformation transformation = new DefaultTransformation(EnumValuePrefixRemovalStrategy.RemoveLongestCommonString);
            MavLink1MessageFilter messageFilter  = new MavLink1MessageFilter();
            DataProvider          dataProvider   = new DataProvider(false, transformation, transformation, transformation, transformation, messageFilter);

            Data.MavLink mavLink = dataProvider.GetMavLink(messageDefinitionPath);
            return(mavLink);
        }
コード例 #2
0
        public Data.MavLink GetMavLink(string path)
        {
            Xml.MavLink xMavLink = XmlSerializer.Deserialize(path);

            Data.MavLink dMavLink = new Data.MavLink();
            dMavLink.Version = xMavLink.Version;
            dMavLink.Dialect = xMavLink.Dialect;
            IEnumerable <Data.Enum> enums = ToModels(xMavLink.Enums).ToList();

            dMavLink.Enums = enums;

            dMavLink.Messages = ToModels(xMavLink.Messages).ToList();

            return(dMavLink);
        }