| | |
| | | OnAxisStatusChanged?.Invoke(axisIndex, preStatus, curStatus); |
| | | } |
| | | |
| | | protected override void Start() |
| | | { |
| | | Task.Run(() => |
| | | { |
| | | Monitor(); |
| | | }); |
| | | } |
| | | public abstract List<AxisInfo> GetCurrentAxisInfo(params string[] axisName); |
| | | public abstract void Monitor(); |
| | | public abstract ResponseMessage MoveToPoint(IOperationConfig opConfig); |
| | |
| | | [Category("板卡配置")] |
| | | [DisplayName("卡号")] |
| | | [Description("CardNum:卡号")] |
| | | public int CardNum { get; set; } |
| | | public int CardNum { get; set; } = 1; |
| | | |
| | | [Category("板卡配置")] |
| | | [DisplayName("初始配置文件路径")] |
| | |
| | | protected override void Start() |
| | | { |
| | | AllAxisOn(); |
| | | |
| | | base.Start(); |
| | | } |
| | | |
| | | protected override void Stop() |
| | |
| | | /// <param name="value">false表示输出,true表示关闭</param> |
| | | public override void WriteOutput(short index, IOValue value) |
| | | { |
| | | short outNum = (short)(index % 100); |
| | | short outNum = (short)(index % 100 + 1); |
| | | if ((int)value <= 1) |
| | | { |
| | | GTSCardAPI.GT_SetDoBit((short)IConfig.CardNum, GTSCardAPI.MC_GPO, outNum, (short)value); |
| | |
| | | AxisMovingStatus axisMovingStatus = new AxisMovingStatus(); |
| | | axisMovingStatus.AxisIndex = axisConfig.AxisIndex; |
| | | axisMovingStatus.AxisName = axisConfig.AxisName; |
| | | axisMovingStatus.CurPosition = Convert.ToInt32(GetPosition(axisMovingStatus.AxisIndex)); |
| | | //axisMovingStatus.CurPosition = Convert.ToInt32(GetPosition(axisMovingStatus.AxisIndex)); |
| | | axisMovingStatus.Destination = Convert.ToInt32(GetPrfPosition(axisMovingStatus.AxisIndex)); |
| | | axisMovingStatus.CurVelocity = GetVelocity(axisMovingStatus.AxisIndex); |
| | | axisMovingStatus.PrfVelocity = GetPrfVelocity(axisMovingStatus.AxisIndex); |
| | | //axisMovingStatus.CurVelocity = GetVelocity(axisMovingStatus.AxisIndex); |
| | | //axisMovingStatus.PrfVelocity = GetPrfVelocity(axisMovingStatus.AxisIndex); |
| | | axisMovingStatus.AxisStatus = GetAxisStatus(axisMovingStatus.AxisIndex); |
| | | |
| | | axisMovingStatusesList.Add(axisMovingStatus); |
| | |
| | | private void InitialSetting() |
| | | { |
| | | //数据库迁移检查 |
| | | DatabaseInitialize.Initialize(); |
| | | //DatabaseInitialize.Initialize(); |
| | | |
| | | MotionCardSettingCheck(); |
| | | |
| | |
| | | using System.Threading.Tasks; |
| | | using static Bro.Common.Helper.EnumHelper; |
| | | |
| | | namespace Bro.Process |
| | | namespace Bro.Process |
| | | { |
| | | [Process("", DeviceAttributeType.Device)] |
| | | public partial class ProcessControl : IProcess |
| | |
| | | object res = null; |
| | | int reTryTimes = config.ReTryTimes; |
| | | IDevice device = DeviceCollection.FirstOrDefault(u => u.Id == deviceId); |
| | | LogAsync(DateTime.Now, $"{device.Name}调用{methodCode}开始", ""); |
| | | LogAsync(DateTime.Now, $"{device?.Name}调用{methodCode}开始", ""); |
| | | |
| | | Stopwatch sw = new Stopwatch(); |
| | | sw.Start(); |
| | |
| | | #endregion |
| | | |
| | | sw.Stop(); |
| | | LogAsync(DateTime.Now, $"{device.Name}调用{methodCode}完成,耗时{sw.ElapsedMilliseconds}ms", ""); |
| | | TimeRecordCSV(DateTime.Now, device.Name, $"{methodCode}调用完成", (int)sw.ElapsedMilliseconds); |
| | | LogAsync(DateTime.Now, $"{device?.Name}调用{methodCode}完成,耗时{sw.ElapsedMilliseconds}ms", ""); |
| | | TimeRecordCSV(DateTime.Now, device?.Name, $"{methodCode}调用完成", (int)sw.ElapsedMilliseconds); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | private void IoOut_DoubleClick(string desc, bool isOn) |
| | | { |
| | | var index = Convert.ToInt16(desc.Substring(3)); |
| | | MotionCard.WriteOutput(index, isOn ? IOValue.FALSE : IOValue.TRUE); |
| | | MotionCard.WriteOutput(index, isOn ? IOValue.TRUE : IOValue.FALSE); |
| | | } |
| | | |
| | | private void RefreshIOStatus(object sender, EventArgs e) |