private void ChkDropMethods_OnChecked(object sender, RoutedEventArgs e) { if (rbDropAllCollections.IsChecked == true) _command = DataCommandType.DropDbAndCreateExampleData; else _command = DataCommandType.CreateJobReadyForFinalizedPayment; MainWindow.MainWindowInstance.btnValidate_Click(null, null); }
public ExampleDataGenerator(SmartFeedback feedback, bool execute, DataCommandType command) { _feedback = feedback; _execute = execute; _command = command; }
public ModelCommandBeforeExecuteEventArgs(IDataCommand dataCommand, IDbCommand command, DataCommandType commandType) { DataCommand = dataCommand; Command = command; CommandType = commandType; }
public ModelCommandBeforeLoadedEventArgs(IDataCommand[] commands, DataCommandType commandType) { Commands = commands; CommandType = commandType; }
public DataCommand(IDbConnection connection, List <IParameter> parameters, DataCommandType commandType) : base(parameters, commandType) { }
public void ComSendData(Form1 Var, SerialPort Var1, DataCommandType Var2, float Var3) { switch (Var2) { case DataCommandType.ShippingCostCommand: //送料 命令 { Length = (Int32)(Var3 * Var.FeedingPulseReference); //145.513 SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ShippingCostCommand; SendDatas[2] = 0x04; SendDatas[3] = (byte)(Length % 256); SendDatas[4] = (byte)((Length % 65536) / 256); SendDatas[5] = (byte)((Length % 16777216) / 65536); SendDatas[6] = (byte)(Length / 16777216); SendDatas[7] = 0xEE; SendDatas[8] = 0xEF; Var1.Write(SendDatas, 0, 9); break; } case DataCommandType.ReturnMaterialCommand: //送料 命令 { Length = (Int32)(Var3 * Var.FeedingPulseReference); //145.513 SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ReturnMaterialCommand; SendDatas[2] = 0x04; SendDatas[3] = (byte)(Length % 256); SendDatas[4] = (byte)((Length % 65536) / 256); SendDatas[5] = (byte)((Length % 16777216) / 65536); SendDatas[6] = (byte)(Length / 16777216); SendDatas[7] = 0xEE; SendDatas[8] = 0xEF; Var1.Write(SendDatas, 0, 9); break; } case DataCommandType.StopCostCommand: //停止 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.StopCostCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.ClampElectromagneticValveCommand: //夹紧电磁阀 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ClampElectromagneticValveCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.ClampElectromagneticValveReleaseCommand: //夹紧电磁阀 松开 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ClampElectromagneticValveReleaseCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.DebugModeCancelCommand: //调试模式 取消所有 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.DebugModeCancelCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.RetreatKnifeCommand: //开槽气缸 退刀 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.RetreatKnifeCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.PushKnifeCommand: //开槽气缸 推刀 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.PushKnifeCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.SensorInformationCommand: //传感器信息 读取 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.SensorInformationCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.ScrewUpCommand: //丝杠向上 { Length = (Int32)(Var3 * Form1.ReferencePulseNumber); SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ScrewUpCommand; SendDatas[2] = 0x04; SendDatas[3] = (byte)(Length % 256); SendDatas[4] = (byte)((Length % 65536) / 256); SendDatas[5] = (byte)((Length % 16777216) / 65536); SendDatas[6] = (byte)(Length / 16777216); SendDatas[7] = 0xEE; SendDatas[8] = 0xEF; Var1.Write(SendDatas, 0, 9); break; } case DataCommandType.ScrewDownCommand: //丝杠向下 { Length = (Int32)(Var3 * Form1.ReferencePulseNumber); SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ScrewDownCommand; SendDatas[2] = 0x04; SendDatas[3] = (byte)(Length % 256); SendDatas[4] = (byte)((Length % 65536) / 256); SendDatas[5] = (byte)((Length % 16777216) / 65536); SendDatas[6] = (byte)(Length / 16777216); SendDatas[7] = 0xEE; SendDatas[8] = 0xEF; Var1.Write(SendDatas, 0, 9); break; } case DataCommandType.SlottedMotorRunCommand: //开槽电机 单独 运行 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.SlottedMotorRunCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.SlottedMotorCancelCommand: //开槽电机 单独 停止 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.SlottedMotorCancelCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.ZeroCalibrationCommand: //零位校准 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ZeroCalibrationCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.ChangeBladeCommand: //更换刀片 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.ChangeBladeCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.TestKnifeCommand: //角磨机和气缸 动作 试刀命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.TestKnifeCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.SlottedDataCommand: //开槽数据 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.SlottedDataCommand; SendDatas[2] = 0x0B; SendDatas[3] = (byte)(Var.PushTheKnifeTime % 256); SendDatas[4] = (byte)((Var.PushTheKnifeTime % 65536) / 256); //退刀时间 SendDatas[5] = (byte)(Var.SlotNumberofRepetitions); //开槽重复次数 SendDatas[6] = (byte)((Var.MaterialRemainingThickness * Form1.ReferencePulseNumber) % 256); SendDatas[7] = (byte)(((Var.MaterialRemainingThickness * Form1.ReferencePulseNumber) / 65536) / 256); // 开槽剩余厚度 SendDatas[8] = (byte)(((Var.MaterialThickness - Var.MaterialRemainingThickness) * Form1.ReferencePulseNumber) % 256); SendDatas[9] = (byte)((((Var.MaterialThickness - Var.MaterialRemainingThickness) * Form1.ReferencePulseNumber) / 65536) / 256); //开槽深度 SendDatas[10] = (byte)(Var.ZeroCalibrationPulseNumber % 256); SendDatas[11] = (byte)((Var.ZeroCalibrationPulseNumber / 65536) / 256); SendDatas[12] = (byte)((Var.ZeroCalibrationPulseNumber % 16777216) / 65536); //零位校准脉冲数 if (Var.SheetLossOptimization) //使能了 角磨机 磨损优化 { SendDatas[13] = (byte)Var.NumberofKnife; ////对刀次数 } else { SendDatas[13] = (byte)(Var.SlotNumberofRepetitions); //开槽重复次数 } SendDatas[14] = 0xEE; SendDatas[15] = 0xEF; Var1.Write(SendDatas, 0, 16); break; } case DataCommandType.SingleSlotCommand: //单次开槽 命令 { SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.SingleSlotCommand; SendDatas[2] = 0x00; SendDatas[3] = 0xEE; SendDatas[4] = 0xEF; Var1.Write(SendDatas, 0, 5); break; } case DataCommandType.FeedSlottedCommand: //送料开槽 命令 { Length = (Int32)(Var3 * Var.FeedingPulseReference); //145.513 SendDatas[0] = 0xEE; SendDatas[1] = (byte)DataCommandType.FeedSlottedCommand; SendDatas[2] = 0x04; SendDatas[3] = (byte)(Length % 256); SendDatas[4] = (byte)((Length % 65536) / 256); SendDatas[5] = (byte)((Length % 16777216) / 65536); SendDatas[6] = (byte)(Length / 16777216); SendDatas[7] = 0xEE; SendDatas[8] = 0xEF; Var1.Write(SendDatas, 0, 9); break; } } }