Ejemplo n.º 1
0
        ///
        ///	 <summary> * add an element x y to the Range attribute as a JDFRange
        ///	 *  </summary>
        ///	 * <param name="JDFShape"> shape1 the Range value </param>
        ///	 * <param name="JDFShape"> shape2 the Range value </param>
        ///
        public virtual void addRange(JDFShape shape1, JDFShape shape2)
        {
            JDFShapeRangeList srl = getRange();

            srl.Append(shape1, shape2);
            setRange(srl);
        }
Ejemplo n.º 2
0
 ///
 ///	 <summary> * sets the Dimension to X Y 0 convenience method to copy media dimension to
 ///	 * component
 ///	 *  </summary>
 ///	 * <param name="dimension"> </param>
 ///
 public virtual void setDimensions(JDFXYPair dimension)
 {
     if (dimension != null)
     {
         JDFShape s = new JDFShape(dimension.X, dimension.Y);
         base.setDimensions(s);
     }
 }
Ejemplo n.º 3
0
        ///
        ///	 <summary> * fitsXYZ - checks wheterh <code>range</code> matches the test lists X, Y,
        ///	 * Z, specified for this Evaluation
        ///	 *  </summary>
        ///	 * <param name="range">
        ///	 *            range to test </param>
        ///	 * <returns> boolean - true, if <code>range</code> matches test lists X, Y, Z
        ///	 *         or if X, Y, Z are not specified </returns>
        ///
        private bool fitsXYZ(JDFShapeRange range)
        {
            JDFNumberRangeList x, y, z;

            JDFShape left  = range.Left;
            JDFShape right = range.Right;

            double         leftX  = left.Y;
            double         rightX = right.Y;
            JDFNumberRange rangeX = new JDFNumberRange(leftX, rightX);

            double         leftY  = left.X;
            double         rightY = right.X;
            JDFNumberRange rangeY = new JDFNumberRange(leftY, rightY);

            double         leftZ  = left.Z;
            double         rightZ = right.Z;
            JDFNumberRange rangeZ = new JDFNumberRange(leftZ, rightZ);

            x = getX();
            y = getY();
            z = getZ();

            if (hasAttribute(AttributeName.TOLERANCE))
            {
                x = fitsXYZTolerance(x);
                y = fitsXYZTolerance(y);
                z = fitsXYZTolerance(z);
            }

            bool bFit = true;

            if (x.Count != 0)
            {
                bFit = x.isPartOfRange(rangeX);
            }
            if (!bFit)
            {
                return(false);
            }

            if (y.Count != 0)
            {
                bFit = y.isPartOfRange(rangeY);
            }
            if (!bFit)
            {
                return(false);
            }

            if (z.Count != 0)
            {
                bFit = z.isPartOfRange(rangeZ);
            }
            return(bFit);
        }
Ejemplo n.º 4
0
        ///
        ///          <summary> * (20) get JDFShape attribute TotalDimensions </summary>
        ///          * <returns> JDFShape the value of the attribute, null if a the
        ///          *         attribute value is not a valid to create a JDFShape </returns>
        ///
        public virtual JDFShape getTotalDimensions()
        {
            string   strAttrName  = "";
            JDFShape nPlaceHolder = null;

            strAttrName = getAttribute(AttributeName.TOTALDIMENSIONS, null, JDFConstants.EMPTYSTRING);
            try
            {
                nPlaceHolder = new JDFShape(strAttrName);
            }
            catch (FormatException)
            {
                return(null);
            }
            return(nPlaceHolder);
        }
Ejemplo n.º 5
0
        ///
        ///          <summary> * (20) get JDFShape attribute CartonShape </summary>
        ///          * <returns> JDFShape the value of the attribute, null if a the
        ///          *         attribute value is not a valid to create a JDFShape </returns>
        ///
        public virtual JDFShape getCartonShape()
        {
            string   strAttrName  = "";
            JDFShape nPlaceHolder = null;

            strAttrName = getAttribute(AttributeName.CARTONSHAPE, null, JDFConstants.EMPTYSTRING);
            try
            {
                nPlaceHolder = new JDFShape(strAttrName);
            }
            catch (FormatException)
            {
                return(null);
            }
            return(nPlaceHolder);
        }
