Ejemplo n.º 1
0
        /// <summary>
        /// Converts a URDF Link to a dictionary of values and writes them to a CSV
        /// </summary>
        /// <param name="stream">StreamWriter of opened CSV document</param>
        /// <param name="link">URDF link to append to the file</param>
        private static void WriteLinkToCSV(CsvWriter writer, Link link)
        {
            OrderedDictionary dictionary = new OrderedDictionary();

            link.AppendToCSVDictionary(new List <string>(), dictionary);
            WriteValuesToCSV(writer, dictionary);

            foreach (Link child in link.Children)
            {
                WriteLinkToCSV(writer, child);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// When an item in any of the list boxes or treeview is selected, the box and properties list view
        /// need to be populated. The link name TextBox is directly set, while the the properties ListView is
        /// bound to the SelectedLinkProperties dictionary
        /// </summary>
        /// <param name="link"></param>
        private void FillSelectedLinkBoxes(Link link)
        {
            SelectedLinkName.Text = link.Name;

            OrderedDictionary dictionary = new OrderedDictionary();

            link.AppendToCSVDictionary(new List <string>(), dictionary);

            SelectedLinkProperties.Clear();
            foreach (DictionaryEntry entry in dictionary)
            {
                string context    = (string)entry.Key;
                string columnName = (string)ContextToColumns.Dictionary[context];
                SelectedLinkProperties.Add(new KeyValuePair <string, object>(columnName, entry.Value));
            }
        }