master
nodyang 1 year ago
parent 7034f0a654
commit 5bf766ff4a

@ -82,14 +82,29 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
view.Id = _id; view.Id = _id;
//List<RecipePlcView> recipePlcViews= List<RecipePlcView> recipePlcViews = new List<RecipePlcView>();
List<Step> recipeSteps = new List<Step>();
recipePlcViews = LjMixManagerDb.GetRecip(view.MetageAId);
recipeSteps=LjMixManagerDb.GetStep(view.MetageAId);
// 第一台干混机 // 第一台干混机
switch (_id) switch (_id)
{ {
case 1 : case 1 :
// LjMixManagerPlc.DownD1Recipe() LjMixManagerPlc.DownD1Recipe(recipePlcViews, recipeSteps);
break;
case 2 :
LjMixManagerPlc.DownD2Recipe(recipePlcViews, recipeSteps);
break;
case 3 :
LjMixManagerPlc.DownD3Recipe(recipePlcViews, recipeSteps);
break;
case 4 :
LjMixManagerPlc.DownD4Recipe(recipePlcViews, recipeSteps);
break; break;
} }

@ -99,6 +99,37 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
_view.MixBId = DrpMixB.SelectedValue.ToString(); _view.MixBId = DrpMixB.SelectedValue.ToString();
_view.MixBName=DrpMixB.Text; _view.MixBName=DrpMixB.Text;
LjMixManagerDb.UpdateMixB(_view); LjMixManagerDb.UpdateMixB(_view);
List<RecipePlcView> rG1 = new List<RecipePlcView>();
List<RecipePlcView> rG2 = new List<RecipePlcView>();
List<Step> recipeSteps = new List<Step>();
rG1 = LjMixManagerDb.GetRecip(_view.MetageB1Id);
rG2 = LjMixManagerDb.GetRecip(_view.MetageB2Id);
recipeSteps=LjMixManagerDb.GetStep( _view.MixBId);
// 第一台干混机
switch (_id)
{
case 1 :
LjMixManagerPlc.DownG1Recipe(rG1,rG2, recipeSteps);
break;
case 2 :
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
break;
case 3 :
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
break;
case 4 :
LjMixManagerPlc.DownG2Recipe(rG1,rG2, recipeSteps);
break;
}
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
} }
} }

@ -256,5 +256,55 @@ namespace Mesnac.Action.ChemicalWeighing.LjMixManager
return ls; return ls;
} }
public static List<RecipePlcView> GetRecip(string metageId)
{
string sql = $"select lsm.Code, a.Weight,a.Difference from lj_metage_detail a " +
$"left join dbo.lj_stock_material lsm on a.DeviceId = lsm.Id where a.MetageId='{metageId}'";
var dataTable = GetTable(sql);
List<RecipePlcView> list = new List<RecipePlcView>();
foreach (DataRow dataTableRow in dataTable.Rows)
{
RecipePlcView view = new RecipePlcView()
{
Bin = Convert.ToInt32(dataTableRow["Code"]),
Set = Convert.ToSingle(dataTableRow["Weight"]),
TolErance = Convert.ToSingle(dataTableRow["Weight"])
};
list.Add(view);
}
return list;
}
public static List<Step> GetStep(string metageId)
{
string sql =
$" select Id, MixId, ActionId, ActionName, SecondTime, Temperature, Speed, Weight, Difference, Remark "
+ $" from lj_mix_detail where MixId='{metageId}'";
var table = GetTable(sql);
List<Step> list = new List<Step>();
foreach (DataRow tableRow in table.Rows)
{
Step step = new Step();
//代码
step.MixCode = Convert.ToInt32(tableRow["ActionId"]);
//时间
step.MixTime = Convert.ToInt32(tableRow["SecondTime"]);
//温度
step.MixTemp = Convert.ToInt32(tableRow["SecondTime"]);
//速度
step.MixSpeed = Convert.ToInt32(tableRow["SecondTime"]);
list.Add(step);
}
return list;
}
} }
} }

@ -110,9 +110,8 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\A3Lib\FastReport\FastReport.VSDesign.dll</HintPath> <HintPath>..\..\..\A3Lib\FastReport\FastReport.VSDesign.dll</HintPath>
</Reference> </Reference>
<Reference Include="HslCommunication, Version=11.0.6.0, Culture=neutral, PublicKeyToken=3d72ad3b6b5ec0e3, processorArchitecture=MSIL"> <Reference Include="HslCommunication">
<SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\PlugInPlatform\HslCommunication.dll</HintPath>
<HintPath>Z:\Desktop\日常代码\榄菊项目\程序设计\lj_plc\PlugInPlatform\HslCommunication.dll</HintPath>
</Reference> </Reference>
<Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>

@ -15,8 +15,6 @@
<Node Name="FrmAnalysisReport" Text="生产分析报表" ToolTipText="FrmAnalysisReport" Tag="FrmAnalysisReport" ImageIndex="3" SelectedImageIndex="3" /> <Node Name="FrmAnalysisReport" Text="生产分析报表" ToolTipText="FrmAnalysisReport" Tag="FrmAnalysisReport" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FrmShift" Text="班次管理" ToolTipText="FrmShift" Tag="FrmShift" ImageIndex="3" SelectedImageIndex="3" /> <Node Name="FrmShift" Text="班次管理" ToolTipText="FrmShift" Tag="FrmShift" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="监控主界面" Text="监控主界面" ToolTipText="监控主界面" Tag="监控主界面" ImageIndex="3" SelectedImageIndex="3" /> <Node Name="监控主界面" Text="监控主界面" ToolTipText="监控主界面" Tag="监控主界面" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="DeviceParamManage" Text="设备参数管理" ToolTipText="DeviceParamManage" Tag="DeviceParamManage" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="密炼回放" Text="密炼回放" ToolTipText="密炼回放" Tag="密炼回放" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FrmProjectDebug" Text="工程调试" ToolTipText="FrmProjectDebug" Tag="FrmProjectDebug" ImageIndex="3" SelectedImageIndex="3" /> <Node Name="FrmProjectDebug" Text="工程调试" ToolTipText="FrmProjectDebug" Tag="FrmProjectDebug" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FrmOperationRecord" Text="操作日志" ToolTipText="FrmOperationRecord" Tag="FrmOperationRecord" ImageIndex="3" SelectedImageIndex="3" /> <Node Name="FrmOperationRecord" Text="操作日志" ToolTipText="FrmOperationRecord" Tag="FrmOperationRecord" ImageIndex="3" SelectedImageIndex="3" />
<Node Name="FrmRecipeType" Text="配方类别" ToolTipText="FrmRecipeType" Tag="FrmRecipeType" ImageIndex="3" SelectedImageIndex="3" /> <Node Name="FrmRecipeType" Text="配方类别" ToolTipText="FrmRecipeType" Tag="FrmRecipeType" ImageIndex="3" SelectedImageIndex="3" />

@ -1,3 +1,3 @@
<DataSources> <DataSources>
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="10.11.41.62" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" /> <DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="127.0.0.1" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
</DataSources> </DataSources>
Loading…
Cancel
Save