Пример #1
0
 public BaseCadenceTarget(IStep parent)
     : base(ITarget.TargetType.Cadence, parent)
 {
     ConcreteTarget = new CadenceZoneSTTarget(this);
 }
Пример #2
0
        public override void HandleTargetOverride(XmlNode extensionNode)
        {
            // We got here so our target must be a range
            Debug.Assert(ConcreteTarget.Type == BaseCadenceTarget.IConcreteCadenceTarget.CadenceTargetType.Range);

            IZoneCategory referenceZones = Options.Instance.CadenceZoneCategory;
            string zoneReferenceId = null;
            int zoneIndex = -1;

            for (int j = 0; j < extensionNode.ChildNodes.Count; ++j)
            {
                XmlNode childNode = extensionNode.ChildNodes[j];

                if (childNode.Name == "Id" && childNode.ChildNodes.Count == 1 &&
                    childNode.FirstChild.GetType() == typeof(XmlText))
                {
                    zoneReferenceId = childNode.FirstChild.Value;
                }
                else if (childNode.Name == "Index" && childNode.ChildNodes.Count == 1 &&
                    childNode.FirstChild.GetType() == typeof(XmlText) &&
                    Utils.IsTextIntegerInRange(childNode.FirstChild.Value, (UInt16)1, (UInt16)referenceZones.Zones.Count))
                {
                    zoneIndex = int.Parse(childNode.FirstChild.Value);
                }
            }

            if (zoneReferenceId == referenceZones.ReferenceId && zoneIndex != -1)
            {
                ConcreteTarget = new CadenceZoneSTTarget(referenceZones.Zones[zoneIndex], this);
            }
        }