public FATrayPickerUpDownServo(FASequenceManager aSequenceManager)
            : base(aSequenceManager)
        {
            PickPos = new FAMMCPosition();
            MoveStandbyPos = new FAPartAction();
            MoveGripPos = new FAPartAction();
            MovePickPos = new FAPartAction();
            MovePlacePos = new FAPartAction();
            MoveTrayPushPos = new FAPartAction();

            MoveStandbyPos.SetActionMethod(DoMoveStandbyPos);
            MoveGripPos.SetActionMethod(DoMoveGripPos);
            MovePickPos.SetActionMethod(DoMovePickPos);
            MovePlacePos.SetActionMethod(DoMovePlacePos);
            MoveTrayPushPos.SetActionMethod(DoMoveTrayPushPos);

            MoveStandbyPos.CreateSequence(aSequenceManager);
            MoveGripPos.CreateSequence(aSequenceManager);
            MovePickPos.CreateSequence(aSequenceManager);
            MovePlacePos.CreateSequence(aSequenceManager);
            MoveTrayPushPos.CreateSequence(aSequenceManager);

            MakeMoveStandbyPos();
            MakeMoveGripPos();
            MakeMovePickPos();
            MakeMovePlacePos();
            MakeMoveTrayPushPos();
        }
 private void MakeSequence(FAMMCPosition position, FAPartAction action, FALibrary.Utility.FATime time, string alarmPropertyName)
 {
     PositionUtility obj = new PositionUtility();
     obj.Part = this;
     obj.Position = position;
     obj.PartAction = action;
     obj.Timeout = time;
     obj.AlarmPropertyName = alarmPropertyName;
     obj.Initialize();
 }
        public void Initialize()
        {
            if (Part == null) return;

            FAFramework.Utility.BindingUtility.SetBindingObject(labelORG, BindingMode.OneWay, Part, Label.IsEnabledProperty, "Origin");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelEZ, BindingMode.OneWay, Part, Label.IsEnabledProperty, "EncoderZ");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelEMG, BindingMode.OneWay, Part, Label.IsEnabledProperty, "Emergency");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelINP, BindingMode.OneWay, Part, Label.IsEnabledProperty, "InPosition");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelARM, BindingMode.OneWay, Part, Label.IsEnabledProperty, "ServoAlarm");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelPOSLMT, BindingMode.OneWay, Part, Label.IsEnabledProperty, "PositiveLimit");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelNEGLMT, BindingMode.OneWay, Part, Label.IsEnabledProperty, "NegativeLimit");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelRUN, BindingMode.OneWay, Part, Label.IsEnabledProperty, "RunFlag");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelERR, BindingMode.OneWay, Part, Label.IsEnabledProperty, "ErrorFlag");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelHOME, BindingMode.OneWay, Part, Label.IsEnabledProperty, "HomeFlag");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelSON, BindingMode.OneWay, Part, Label.IsEnabledProperty, "ServoOn");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelCommandPos, BindingMode.OneWay, Part, Label.ContentProperty, "CommandPos");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelActualPos, BindingMode.OneWay, Part, Label.ContentProperty, "ActualPos");
            FAFramework.Utility.BindingUtility.SetBindingObject(textBoxJogSpeed, BindingMode.TwoWay, Part, TextBox.TextProperty, "JogMoveSpeed");

            FAFramework.Utility.BindingUtility.SetBindingObject(buttonSetPos, BindingMode.OneWay, Part, Button.IsEnabledProperty, "MotionDone");

            _position = Part.TargetPosition;
            BindingPositionConfig(_position);

            _timer.Tick += OnTick;
            _timer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            _timer.Start();

            if (UseSyncSlave == true && SlavePart != null)
            {
                Part.LinkMode = true;
                Part.LinkRatio = 1;
                Part.SlaveAxis = SlavePart.AxisNo;
                Part.SetLinkMode(Part.SlaveAxis, 1);
            }
        }
