|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMaterial;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMetageFormula;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMixFormula;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjMixManager
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class FrmMixB : Form
|
|
|
|
|
{
|
|
|
|
|
public FrmMixB()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
private int _id = 0;
|
|
|
|
|
|
|
|
|
|
public FrmMixB(int id) : this()
|
|
|
|
|
{
|
|
|
|
|
_id = id;
|
|
|
|
|
FillController();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private LjMixManagerView _view;
|
|
|
|
|
|
|
|
|
|
private void FillController()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IEnumerable<MyNameValueStr> ien = MetageFormulaDb.GetMetageNmaValue();
|
|
|
|
|
var drpA = ien.ToList();
|
|
|
|
|
var drpB = ien.ToList();
|
|
|
|
|
var drpC = ien.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FillComboBox(DrpMetageB1);
|
|
|
|
|
DrpMetageB1.DataSource = drpB;
|
|
|
|
|
FillComboBox(DrpMetageB2);
|
|
|
|
|
DrpMetageB2.DataSource = drpC;
|
|
|
|
|
var lsBMixList = MixDb.GetMyNameValueStrs(1);
|
|
|
|
|
DrpMixB.DataSource = lsBMixList;
|
|
|
|
|
FillComboBox(DrpMixB);
|
|
|
|
|
_view = LjMixManagerDb.GetById(_id);
|
|
|
|
|
Checked(DrpMetageB1, _view.MetageB1Id);
|
|
|
|
|
Checked(DrpMetageB2, _view.MetageB2Id);
|
|
|
|
|
Checked(DrpMixB, _view.MixBId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void FillComboBox(ComboBox combo)
|
|
|
|
|
{
|
|
|
|
|
combo.ValueMember = "Id";
|
|
|
|
|
combo.DisplayMember = "Name";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Checked(ComboBox alBox, string checkId)
|
|
|
|
|
{
|
|
|
|
|
foreach (MyNameValueStr combo in alBox.Items)
|
|
|
|
|
{
|
|
|
|
|
if (combo.Id == checkId)
|
|
|
|
|
{
|
|
|
|
|
alBox.SelectedItem = combo;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
_view.Id = _id;
|
|
|
|
|
_view.MetageB1Id = DrpMetageB1.SelectedValue.ToString();
|
|
|
|
|
_view.MetageB1Name = DrpMetageB1.Text;
|
|
|
|
|
_view.MetageB2Id = DrpMetageB2.SelectedValue.ToString();
|
|
|
|
|
_view.MetageB2Name = DrpMetageB2.Text;
|
|
|
|
|
_view.MixBId = DrpMixB.SelectedValue.ToString();
|
|
|
|
|
_view.MixBName=DrpMixB.Text;
|
|
|
|
|
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.DownG3Recipe(rG1,rG2, recipeSteps);
|
|
|
|
|
// break;
|
|
|
|
|
// case 4 :
|
|
|
|
|
// LjMixManagerPlc.DownG4Recipe(rG1,rG2, recipeSteps);
|
|
|
|
|
// break;
|
|
|
|
|
//
|
|
|
|
|
// case 5 :
|
|
|
|
|
// LjMixManagerPlc.DownG5Recipe(rG1,rG2, recipeSteps);
|
|
|
|
|
// break;
|
|
|
|
|
// case 6 :
|
|
|
|
|
// LjMixManagerPlc.DownG6Recipe(rG1,rG2, recipeSteps);
|
|
|
|
|
// break;
|
|
|
|
|
// case 7 :
|
|
|
|
|
// LjMixManagerPlc.DownG7Recipe(rG1,rG2, recipeSteps);
|
|
|
|
|
// break;
|
|
|
|
|
// case 8 :
|
|
|
|
|
// LjMixManagerPlc.DownG8Recipe(rG1,rG2, recipeSteps);
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|