Exemplo n.º 1
0
        public ROIInstance(ROIDefinition theDefinition, TestExecution theExecution)
            : base(theDefinition, theExecution)
        {
            if (theDefinition.ReferencePoint_X != null)
            {
                mReferencePoint_X = theExecution.ReferencePointRegistry.GetObject(theDefinition.ReferencePoint_X.Name);
            }
            if (theDefinition.ReferencePoint_Y != null)
            {
                mReferencePoint_Y = theExecution.ReferencePointRegistry.GetObject(theDefinition.ReferencePoint_Y.Name);
            }

            theExecution.ROIRegistry.RegisterObject(this);
        }
Exemplo n.º 2
0
        public void ToggleROI(string roiName)
        {
            ROIDefinition roiDef = mTestSequence.ROIRegistry.GetObject(roiName);

            if (roisToShow.Contains(roiDef))
            {
                roisToShow.Remove(roiDef);
            }
            else
            {
                roisToShow.Add(roiDef);
            }
            if (ImageDisplayDefChange != null)
            {
                ImageDisplayDefChange();
            }
        }
Exemplo n.º 3
0
        public void DeserializeDef(string defString)
        {
            string[] mainSplitComponents = defString.Split(new char[] { ';' });
            if (mainSplitComponents.GetUpperBound(0) != 3)
            {
                throw new ArgumentException("Invalid image row definition; definition='" + defString + "'");
            }

            ImageDefinition = mTestSequence.ImageRegistry.GetObjectIfExists(mainSplitComponents[0].Trim());

            switch (mainSplitComponents[1].Trim())
            {
            case "StretchImage":
                SizeMode = PictureBoxSizeMode.StretchImage;
                break;

            case "Zoom":
                SizeMode = PictureBoxSizeMode.Zoom;
                break;

            case "Normal":
                SizeMode = PictureBoxSizeMode.Normal;
                break;

            case "CenterImage":
                SizeMode = PictureBoxSizeMode.CenterImage;
                break;

            default:
                SizeMode = PictureBoxSizeMode.StretchImage;
                break;
            }
            string[] objects = mainSplitComponents[2].Split(new char[] { ',' });
            string   name;

            for (int ndx = 0; ndx <= objects.GetUpperBound(0); ndx++)
            {
                name = objects[ndx].Trim();
                if (name != string.Empty)
                {
                    ROIDefinition roi = mTestSequence.ROIRegistry.GetObjectIfExists(name);
                    if (roi != null)
                    {
                        roisToShow.Add(roi);
                    }
                }
            }

            objects = mainSplitComponents[3].Split(new char[] { ',' });
            for (int ndx = 0; ndx <= objects.GetUpperBound(0); ndx++)
            {
                name = objects[ndx].Trim();
                if (name != string.Empty)
                {
                    IDecorationDefinition decoration = mTestSequence.DecorationRegistry.GetObjectIfExists(name);
                    if (decoration != null)
                    {
                        decorationsToShow.Add(decoration);
                    }
                }
            }
        }