예제 #4
0
 public XYZPositionGroup()
 {
     PositionX = new FAMMCPosition();
     PositionY = new FAMMCPosition();
     PositionZ = new FAMMCPosition();
 }
        private void AddPositionConfigToListView()
        {
            PositionList = new List<FAMMCPosition>();
            PropertyInfo[] propList;
            propList = Part.GetType().GetProperties();

            foreach (PropertyInfo info in propList)
            {
                if (info.PropertyType == typeof(FAMMCPosition))
                {
                    PositionList.Add((FAMMCPosition)info.GetValue(Part, null));
                }
            }

            ListView listView = Utility.AttributeUtility.CreateListView(this, "PositionList");
            listView.Margin = new Thickness(2);
            listView.SelectionChanged +=
                delegate(object sender, SelectionChangedEventArgs e)
                {
                    if (listView.SelectedItem != null)
                    {
                        _position = (FAMMCPosition)listView.SelectedItem;
                        BindingPositionConfig(_position);
                    }
                };

            gridBase.Children.Add(listView);
            Grid.SetColumn(listView, 1);

            UIUtility.RemoveColumn(listView, "RangeList");
        }
        public void Initialize()
        {
            if (Part == null) return;

            if (Unit != null && Unit != "")
            {
                labelCommandPosUnit.Content = Unit;
                labelActualPosUnit.Content = Unit;
            }

            FAFramework.Utility.BindingUtility.SetBindingObject(labelORG, BindingMode.OneWay, Part, Label.IsEnabledProperty, "Origin");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelEZ, BindingMode.OneWay, Part, Label.IsEnabledProperty, "EncoderZ");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelEMG, BindingMode.OneWay, Part, Label.IsEnabledProperty, "Emergency");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelINP, BindingMode.OneWay, Part, Label.IsEnabledProperty, "InPosition");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelARM, BindingMode.OneWay, Part, Label.IsEnabledProperty, "ServoAlarm");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelPOSLMT, BindingMode.OneWay, Part, Label.IsEnabledProperty, "PositiveLimit");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelNEGLMT, BindingMode.OneWay, Part, Label.IsEnabledProperty, "NegativeLimit");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelRUN, BindingMode.OneWay, Part, Label.IsEnabledProperty, "RunFlag");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelERR, BindingMode.OneWay, Part, Label.IsEnabledProperty, "ErrorFlag");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelHOME, BindingMode.OneWay, Part, Label.IsEnabledProperty, "HomeFlag");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelSON, BindingMode.OneWay, Part, Label.IsEnabledProperty, "ServoOn");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelCommandPos, BindingMode.OneWay, Part, Label.ContentProperty, "CommandPos");
            FAFramework.Utility.BindingUtility.SetBindingObject(labelActualPos, BindingMode.OneWay, Part, Label.ContentProperty, "ActualPos");
            FAFramework.Utility.BindingUtility.SetBindingObject(textBoxJogSpeed, BindingMode.TwoWay, Part, TextBox.TextProperty, "JogMoveSpeed");

            FAFramework.Utility.BindingUtility.SetBindingObject(buttonSetPos, BindingMode.OneWay, Part, Button.IsEnabledProperty, "MotionDone");

            _position = Part.TargetPosition;
            BindingPositionConfig(_position);
            AddPositionConfigToListView();

            _timer.Tick += OnTick;
            _timer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            _timer.Start();
        }
 private void BindingPositionConfig(FAMMCPosition position)
 {
     FAFramework.Utility.BindingUtility.SetBindingObject(textBoxPosition, BindingMode.TwoWay, position, TextBox.TextProperty, "Position");
     FAFramework.Utility.BindingUtility.SetBindingObject(textBoxStartSpeed, BindingMode.TwoWay, position, TextBox.TextProperty, "StartSpeed");
     FAFramework.Utility.BindingUtility.SetBindingObject(textBoxMoveSpeed, BindingMode.TwoWay, position, TextBox.TextProperty, "DriveSpeed");
     FAFramework.Utility.BindingUtility.SetBindingObject(textBoxAccTime, BindingMode.TwoWay, position, TextBox.TextProperty, "AccelTime");
     FAFramework.Utility.BindingUtility.SetBindingObject(textBoxDecTime, BindingMode.TwoWay, position, TextBox.TextProperty, "DecelTime");
 }
 public void SetPlasePos(FAMMCPosition position)
 {
     position.CopyTo(PlacePos);
 }
 public void SetPickPos(FAMMCPosition position)
 {
     position.CopyTo(PickPos);
 }
예제 #10
0
 public PositionGroup()
 {
     XPosition = new FAMMCPosition();
     YPosition = new FAMMCPosition();
     ZPosition = new FAMMCPosition();
 }
예제 #11
0
        public void MovePositionNoCopyTargetPosition(FAMMCPosition positionDefine)
        {
            if (SimulationMode)
            {
                ServoOn = true;
                CommandPos = positionDefine.Position;
                ActualPos = CommandPos;
                MotionDone = true;
            }
            else
            {
                if (IsMotionDone() && IsInPosition(positionDefine))
                    return;
                else
                {
                    if (LinkMode)
                        SetLinkMode(SlaveAxis, LinkRatio);

                    double startSpeed = ((double)positionDefine.StartSpeed * (double)SpeedRate) / 100.0;
                    double driveSpeed = ((double)positionDefine.DriveSpeed * (double)SpeedRate) / 100.0;

                    Device.MovePos(AxisNo,
                        (int)(positionDefine.Position / Scale),
                        SpeedMode,
                        (startSpeed / Scale),
                        (driveSpeed / Scale),
                        (positionDefine.AccelTime),
                        (positionDefine.DecelTime));
                }
            }
        }
