删除么有用的报表

dep_nodyang
nodyang 1 year ago
parent dfcfd01e71
commit 4618441c44

@ -46,7 +46,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo
dataGridView = control.FirstOrDefault(x => x.Name == "MCDataGridView1") as DataGridView;
dataGridView.AutoGenerateColumns = true;
mCDateTimePicker.Value = DateTime.Now.AddDays(-1);
mCDateTimePicker.Value = DateTime.Now.AddDays(0);
dt=new DataTable();
dt.Columns.Add("机台",typeof(string));

@ -0,0 +1,63 @@
using FreeSql.DataAnnotations;
using FreeSql.Extensions.EntityUtil;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor
{
[Table(Name = "OpenDoor")]
public class OpenDoorEntity
{
[Column(IsPrimary = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 设备编号
/// </summary>
public int? DeviceId { get; set; }
/// <summary>
/// 有料的时间
/// </summary>
public DateTime? OpenTime { get; set; }
/// <summary>
/// 当前时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 状态
/// </summary>
public int Status { get; set; }
}
public class OpenDoorService
{
public static void Insert(OpenDoorEntity entity)
{
var ctx= FreeDb.FreeSqlUnit.Instance;
var openDoorEntity = ctx.Queryable<OpenDoorEntity>().Where(x => x.Status == entity.Status)
.Where(x => x.DeviceId == entity.DeviceId).OrderByDescending(x => x.CreateTime)
.Limit(1).ToOne();
if (openDoorEntity == null || entity.Status!=openDoorEntity.Status)
{
ctx.Insert(entity).ExecuteInserted();
}
}
}
}

@ -8,6 +8,7 @@ using Mesnac.Action.ChemicalWeighing.FreeDb;
using Mesnac.Action.ChemicalWeighing.InterfaceDocking;
using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity;
using Mesnac.Action.ChemicalWeighing.LjMaterial;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Basic;
using Mesnac.Controls.Base;
using Mesnac.Core.Service;
@ -178,6 +179,15 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
private void Time(int deviceNo,int statu)
{
OpenDoorService.Insert(new OpenDoorEntity()
{
DeviceId = deviceNo,
OpenTime = DateTime.Now,
CreateTime = DateTime.Now,
Status = statu
});
TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity()
{
reqCode = System.Guid.NewGuid().ToString(),

@ -466,6 +466,7 @@
<Compile Include="LjRecipeData\UpdateAction.cs" />
<Compile Include="LjReport\DayWhiteEmbryo\DayWhiteEmbryoEntity.cs" />
<Compile Include="LjReport\DayWhiteEmbryo\DayWhiteEmbryoInitDb.cs" />
<Compile Include="LjReport\OpenDoor\OpenDoorEntity.cs" />
<Compile Include="LjStock\FrmStock.cs">
<SubType>Form</SubType>
</Compile>
@ -609,6 +610,7 @@
<Compile Include="Report\GelDoser\InitFormAction.cs" />
<Compile Include="Report\GelDoser\SelectAction.cs" />
<Compile Include="Report\GelDoser\SelectRowAction.cs" />
<Compile Include="Report\OpenDoor\OpenDoor.cs" />
<Compile Include="Report\ReportHelper.cs" />
<Compile Include="Report\WetMixer\ExportAction.cs" />
<Compile Include="Report\WetMixer\InitFormAction.cs" />

@ -1,77 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.BarcodeReport
{
/// <summary>
/// 查询条码扫描信息
/// </summary>
class SelectBarcodeAction : ChemicalWeighingAction, IAction
{
private RuntimeParameter _runtime;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _clientDGV = null;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
ICSharpCode.Core.LoggingService<SelectBarcodeAction>.Debug("条码扫描信息报表-查询..");
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"SELECT *, CASE Scan_State WHEN '1' THEN '通过' ELSE '不通过' END AS 'state' FROM LR_BarcodeLog WHERE 1=1 ");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And Scan_Time >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectBarcodeAction>.Debug("{条码扫描信息报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And Scan_Time <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectBarcodeAction>.Debug("{条码扫描信息报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_BarcodeLog").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectBarcodeAction>.Warn("{条码扫描信息报表-查询} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
_clientDGV.BaseControl.BindDataSource = null;
_clientDGV.BaseControl.BindDataSource = table;
}
}
}

@ -1,82 +0,0 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport
{
/// <summary>
/// 导出物料统计报表业务
/// </summary>
class ExportAction : ChemicalWeighingAction, IAction
{
private DbMCControl _clientDGV = null;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<ExportAction>.Debug("物料统计-导出...");
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "xls files(*.xls)|*.xls";
sfd.FileName = String.Format("物料统计报表_{0:yyyyMMdd}", DateTime.Now);
sfd.AddExtension = true;
DialogResult result = sfd.ShowDialog();
if (result == DialogResult.OK)
{
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_weigh").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Warn("{物料统计报表-导出} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
DataTable dt = _clientDGV.BaseControl.BindDataSource as DataTable;
dt.Columns["Recipe_Name"].ColumnName = "配方名";
dt.Columns["Material_Code"].ColumnName = "物料代码";
dt.Columns["Material_name"].ColumnName = "物料名";
dt.Columns["realWeight"].ColumnName = "重量(kg)";
string fileName = sfd.FileName;
if (!String.IsNullOrEmpty(fileName))
{
try
{
System.IO.Stream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite);
Mesnac.Basic.DataToFileHandler.Instance.ToExcel(dt, ref fs);
fs.Close();
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_MaterialStatisticsReport_ExportAction_msg1")); //导出物料统计数据至Excel成功!
ICSharpCode.Core.LoggingService<ExportAction>.Info(msg1);
#region 记录操作日志
base.DBLog(msg1);
#endregion
MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
string msg2 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_MaterialStatisticsReport_ExportAction_msg2")); //导出物料统计数据至Excel失败:{0}!
msg2 = String.Format(msg2, ex.Message);
ICSharpCode.Core.LoggingService<ExportAction>.Error(msg2);
#region 记录操作日志
base.DBLog(msg2);
#endregion
MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
runtime.IsReturn = true;
return;
}
}
}
}
}
}

@ -1,128 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.MaterialManage;
using Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe;
using Mesnac.Action.ChemicalWeighing.Technical.PmtRecipe.entity;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport
{
public class InitFormAction : ChemicalWeighingAction, IAction
{
private DbMCControl _dgvLRPlan = null;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _clientDGV = null;
private IBaseControl _recipeName = null; //配方名
private string[] DataTypeArray = { "--", "早", "中", "晚" };
private string[] materialDataTypeArray;
private string[] recipeDataTypeArray;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
starttime.MCValue = DateTime.Parse("00:00:00");
endtime.MCValue = DateTime.Parse("23:59:59");
this._recipeName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_RecipeInfo].[recipe_Name]").FirstOrDefault().BaseControl;
#region 下拉框班次加载
ComboBox comboBox1 = base.GetControlById("MCCombobox1") as ComboBox;
List<string> DataType = new List<String>(DataTypeArray);
comboBox1.DataSource = DataType;
#endregion
#region 下拉框物料名称加载
List<Base_MaterialInfo> base_MaterialInfos = MaterialHelper.getMaterialList();
materialDataTypeArray = new string[base_MaterialInfos.Count + 1];
materialDataTypeArray[0] = "--";
for (int i = 0; i < base_MaterialInfos.Count; i++)
{
materialDataTypeArray[i + 1] = base_MaterialInfos[i].materialName;
}
ComboBox comboBox2 = base.GetControlById("MCCombobox3") as ComboBox;
comboBox2.DataSource = materialDataTypeArray;
#endregion
#region 下拉框配方名称加载
ComboBox comboBox3 = base.GetControlById("MCCombobox2") as ComboBox;
List<Base_RecipeInfo> base_RecipeInfos = RecipeHelper.GetBaseRecipeInfo();
recipeDataTypeArray = new string[base_RecipeInfos.Count + 1];
recipeDataTypeArray[0] = "--";
for (int i = 0; i < base_RecipeInfos.Count; i++)
{
recipeDataTypeArray[i + 1] = base_RecipeInfos[i].recipeName;
}
comboBox3.DataSource = recipeDataTypeArray;
#endregion
//2.按名称累加物料统计
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"SELECT Base_PlanInfo.recipe_Name AS Recipe_Name,Base_MaterialInfo.material_Id AS Material_Code,Base_MaterialInfo.material_Name AS Material_Name, SUM(LR_Weigh.Real_Weight) as realWeight,Pmt_Shiftime.Shift_name FROM
LR_weigh,Base_PlanInfo,Base_RecipeInfo,Base_MaterialInfo,Pmt_Shiftime
WHERE Base_PlanInfo.plan_Id = LR_weigh.Plan_id AND Base_MaterialInfo.material_Id = LR_weigh.Material_Code AND Base_RecipeInfo.recipe_Id = LR_weigh.Recipe_code AND Pmt_Shiftime.Shift_id = Base_PlanInfo.plan_Team ");
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
sbSql.Append(" GROUP BY Base_PlanInfo.recipe_Name,Base_MaterialInfo.material_Id,Base_MaterialInfo.material_Name,Pmt_Shiftime.Shift_name");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_weigh").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Warn("{物料统计报表-查询} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
_clientDGV.BaseControl.BindDataSource = null;
_clientDGV.BaseControl.BindDataSource = table;
}
}
}

