Exemplo n.º 1
0
 public bool equals(Object o)
 {
     if (o.GetType() == this.GetType())
     {
         ComponentIdentifier ci = (ComponentIdentifier)o;
         if (ci.ToString().Equals(this.ToString()))
         {
             return(true);
         }
     }
     return(false);
 }
        private static string componentAssemblyInstruction(ComponentIdentifier ci)
        {
            // first, we select the component and take a screenshot of the model
            string screenshotLocation = tempFile(".jpg");
            int    errors = 0, warnings = 0;

            ci.component.Select(false);
            swDoc.ShowNamedView2("*Dimetric", -1);
            swDoc.ViewZoomtofit2();
            swDoc.Extension.SaveAs(screenshotLocation, 0, 0, null, ref errors, ref warnings);

            string allApplicable = "";
            string exampleImage  = "file:///" + IMAGE_DIR;

            // TODO : add in images for examples of all of these!
            if (ci.component.Name.StartsWith("button"))
            {
                allApplicable += step("stick a circle of reflective material on the bottom of the button as in the example below<br/><img src='" + exampleImage + "button.jpg'>", screenshotLocation);
                allApplicable += step("use tweezers to put a small spring between the button and the body", IMAGE_DIR + "button-spring.jpg");
            }
            if (ci.component.Name.StartsWith("slider"))
            {
                allApplicable += step("stick a rectangle of reflective material on the bottom of the slider as in the example below<br/><img src='" + exampleImage + "slider.jpg'>", screenshotLocation);
            }
            if (ci.component.Name.StartsWith("dpad"))
            {
                allApplicable += step("stick a circle of reflective material on the bottom of each of the direction pad's protrusions as in the example below<br/><img src='" + exampleImage + "dpad.jpg'>", screenshotLocation);
                allApplicable += step("use tweezers to put a small spring between the direction pad and the body", IMAGE_DIR + "dpad-spring.jpg");
            }
            if (ci.component.Name.StartsWith("scroll-wheel"))
            {
                allApplicable += step("stick horizontal stripes (about 10) of reflective material on the outside of the scroll wheel as in the example below<br/><img src='" + exampleImage + "scrollwheel.jpg'>", screenshotLocation);
            }
            if (ci.component.Name.StartsWith("joystick"))
            {
                allApplicable += step("stick a rectangle of reflective material on the bottom of each of the joystick's protrusions as in the example below<br/><img src='" + exampleImage + "joystick.jpg'>", screenshotLocation);
            }
            if (ci.component.Name.StartsWith("dial"))
            {
                allApplicable += step("stick a circle of reflective material on the bottom of the dial's protrusion as in the example below<br/><img src='" + exampleImage + "dial.jpg'>", screenshotLocation);
            }

            return(allApplicable);
        }
Exemplo n.º 3
0
        private List <ComponentIdentifier> getAllOurComponents()
        {
            List <ComponentIdentifier> found = new List <ComponentIdentifier>();
            Component2 swComp = swConf.GetRootComponent3(true);

            object[]   vChildComp;
            Component2 swChildComp;
            int        i;

            vChildComp = (object[])swComp.GetChildren();
            for (i = 0; i < vChildComp.Length; i++)
            {
                swChildComp = (Component2)vChildComp[i];
                foreach (String compName in ourComponentNames)
                {
                    if (swChildComp.Name2.StartsWith(compName) && !swChildComp.Equals(mainBody) && !swChildComp.IsSuppressed())
                    {
                        ComponentIdentifier ci = new ComponentIdentifier(swChildComp);
                        found.Add(ci);
                    }
                }
            }
            return(found);
        }