예제 #12
0
        public void MoveIncPosition(FAMMCPosition positionDefine)
        {
            if (SimulationMode)
            {
                ServoOn = true;
                CommandPos += positionDefine.Position;
                ActualPos += positionDefine.Position;
                MotionDone = true;
            }
            else
            {
                if (IsMotionDone() && IsInPosition(positionDefine))
                    return;
                else
                {
                    double startSpeed = ((double)positionDefine.StartSpeed * (double)SpeedRate) / 100.0;
                    double driveSpeed = ((double)positionDefine.DriveSpeed * (double)SpeedRate) / 100.0;

                    Device.MoveIncPos(AxisNo,
                        (int)(positionDefine.Position / Scale),
                        SpeedMode,
                        (startSpeed / Scale),
                        (driveSpeed / Scale),
                        positionDefine.AccelTime,
                        positionDefine.DecelTime);
                }
            }
        }
예제 #13
0
 public bool IsInPosition(FAMMCPosition position, double tolerance)
 {
     if (Math.Abs(ActualPos - position.Position) <= tolerance &&
         Math.Abs(CommandPos - position.Position) <= tolerance)
         return true;
     else
         return false;
 }
예제 #14
0
        private void LoadPositionDefine(XElement xml, bool reload)
        {
            foreach (XElement item in xml.Elements())
            {
                double position = 0;
                uint startSpeed = 0;
                uint driveSpeed = 0;
                uint accelTime = 0;
                uint decelTime = 0;

                string name = item.Element("Name").Value.ToString();

                if (item.Element("Position") != null)
                    if (double.TryParse(item.Element("Position").Value.Trim(), out position) == false)
                        throw new Exception("Position Value is not double.\n" +
                            "Part Name : " + Name + ", " +
                            "Position : " + item.Element("Position").Value);

                if (item.Element("StartSpeed") != null)
                    if (uint.TryParse(item.Element("StartSpeed").Value.Trim(), out startSpeed) == false)
                        throw new Exception("StartSpeed Value is not Unsigned Integer.\n" +
                            "Part Name : " + Name + ", " +
                            "StartSpeed : " + item.Element("StartSpeed").Value);

                if (item.Element("DriveSpeed") != null)
                    if (uint.TryParse(item.Element("DriveSpeed").Value.Trim(), out driveSpeed) == false)
                        throw new Exception("DriveSpeed Value is not Unsigned Integer.\n" +
                            "Part Name : " + Name + ", " +
                            "DriveSpeed : " + item.Element("DriveSpeed").Value);

                if (item.Element("AccelTime") != null)
                    if (uint.TryParse(item.Element("AccelTime").Value.Trim(), out accelTime) == false)
                        throw new Exception("AccelTime Value is not Unsigned Integer.\n" +
                            "Part Name : " + Name + ", " +
                            "AccelTime : " + item.Element("AccelTime").Value);

                if (item.Element("DecelTime") != null)
                    if (uint.TryParse(item.Element("DecelTime").Value.Trim(), out decelTime) == false)
                        throw new Exception("DecelTime Value is not Unsigned Integer.\n" +
                            "Part Name : " + Name + ", " +
                            "DecelTime : " + item.Element("DecelTime").Value);

                if (reload)
                {
                    var positionDefine = FAReflection.GetPropertyValue(this, name) as FAMMCPosition;
                    positionDefine.Name = name;
                    positionDefine.Position = position;
                    positionDefine.StartSpeed = startSpeed;
                    positionDefine.DriveSpeed = driveSpeed;
                    positionDefine.AccelTime = accelTime;
                    positionDefine.DecelTime = decelTime;
                }
                else
                {
                    FAMMCPosition positionDefine = new FAMMCPosition();
                    positionDefine.Name = name;
                    positionDefine.Position = position;
                    positionDefine.StartSpeed = startSpeed;
                    positionDefine.DriveSpeed = driveSpeed;
                    positionDefine.AccelTime = accelTime;
                    positionDefine.DecelTime = decelTime;
                    FAReflection.SetPropertyValue(this, name, positionDefine);
                }
            }
        }
예제 #15
0
        private void CreatePositionDefine()
        {
            PropertyInfo[] propList;
            propList = this.GetType().GetProperties();

            foreach (PropertyInfo info in propList)
            {
                if (info.PropertyType == typeof(FAMMCPosition))
                {
                    FAMMCPosition pos = new FAMMCPosition();
                    info.SetValue(this, pos, null);
                }
            }
        }