145 lines
4.5 KiB
C#
145 lines
4.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MesWork
|
|
{
|
|
public partial class Temp { }
|
|
public partial class MesWorkForm
|
|
{
|
|
|
|
/// <summary>
|
|
/// 允许保存(针对半自动和手动压装工位)
|
|
/// </summary>
|
|
/// <param name="OpName"></param>
|
|
/// <param name="tagValue"></param>
|
|
private static void MesRead(string opName, string tagValue, int tagID)
|
|
{
|
|
if (tagValue == "1")
|
|
{
|
|
// Hashtable valueList = ReadPLC_Sync_DataList_MesRead(opName);
|
|
|
|
// long id_tagCF;
|
|
// InsertQualityDataIndex(out id_tagCF);
|
|
|
|
//InsertQualityData(id_tagCF);
|
|
//// //Insert(System.Data.DataTable dt);
|
|
}
|
|
else
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
//static public void InsertQualityDataIndex(out long id_tagCF)
|
|
//{
|
|
// string tableName;
|
|
// ParamData[] paramWhere;
|
|
|
|
// int tagID = 81010003;
|
|
// int engineTypeID = 1;
|
|
// string engineID = "TestEn0001";
|
|
// string engineType = "Type001";
|
|
|
|
// paramWhere = new ParamData[4];
|
|
|
|
|
|
// tableName = "测量数据合格索引";
|
|
// paramWhere[0].name = "TagID_CF";
|
|
// paramWhere[0].value = tagID.ToString();
|
|
// paramWhere[1].name = "EngineTypeID";
|
|
// paramWhere[1].value = engineTypeID.ToString();
|
|
// paramWhere[2].name = "EngineID";
|
|
// paramWhere[2].value = engineID.ToString();
|
|
// paramWhere[3].name = "EngineType";
|
|
// paramWhere[3].value = engineType.ToString();
|
|
|
|
// Insert(tableName, paramWhere, out id_tagCF);
|
|
//}
|
|
|
|
|
|
//static public void InsertQualityData(long id_tagCF)
|
|
//{
|
|
// int tagID = 81010003;
|
|
// int engineTypeID = 1;
|
|
// string engineID = "TestEn0001";
|
|
// string engineType = "Type001";
|
|
// string tagValue;
|
|
// int isgood = 1;
|
|
// string tableName;
|
|
// tableName = "测量数据合格";
|
|
|
|
// DataTable dt = BuildDataTables_WWW(tableName);
|
|
// object[] value = new object[10];
|
|
|
|
// tagValue = "10001";
|
|
|
|
// value[0] = id_tagCF;
|
|
// value[1] = engineTypeID;
|
|
// value[2] = engineID;
|
|
// value[3] = tagID;
|
|
// value[4] = tagValue;
|
|
// value[5] = isgood;
|
|
// value[6] = "测量位置01";
|
|
// value[7] = "测量项目01";
|
|
// value[8] = "工位号01";
|
|
// value[9] = "理论值01";
|
|
// dt.Rows.Add(value);
|
|
|
|
// tagValue = "10002";
|
|
|
|
// value[0] = id_tagCF;
|
|
// value[1] = engineTypeID;
|
|
// value[2] = engineID;
|
|
// value[3] = tagID;
|
|
// value[4] = tagValue;
|
|
// value[5] = isgood;
|
|
// value[6] = "测量位置02";
|
|
// value[7] = "测量项目02";
|
|
// value[8] = "工位号02";
|
|
// value[9] = "理论值02";
|
|
// dt.Rows.Add(value);
|
|
|
|
// Insert(dt);
|
|
//}
|
|
|
|
|
|
static public DataTable BuildDataTables_WWW(string tableName)
|
|
{
|
|
DataTable table;
|
|
DataColumnCollection columns;
|
|
table = new DataTable(tableName);
|
|
columns = table.Columns;
|
|
table.Columns.Add("Id_tagCF", typeof(System.Int32));
|
|
table.Columns.Add("EngineTypeID", typeof(System.Int32));
|
|
table.Columns.Add("EngineID", typeof(System.String));
|
|
table.Columns.Add("TagID", typeof(System.String));
|
|
table.Columns.Add("TagValue", typeof(System.String));
|
|
table.Columns.Add("IsGoodBad", typeof(System.Int32));
|
|
table.Columns.Add("测量位置", typeof(System.String));
|
|
table.Columns.Add("测量项目", typeof(System.String));
|
|
table.Columns.Add("工位号", typeof(System.String));
|
|
table.Columns.Add("理论值", typeof(System.String));
|
|
table.Columns.Add("上限值", typeof(System.String));
|
|
table.Columns.Add("下限值", typeof(System.String));
|
|
table.Columns.Add("测量单位", typeof(System.String));
|
|
table.Columns.Add("列位置", typeof(System.Int32));
|
|
table.Columns.Add("变量排序", typeof(System.Int32));
|
|
|
|
return table;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|