|
|
|
@ -11,6 +11,7 @@ using Mesnac.Action.Base;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Entity.PptPlan;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.ChemicalWeighingPlc;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Entity;
|
|
|
|
|
using Steema.TeeChart.Styles;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
|
|
|
|
|
{
|
|
|
|
@ -89,27 +90,33 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string weighbridge = clientGridView.SelectedRows[0].Cells["Weighbridge"].Value.ToString();
|
|
|
|
|
//任务还在称量中,不允许下发计划
|
|
|
|
|
if (weighbridge == "1号地磅")
|
|
|
|
|
{
|
|
|
|
|
int status = BasePlcHelper.Instance.solvent_SystemRuning.NowValue.ToInt();
|
|
|
|
|
if (status == 1)
|
|
|
|
|
if (string.IsNullOrEmpty(weighbridge))
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("配方还在正在执行中,请勿下发!");
|
|
|
|
|
ICSharpCode.Core.LoggingService<PlanDownloadAction>.Error("{生产计划-手动下发计划} 配方正在执行中...");
|
|
|
|
|
MessageBox.Show("地磅为空,不可以下发任务!");
|
|
|
|
|
ICSharpCode.Core.LoggingService<PlanDownloadAction>.Error("{生产计划-手动下发计划} 地磅为空.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (weighbridge == "2号地磅")
|
|
|
|
|
{
|
|
|
|
|
int status = BasePlcHelper.Instance.solvent2_SystemRuning.NowValue.ToInt();
|
|
|
|
|
if (status ==1)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("配方还在正在执行中,请勿下发!");
|
|
|
|
|
ICSharpCode.Core.LoggingService<PlanDownloadAction>.Error("{生产计划-手动下发计划} 配方正在执行中...");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//任务还在称量中,不允许下发计划
|
|
|
|
|
//if (weighbridge == "1号地磅")
|
|
|
|
|
//{
|
|
|
|
|
// int status = BasePlcHelper.Instance.solvent_SystemRuning.NowValue.ToInt();
|
|
|
|
|
// if (status == 1)
|
|
|
|
|
// {
|
|
|
|
|
// MessageBox.Show("配方还在正在执行中,请勿下发!");
|
|
|
|
|
// ICSharpCode.Core.LoggingService<PlanDownloadAction>.Error("{生产计划-手动下发计划} 配方正在执行中...");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//if (weighbridge == "2号地磅")
|
|
|
|
|
//{
|
|
|
|
|
// int status = BasePlcHelper.Instance.solvent2_SystemRuning.NowValue.ToInt();
|
|
|
|
|
// if (status ==1)
|
|
|
|
|
// {
|
|
|
|
|
// MessageBox.Show("配方还在正在执行中,请勿下发!");
|
|
|
|
|
// ICSharpCode.Core.LoggingService<PlanDownloadAction>.Error("{生产计划-手动下发计划} 配方正在执行中...");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取选中计划、获取选中物料
|
|
|
|
@ -119,19 +126,18 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
|
|
|
|
|
List<MetagePlan> list = (materialList.Concat(emptList)).ToList();
|
|
|
|
|
//下传计划给PLC
|
|
|
|
|
|
|
|
|
|
bool IsSucess;
|
|
|
|
|
bool IsSucess=false;
|
|
|
|
|
if (weighbridge=="1号地磅")
|
|
|
|
|
{
|
|
|
|
|
IsSucess = PlcPlanHelper.DownloadPlanDataToWeighbridge1Plc(list);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (weighbridge == "2号地磅")
|
|
|
|
|
{
|
|
|
|
|
IsSucess = PlcPlanHelper.DownloadPlanDataToWeighbridge2Plc(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (IsSucess)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//回写计划任务状态 3:任务执行中
|
|
|
|
|
PlanHelper.UpdatePlanState1(selectedPlanId, 3);
|
|
|
|
|
MessageBox.Show("计划任务下发成功!");
|
|
|
|
|