@ -1,123 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Test;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.MaterialStatisticsReport
{
/// <summary>
/// 物料统计报表
/// </summary>
class SelectWeightAction : ChemicalWeighingAction, IAction
{
public static event EventHandler MaterialSynchronousComplete;
private RuntimeParameter _runtime;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _clientDGV = null;
private IBaseControl _recipeName = null; //配方名
private IBaseControl _shiftName = null; //班次
private IBaseControl _materialName = null; //物料名称
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("物料统计报表-查询..");
//1.按配方、按时间、按班次物料统计
//ComboBox comboBox = base.GetControlById("MCCombobox1") as ComboBox;
//if (SelectWeightAction.MaterialSynchronousComplete != null)
//{
// SelectWeightAction.MaterialSynchronousComplete(null, EventArgs.Empty);
//}
//2.按名称累加物料统计
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
StringBuilder sbSql = new StringBuilder(@"SELECT Base_PlanInfo.recipe_Name AS Recipe_Name,Base_MaterialInfo.material_Id AS Material_Code,Base_MaterialInfo.material_Name AS Material_Name, SUM(LR_Weigh.Real_Weight) as realWeight,Pmt_Shiftime.Shift_name FROM
LR_weigh,Base_PlanInfo,Base_RecipeInfo,Base_MaterialInfo,Pmt_Shiftime
WHERE Base_PlanInfo.plan_Id = LR_weigh.Plan_id AND Base_MaterialInfo.material_Id = LR_weigh.Material_Code AND Base_RecipeInfo.recipe_Id = LR_weigh.Recipe_code AND Pmt_Shiftime.Shift_id = Base_PlanInfo.plan_Team ");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And LR_Weigh.Weight_Time <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Debug("{物料统计报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
//配方名称、物料名称及班次
this._recipeName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_RecipeInfo].[recipe_Name]").FirstOrDefault().BaseControl;
this._shiftName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Pmt_Shiftime].[Shift_name]").FirstOrDefault().BaseControl;
this._materialName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_MaterialInfo].[material_Name]").FirstOrDefault().BaseControl;
if (!String.IsNullOrEmpty(this._recipeName.MCValue.ToString()))
{
if (_recipeName.MCValue.ToString() != "--")
{
sbSql.AppendLine(@"And Base_PlanInfo.Recipe_Name = '" + _recipeName.MCValue.ToString() + "' ");
}
}
if (!String.IsNullOrEmpty(this._shiftName.MCValue.ToString()))
{
if (_shiftName.MCValue.ToString() != "--")
{
sbSql.AppendLine(@"And Shift_Name = '" + _shiftName.MCValue.ToString() + "' ");
}
}
if (!String.IsNullOrEmpty(this._materialName.MCValue.ToString()))
{
if (_materialName.MCValue.ToString() != "--")
{
sbSql.AppendLine(@"And Material_Name = '" + _materialName.MCValue.ToString() + "' ");
}
}
sbSql.Append(" GROUP BY Base_PlanInfo.recipe_Name,Base_MaterialInfo.material_Id,Base_MaterialInfo.material_Name,Pmt_Shiftime.Shift_name");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
this._clientDGV = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "LR_weigh").FirstOrDefault();
if (_clientDGV == null || !(_clientDGV.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectWeightAction>.Warn("{物料统计报表-查询} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
_clientDGV.BaseControl.BindDataSource = null;
_clientDGV.BaseControl.BindDataSource = table;
}
}
}

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.Report.OpenDoor
{
//public class OpenDoorEntity
//{
//}
}

@ -1,248 +0,0 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport
{
/// <summary>
/// 生产分析报表导出业务
/// </summary>
class ExportAction : ChemicalWeighingAction, Base.IAction
{
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _recipeNameControl = null; //配方名Combobox控件
private Control _clientDGV = null; //生产分析DGV
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<ExportAction>.Debug("生产分析报表-导出...");
#region 时间配方名控件
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate == null && _starttime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
string start = Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString();
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate == null && _endtime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
string end = Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString();
this._recipeNameControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "[Pmt_recipe].[Recipe_Name]").FirstOrDefault();
if (_recipeNameControl == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Warn("{生产分析报表} 缺少配方名控件...");
runtime.IsReturn = false;
return;
}
ComboBox recipeNameCB = this._recipeNameControl.BaseControl as ComboBox;
#endregion
List<string> PlanIds = ReportHelper.GetPlanIDList(start, end, recipeNameCB.Text);
string lR_planID = PlanIds[0];
string lR_reName = recipeNameCB.Text;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "xls files(*.xls)|*.xls";
sfd.FileName = String.Format("生产分析报表_{0:yyyyMMdd}", DateTime.Now);
sfd.AddExtension = true;
DialogResult result = sfd.ShowDialog();
if (result == DialogResult.OK)
{
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientDGV = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientDGV == null)
{
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产分析报表-导出} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientDGV as Mesnac.Controls.Default.MultiColHeaderDgv);
System.Data.DataTable dt = clientGrid.DataSource as System.Data.DataTable;
string fileName = sfd.FileName;
if (!String.IsNullOrEmpty(fileName))
{
try
{
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
DataTabletoExcel(dt, fileName, lR_Recipes, lR_reName);
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionAnalysisReport_ExportAction_msg1")); //导出生产分析报表数据至Excel成功!
ICSharpCode.Core.LoggingService<ExportAction>.Info(msg1);
#region 记录操作日志
base.DBLog(msg1);
#endregion
MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
string msg2 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionAnalysisReport_ExportAction_msg2")); //导出生产分析数据至Excel失败:{0}!
msg2 = String.Format(msg2, ex.Message);
ICSharpCode.Core.LoggingService<ExportAction>.Error(msg2);
#region 记录操作日志
base.DBLog(msg2);
#endregion
MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
runtime.IsReturn = true;
return;
}
}
}
}
public void DataTabletoExcel(System.Data.DataTable tmpDataTable, string strFileName, List<Entity.LR_recipe> lR_Recipes, string reName)
{
///先得到datatable的行数
int rowNum = tmpDataTable.Rows.Count;
///列数
int columnNum = tmpDataTable.Columns.Count;
///声明一个应用程序类实例
Microsoft.Office.Interop.Excel.Application xlApp = new ApplicationClass();
//创建一个新工作簿
Workbook xlBook = xlApp.Workbooks.Add();
///在工作簿中得到sheet。
_Worksheet oSheet = (_Worksheet)xlBook.Worksheets[1];
#region 绘制列
//绘制配方名和开始时间
oSheet.Cells[1, 1] = "配方名";
oSheet.Cells[1, 2] = reName;
//自定义方法,绘制合并表头
RangeBuild(oSheet, oSheet.Cells[2, 1], oSheet.Cells[2, 2], "物料");
oSheet.Cells[3, 1] = "车次";
oSheet.Cells[3, 2] = "检量时间";
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
int ordinate = 3;
if (lR_Recipes != null && lR_Recipes.Count > 0)
{
//物料表头
for (int i = 0; i < lR_Recipes.Count; i++)
{
sumSet_Weight += (decimal)lR_Recipes[i].Set_Weight;
sumSet_Error += (decimal)lR_Recipes[i].Set_Error;
RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 2], lR_Recipes[i].Material_Name);
oSheet.Cells[3, ordinate] = lR_Recipes[i].Set_Weight.ToString("0.000");
oSheet.Cells[3, ordinate + 1] = lR_Recipes[i].Set_Error.ToString("0.000");
oSheet.Cells[3, ordinate + 2] = "T(s)";
ordinate += 3;
}
//加和重量表头
RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 2], "加和重量");
oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
oSheet.Cells[3, ordinate + 2] = "T(s)";
ordinate += 3;
//检量重量表头
RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 3], "检量重量");
oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
oSheet.Cells[3, ordinate + 2] = "T(s)";
oSheet.Cells[3, ordinate + 3] = "皮重";
ordinate += 4;
}
#endregion
//将DataTable中的数据导入Excel中
for (int i = 0; i < rowNum; i++)
{
for (int j = 0; j < columnNum; j++)
{
///excel中的列是从1开始的
xlApp.Cells[i + 4, j + 1] = tmpDataTable.Rows[i][j].ToString();
}
}
///保存,路径一块穿进去。否则回到一个很奇妙的地方貌似是system32里 temp下....
oSheet.SaveAs(strFileName);
}
/// <summary>
/// 合并单元格业务方法
/// </summary>
/// <param name="oSheet">工作簿中的sheet</param>
/// <param name="startcell">起始cell</param>
/// <param name="endcell">结束cell</param>
/// <param name="value">合并后单元格文本</param>
private static void RangeBuild(_Worksheet oSheet, object startcell, object endcell, string value)
{
Range excelRange = oSheet.Range[startcell, endcell];/*需要合并的单元格*/
///合并方法
excelRange.Merge(excelRange.MergeCells);/*合并*/
///合并单元格之后,设置其中的文本
excelRange.Value = value;
//横向居中
excelRange.HorizontalAlignment = XlVAlign.xlVAlignCenter;
//字体大小
//range.Font.Size = 18;
//字体
//range.Font.Name = "黑体";
//行高
//range.RowHeight = 24;
//自动调整列宽
excelRange.EntireColumn.AutoFit();
//填充颜色
//range.Interior.ColorIndex = 20;
//设置单元格边框的粗细
excelRange.Cells.Borders.LineStyle = 1;
}
}
}

@ -1,28 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport
{
/// <summary>
/// 初始化生产分析报表
/// </summary>
class InitFormAction : ChemicalWeighingAction, IAction
{
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
starttime.MCValue = DateTime.Parse("00:00:00");
endtime.MCValue = DateTime.Parse("23:59:59");
}
}
}

