2024-03-07 14:03:22 +08:00
|
|
|
|
using LeatherApp.Device;
|
|
|
|
|
using LeatherApp.Interface;
|
|
|
|
|
using Models;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using Sunny.UI;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace LeatherApp.Page
|
|
|
|
|
{
|
|
|
|
|
public partial class FProductInfo : UIPage
|
|
|
|
|
{
|
|
|
|
|
private Service.ProductService service=new Service.ProductService();
|
|
|
|
|
private Models.Product model = new Models.Product();
|
|
|
|
|
public FProductInfo()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
#region dataGridView设置
|
|
|
|
|
uiDataGridView1.AllowUserToAddRows = uiDataGridView1.AllowUserToDeleteRows = false;//用户添加删除行
|
|
|
|
|
uiDataGridView2.AllowUserToAddRows = uiDataGridView2.AllowUserToDeleteRows = false;
|
|
|
|
|
uiDataGridView1.AllowUserToResizeRows = uiDataGridView2.AllowUserToResizeRows=false;//用户调整行大小
|
|
|
|
|
//dataGridView1.AllowUserToResizeColumns = false;//用户调整列大小
|
|
|
|
|
//显示行号与列宽度自动调整
|
|
|
|
|
uiDataGridView1.RowHeadersVisible = uiDataGridView2.RowHeadersVisible = true;
|
|
|
|
|
uiDataGridView1.RowHeadersWidth = uiDataGridView2.RowHeadersWidth = 50;
|
|
|
|
|
uiDataGridView1.ColumnHeadersHeightSizeMode = uiDataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
|
|
|
|
uiDataGridView1.RowHeadersWidthSizeMode = uiDataGridView2.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;//数据量过百绑定太变
|
|
|
|
|
//dataGridView1.RowPostPaint += (sender, e) =>//序号列头
|
|
|
|
|
//{
|
|
|
|
|
// //Utils.Util.showRowNum_onDataGrid_RowPostPaint(this.dataGridView1, sender, e);
|
|
|
|
|
// Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dataGridView1.RowHeadersWidth - 4, e.RowBounds.Height);
|
|
|
|
|
// TextRenderer.DrawText(e.Graphics, (e.RowIndex * 0.25f).ToString(), dataGridView1.RowHeadersDefaultCellStyle.Font, rectangle, dataGridView1.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
|
|
|
|
|
//};
|
|
|
|
|
//for (int i = 0; i < dataGridView1.Columns.Count; i++)//禁止点击列头排序
|
|
|
|
|
// dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
|
|
|
|
|
////行列交叉处标题
|
|
|
|
|
//if (dataGridView1.RowHeadersVisible) dataGridView1.TopLeftHeaderCell.Value = "SPH/CYL";
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
initData();
|
|
|
|
|
}
|
|
|
|
|
private void initData()
|
|
|
|
|
{
|
|
|
|
|
//var lstMaterial = Config.materialNameList.Select(x => new { code = x.Value<string>("code"), name = x.Value<string>("name") }).ToList();
|
|
|
|
|
//cmbMaterial.ValueMember = "code";
|
|
|
|
|
//cmbMaterial.DisplayMember = "name";
|
|
|
|
|
//cmbMaterial.DataSource = lstMaterial;
|
|
|
|
|
//cmbMaterial.SelectedIndex = -1;
|
|
|
|
|
|
|
|
|
|
var lstColor = Config.colorNameList.Select(x => new { code = x.Value<int>("code"),name = x.Value<string>("name") }).ToList();
|
|
|
|
|
cmbColor.ValueMember = "code";
|
|
|
|
|
cmbColor.DisplayMember = "name";
|
|
|
|
|
cmbColor.DataSource = lstColor;
|
|
|
|
|
cmbColor.SelectedIndex = -1;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
var filePathList = Directory.GetFiles(Application.StartupPath + "\\models\\", "*.trt");//*.onnx,
|
|
|
|
|
string[] onlyNameList=new string[filePathList.Length];
|
|
|
|
|
for (int i = 0; i < filePathList.Length; i++)
|
|
|
|
|
onlyNameList[i]=Path.GetFileName(filePathList[i]);
|
|
|
|
|
this.cmbModelName.Items.AddRange(onlyNameList);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
ABSCamerCardDev devCamer1;
|
|
|
|
|
if (Config.Camer_Name == CamerDevNameEnum.海康)
|
|
|
|
|
devCamer1 = new CamerCardDev();
|
|
|
|
|
else
|
|
|
|
|
devCamer1 = new CamerCardDevIK();
|
|
|
|
|
var value = devCamer1.getFeatureRangeValue("ExposureTime");
|
|
|
|
|
if (value.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
this.tcbarExposureTime.Minimum = (int)value[0];
|
|
|
|
|
this.tcbarExposureTime.Maximum = (int)value[1];
|
|
|
|
|
}
|
|
|
|
|
value = devCamer1.getFeatureRangeValue("Gain");
|
|
|
|
|
if (value.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
this.tcbarGain.Minimum = (int)value[0];
|
|
|
|
|
this.tcbarGain.Maximum = (int)value[1];
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
clear(true);
|
|
|
|
|
}
|
|
|
|
|
private void loadProduct(int id,bool resetAll=false)
|
|
|
|
|
{
|
|
|
|
|
model = service.GetModelNav(id);
|
|
|
|
|
if(model == null)
|
|
|
|
|
{
|
|
|
|
|
clear(resetAll);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
loadProduct();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 对外,生产页面不存在的CODE进行添加
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="pcode"> //PX-6</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public void loadProduct(string pcode, bool resetAll = false)
|
|
|
|
|
{
|
|
|
|
|
model = service.GetModelNav(pcode);
|
|
|
|
|
if (model == null)
|
|
|
|
|
{
|
|
|
|
|
clear(resetAll);
|
|
|
|
|
string[] codes= pcode.Split('-');
|
|
|
|
|
if (codes[0]=="0" || Config.SuedeList.Contains(codes[0]))
|
|
|
|
|
this.rbMaterial0.Checked = true;
|
|
|
|
|
else
|
|
|
|
|
this.rbMaterial1.Checked = true;
|
|
|
|
|
this.cmbColor.SelectedValue = int.Parse(codes[1]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
loadProduct();
|
|
|
|
|
}
|
|
|
|
|
private void loadProduct()
|
|
|
|
|
{
|
|
|
|
|
if (model == null) return;
|
|
|
|
|
if(model.Material=="0")
|
|
|
|
|
this.rbMaterial0.Checked = true;
|
|
|
|
|
else
|
|
|
|
|
this.rbMaterial1.Checked = true;
|
|
|
|
|
this.cmbColor.SelectedValue = model.Color;
|
|
|
|
|
|
|
|
|
|
tcbarLightValue.Value = model.LightValue;
|
|
|
|
|
tcbarExposureTime.Value = (int)model.ExposureTime;
|
|
|
|
|
tcbarGain.Value = (int)model.Gain;
|
|
|
|
|
tcbarTensionValue.Value = (int)model.TensionValue;
|
|
|
|
|
|
|
|
|
|
this.cmbModelName.Text = model.ModelName;
|
|
|
|
|
numDefectAreaLimit.Text = model.DefectAreaLimit.ToString();
|
|
|
|
|
numDefectCountLimit.Text = model.DefectCountLimit.ToString();
|
|
|
|
|
swcDefectPauseForUser.Active = model.DefectPauseForUser;
|
|
|
|
|
|
|
|
|
|
//uiDataGridView fill
|
|
|
|
|
string code;
|
|
|
|
|
QualifiedLimit item1;
|
|
|
|
|
for (int i = 0; i < uiDataGridView1.Rows.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
code = uiDataGridView1.Rows[i].Cells["col_code"].Value.ToString();
|
|
|
|
|
item1 = model.QualifiedLimitList.FirstOrDefault(m=>m.Code == code);
|
|
|
|
|
if (item1 != null)
|
|
|
|
|
{
|
|
|
|
|
uiDataGridView1.Rows[i].Cells["col_zxd"].Value=item1.ZXD;
|
2024-04-12 08:48:03 +08:00
|
|
|
|
uiDataGridView1.Rows[i].Cells["col_area"].Value = item1.Area * 100;
|
2024-03-07 14:03:22 +08:00
|
|
|
|
uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value = item1.ContrastTop;
|
|
|
|
|
uiDataGridView1.Rows[i].Cells["col_contrast_lower"].Value = item1.ContrastLower;
|
|
|
|
|
uiDataGridView1.Rows[i].Cells["col_IsOR"].Value = item1.IsOR;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GradeLimit item2;
|
|
|
|
|
for (int i = 0; i < uiDataGridView2.Rows.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
code = uiDataGridView2.Rows[i].Cells["col2_code"].Value.ToString();
|
|
|
|
|
item2 = model.GradeLimitList.FirstOrDefault(m => m.Code == code);
|
|
|
|
|
if (item2 != null)
|
|
|
|
|
{
|
|
|
|
|
uiDataGridView2.Rows[i].Cells["col2_1"].Value = item2.A;
|
|
|
|
|
uiDataGridView2.Rows[i].Cells["col2_2"].Value = item2.B;
|
|
|
|
|
uiDataGridView2.Rows[i].Cells["col2_3"].Value = item2.C;
|
|
|
|
|
uiDataGridView2.Rows[i].Cells["col2_4"].Value = item2.D;
|
|
|
|
|
uiDataGridView2.Rows[i].Cells["col2_5"].Value = item2.E;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
this.btnSave.Visible = this.btnReload.Visible = true;
|
|
|
|
|
}
|
|
|
|
|
private void clear(bool resetAll=false)
|
|
|
|
|
{
|
|
|
|
|
model = new Models.Product();
|
|
|
|
|
if (resetAll)
|
|
|
|
|
{
|
|
|
|
|
rbMaterial0.Checked=rbMaterial1.Checked=false;
|
|
|
|
|
cmbColor.SelectedIndex = -1;
|
|
|
|
|
}
|
|
|
|
|
tcbarLightValue.Value = tcbarExposureTime.Value = tcbarGain.Value = tcbarTensionValue.Value=0;
|
|
|
|
|
//cmbModelName.SelectedIndex = -1;
|
|
|
|
|
numDefectAreaLimit.Text =numDefectCountLimit.Text= "0";
|
|
|
|
|
swcDefectPauseForUser.Active = true;
|
|
|
|
|
|
|
|
|
|
this.btnSave.Visible = true;
|
|
|
|
|
this.btnReload.Visible = false;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
uiDataGridView1.Rows.Clear();
|
|
|
|
|
uiDataGridView2.Rows.Clear();
|
|
|
|
|
string code, name;
|
|
|
|
|
//===uiDataGridView1
|
|
|
|
|
//加列
|
|
|
|
|
//uiDataGridView1.Columns.Add("col_code", "code");
|
|
|
|
|
//uiDataGridView1.Columns.Add("col_zxd", "置信度");
|
|
|
|
|
//uiDataGridView1.Columns.Add("col_area", "面积");
|
|
|
|
|
//uiDataGridView1.Columns.Add("col_contrast", "对比度");
|
|
|
|
|
//禁止点击列头排序
|
|
|
|
|
//uiDataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
|
|
|
|
|
uiDataGridView1.Columns[0].Visible = false;
|
|
|
|
|
//加行
|
|
|
|
|
foreach (JObject item in Config.defectItemList)
|
|
|
|
|
{
|
|
|
|
|
code = item.Value<string>("code");
|
|
|
|
|
name = item.Value<string>("name");
|
|
|
|
|
//color = item.Value<string>("color");
|
|
|
|
|
uiDataGridView1.Rows.Add();
|
|
|
|
|
uiDataGridView1.Rows[uiDataGridView1.RowCount - 1].HeaderCell.Value = name;
|
|
|
|
|
uiDataGridView1[0, uiDataGridView1.RowCount - 1].Value = code;
|
|
|
|
|
}
|
|
|
|
|
//===uiDataGridView2
|
|
|
|
|
//加列
|
|
|
|
|
//uiDataGridView2.Columns.Add("col_code", "code");
|
|
|
|
|
//uiDataGridView2.Columns.Add("col_1", "A");
|
|
|
|
|
//uiDataGridView2.Columns.Add("col_2", "B");
|
|
|
|
|
//uiDataGridView2.Columns.Add("col_3", "C");
|
|
|
|
|
//uiDataGridView2.Columns.Add("col_4", "D");
|
|
|
|
|
//uiDataGridView2.Columns.Add("col_5", "E");
|
|
|
|
|
//禁止点击列头排序
|
|
|
|
|
//uiDataGridView2.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
|
|
|
|
|
uiDataGridView2.Columns[0].Visible = false;
|
|
|
|
|
//加行
|
|
|
|
|
foreach (JObject item in Config.defectItemList)
|
|
|
|
|
{
|
|
|
|
|
code = item.Value<string>("code");
|
|
|
|
|
name = item.Value<string>("name");
|
|
|
|
|
//color = item.Value<string>("color");
|
|
|
|
|
uiDataGridView2.Rows.Add();
|
|
|
|
|
uiDataGridView2.Rows[uiDataGridView2.RowCount - 1].HeaderCell.Value = name;
|
|
|
|
|
uiDataGridView2[0, uiDataGridView2.RowCount - 1].Value = code;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void FProductInfo_Initialize(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void btnNew_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.clear();
|
|
|
|
|
}
|
|
|
|
|
private void btnReload_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
this.loadProduct(model.Id,true);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
UIMessageTip.ShowError(ex.Message, 2000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void btnSave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (!this.rbMaterial0.Checked && !rbMaterial1.Checked) throw new Exception("请选择材质!");
|
|
|
|
|
if (this.cmbColor.SelectedIndex < 0) throw new Exception("请选择颜色!");
|
|
|
|
|
if (this.cmbModelName.SelectedIndex < 0) throw new Exception("请选择模型!");
|
|
|
|
|
|
|
|
|
|
model.Material = rbMaterial0.Checked ? "0" : "1";
|
|
|
|
|
model.Color = (int)cmbColor.SelectedValue;
|
|
|
|
|
model.Code = model.Material+"-"+ model.Color;
|
|
|
|
|
|
|
|
|
|
model.LightValue = tcbarLightValue.Value;
|
|
|
|
|
model.TensionValue = tcbarTensionValue.Value;
|
|
|
|
|
model.ExposureTime = tcbarExposureTime.Value;
|
|
|
|
|
model.Gain = tcbarGain.Value;
|
|
|
|
|
|
|
|
|
|
model.ModelName = this.cmbModelName.Text.Trim();
|
|
|
|
|
model.DefectAreaLimit = double.Parse(numDefectAreaLimit.Text.Trim());
|
|
|
|
|
model.DefectCountLimit = int.Parse(numDefectCountLimit.Text.Trim());
|
|
|
|
|
model.DefectPauseForUser = swcDefectPauseForUser.Active;
|
|
|
|
|
|
|
|
|
|
//datagrid
|
|
|
|
|
if (model.QualifiedLimitList == null)
|
|
|
|
|
model.QualifiedLimitList = new List<Models.QualifiedLimit>();
|
|
|
|
|
else
|
|
|
|
|
model.QualifiedLimitList.Clear();
|
|
|
|
|
QualifiedLimit qualifiedLimit = new QualifiedLimit();
|
|
|
|
|
for (int i=0;i< uiDataGridView1.Rows.Count;i++ )
|
|
|
|
|
{
|
|
|
|
|
qualifiedLimit = new Models.QualifiedLimit()
|
|
|
|
|
{
|
|
|
|
|
Code = uiDataGridView1.Rows[i].Cells["col_code"].Value.ToString(),
|
|
|
|
|
ZXD = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_zxd"].Value) ? Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_zxd"].Value) : 0,
|
2024-04-12 08:48:03 +08:00
|
|
|
|
Area = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_area"].Value) ? Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_area"].Value) / 100 : 0,
|
2024-03-07 14:03:22 +08:00
|
|
|
|
ContrastLower = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_contrast_lower"].Value) ? Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_contrast_lower"].Value) : 0,
|
|
|
|
|
ContrastTop = Utils.Util.IsDecimal(uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value) ? Convert.ToDouble(uiDataGridView1.Rows[i].Cells["col_contrast_top"].Value) : 0,
|
|
|
|
|
IsOR = Convert.ToBoolean(uiDataGridView1.Rows[i].Cells["col_IsOR"].Value),
|
|
|
|
|
|
|
|
|
|
ModifyUserCode = Config.loginUser.Code,
|
|
|
|
|
CreateUserCode = Config.loginUser.Code
|
|
|
|
|
};
|
|
|
|
|
if (qualifiedLimit.ContrastLower + qualifiedLimit.ContrastTop > 0 && qualifiedLimit.ContrastTop < qualifiedLimit.ContrastLower)
|
|
|
|
|
throw new Exception($"检测标准中第{i+1}行中对比度上限值({qualifiedLimit.ContrastTop})不可小于下限值({qualifiedLimit.ContrastLower})!");
|
|
|
|
|
model.QualifiedLimitList.Add(qualifiedLimit);
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
if (model.GradeLimitList == null)
|
|
|
|
|
model.GradeLimitList = new List<Models.GradeLimit>();
|
|
|
|
|
else
|
|
|
|
|
model.GradeLimitList.Clear();
|
|
|
|
|
for (int i = 0; i < uiDataGridView2.Rows.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
model.GradeLimitList.Add(
|
|
|
|
|
new Models.GradeLimit()
|
|
|
|
|
{
|
|
|
|
|
Code = uiDataGridView2.Rows[i].Cells["col2_code"].Value.ToString(),
|
|
|
|
|
A = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_1"].Value)? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_1"].Value) : 0,
|
|
|
|
|
B = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_2"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_2"].Value) : 0,
|
|
|
|
|
C = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_3"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_3"].Value) : 0,
|
|
|
|
|
D = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_4"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_4"].Value) : 0,
|
|
|
|
|
E = Utils.Util.IsNumber(uiDataGridView2.Rows[i].Cells["col2_5"].Value) ? Convert.ToInt32(uiDataGridView2.Rows[i].Cells["col2_5"].Value) : 0,
|
|
|
|
|
ModifyUserCode = Config.loginUser.Code,
|
|
|
|
|
CreateUserCode = Config.loginUser.Code
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
model.ModifyUserCode = Config.loginUser.Code;
|
|
|
|
|
bool result;
|
|
|
|
|
if (model.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
model.CreateUserCode = Config.loginUser.Code;
|
|
|
|
|
result = service.InsertNav(model);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result = service.UpdateNav(model);
|
|
|
|
|
}
|
|
|
|
|
if (!result)
|
|
|
|
|
throw new Exception("保存失败!");
|
|
|
|
|
|
|
|
|
|
this.btnReload.Visible = true;
|
|
|
|
|
UIMessageTip.ShowOk("保存成功!", 1000);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
UIMessageTip.ShowError(ex.Message, 2000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
private void tcbarLightValue_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
lblLightValue.Text = $"{tcbarLightValue.Value}/{tcbarLightValue.Maximum}";
|
|
|
|
|
}
|
|
|
|
|
private void tcbarExposureTime_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
lblExposureTime.Text = $"{tcbarExposureTime.Value}/{tcbarExposureTime.Maximum}";
|
|
|
|
|
}
|
|
|
|
|
private void tcbarGainValue_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
lblGain.Text = $"{tcbarGain.Value}/{tcbarGain.Maximum}";
|
|
|
|
|
}
|
|
|
|
|
private void tcbarTensionValue_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
lblTensionValue.Text = $"{tcbarTensionValue.Value}/{tcbarTensionValue.Maximum}";
|
|
|
|
|
}
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.clear(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmbMaterial_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
//if (this.cmbMaterial.SelectedIndex < 0 || this.cmbColor.SelectedIndex < 0)
|
|
|
|
|
// return;
|
|
|
|
|
if ((!this.rbMaterial0.Checked && !this.rbMaterial1.Checked) || this.cmbColor.SelectedIndex < 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
this.loadProduct((this.rbMaterial0.Checked?"0":"1") + "-" + this.cmbColor.SelectedValue.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnDefectOption_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.model == null || this.model.Id==0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
FSelDefect frm = new FSelDefect(model.DefectPauseOption);
|
|
|
|
|
frm.Render();
|
|
|
|
|
frm.Text = "选择瑕疵";
|
|
|
|
|
frm.ShowDialog();
|
|
|
|
|
if (frm.IsOK)
|
|
|
|
|
{
|
|
|
|
|
model.DefectPauseOption = frm.lstCodes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
frm.Dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void swcDefectPauseForUser_ValueChanged(object sender, bool value)
|
|
|
|
|
{
|
|
|
|
|
btnDefectOption.Enabled = swcDefectPauseForUser.Active;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|