Ejemplo n.º 6
0
        ///
        ///	 <summary> * fitsTolerance - checks whether this Evaluation has a specified Tolerance
        ///	 * that it is not equal to "0 0", and expands the original rangelist to the
        ///	 * rangelist that fits Tolerance.
        ///	 *  </summary>
        ///	 * <param name="origRangeList">
        ///	 *            original rangelist </param>
        ///	 * <returns> NumberRangeList - expanded rangelist, returns original range if
        ///	 *         Tolerance=="0 0" </returns>
        ///
        private JDFShapeRangeList fitsTolerance(JDFShapeRangeList origRangeList)
        {
            double nt = getTolerance().X; // negative tolerance
            double pt = getTolerance().Y; // positive tolerance

            if ((nt == 0) && (pt == 0))
            {
                return(origRangeList);
            }

            // expand our original range into the range +/- Tolerance

            JDFShapeRangeList rangeList = new JDFShapeRangeList(origRangeList);

            JDFShapeRangeList tolRangeList = new JDFShapeRangeList();

            int size = rangeList.Count;

            for (int i = 0; i < size; i++)
            {
                JDFShapeRange range = (JDFShapeRange)rangeList[i];

                JDFShape left  = range.Left;
                double   leftX = left.Y;
                double   leftY = left.X;
                double   leftZ = left.Z;
                left.Y = leftX - nt;
                left.X = leftY - nt;
                left.Z = leftZ - nt;

                JDFShape right  = range.Right;
                double   rightX = right.Y;
                double   rightY = right.X;
                double   rightZ = right.Z;
                right.Y = rightX + pt;
                right.X = rightY + pt;
                right.Z = rightZ + pt;

                range.Left  = left;
                range.Right = right;

                tolRangeList.Append(range);
            }

            return(tolRangeList);
        }
Ejemplo n.º 7
0
        //
        //	 * // Element getter / setter
        //
        //
        //	 * (non-Javadoc)
        //	 *
        //	 * @see
        //	 * org.cip4.jdflib.resource.devicecapability.JDFAbstractState#addValue(java
        //	 * .lang.String, org.cip4.jdflib.datatypes.JDFBaseDataTypes.EnumFitsValue)
        //
        public override void addValue(string @value, EnumFitsValue testlists)
        {
            if (fitsValue(@value, testlists))
            {
                return;
            }

            JDFShape rect;

            try
            {
                rect = new JDFShape(@value);
            }
            catch (FormatException)
            {
                return; // nop for bad values
            }
            if (testlists == null || EnumFitsValue.Allowed.Equals(testlists))
            {
                JDFShapeRangeList list = getAllowedValueList();
                if (list == null)
                {
                    list = new JDFShapeRangeList();
                }
                list.Append(rect);
                setAllowedValueList(list);
            }
            if (testlists == null || EnumFitsValue.Present.Equals(testlists))
            {
                JDFShapeRangeList list = getPresentValueList();
                if (list == null || !hasAttribute(AttributeName.PRESENTVALUELIST))
                {
                    list = new JDFShapeRangeList();
                }
                list.Append(rect);
                setPresentValueList(list);
            }
        }
Ejemplo n.º 8
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual JDFComponent initOutputComponent(JDFNode node, JDFLayoutIntent li, string productType)
        {
            JDFComponent outComp = (JDFComponent)node.getCreateResource(ElementName.COMPONENT, EnumUsage.Output, 0);

            if (productType == null)
            {
                outComp.setComponentType(EnumComponentType.FinalProduct, EnumComponentType.Sheet);
            }
            else
            {
                outComp.setComponentType(EnumComponentType.PartialProduct, EnumComponentType.Sheet);
                outComp.setProductType(productType);
            }
            theNode.getResource(ElementName.LAYOUTINTENT, null, 0);
            JDFShape s = li.getFinishedDimensions().getActual();

            outComp.setDimensions(s);
            if (theNode != node)
            {
                theNode.getResourcePool().moveElement(outComp, null);
                theNode.linkResource(outComp, EnumUsage.Output, null);
            }
            return(outComp);
        }
Ejemplo n.º 9
0
 public virtual void setDefaultValue(JDFShape @value)
 {
     setAttribute(AttributeName.DEFAULTVALUE, @value.ToString(), null);
 }
Ejemplo n.º 10
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute CartonShape
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (36) set attribute CartonShape </summary>
 ///          * <param name="value">: the value to set the attribute to </param>
 ///
 public virtual void setCartonShape(JDFShape @value)
 {
     setAttribute(AttributeName.CARTONSHAPE, @value, null);
 }
