}//getLabelServer //Load a section database from Robot private IRobotSectionDatabase getSectionDatabase(string database) { //Change the database setCurrentDatabase(IRobotDatabaseType.I_DT_SECTIONS, database); //Retrive the list of all databases IRobotSectionDatabaseList dbSectionList = (RobotSectionDatabaseList)iRobotApp.Project.Preferences.SectionsActive; IRobotSectionDatabase dbSection = null; for (int i = 0; i < dbSectionList.Count; i++) { if (dbSectionList.GetDatabase(i).Name.Equals(database)) { dbSection = (RobotSectionDatabase)dbSectionList.GetDatabase(i); } } return(dbSection); }//getSectionDatabase
}//getSectionDatabase public IRobotNamesArray loadProfileDatabase(string database, string type) { //Access the IRobotLabelServer IRobotLabelServer labelServer = getLabelServer(); //Change the current section database string sDBName = database; IRobotSectionDatabase sectionDBase = getSectionDatabase(sDBName); IRobotNamesArray profiles = (RobotNamesArray)sectionDBase.GetAll(); RobotNamesArray filtered = new RobotNamesArray(); int filterSize = 1; for (int i = 1; i < profiles.Count; i++) { //Defines the size of the Array //Console.WriteLine(profiles.Get(i)); if (profiles.Get(i).StartsWith(type)) { filterSize++; } } //Console.WriteLine(filterSize); filtered.SetSize(filterSize); //Labeling the filter int pos = 1; for (int i = 1; i < profiles.Count; i++) { if (profiles.Get(i).StartsWith(type)) { filtered.Set(pos, profiles.Get(i)); pos++; } } return(filtered); }//loadProfileDatabase