当前位置: 首页>>代码示例>>C#>>正文


C# Section.add_entry方法代码示例

本文整理汇总了C#中Section.add_entry方法的典型用法代码示例。如果您正苦于以下问题:C# Section.add_entry方法的具体用法?C# Section.add_entry怎么用?C# Section.add_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Section的用法示例。


在下文中一共展示了Section.add_entry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createDefault

        /// <summary>
        /// create a default initialisation file
        /// </summary>
        /// <param name="initialisation_file"></param>
        public void createDefault(String initialisation_file, float target_width_mm, float target_height_mm, float target_distance_mm)
        {
            Section new_section;
            StreamWriter stream = File.CreateText(initialisation_file);

            float half_width_metres = target_width_mm / 2000;
            float half_height_metres = target_height_mm / 2000;
            float target_dist_metres = -target_distance_mm / 1000;

            m_sections.Clear();

            new_section = new Section("Models");
            new_section.add_entry("MotionModel", "IMPULSE_THREED");
            new_section.add_entry("NewFeatureMeasurementModel", "CAMERA_WIDE_LINE_INIT");
            m_sections.Add(new_section);
            new_section = new Section("CAMERA_WIDE_POINT");
            new_section.add_entry("Camera", "UNIBRAIN_WIDE_CAMERA");
            m_sections.Add(new_section);
            new_section = new Section("CAMERA_WIDE_LINE_INIT");
            new_section.add_entry("Camera", "UNIBRAIN_WIDE_CAMERA");
            m_sections.Add(new_section);
            new_section = new Section("UNIBRAIN_WIDE_CAMERA");
            new_section.add_entry("CameraParameters", "320,240,162,125,195,195,9e-06,1");
            m_sections.Add(new_section);
            new_section = new Section("IMPULSE_THREED");
            m_sections.Add(new_section);
            new_section = new Section("InitialState");
            new_section.add_entry("MotionModel", "IMPULSE_THREED");
            new_section.add_entry("xv", "0.0,0.0," + Convert.ToString(target_dist_metres) + ",1.0,0.0,0.0,0.0,0.0,0.0,-0.1,0.0,0.0,0.01");
            new_section.add_entry("Pxx", "0.0004,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0004,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0004,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0," +
                                         "0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0");
            m_sections.Add(new_section);
            for (int i = 1; i <= 4; i++)
            {
                new_section = new Section("KnownFeature" + Convert.ToString(i));
                new_section.add_entry("FeatureMeasurementModel", "CAMERA_WIDE_POINT");
                new_section.add_entry("Identifier", "known_patch" + Convert.ToString(i-1) + ".bmp");
                switch (i)
                {
                    case (1):
                        {
                            new_section.add_entry("yi", Convert.ToString(half_width_metres) + "," +
                                                        Convert.ToString(half_height_metres) + ",0.0");
                            break;
                        }
                    case (2):
                        {
                            new_section.add_entry("yi", Convert.ToString(-half_width_metres) + "," +
                                                        Convert.ToString(half_height_metres) + ",0.0");
                            break;
                        }
                    case (3):
                        {
                            new_section.add_entry("yi", Convert.ToString(half_width_metres) + "," +
                                                        Convert.ToString(-half_height_metres) + ",0.0");
                            break;
                        }
                    case (4):
                        {
                            new_section.add_entry("yi", Convert.ToString(-half_width_metres) + "," +
                                                        Convert.ToString(-half_height_metres) + ",0.0");
                            break;
                        }
                }
                new_section.add_entry("xp_orig", "0.0,0.0," + Convert.ToString(target_dist_metres) + "," +
                                                 "1.0,0.0,0.0,0.0");
                m_sections.Add(new_section);
            }

            save(stream);
            stream.Close();
        }
开发者ID:kasertim,项目名称:sentience,代码行数:87,代码来源:settings.cs


注:本文中的Section.add_entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。