Ejemplo n.º 1
0
        /// <summary>
        /// Queries OctoPart for the category heirarchy with the category UID from OctoPart's website.
        /// The parent and all grandparent categories are stored and strung together to for the classification
        /// </summary>
        public void AddOctoPartClassificationToComponent(CyPhy.Component comp, MfgBom.Bom.Part part)
        {
            part.QueryCategory(part.CategoryUID);

            if (String.IsNullOrWhiteSpace(comp.Attributes.Classifications))
            {
                comp.Attributes.Classifications = part.Classification;
            }
            else
            {
                LogMessage(String.Format("A classification is already specified for component {0}. ", comp.Name) +
                           String.Format("Classification returned by OctoPart is {0}; will not overwrite.", part.Classification),
                           CyPhyGUIs.SmartLogger.MessageType_enum.Warning);
            }
        }