@ -1,344 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport
{
/// <summary>
/// 生产质量分析
/// </summary>
class SelectAnalysisAction : ChemicalWeighingAction, IAction
{
#region 字段定义
private RuntimeParameter _runtime;
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private DbMCControl _recipeNameControl = null; //配方名Combobox控件
private Control _clientGridControl = null; //多维表控件
private DataTable dataTable = null;
#endregion
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
#region 获取开始/结束时间控件和质量分析控件
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if(_startdate == null && _starttime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
string start = Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString();
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate == null && _endtime == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Debug("{生产分析报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
string end = Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString();
this._recipeNameControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "[Pmt_recipe].[Recipe_Name]").FirstOrDefault();
if (_recipeNameControl == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Warn("{生产分析报表} 缺少配方名控件...");
runtime.IsReturn = false;
return;
}
ComboBox recipeNameCB = this._recipeNameControl.BaseControl as ComboBox;
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientGridControl = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectAnalysisAction>.Warn("{生产分析报表} 缺少质量分析MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv);
dataTable = new DataTable("AnalysisDT");
#endregion
#region 控件格式化
clientGrid.myColHeaderTreeView = null;
clientGrid.DataSource = null;
clientGrid.iNodeLevels = 0;
clientGrid.ColLists.Clear();
clientGrid.ColumnHeadersHeight = 23;
clientGrid.ScrollBars = ScrollBars.Both;
clientGrid.AllowUserToAddRows = false;
clientGrid.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
clientGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
clientGrid.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 12);
clientGrid.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 10);
#endregion
if (!string.IsNullOrEmpty(recipeNameCB.Text))
{
List<string> PlanIds = ReportHelper.GetPlanIDList(start,end,recipeNameCB.Text);
if (PlanIds.Count == 0)
{
MessageBox.Show("未查询到该时间段的配方计划信息");
return;
}
string lR_planID = PlanIds[0];
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
TreeView treeView = new TreeView();
List<Entity.LR_lot> lR_Lots = ReportHelper.GetAllLR_lotList(PlanIds);
List<Entity.LR_weigh> lR_Weighs = ReportHelper.GetAllLR_weighList(PlanIds, lR_Recipes.Count);
#region 表头建立
BuildTableHead(treeView, lR_Recipes);
clientGrid.myColHeaderTreeView = treeView;
#endregion
#region 数据填充
DataTableWrite(lR_Lots, lR_Weighs);
#endregion
#region 增加最大最小平均合计值行
DataTableAdd(lR_Recipes.Count);
#endregion
clientGrid.DataSource = dataTable;
}
}
#region 建立表头结构
private void BuildTableHead(TreeView treeView, List<Entity.LR_recipe> lR_Recipes)
{
int treeIndex = 0;
TreeNode rootTreeNode = new TreeNode("物料");
treeView.Nodes.Add(rootTreeNode);
TreeNode childTreeNodeSerial_Num = new TreeNode("序号");
TreeNode childTreeNodeWeight_Time = new TreeNode("检量时间");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSerial_Num);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWeight_Time);
dataTable.Columns.Add("Serial_Num", typeof(System.String));
dataTable.Columns.Add("Weight_Time", typeof(System.String));
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
if (lR_Recipes != null && lR_Recipes.Count > 0)
{
//物料表头
for (int i = 0; i < lR_Recipes.Count; i++)
{
sumSet_Weight = sumSet_Weight + (decimal)lR_Recipes[i].Set_Weight;
sumSet_Error = sumSet_Error + (decimal)lR_Recipes[i].Set_Error;
TreeNode rootTreeNodeMaterialName = new TreeNode(lR_Recipes[i].Material_Name);
treeView.Nodes.Add(rootTreeNodeMaterialName);
treeIndex++;
TreeNode childTreeNodeSet_Weight = new TreeNode("重量(kg)");
TreeNode childTreeNodeSet_Error = new TreeNode("误差(kg)");
TreeNode childTreeNodeWaste_Time = new TreeNode("时间(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWaste_Time);
dataTable.Columns.Add("Set_Weight" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Set_Error" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Waste_Time" + treeIndex.ToString(), typeof(decimal));
}
//加和重量表头
TreeNode rootTreeNodeSum = new TreeNode("加和重量");
treeView.Nodes.Add(rootTreeNodeSum);
treeIndex++;
TreeNode childTreeNodeSumSet_Weight = new TreeNode("重量(kg)");
TreeNode childTreeNodeSumSet_Error = new TreeNode("误差(kg)");
TreeNode childTreeNodesumWaste_Time = new TreeNode("T(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodesumWaste_Time);
dataTable.Columns.Add("SumSet_Weight", typeof(decimal));
dataTable.Columns.Add("SumSet_Error", typeof(decimal));
dataTable.Columns.Add("SumWaste_Time", typeof(decimal));
//检量重量表头
TreeNode rootTreeNodeCheck = new TreeNode("检量重量");
treeView.Nodes.Add(rootTreeNodeCheck);
treeIndex++;
TreeNode childTreeNodeCheckSet_Weight = new TreeNode("重量(kg)");
TreeNode childTreeNodeCheckSet_Error = new TreeNode("误差(kg)");
TreeNode childTreeNodeCheckWaste_Time = new TreeNode("T(s)");
TreeNode childTreeNodeCheckNet_Weight = new TreeNode("皮重");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckWaste_Time);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckNet_Weight);
dataTable.Columns.Add("CheckSet_Weight", typeof(decimal));
dataTable.Columns.Add("CheckSet_Error", typeof(decimal));
dataTable.Columns.Add("CheckWaste_Time", typeof(decimal));
dataTable.Columns.Add("CheckNet_Weight", typeof(System.String));
}
}
#endregion
#region 数据表填充
private void DataTableWrite(List<Entity.LR_lot> lR_Lots, List<Entity.LR_weigh> lR_Weighs)
{
if (lR_Lots != null && lR_Lots.Count > 0)
{
for (int i = 0; i < lR_Lots.Count; i++)
{
int sumRealWaste_Time = 0; //加和时间
DataRow drow = dataTable.NewRow();
//车次和检量时间数据填入
drow["Serial_Num"] = lR_Lots[i].Serial_Num;
drow["Weight_Time"] = lR_Lots[i].Prd_date;
//每车物料数据填入
List<Entity.LR_weigh> curWeights = lR_Weighs.FindAll(x => x.Serial_Num == lR_Lots[i].Serial_Num);
if (curWeights != null && curWeights.Count > 0)
{
for (int j = 0; j < curWeights.Count; j++)
{
drow["Set_Weight" + (j + 1).ToString()] = curWeights[j].Real_Weight;
drow["Set_Error" + (j + 1).ToString()] = curWeights[j].Real_Error;
drow["Waste_Time" + (j + 1).ToString()] = curWeights[j].Waste_Time;
sumRealWaste_Time = sumRealWaste_Time + (int)curWeights[j].Waste_Time;
}
}
//加和重量数据填入
drow["SumSet_Weight"] = lR_Lots[i].Real_weight;
drow["SumSet_Error"] = lR_Lots[i].Real_weight;
drow["SumWaste_Time"] = sumRealWaste_Time;
//检量重量数据填入
drow["CheckSet_Weight"] = lR_Lots[i].Real_weight;
drow["CheckSet_Error"] = lR_Lots[i].Real_weight;
drow["CheckWaste_Time"] = lR_Lots[i].Waste_Time;
drow["CheckNet_Weight"] = lR_Lots[i].Net_Weight;
dataTable.Rows.Add(drow);
}
}
}
#endregion
#region DataTable新增最大最小平均合计值行
private void DataTableAdd(int mNum)
{
//最大值行
DataRow drowMax = dataTable.NewRow();
drowMax["Weight_Time"] = "最大值";
for (int i=0; i<mNum;i++)
{
drowMax["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("max(Set_Weight"+ (i + 1).ToString() + ")", "");
drowMax["Set_Error" + (i + 1).ToString()] = dataTable.Compute("max(Set_Error" + (i + 1).ToString() + ")", "");
drowMax["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("max(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMax["SumSet_Weight"] = dataTable.Compute("max(SumSet_Weight)", "");
drowMax["SumSet_Error"] = dataTable.Compute("max(SumSet_Error)", "");
drowMax["SumWaste_Time"] = dataTable.Compute("max(SumWaste_Time)", "");
drowMax["CheckSet_Weight"] = dataTable.Compute("max(CheckSet_Weight)", "");
drowMax["CheckSet_Error"] = dataTable.Compute("max(CheckSet_Error)", "");
drowMax["CheckWaste_Time"] = dataTable.Compute("max(CheckWaste_Time)", "");
//最小值行
DataRow drowMin = dataTable.NewRow();
drowMin["Weight_Time"] = "最小值";
for (int i = 0; i < mNum; i++)
{
drowMin["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("min(Set_Weight" + (i + 1).ToString() + ")", "");
drowMin["Set_Error" + (i + 1).ToString()] = dataTable.Compute("min(Set_Error" + (i + 1).ToString() + ")", "");
drowMin["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("min(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMin["SumSet_Weight"] = dataTable.Compute("min(SumSet_Weight)", "");
drowMin["SumSet_Error"] = dataTable.Compute("min(SumSet_Error)", "");
drowMin["SumWaste_Time"] = dataTable.Compute("min(SumWaste_Time)", "");
drowMin["CheckSet_Weight"] = dataTable.Compute("min(CheckSet_Weight)", "");
drowMin["CheckSet_Error"] = dataTable.Compute("min(CheckSet_Error)", "");
drowMin["CheckWaste_Time"] = dataTable.Compute("min(CheckWaste_Time)", "");
//平均值行
DataRow drowAvg = dataTable.NewRow();
drowAvg["Weight_Time"] = "平均值";
for (int i = 0; i < mNum; i++)
{
drowAvg["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Weight" + (i + 1).ToString() + ")", "");
drowAvg["Set_Error" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Error" + (i + 1).ToString() + ")", "");
drowAvg["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("avg(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowAvg["SumSet_Weight"] = dataTable.Compute("avg(SumSet_Weight)", "");
drowAvg["SumSet_Error"] = dataTable.Compute("avg(SumSet_Error)", "");
drowAvg["SumWaste_Time"] = dataTable.Compute("avg(SumWaste_Time)", "");
drowAvg["CheckSet_Weight"] = dataTable.Compute("avg(CheckSet_Weight)", "");
drowAvg["CheckSet_Error"] = dataTable.Compute("avg(CheckSet_Error)", "");
drowAvg["CheckWaste_Time"] = dataTable.Compute("avg(CheckWaste_Time)", "");
//合计
DataRow drowSum = dataTable.NewRow();
drowSum["Weight_Time"] = "合计";
for (int i = 0; i < mNum; i++)
{
drowSum["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Weight" + (i + 1).ToString() + ")", "");
drowSum["Set_Error" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Error" + (i + 1).ToString() + ")", "");
drowSum["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("sum(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowSum["SumSet_Weight"] = dataTable.Compute("sum(SumSet_Weight)", "");
drowSum["SumSet_Error"] = dataTable.Compute("sum(SumSet_Error)", "");
drowSum["SumWaste_Time"] = dataTable.Compute("sum(SumWaste_Time)", "");
drowSum["CheckSet_Weight"] = dataTable.Compute("sum(CheckSet_Weight)", "");
drowSum["CheckSet_Error"] = dataTable.Compute("sum(CheckSet_Error)", "");
drowSum["CheckWaste_Time"] = dataTable.Compute("sum(CheckWaste_Time)", "");
dataTable.Rows.Add(drowMax);
dataTable.Rows.Add(drowMin);
dataTable.Rows.Add(drowAvg);
dataTable.Rows.Add(drowSum);
}
#endregion
}
}

@ -1,253 +0,0 @@
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表导出Action
/// </summary>
class ExportAction : ChemicalWeighingAction, Base.IAction
{
private Control _clientDGV = null; //称量明细DGV
private DbMCControl _dgvLRPlan = null; //生产计划DGV
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<ExportAction>.Debug("生产报表-导出...");
this._dgvLRPlan = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Base_PlanInfo").FirstOrDefault();
DataGridView lR_planGridView = this._dgvLRPlan.BaseControl as DataGridView;
string lR_planID = lR_planGridView.SelectedRows[0].Cells["plan_Id"].Value as string;
string lR_reName = lR_planGridView.SelectedRows[0].Cells["recipe_Name"].Value as string;
string lR_starTime = lR_planGridView.SelectedRows[0].Cells["plan_beginTime"].Value as string;
string plan_count = Convert.ToInt32(lR_planGridView.SelectedRows[0].Cells["plan_Amount"].Value).ToString();
string real_count = Convert.ToInt32(lR_planGridView.SelectedRows[0].Cells["real_Amount"].Value).ToString();
string plan_State = lR_planGridView.SelectedRows[0].Cells["plan_State"].Value as string;
string plan_endTime = lR_planGridView.SelectedRows[0].Cells["plan_endTime"].Value as string;
string Shift_Name = lR_planGridView.SelectedRows[0].Cells["Shift_Name"].Value as string;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "xls files(*.xls)|*.xls";
sfd.FileName = String.Format("生产报表_{0:yyyyMMdd}", DateTime.Now);
sfd.AddExtension = true;
DialogResult result = sfd.ShowDialog();
if (result == DialogResult.OK)
{
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientDGV = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientDGV == null)
{
ICSharpCode.Core.LoggingService<ExportAction>.Warn("{生产报表-导出} 缺少DataGridView控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientDGV as Mesnac.Controls.Default.MultiColHeaderDgv);
System.Data.DataTable dt = clientGrid.DataSource as System.Data.DataTable;
string fileName = sfd.FileName;
if (!String.IsNullOrEmpty(fileName))
{
try
{
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
DataTabletoExcel(dt, fileName, lR_Recipes, lR_planID, lR_reName, plan_count, real_count, plan_State, lR_starTime, plan_endTime, Shift_Name);
string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionReport_ExportAction_msg1")); //导出生产报表数据至Excel成功!
ICSharpCode.Core.LoggingService<ExportAction>.Info(msg1);
#region 记录操作日志
base.DBLog(msg1);
#endregion
MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
string msg2 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionReport_ExportAction_msg2")); //导出生产报表数据至Excel失败:{0}!
msg2 = String.Format(msg2, ex.Message);
ICSharpCode.Core.LoggingService<ExportAction>.Error(msg2);
#region 记录操作日志
base.DBLog(msg2);
#endregion
MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
runtime.IsReturn = true;
return;
}
}
}
}
public void DataTabletoExcel(System.Data.DataTable tmpDataTable, string strFileName, List<Entity.LR_recipe> lR_Recipes, string lR_planID , string reName,string plan_count, string real_count, string plan_State, string startTime,string plan_endTime,string Shift_Name)
{
///先得到datatable的行数
int rowNum = tmpDataTable.Rows.Count;
///列数
int columnNum = tmpDataTable.Columns.Count;
///声明一个应用程序类实例
Microsoft.Office.Interop.Excel.Application xlApp = new ApplicationClass();
//创建一个新工作簿
Workbook xlBook = xlApp.Workbooks.Add();
///在工作簿中得到sheet。
_Worksheet oSheet = (_Worksheet)xlBook.Worksheets[1];
#region 绘制列
//绘制配方名和开始时间
oSheet.Cells[1, 1] = "计划号";
oSheet.Cells[1, 2] = "配方名";
oSheet.Cells[1, 3] = "计划数量";
oSheet.Cells[1, 4] = "完成数量";
oSheet.Cells[1, 5] = "完成数量";
oSheet.Cells[1, 5] = "计划状态";
oSheet.Cells[1, 6] = "开始时间";
oSheet.Cells[1, 7] = "完成时间";
oSheet.Cells[1, 8] = "计划班组";
oSheet.Cells[2, 1] = lR_planID;
oSheet.Cells[2, 2] = reName;
oSheet.Cells[2, 3] = plan_count;
oSheet.Cells[2, 4] = real_count;
oSheet.Cells[2, 5] = plan_State;
oSheet.Cells[2, 6] = startTime;
oSheet.Cells[2, 7] = plan_endTime;
oSheet.Cells[2, 8] = Shift_Name;
//自定义方法,绘制合并表头
//RangeBuild(oSheet, oSheet.Cells[2, 1], oSheet.Cells[2, 2], "物料");
oSheet.Cells[3, 1] = "车数";
oSheet.Cells[3, 2] = "格数";
oSheet.Cells[3, 3] = "完成时间";
oSheet.Cells[3, 4] = "罐A应配";
oSheet.Cells[3, 5] = "罐A实配";
oSheet.Cells[3, 6] = "罐B应配";
oSheet.Cells[3, 7] = "罐B实配";
oSheet.Cells[3, 8] = "树脂应配";
oSheet.Cells[3, 9] = "树脂实配";
//oSheet.Cells[3, 10] = "VCC及GFA卸料速度";
//oSheet.Cells[3, 11] = "混料运行速度";
//oSheet.Cells[3, 12] = "混合机卸料速度";
//oSheet.Cells[3, 13] = "混合机运行时间";
//oSheet.Cells[3, 14] = "系数";
oSheet.Cells[3, 10] = "混料运行速度";
oSheet.Cells[3, 11] = "混合机卸料速度";
oSheet.Cells[3, 12] = "混合机运行时间";
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
int ordinate = 3;
//if (lR_Recipes != null && lR_Recipes.Count > 0)
//{
// //物料表头
// for (int i = 0; i < lR_Recipes.Count; i++)
// {
// sumSet_Weight += (decimal)lR_Recipes[i].Set_Weight;
// sumSet_Error += (decimal)lR_Recipes[i].Set_Error;
// RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate+2], lR_Recipes[i].Material_Name);
// oSheet.Cells[3, ordinate] = lR_Recipes[i].Set_Weight.ToString("0.000");
// oSheet.Cells[3, ordinate+1] = lR_Recipes[i].Set_Error.ToString("0.000");
// oSheet.Cells[3, ordinate+2] = "T(s)";
// ordinate += 3;
// }
// //加和重量表头
// RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 2], "加和重量");
// oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
// oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
// oSheet.Cells[3, ordinate + 2] = "T(s)";
// ordinate += 3;
// //检量重量表头
// RangeBuild(oSheet, oSheet.Cells[2, ordinate], oSheet.Cells[2, ordinate + 3], "检量重量");
// oSheet.Cells[3, ordinate] = sumSet_Weight.ToString();
// oSheet.Cells[3, ordinate + 1] = sumSet_Error.ToString();
// oSheet.Cells[3, ordinate + 2] = "T(s)";
// oSheet.Cells[3, ordinate + 3] = "皮重";
// ordinate += 4;
//}
#endregion
//将DataTable中的数据导入Excel中
for (int i = 0; i < rowNum; i++)
{
for (int j = 0; j < columnNum; j++)
{
///excel中的列是从1开始的
xlApp.Cells[i + 4, j + 1] = tmpDataTable.Rows[i][j].ToString();
}
}
///保存,路径一块穿进去。否则回到一个很奇妙的地方貌似是system32里 temp下....
oSheet.SaveAs(strFileName);
}
/// <summary>
/// 合并单元格业务方法
/// </summary>
/// <param name="oSheet">工作簿中的sheet</param>
/// <param name="startcell">起始cell</param>
/// <param name="endcell">结束cell</param>
/// <param name="value">合并后单元格文本</param>
private static void RangeBuild(_Worksheet oSheet, object startcell, object endcell, string value)
{
Range excelRange = oSheet.Range[startcell, endcell];/*需要合并的单元格*/
///合并方法
excelRange.Merge(excelRange.MergeCells);/*合并*/
///合并单元格之后,设置其中的文本
excelRange.Value = value;
//横向居中
excelRange.HorizontalAlignment = XlVAlign.xlVAlignCenter;
//字体大小
//range.Font.Size = 18;
//字体
//range.Font.Name = "黑体";
//行高
//range.RowHeight = 24;
//自动调整列宽
excelRange.EntireColumn.AutoFit();
//填充颜色
//range.Interior.ColorIndex = 20;
//设置单元格边框的粗细
excelRange.Cells.Borders.LineStyle = 1;
}
}
}

@ -1,28 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表初始化窗体
/// </summary>
class InitFormAction : ChemicalWeighingAction, IAction
{
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用的
ICSharpCode.Core.LoggingService<InitFormAction>.Debug("生产报表-窗体初始化...");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
starttime.MCValue = DateTime.Parse("00:00:00");
endtime.MCValue = DateTime.Parse("23:59:59");
}
}
}

@ -1,112 +0,0 @@
using Mesnac.Action.Base;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表中查询生产计划Action
/// </summary>
class SelectPlanAction : ChemicalWeighingAction, IAction
{
private RuntimeParameter _runtime;
private IBaseControl _equipCode = null; //机台号
private IBaseControl _version = null; //版本
private IBaseControl _startdate = null; //开始日期
private IBaseControl _enddate = null; //结束日期
private IBaseControl _starttime = null; //开始时间
private IBaseControl _endtime = null; //结束时间
private IBaseControl _recipeName = null; //配方名
private IBaseControl _shiftName = null; //班次
private DbMCControl _dgvLRPlan = null; //生产计划DGV
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
ICSharpCode.Core.LoggingService<SelectPlanAction>.Debug("生产报表-生产计划-查询..");
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
dbHelper.ClearParameter();
//StringBuilder sbSql = new StringBuilder(@"Select A.Plan_Id,A.Equip_Code,A.Plan_ID,A.Recipe_Code,A.Recipe_Name,A.Version,A.Mixer_Line,A.Plan_num,A.Real_Num,A.Start_Date,A.End_Date,A.Weight_Man,B.Shift_Name
// From LR_Plan A Left Join Pmt_ShifTime B On(A.Shift_ID = B.Shift_ID) WHERE 1=1 ");
StringBuilder sbSql = new StringBuilder(@"select A.plan_Id,A.recipe_Name,A.plan_Amount,A.real_Amount,case plan_State when '0' then '待执行' when '1' then '执行中' when '2' then '已完成' when '3' then '已终止' else '异常' end as 'plan_State',A.plan_beginTime,A.plan_endTime,B.Shift_name as Shift_Name from Base_PlanInfo A Left Join Pmt_ShifTime B On(A.plan_Team = B.Shift_ID) WHERE 1=1 ");
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
//开始时间条件
this._startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
this._starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl;
if (_startdate != null && _starttime != null)
{
sbSql.AppendLine(@"And A.plan_beginTime >= '" + Convert.ToDateTime(_startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_starttime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Debug("{生产报表} 缺少key值为startdate或者starttime的时间查询条件...");
return;
}
//结束时间条件
this._enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl;
this._endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl;
if (_enddate != null && _endtime != null)
{
sbSql.AppendLine(@"And A.plan_beginTime <= '" + Convert.ToDateTime(_enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(_endtime.MCValue).ToShortTimeString() + "' ");
}
else
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Debug("{生产报表} 缺少key值为enddate或者enddate的时间查询条件...");
return;
}
//配方名和班次条件
this._recipeName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Base_RecipeInfo].[recipe_Name]").FirstOrDefault().BaseControl;
this._shiftName = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "[DataSource1].[Pmt_Shiftime].[Shift_name]").FirstOrDefault().BaseControl;
if (!String.IsNullOrEmpty(this._recipeName.MCValue.ToString()))
{
sbSql.AppendLine(@"And A.Recipe_Name = '" + _recipeName.MCValue.ToString() + "' ");
}
if (!String.IsNullOrEmpty(this._shiftName.MCValue.ToString()))
{
sbSql.AppendLine(@"And Shift_Name = '" + _shiftName.MCValue.ToString() + "' ");
}
//机台号和版本条件
//this._equipCode = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "EquipCode").FirstOrDefault().BaseControl;
//this._version = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "version").FirstOrDefault().BaseControl;
//if (!String.IsNullOrEmpty(this._equipCode.MCValue.ToString()))
//{
// sbSql.AppendLine(@"And A.Equip_Code = '" + _equipCode.MCValue.ToString() + "' ");
//}
//if (!String.IsNullOrEmpty(this._version.MCValue.ToString()))
//{
// sbSql.AppendLine(@"And A.Version = '" + _version.MCValue.ToString() + "' ");
//}
sbSql.Append(" ORDER BY A.plan_beginTime desc");
dbHelper.CommandText = sbSql.ToString();
dbHelper.CommandType = System.Data.CommandType.Text;
DataTable table = dbHelper.ToDataTable();
//刷新生产计划DataGridView数据
this._dgvLRPlan = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Base_PlanInfo").FirstOrDefault();
if (_dgvLRPlan == null || !(_dgvLRPlan.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表-查询} 缺少生产计划DataGridView控件...");
runtime.IsReturn = false;
return;
}
_dgvLRPlan.BaseControl.BindDataSource = null;
_dgvLRPlan.BaseControl.BindDataSource = table;
}
}
}

@ -1,537 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data;
using Mesnac.Action.Base;
using Mesnac.Codd.Session;
using System.Reflection;
using Mesnac.Controls.Base;
namespace Mesnac.Action.ChemicalWeighing.Report.ProductionReport
{
/// <summary>
/// 生产报表业务
/// </summary>
public class SelectRowAction : ChemicalWeighingAction,IAction
{
#region 字段定义
public static bool IsFirstRun = true; //是否首次运行
private RuntimeParameter _runtime;
private Control _clientGridControl = null; //多维表控件
private DbMCControl _dgvLRPlan = null; //生产计划DGV
private DataTable dataTable = null;
#endregion
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
this._runtime = runtime;
#region 获取界面生产计划控件和称量明细控件
this._dgvLRPlan = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Base_PlanInfo").FirstOrDefault();
if (_dgvLRPlan == null || !(_dgvLRPlan.BaseControl is DataGridView))
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少生产计划DataGridView控件...");
runtime.IsReturn = false;
return;
}
DataGridView lR_planGridView = this._dgvLRPlan.BaseControl as DataGridView;
bool gridFlag = false;
foreach (Control ib in GetAllControls())
{
if (ib.Name.Contains("MultiColHeaderDgv"))
{
this._clientGridControl = ib;
gridFlag = true;
}
if (gridFlag)
{
break;
}
}
if (_clientGridControl == null)
{
ICSharpCode.Core.LoggingService<SelectPlanAction>.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件...");
runtime.IsReturn = false;
return;
}
Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv);
dataTable = new DataTable("ProductionDT");
#endregion
#region 控件格式化
clientGrid.myColHeaderTreeView = null;
clientGrid.DataSource = null;
clientGrid.iNodeLevels = 0;
clientGrid.ColLists.Clear();
clientGrid.ColumnHeadersHeight = 23;
clientGrid.ScrollBars = ScrollBars.Both;
clientGrid.AllowUserToAddRows = false;
clientGrid.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
clientGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
clientGrid.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 12);
clientGrid.DefaultCellStyle.Font = new System.Drawing.Font("宋体",10);
clientGrid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
#endregion
if (lR_planGridView.SelectedRows.Count == 1)
{
string lR_planID = lR_planGridView.SelectedRows[0].Cells["Plan_Id"].Value as string;
if (!string.IsNullOrEmpty(lR_planID))
{
#region 数据源获取及定义
List<Entity.LR_lot> lR_Lots = ReportHelper.GetLR_lotList(lR_planID);
List<Entity.LR_recipe> lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID);
List<Entity.LR_weigh> lR_Weighs = ReportHelper.GetLR_weighList(lR_planID);
List<Entity.RecordSaveDataInfo> RecordSaveDataInfo = ReportHelper.GetReportSaveDataList(lR_planID);
TreeView treeView = new TreeView();
#endregion
#region 表头建立
GHBuildTableHead(treeView, RecordSaveDataInfo);
//BuildTableHead(treeView, lR_Recipes);
//clientGrid.myColHeaderTreeView = treeView;
#endregion
#region 数据填充
GHDataTableWrite(RecordSaveDataInfo);
//DataTableWrite(lR_Lots, lR_Recipes, lR_Weighs);
#endregion
#region 增加最大最小平均合计值行
GHDataTableAdd(RecordSaveDataInfo.Count);
//DataTableAdd(lR_Recipes.Count);
#endregion
clientGrid.DataSource = dataTable;
for (int i = 0; i < clientGrid.Columns.Count; i++)
{
clientGrid.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}
}
}
}
#region 方法定义
#region 建立表头结构
private void GHBuildTableHead(TreeView treeView, List<Entity.RecordSaveDataInfo> RecordSaveDataInfo)
{
try
{
//decimal sumSet_Weight = 0.0M;
//decimal sumSet_Error = 0.0M;
//if (RecordSaveDataInfo != null && RecordSaveDataInfo.Count > 0)
//{
// for (int i = 0; i < RecordSaveDataInfo.Count; i++)
// {
// sumSet_Weight = sumSet_Weight + (decimal)RecordSaveDataInfo[i].SaveVCCAct;
// }
//}
//TreeNode childTreeNodeSaveFinishedNum = new TreeNode("车数");
//treeView.Nodes.Add(childTreeNodeSaveFinishedNum);
//TreeNode childTreeNodeSaveRecordTime = new TreeNode("记录时间");
//treeView.Nodes.Add(childTreeNodeSaveRecordTime);
//TreeNode childTreeNodeSaveCol = new TreeNode("格数");
//treeView.Nodes.Add(childTreeNodeSaveCol);
//TreeNode childTreeNodeSaveVCCSet = new TreeNode(" VCC应配");
//treeView.Nodes.Add(childTreeNodeSaveVCCSet);
//TreeNode childTreeNodeSaveVCCAct = new TreeNode(" VCC实配");
//treeView.Nodes.Add(childTreeNodeSaveVCCAct);
//TreeNode childTreeNodeSaveGFASet = new TreeNode("GFA应配");
//treeView.Nodes.Add(childTreeNodeSaveGFASet);
//TreeNode childTreeNodeSaveGFAAct = new TreeNode("GFA实配");
//treeView.Nodes.Add(childTreeNodeSaveGFAAct);
//TreeNode childTreeNodeSave3thSet = new TreeNode("树脂应配");
//treeView.Nodes.Add(childTreeNodeSave3thSet);
//TreeNode childTreeNodeSave3thAct = new TreeNode("树脂实配");
//treeView.Nodes.Add(childTreeNodeSave3thAct);
//TreeNode childTreeNodeSaveLevel = new TreeNode("系数");
//treeView.Nodes.Add(childTreeNodeSaveLevel);
//TreeNode childTreeNodeSaveFillTime = new TreeNode("VCC+GFA卸料速度");
//treeView.Nodes.Add(childTreeNodeSaveFillTime);
//TreeNode childTreeNodeSaveSpeed1 = new TreeNode("混料运行速度");
//treeView.Nodes.Add(childTreeNodeSaveSpeed1);
//TreeNode childTreeNodeSaveSpeed2 = new TreeNode("混合机卸料速度");
//treeView.Nodes.Add(childTreeNodeSaveSpeed2);
//TreeNode childTreeNodeSaveTime = new TreeNode("混料运行时间");
//treeView.Nodes.Add(childTreeNodeSaveTime);
dataTable.Columns.Add("车数", typeof(System.String));
dataTable.Columns.Add("格数", typeof(System.String));
dataTable.Columns.Add("记录时间", typeof(System.String));
dataTable.Columns.Add("罐A应配", typeof(decimal));
dataTable.Columns.Add("罐A实配", typeof(decimal));
dataTable.Columns.Add("罐B应配", typeof(decimal));
dataTable.Columns.Add("罐B实配", typeof(decimal));
dataTable.Columns.Add("树脂应配", typeof(decimal));
dataTable.Columns.Add("树脂实配", typeof(decimal));
dataTable.Columns.Add("罐A二次应配", typeof(decimal));
dataTable.Columns.Add("罐A二次实配", typeof(decimal));
dataTable.Columns.Add("罐B二次应配", typeof(decimal));
dataTable.Columns.Add("罐B二次实配", typeof(decimal));
//dataTable.Columns.Add("VCC及GFA卸料速度", typeof(decimal));
dataTable.Columns.Add("混料运行速度", typeof(decimal));
dataTable.Columns.Add("混合机卸料速度", typeof(decimal));
dataTable.Columns.Add("混料运行时间", typeof(decimal));
//dataTable.Columns.Add("系数", typeof(decimal));
//dataTable.Columns.Add("SaveFinishedNum", typeof(System.String));
//dataTable.Columns.Add("Record_Time", typeof(System.String));
//dataTable.Columns.Add("SaveCol", typeof(System.String));
//dataTable.Columns.Add("SaveVCCSet", typeof(decimal));
//dataTable.Columns.Add("SaveVCCAct", typeof(decimal));
//dataTable.Columns.Add("SaveGFASet", typeof(decimal));
//dataTable.Columns.Add("SaveGFAAct", typeof(decimal));
//dataTable.Columns.Add("Save3thSet", typeof(decimal));
//dataTable.Columns.Add("Save3thAct", typeof(decimal));
//dataTable.Columns.Add("SaveFillTime", typeof(decimal));
//dataTable.Columns.Add("SaveSpeed1", typeof(decimal));
//dataTable.Columns.Add("SaveSpeed2", typeof(decimal));
//dataTable.Columns.Add("SaveTime", typeof(decimal));
//dataTable.Columns.Add("SaveLevel", typeof(decimal));
}
catch (Exception ex)
{
}
}
private void BuildTableHead(TreeView treeView, List<Entity.LR_recipe> lR_Recipes)
{
int treeIndex = 0;
TreeNode rootTreeNode = new TreeNode("物料");
treeView.Nodes.Add(rootTreeNode);
TreeNode childTreeNodeSerial_Num = new TreeNode("车次");
TreeNode childTreeNodeWeight_Time = new TreeNode("检量时间");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSerial_Num);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWeight_Time);
dataTable.Columns.Add("Serial_Num", typeof(System.String));
dataTable.Columns.Add("Weight_Time", typeof(System.String));
decimal sumSet_Weight = 0.0M;
decimal sumSet_Error = 0.0M;
if (lR_Recipes != null && lR_Recipes.Count > 0)
{
//物料表头
for (int i = 0; i < lR_Recipes.Count; i++)
{
sumSet_Weight = sumSet_Weight + (decimal)lR_Recipes[i].Set_Weight;
sumSet_Error = sumSet_Error + (decimal)lR_Recipes[i].Set_Error;
TreeNode rootTreeNodeMaterialName = new TreeNode(lR_Recipes[i].Material_Name);
treeView.Nodes.Add(rootTreeNodeMaterialName);
treeIndex++;
TreeNode childTreeNodeSet_Weight = new TreeNode(lR_Recipes[i].Set_Weight.ToString("0.000"));
TreeNode childTreeNodeSet_Error = new TreeNode(lR_Recipes[i].Set_Error.ToString("0.000"));
TreeNode childTreeNodeWaste_Time = new TreeNode("T(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeWaste_Time);
dataTable.Columns.Add("Set_Weight" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Set_Error" + treeIndex.ToString(), typeof(decimal));
dataTable.Columns.Add("Waste_Time" + treeIndex.ToString(), typeof(decimal));
}
//加和重量表头
TreeNode rootTreeNodeSum = new TreeNode("加和重量");
treeView.Nodes.Add(rootTreeNodeSum);
treeIndex++;
TreeNode childTreeNodeSumSet_Weight = new TreeNode(sumSet_Weight.ToString());
TreeNode childTreeNodeSumSet_Error = new TreeNode(sumSet_Error.ToString());
TreeNode childTreeNodesumWaste_Time = new TreeNode("T(s)");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeSumSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodesumWaste_Time);
dataTable.Columns.Add("SumSet_Weight", typeof(decimal));
dataTable.Columns.Add("SumSet_Error", typeof(decimal));
dataTable.Columns.Add("SumWaste_Time", typeof(decimal));
//检量重量表头
TreeNode rootTreeNodeCheck = new TreeNode("检量重量");
treeView.Nodes.Add(rootTreeNodeCheck);
treeIndex++;
TreeNode childTreeNodeCheckSet_Weight = new TreeNode(sumSet_Weight.ToString());
TreeNode childTreeNodeCheckSet_Error = new TreeNode(sumSet_Error.ToString());
TreeNode childTreeNodeCheckWaste_Time = new TreeNode("T(s)");
TreeNode childTreeNodeCheckNet_Weight = new TreeNode("皮重");
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Weight);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckSet_Error);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckWaste_Time);
treeView.Nodes[treeIndex].Nodes.Add(childTreeNodeCheckNet_Weight);
dataTable.Columns.Add("CheckSet_Weight", typeof(decimal));
dataTable.Columns.Add("CheckSet_Error", typeof(decimal));
dataTable.Columns.Add("CheckWaste_Time", typeof(decimal));
dataTable.Columns.Add("CheckNet_Weight", typeof(System.String));
}
}
#endregion
#region 数据表填充
private void GHDataTableWrite(List<Entity.RecordSaveDataInfo> RecordSaveDataInfo)
{
try
{
if (RecordSaveDataInfo != null && RecordSaveDataInfo.Count > 0)
{
for (int i = 0; i < RecordSaveDataInfo.Count; i++)
{
DataRow drow = dataTable.NewRow();
drow["车数"] = RecordSaveDataInfo[i].SaveFinishedNum;
drow["格数"] = RecordSaveDataInfo[i].SaveCol;
drow["记录时间"] = RecordSaveDataInfo[i].RecordTime;
drow["罐A应配"] = RecordSaveDataInfo[i].SaveVCCSet;
drow["罐A实配"] = RecordSaveDataInfo[i].SaveVCCAct;
drow["罐B应配"] = RecordSaveDataInfo[i].SaveGFASet;
drow["罐B实配"] = RecordSaveDataInfo[i].SaveGFAAct;
drow["树脂应配"] = RecordSaveDataInfo[i].Save3thSet;
drow["树脂实配"] = RecordSaveDataInfo[i].Save3thAct;
drow["罐A二次应配"] = RecordSaveDataInfo[i].SaveVCC2thSet;
drow["罐A二次实配"] = RecordSaveDataInfo[i].SaveVCC2thAct;
drow["罐B二次应配"] = RecordSaveDataInfo[i].SaveGFA2thSet;
drow["罐B二次实配"] = RecordSaveDataInfo[i].SaveGFA2thAct;
//drow["VCC及GFA卸料速度"] = RecordSaveDataInfo[i].SaveFillTime;
drow["混料运行速度"] = RecordSaveDataInfo[i].SaveSpeed1;
drow["混合机卸料速度"] = RecordSaveDataInfo[i].SaveSpeed2;
drow["混料运行时间"] = RecordSaveDataInfo[i].SaveTime;
//drow["系数"] = RecordSaveDataInfo[i].SaveLevel;
dataTable.Rows.Add(drow);
}
}
}
catch (Exception ex)
{
throw;
}
}
private void DataTableWrite(List<Entity.LR_lot> lR_Lots, List<Entity.LR_recipe> lR_Recipes, List<Entity.LR_weigh> lR_Weighs)
{
if(lR_Lots != null && lR_Lots.Count > 0)
{
for(int i = 0; i < lR_Lots.Count; i++)
{
int sumRealWaste_Time = 0; //加和时间
DataRow drow = dataTable.NewRow();
//车次和检量时间数据填入
drow["Serial_Num"] = lR_Lots[i].Serial_Num;
drow["Weight_Time"] = lR_Lots[i].Prd_date;
//每车物料数据填入
List<Entity.LR_weigh> curWeights = lR_Weighs.FindAll(x => x.Serial_Num == lR_Lots[i].Serial_Num);
if(curWeights != null && curWeights.Count > 0)
{
for(int j = 0;j< curWeights.Count; j++)
{
drow["Set_Weight" + (j + 1).ToString()] = curWeights[j].Real_Weight;
drow["Set_Error" + (j + 1).ToString()] = curWeights[j].Real_Error;
drow["Waste_Time" + (j + 1).ToString()] = curWeights[j].Waste_Time;
sumRealWaste_Time = sumRealWaste_Time + (int)curWeights[j].Waste_Time;
}
}
//加和重量数据填入
drow["SumSet_Weight"] = lR_Lots[i].Real_weight;
drow["SumSet_Error"] = lR_Lots[i].Real_Error;
drow["SumWaste_Time"] = sumRealWaste_Time;
//检量重量数据填入
drow["CheckSet_Weight"] = lR_Lots[i].Real_weight;
drow["CheckSet_Error"] = lR_Lots[i].Real_Error;
drow["CheckWaste_Time"] = lR_Lots[i].Waste_Time;
drow["CheckNet_Weight"] = lR_Lots[i].Net_Weight;
dataTable.Rows.Add(drow);
}
}
}
#endregion
#region DataTable新增最大最小平均合计值行
private void GHDataTableAdd(int mNun)
{
try
{
DataRow drowMax = dataTable.NewRow();
drowMax["记录时间"] = "最大值";
drowMax["罐A应配"] = dataTable.Compute("max(罐A应配)", "");
drowMax["罐A实配"] = dataTable.Compute("max(罐A实配)", "");
drowMax["罐B应配"] = dataTable.Compute("max(罐B应配)", "");
drowMax["罐B实配"] = dataTable.Compute("max(罐B实配)", "");
drowMax["树脂应配"] = dataTable.Compute("max(树脂应配)", "");
drowMax["树脂实配"] = dataTable.Compute("max(树脂实配)", "");
drowMax["罐A二次应配"] = dataTable.Compute("max(罐A二次应配)", "");
drowMax["罐A二次实配"] = dataTable.Compute("max(罐A二次实配)", "");
drowMax["罐B二次应配"] = dataTable.Compute("max(罐B二次应配)", "");
drowMax["罐B二次实配"] = dataTable.Compute("max(罐B二次实配)", "");
//drowMax["VCC及GFA卸料速度"] = dataTable.Compute("max(VCC及GFA卸料速度)", "");
drowMax["混料运行速度"] = dataTable.Compute("max(混料运行速度)", "");
drowMax["混合机卸料速度"] = dataTable.Compute("max(混合机卸料速度)", "");
drowMax["混料运行时间"] = dataTable.Compute("max(混料运行时间)", "");
//drowMax["系数"] = dataTable.Compute("max(系数)", "");
DataRow drowMin = dataTable.NewRow();
drowMin["记录时间"] = "最小值";
drowMin["罐A应配"] = dataTable.Compute("min(罐A应配)", "");
drowMin["罐A实配"] = dataTable.Compute("min(罐A实配)", "");
drowMin["罐B应配"] = dataTable.Compute("min(罐B应配)", "");
drowMin["罐B实配"] = dataTable.Compute("min(罐B实配)", "");
drowMin["树脂应配"] = dataTable.Compute("min(树脂应配)", "");
drowMin["树脂实配"] = dataTable.Compute("min(树脂实配)", "");
drowMin["罐A二次应配"] = dataTable.Compute("min(罐A二次应配)", "");
drowMin["罐A二次实配"] = dataTable.Compute("min(罐A二次实配)", "");
drowMin["罐B二次应配"] = dataTable.Compute("min(罐B二次应配)", "");
drowMin["罐B二次实配"] = dataTable.Compute("min(罐B二次实配)", "");
//drowMin["VCC及GFA卸料速度"] = dataTable.Compute("min(VCC及GFA卸料速度)", "");
drowMin["混料运行速度"] = dataTable.Compute("min(混料运行速度)", "");
drowMin["混合机卸料速度"] = dataTable.Compute("min(混合机卸料速度)", "");
drowMin["混料运行时间"] = dataTable.Compute("min(混料运行时间)", "");
//drowMin["系数"] = dataTable.Compute("min(系数)", "");
DataRow drowAvg = dataTable.NewRow();
drowAvg["记录时间"] = "平均值";
drowAvg["罐A应配"] = dataTable.Compute("avg(罐A应配)", "");
drowAvg["罐A实配"] = dataTable.Compute("avg(罐A实配)", "");
drowAvg["罐B应配"] = dataTable.Compute("avg(罐B应配)", "");
drowAvg["罐B实配"] = dataTable.Compute("avg(罐B实配)", "");
drowAvg["树脂应配"] = dataTable.Compute("avg(树脂应配)", "");
drowAvg["树脂实配"] = dataTable.Compute("avg(树脂实配)", "");
drowAvg["罐A二次应配"] = dataTable.Compute("avg(罐A二次应配)", "");
drowAvg["罐A二次实配"] = dataTable.Compute("avg(罐A二次实配)", "");
drowAvg["罐B二次应配"] = dataTable.Compute("avg(罐B二次应配)", "");
drowAvg["罐B二次实配"] = dataTable.Compute("avg(罐B二次实配)", "");
//drowAvg["VCC及GFA卸料速度"] = dataTable.Compute("avg(VCC及GFA卸料速度)", "");
drowAvg["混料运行速度"] = dataTable.Compute("avg(混料运行速度)", "");
drowAvg["混合机卸料速度"] = dataTable.Compute("avg(混合机卸料速度)", "");
drowAvg["混料运行时间"] = dataTable.Compute("avg(混料运行时间)", "");
//drowAvg["系数"] = dataTable.Compute("avg(系数)", "");
DataRow drowSum = dataTable.NewRow();
drowSum["记录时间"] = "合计";
drowSum["罐A应配"] = dataTable.Compute("sum([罐A应配])", "");
drowSum["罐A实配"] = dataTable.Compute("sum([罐A实配])", "");
drowSum["罐B应配"] = dataTable.Compute("sum([罐B应配])", "");
drowSum["罐B实配"] = dataTable.Compute("sum([罐B实配])", "");
drowSum["树脂应配"] = dataTable.Compute("sum([树脂应配])", "");
drowSum["树脂实配"] = dataTable.Compute("sum([树脂实配])", "");
drowSum["罐A二次应配"] = dataTable.Compute("sum([罐A二次应配])", "");
drowSum["罐A二次实配"] = dataTable.Compute("sum([罐A二次实配])", "");
drowSum["罐B二次应配"] = dataTable.Compute("sum([罐B二次应配])", "");
drowSum["罐B二次实配"] = dataTable.Compute("sum([罐B二次实配])", "");
//drowSum["VCC及GFA卸料速度"] = dataTable.Compute("sum([VCC及GFA卸料速度])", "");
drowSum["混料运行速度"] = dataTable.Compute("sum([混料运行速度])", "");
drowSum["混合机卸料速度"] = dataTable.Compute("sum(混合机卸料速度)", "");
drowSum["混料运行时间"] = dataTable.Compute("sum([混料运行时间])", "");
//drowSum["系数"] = dataTable.Compute("sum([系数])", "");
dataTable.Rows.Add(drowMax);
dataTable.Rows.Add(drowMin);
dataTable.Rows.Add(drowAvg);
dataTable.Rows.Add(drowSum);
}
catch (Exception ex)
{
throw;
}
}
private void DataTableAdd(int mNum)
{
//最大值行
DataRow drowMax = dataTable.NewRow();
drowMax["Weight_Time"] = "最大值";
for (int i = 0; i < mNum; i++)
{
drowMax["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("max(Set_Weight" + (i + 1).ToString() + ")", "");
drowMax["Set_Error" + (i + 1).ToString()] = dataTable.Compute("max(Set_Error" + (i + 1).ToString() + ")", "");
drowMax["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("max(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMax["SumSet_Weight"] = dataTable.Compute("max(SumSet_Weight)", "");
drowMax["SumSet_Error"] = dataTable.Compute("max(SumSet_Error)", "");
drowMax["SumWaste_Time"] = dataTable.Compute("max(SumWaste_Time)", "");
drowMax["CheckSet_Weight"] = dataTable.Compute("max(CheckSet_Weight)", "");
drowMax["CheckSet_Error"] = dataTable.Compute("max(CheckSet_Error)", "");
drowMax["CheckWaste_Time"] = dataTable.Compute("max(CheckWaste_Time)", "");
//最小值行
DataRow drowMin = dataTable.NewRow();
drowMin["Weight_Time"] = "最小值";
for (int i = 0; i < mNum; i++)
{
drowMin["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("min(Set_Weight" + (i + 1).ToString() + ")", "");
drowMin["Set_Error" + (i + 1).ToString()] = dataTable.Compute("min(Set_Error" + (i + 1).ToString() + ")", "");
drowMin["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("min(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowMin["SumSet_Weight"] = dataTable.Compute("min(SumSet_Weight)", "");
drowMin["SumSet_Error"] = dataTable.Compute("min(SumSet_Error)", "");
drowMin["SumWaste_Time"] = dataTable.Compute("min(SumWaste_Time)", "");
drowMin["CheckSet_Weight"] = dataTable.Compute("min(CheckSet_Weight)", "");
drowMin["CheckSet_Error"] = dataTable.Compute("min(CheckSet_Error)", "");
drowMin["CheckWaste_Time"] = dataTable.Compute("min(CheckWaste_Time)", "");
//平均值行
DataRow drowAvg = dataTable.NewRow();
drowAvg["Weight_Time"] = "平均值";
for (int i = 0; i < mNum; i++)
{
drowAvg["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Weight" + (i + 1).ToString() + ")", "");
drowAvg["Set_Error" + (i + 1).ToString()] = dataTable.Compute("avg(Set_Error" + (i + 1).ToString() + ")", "");
drowAvg["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("avg(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowAvg["SumSet_Weight"] = dataTable.Compute("avg(SumSet_Weight)", "");
drowAvg["SumSet_Error"] = dataTable.Compute("avg(SumSet_Error)", "");
drowAvg["SumWaste_Time"] = dataTable.Compute("avg(SumWaste_Time)", "");
drowAvg["CheckSet_Weight"] = dataTable.Compute("avg(CheckSet_Weight)", "");
drowAvg["CheckSet_Error"] = dataTable.Compute("avg(CheckSet_Error)", "");
drowAvg["CheckWaste_Time"] = dataTable.Compute("avg(CheckWaste_Time)", "");
//合计
DataRow drowSum = dataTable.NewRow();
drowSum["Weight_Time"] = "合计";
for (int i = 0; i < mNum; i++)
{
drowSum["Set_Weight" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Weight" + (i + 1).ToString() + ")", "");
drowSum["Set_Error" + (i + 1).ToString()] = dataTable.Compute("sum(Set_Error" + (i + 1).ToString() + ")", "");
drowSum["Waste_Time" + (i + 1).ToString()] = dataTable.Compute("sum(Waste_Time" + (i + 1).ToString() + ")", "");
}
drowSum["SumSet_Weight"] = dataTable.Compute("sum(SumSet_Weight)", "");
drowSum["SumSet_Error"] = dataTable.Compute("sum(SumSet_Error)", "");
drowSum["SumWaste_Time"] = dataTable.Compute("sum(SumWaste_Time)", "");
drowSum["CheckSet_Weight"] = dataTable.Compute("sum(CheckSet_Weight)", "");
drowSum["CheckSet_Error"] = dataTable.Compute("sum(CheckSet_Error)", "");
drowSum["CheckWaste_Time"] = dataTable.Compute("sum(CheckWaste_Time)", "");
dataTable.Rows.Add(drowMax);
dataTable.Rows.Add(drowMin);
dataTable.Rows.Add(drowAvg);
dataTable.Rows.Add(drowSum);
}
#endregion
#endregion
}
}

@ -5,6 +5,9 @@ using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors.Filtering.Templates;
using ICSharpCode.Core;
using Mesnac.Action.Base;
@ -15,6 +18,7 @@ using Mesnac.Action.ChemicalWeighing.LjMixFormula;
using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Action.ChemicalWeighing.LjPlanning;
using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Basic;
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
@ -27,174 +31,37 @@ namespace Mesnac.Action.ChemicalWeighing.Test
public class TestAction : DatabaseAction, IAction
{
MCButton mCButton;
public void timer1EventProcessor(object source, EventArgs e)
{
DataTable dt2 = FreeSqlUnit.Instance.Select<object>()
.WithSql("select * from ActionCode ")
.ToDataTable("*");
this.startdate.MCValue = DateTime.Now.ToString() + dt2.Rows.Count;
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
var dt= dbHelper.GetDataTableBySql("select * from ActionCode");
OpenDoorService.Insert(new OpenDoorEntity()
{
DeviceId = 0,
OpenTime = DateTime.Now,
CreateTime = DateTime.Now,
Status = 0
});
}
List<DbMCControl> mcControllist;
IBaseControl startdate;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
var allDb=GetAllControls();
//int adsa = BasePlcHelper.Instance.BU1BLT01_Alarm.NowValue.ToInt();
int value = BasePlcHelper.Instance.BU1BLT01_Set.NowValue.ToInt();
string sql = "insert into ActionCode values (13,'test','',1) select @@IDENTITY";
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null)
{
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
}
// dbHelper.ClearParameter();
// dbHelper.CommandType = CommandType.Text;
// dbHelper.CommandText = sql;
var s1 = BasePlcHelper.Instance.dryerA_dos0_eqNo.LastValue.ToInt();
int[] ssss = new int [] { };
var ss2s = BasePlcHelper.Instance.PlcReadByRunName("BU1BLT01_Set", out ssss);
mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.None);//获取所有待初始化控件
startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "MCLabel153".ToLower()).FirstOrDefault().BaseControl;
Timer timer1 = new Timer();
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Tick += new EventHandler(timer1EventProcessor);//添加事件
//ParametersWithPc.B1.FirstWord 256 768
//badc1el26587193265870
//
// var instanceDryer0Speeds = BasePlcHelper.Instance.Dryer0_speed;
//
// var instanceRecipeName0 = BasePlcHelper.Instance.recipeName0;
//
// //badc1e 2
// var read = BasePlcHelper.Instance.PlcRead(instanceRecipeName0, out int[] ss);
//192.168.153.100
// var firstWordNowValue = BasePlcHelper.Instance.test;
// var a = BasePlcHelper.Instance.tst0;
// var b = BasePlcHelper.Instance.tst1;
// var bs = BasePlcHelper.Instance.tst2;
// var bo = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 2, 2, out short[] f);
// var a2 = Mesnac.Basic.DataProcessor.Swap(f[0]); //注意西门子PLC需要高低位转换
//
// bo = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 0, 1, out short[] aaaaa);
// var aa = Mesnac.Basic.DataProcessor.Swap(aaaaa[0]); //注意西门子PLC需要高低位转换
// var qq = Convert.ToBoolean(aa);
//
//
//
//
// var aa = Mesnac.Basic.DataProcessor.Swap(aaaaa[0]); //注意西门子PLC需要高低位转换
//
// var bytesa = BitConverter.GetBytes(aa);
//
// bool[] bitsa = new bool[8];
//
// for (int i = 0; i < 8; i++)
// {
// bitsa[i] = (bytesa[0] & (1 << i)) != 0;
// }
// var plcReadds = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 1, 1, out short[] bbbb);
// var bSwap = Mesnac.Basic.DataProcessor.Swap(bbbb[0]); //注意西门子PLC需要高低位转换
//
// var bytesa = BitConverter.GetBytes(bSwap);
//
// bool[] bits = new bool[8];
//
// for (int i = 0; i <8; i++)
// {
// bits[i] = (bytesa[0] & (1 << i)) != 0;
//
// }
// bool[] bits2 = new bool[8];
//
// for (int i = 0; i <8; i++)
// {
// bits2[i] = (bytesa[1] & (1 << i)) != 0;
//
// }
//
// var ss = "asdf";
//
// short test = ssss[0];
// var bytes = BitConverter.GetBytes(test);
// DataKeyValue dataKeyRecipePause = new DataKeyValue("RecipePause");
//
// var swap = DataProcessor.Swap(ghPcSave3ThActs[0]);
// DataProcessor.ParseBinaryValue()
// var recipePause = BasePlcHelper.Instance.RecipePause.NowValue.ToInt();
//ParametersWithPc.B1.RecipePause
// 768 怎么调佣函数 怎么通过代码去写入
//或者调用控件
//Mesnac.Basic.DataProcessor.ToSiemen sInt32();
// var i = BasePlcHelper.Instance.Spare4.NowValue.ToInt();
// bool Spare4 = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.Spare4, out int[] spare4s);
//
//256 default-bit(11
// DbMCControl binGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "MCLabel153").FirstOrDefault();
//
//
// var comboBox1 = base.GetControlById("MCButton1") as System.Windows.Forms.Button;
// var comboBox1s = base.GetControlById("MCButton1") as Mesnac.Controls.Default.Button;
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
// List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
// IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
mCButton.Click += new EventHandler(timer1EventProcessor);
// var firstWordNowValue = BasePlcHelper.Instance.FirstWord.NowValue.ToInt();
//
// BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.FirstWord, new object[] {1});
//
// var plcHelp = BasePlcHelper.Instance;
//MCButton1
//OpenDoorService
// ShowMsg("小料Action1事件测试", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

@ -1,652 +1,9 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Form1" children="Controls">
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel1" children="Controls">
<Object type="Mesnac.Controls.ChemicalWeighing.LouDou, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="LouDou1" children="Controls">
<Property name="Location">156, 15</Property>
<Property name="Name">LouDou1</Property>
<Property name="Size">65, 99</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.SwithHostLight, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="SwithHostLight1" children="Controls">
<Property name="MName" />
<Property name="TName" />
<Property name="SName" />
<Property name="Location">129, 798</Property>
<Property name="Name">SwithHostLight1</Property>
<Property name="Size">18, 24</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.Xie, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Xie1" children="Controls">
<Property name="Location">79, 516</Property>
<Property name="Name">Xie1</Property>
<Property name="Size">56, 26</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.ThreeWayValve, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ThreeWayValve2" children="Controls">
<Property name="ZLTName" />
<Property name="ZLDName" />
<Property name="ALMTName" />
<Property name="ALMDName" />
<Property name="Location">419, 617</Property>
<Property name="Name">ThreeWayValve2</Property>
<Property name="Size">101, 51</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.FenChaXian, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="FenChaXian1" children="Controls">
<Property name="Location">319, 186</Property>
<Property name="Name">FenChaXian1</Property>
<Property name="Size">79, 100</Property>
</Object>
<Object type="Mesnac.Controls.Feeding.FaMen, Mesnac.Controls.Feeding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="FaMen32" children="Controls">
<Property name="StatusName" />
<Property name="Status">fmTurnOn</Property>
<Property name="Location">1022, 217</Property>
<Property name="Name">FaMen32</Property>
<Property name="Size">40, 38</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslConveyer, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="HslConveyer1" children="Controls">
<Property name="Text">HslConveyer1</Property>
<Property name="ForeColor">142, 196, 216</Property>
<Property name="MoveSpeed">-3</Property>
<Property name="CircularRadius">20</Property>
<Property name="Location">419, 127</Property>
<Property name="Name">HslConveyer1</Property>
<Property name="Size">299, 61</Property>
</Object>
<Object type="Mesnac.Controls.Feeding.PressureSwitch, Mesnac.Controls.Feeding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="PressureSwitch1" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylAlarm</Property>
<Property name="Location">464, 175</Property>
<Property name="Name">PressureSwitch1</Property>
<Property name="Size">13, 13</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.ThreeWayValve, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ThreeWayValve1" children="Controls">
<Property name="ZLTName" />
<Property name="ZLDName" />
<Property name="ALMTName" />
<Property name="ALMDName" />
<Property name="Location">211, 599</Property>
<Property name="Name">ThreeWayValve1</Property>
<Property name="Size">56, 60</Property>
</Object>
<Object type="Mesnac.Controls.Default.InfoPanel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="InfoPanel5" children="Controls">
<Object type="Mesnac.Controls.Default.ReplaceLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ReplaceLabel1" children="Controls">
<Property name="ReplaceExpress">0:暂停|1:运行|2:停止</Property>
<Property name="TextName">ParametersWithPc.B1.Dryer0_status</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">132, 71</Property>
<Property name="Name">ReplaceLabel1</Property>
<Property name="Size">95, 22</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line42" children="Controls">
<Property name="Location">-1, 272</Property>
<Property name="Name">Line42</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel13" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_pressure</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 243</Property>
<Property name="Name">MCLabel13</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel12" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">压力:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 244</Property>
<Property name="Name">MCLabel12</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond42" children="Controls">
<Property name="Location">25, 248</Property>
<Property name="Name">Diamond42</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line41" children="Controls">
<Property name="Location">-1, 229</Property>
<Property name="Name">Line41</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel11" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_currnet</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 200</Property>
<Property name="Name">MCLabel11</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel10" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">电流:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 201</Property>
<Property name="Name">MCLabel10</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond41" children="Controls">
<Property name="Location">25, 205</Property>
<Property name="Name">Diamond41</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line40" children="Controls">
<Property name="Location">-1, 187</Property>
<Property name="Name">Line40</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel9" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_speed</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 158</Property>
<Property name="Name">MCLabel9</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel8" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">速度:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 159</Property>
<Property name="Name">MCLabel8</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond40" children="Controls">
<Property name="Location">25, 163</Property>
<Property name="Name">Diamond40</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line39" children="Controls">
<Property name="Location">-1, 142</Property>
<Property name="Name">Line39</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel7" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_tempera-ture</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 113</Property>
<Property name="Name">MCLabel7</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel6" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">温度:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 114</Property>
<Property name="Name">MCLabel6</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel5" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">状态:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 70</Property>
<Property name="Name">MCLabel5</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line38" children="Controls">
<Property name="Location">-1, 98</Property>
<Property name="Name">Line38</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond39" children="Controls">
<Property name="Location">25, 118</Property>
<Property name="Name">Diamond39</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond38" children="Controls">
<Property name="Location">25, 74</Property>
<Property name="Name">Diamond38</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel4" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">干混机</Property>
<Property name="Font">黑体, 15.75pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">79, 12</Property>
<Property name="Name">MCLabel4</Property>
<Property name="Size">79, 21</Property>
</Object>
<Property name="MCKey" />
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Location">1143, 406</Property>
<Property name="Name">InfoPanel5</Property>
<Property name="Size">248, 289</Property>
</Object>
<Object type="Mesnac.Controls.Default.InfoPanel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="InfoPanel6" children="Controls">
<Object type="Mesnac.Controls.Default.ReplaceLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ReplaceLabel2" children="Controls">
<Property name="ReplaceExpress">0:暂停|1:运行|2:停止</Property>
<Property name="TextName">ParametersWithPc.B1.Dryer0_status</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">132, 71</Property>
<Property name="Name">ReplaceLabel2</Property>
<Property name="Size">95, 22</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line43" children="Controls">
<Property name="Location">-1, 272</Property>
<Property name="Name">Line43</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel15" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_pressure</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 243</Property>
<Property name="Name">MCLabel15</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel14" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">压力:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 244</Property>
<Property name="Name">MCLabel14</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond43" children="Controls">
<Property name="Location">25, 248</Property>
<Property name="Name">Diamond43</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line44" children="Controls">
<Property name="Location">-1, 229</Property>
<Property name="Name">Line44</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel17" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_currnet</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 200</Property>
<Property name="Name">MCLabel17</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel16" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">电流:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 201</Property>
<Property name="Name">MCLabel16</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond44" children="Controls">
<Property name="Location">25, 205</Property>
<Property name="Name">Diamond44</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line45" children="Controls">
<Property name="Location">-1, 187</Property>
<Property name="Name">Line45</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel19" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_speed</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 158</Property>
<Property name="Name">MCLabel19</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel18" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">速度:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 159</Property>
<Property name="Name">MCLabel18</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond45" children="Controls">
<Property name="Location">25, 163</Property>
<Property name="Name">Diamond45</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line48" children="Controls">
<Property name="Location">-1, 142</Property>
<Property name="Name">Line48</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel26" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.B1.Dryer0_tempera-ture</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">162, 113</Property>
<Property name="Name">MCLabel26</Property>
<Property name="Size">24, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel23" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">温度:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 114</Property>
<Property name="Name">MCLabel23</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel21" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">状态:</Property>
<Property name="Font">微软雅黑, 14.25pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">49, 70</Property>
<Property name="Name">MCLabel21</Property>
<Property name="Size">69, 26</Property>
</Object>
<Object type="Mesnac.Controls.Default.Line, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Line46" children="Controls">
<Property name="Location">-1, 98</Property>
<Property name="Name">Line46</Property>
<Property name="Size">292, 1</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond47" children="Controls">
<Property name="Location">25, 118</Property>
<Property name="Name">Diamond47</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.Diamond, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Diamond46" children="Controls">
<Property name="Location">25, 74</Property>
<Property name="Name">Diamond46</Property>
<Property name="Size">18, 18</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel20" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">干混机</Property>
<Property name="Font">黑体, 15.75pt, style=Bold</Property>
<Property name="ForeColor">White</Property>
<Property name="Location">79, 12</Property>
<Property name="Name">MCLabel20</Property>
<Property name="Size">79, 21</Property>
</Object>
<Property name="MCKey" />
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Location">760, 412</Property>
<Property name="Name">InfoPanel6</Property>
<Property name="Size">248, 289</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel153" children="Controls">
<Property name="Format" />
<Property name="TextName">ParametersWithPc.Tst3.recipeName</Property>
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">MCLabel153</Property>
<Property name="Location">205, 517</Property>
<Property name="Name">MCLabel153</Property>
<Property name="Size">65, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCButton1" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAKAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIGI0NWRkODA1MzMyMjQwZWE4YWFkNWVmYjM1ZDUyOGJmBgYAAAAM5by55Ye656qX5L2TBgcAAAAM5by55Ye656qX5L2TCw==</Binary>
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAALAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAANBAs=</Binary>
</Property>
<Property name="MCKey">MCLabel153</Property>
<Property name="MCDataSourceID" />
@ -663,72 +20,11 @@
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">MCButton1</Property>
<Property name="Location">505, 364</Property>
<Property name="Location">272, 199</Property>
<Property name="Name">MCButton1</Property>
<Property name="Size">161, 178</Property>
<Property name="TabIndex">66</Property>
</Object>
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel2" children="Controls">
<Object type="Mesnac.Controls.ChemicalWeighing.StateButton, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="StateButton1" children="Controls">
<Property name="StatusName">ParametersWithPc.B1.WatchDog</Property>
<Property name="Status">sssStop</Property>
<Property name="Location">16, 3</Property>
<Property name="Name">StateButton1</Property>
<Property name="Size">50, 54</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel171" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">系统急停</Property>
<Property name="Font">黑体, 9.75pt</Property>
<Property name="ForeColor">ControlLightLight</Property>
<Property name="Location">16, 149</Property>
<Property name="Name">MCLabel171</Property>
<Property name="Size">63, 13</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel154" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">PLC连接状态</Property>
<Property name="Font">黑体, 9.75pt</Property>
<Property name="ForeColor">ControlLightLight</Property>
<Property name="Location">6, 62</Property>
<Property name="Name">MCLabel154</Property>
<Property name="Size">84, 13</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.SystemStateShow, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="SystemStateShow1" children="Controls">
<Property name="StatusName">CWSS_PLC.DB100.PLC_SystemStop</Property>
<Property name="Status">sssStop</Property>
<Property name="Location">16, 92</Property>
<Property name="Name">SystemStateShow1</Property>
<Property name="Size">55, 54</Property>
</Object>
<Property name="Location">205, 257</Property>
<Property name="Name">Panel2</Property>
<Property name="Size">91, 174</Property>
</Object>
<Property name="BackColor">32, 72, 98</Property>
<Property name="Dock">Fill</Property>
<Property name="Location">0, 0</Property>

Loading…
Cancel
Save