public void Import(string line, StateMachine machine) { var data = line.Split(' '); int i = 0; var id = int.Parse(data[i++]); Name = data[i++]; Id = int.Parse(data[i++]); var typeName = data[i++]; var configFile = data[i++]; ConfigFile = configFile; //load motion card var motioncard = Activator.CreateInstance(FrameworkManager.MotionCardTypes[typeName]) as IMotionCard; if (motioncard == null) { throw new Exception($"LOAD MOTION ERROR: {line}"); } Motion = motioncard; if (machine.MotionExs.ContainsKey(id)) { return; } machine.MotionExs.Add(id, this); }
public MotionCardWrapper(IMotionCard motion) { if (motion == null) { return; } Name = (motion)?.Name; Id = motion.DeviceID; Motion = motion; }
public void UpdateEleStatus(IMotionCard _motion) { if (CurEle.Enable && _motion != null) { var val = -1; _motion.ReadSingleDOutput(_motion.DevIndex, 0, CurEle.Port, out val); if (val != -1) { tBoxName.BackColor = (val == 0) ? Color.LightGray : System.Drawing.Color.Lime; } } }
public MotionCardWrapper(IMotionCard motion) { if (motion == null) { return; } Name = (motion as IPrim)?.Name; Index = motion.DevIndex; Motion = motion; Trigger = motion; Interp = motion; }
public void UpdateEleStatus(IMotionCard motion) { if (motion != null) { motion.ReadStatus(CurEle.AxisChannel); if (motion.AxisIsAlarm(0, CurEle.AxisChannel)) { tBoxName.BackColor = Color.Red; } else { tBoxName.BackColor = motion.AxisIsStop(0, CurEle.AxisChannel) ? Color.Lime : Color.LightGray; } } }
public void UpdateEleStatus(IMotionCard _motion) { if (CurEle.Enable) { var val = -1; if (_motion != null) { _motion.ReadSingleDInput(_motion.DevIndex, 0, CurEle.Port, out val); } if (val != -1) { tBoxName.BackColor = (val == 0) ? Color.LightGray : Color.Lime; } } }
private void btnRun_Click(object sender, EventArgs e) { var prim = DevPrimsManager.Instance.GetPrimByName(_axis.Driver); if (prim == null) { MessageBox.Show("没有找到名称为: " + _axis.Driver + " 的设备!"); return; } if (_motion != prim) { _motion = (IMotionCard)prim; } tmrUpdateAxis.Start(); }
private void btnRun_Click(object sender, EventArgs e) { IPrim prim = DevPrimsManager.Instance.GetPrimByName(_di.Driver); if (prim == null) { MessageBox.Show("没有找到名称为: " + _di.Driver + " 的设备!"); return; } if (_motion != prim) { _motion = (IMotionCard)prim; } btnRun.BackColor = Color.Green; tmrUpdateCylinder.Start(); }
public void UpdateEleStatus(IMotionCard motion) { if (motion != null) { var org = 0; var work = 0; motion.ReadSingleDInput(motion.DevIndex, 0, CurEle.DiOrg, out org); motion.ReadSingleDInput(motion.DevIndex, 0, CurEle.DiWork, out work); if (org == 1 && work == 0) { tBoxName.BackColor = Color.LightGray; } else if (org == 0 && work == 1) { tBoxName.BackColor = Color.Lime; } else { tBoxName.BackColor = Color.Red; } } }
public IOCardWrapper(IMotionCard motion) { Index = _motion.DevIndex; _motion = motion; }