Ejemplo n.º 11
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute BoxShape
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (36) set attribute BoxShape </summary>
 ///          * <param name="value">: the value to set the attribute to </param>
 ///
 public virtual void setBoxShape(JDFShape @value)
 {
     setAttribute(AttributeName.BOXSHAPE, @value, null);
 }
Ejemplo n.º 12
0
        ///
        ///	 <summary> * fitsXYZ - checks whether <code>rangelist</code> matches the (AllowedX,
        ///	 * AllowedY, AllowedZ) or (PresentX, PresentY, PresentZ) values specified
        ///	 * for this State
        ///	 *  </summary>
        ///	 * <param name="rangelist">
        ///	 *            range list to test </param>
        ///	 * <param name="xyzlist">
        ///	 *            switches between (AllowedX, AllowedY, AllowedZ) and (PresentX,
        ///	 *            PresentY, PresentZ). </param>
        ///	 * <returns> boolean - true, if the 'rangelist' matches xyzlist or if
        ///	 *         AllowedX, AllowedY, AllowedZ are not specified </returns>
        ///
        private bool fitsXYZ(JDFShapeRangeList rangelist, EnumFitsValue xyzlist)
        {
            int siz = rangelist.Count;

            for (int i = 0; i < siz; i++)
            {
                JDFShapeRange range = (JDFShapeRange)rangelist[i];

                JDFNumberRangeList x, y, z;

                JDFShape left  = range.Left;
                JDFShape right = range.Right;

                double         leftX  = left.Y;
                double         rightX = right.Y;
                JDFNumberRange rangeX = new JDFNumberRange(leftX, rightX);

                double         leftY  = left.X;
                double         rightY = right.X;
                JDFNumberRange rangeY = new JDFNumberRange(leftY, rightY);

                double         leftZ  = left.Z;
                double         rightZ = right.Z;
                JDFNumberRange rangeZ = new JDFNumberRange(leftZ, rightZ);

                if (xyzlist.Equals(EnumFitsValue.Allowed))
                {
                    x = getAllowedX();
                    y = getAllowedY();
                    z = getAllowedZ();
                }
                else
                {
                    x = getPresentX();
                    y = getPresentY();
                    z = getPresentZ();
                }

                bool bFit = true;
                if (x.Count != 0)
                {
                    bFit = x.isPartOfRange(rangeX);
                }
                if (!bFit)
                {
                    return(false);
                }

                if (y.Count != 0)
                {
                    bFit = y.isPartOfRange(rangeY);
                }
                if (!bFit)
                {
                    return(false);
                }

                if (z.Count != 0)
                {
                    bFit = z.isPartOfRange(rangeZ);
                }
                if (!bFit)
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 13
0
 public virtual void setAllowedValueMin(JDFShape @value)
 {
     setAttribute(AttributeName.ALLOWEDVALUEMIN, @value.ToString(), null);
 }
Ejemplo n.º 14
0
 public virtual void setPresentValueMin(JDFShape @value)
 {
     setAttribute(AttributeName.PRESENTVALUEMIN, @value.ToString(), null);
 }
Ejemplo n.º 15
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute TotalDimensions
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (36) set attribute TotalDimensions </summary>
 ///          * <param name="value">: the value to set the attribute to </param>
 ///
 public virtual void setTotalDimensions(JDFShape @value)
 {
     setAttribute(AttributeName.TOTALDIMENSIONS, @value, null);
 }
Ejemplo n.º 16
0
        //
        //	 * // Attribute getter/ setter
        //

        public virtual void setCurrentValue(JDFShape @value)
        {
            setAttribute(AttributeName.CURRENTVALUE, @value.ToString(), null);
        }
Ejemplo n.º 17
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute ClampSize
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (36) set attribute ClampSize </summary>
 ///          * <param name="value">: the value to set the attribute to </param>
 ///
 public virtual void setClampSize(JDFShape @value)
 {
     setAttribute(AttributeName.CLAMPSIZE, @value, null);
 }
Ejemplo n.º 18
0
 public virtual void setPreferred(JDFShape @value)
 {
     setAttribute(AttributeName.PREFERRED, @value.ToString(), null);
 }
Ejemplo n.º 19
0
 public virtual void setActual(JDFShape @value)
 {
     setAttribute(AttributeName.ACTUAL, @value.ToString(), null);
 }