|
|
@@ -165,8 +165,8 @@ namespace UAS_MES_NEW.Make
|
|
|
break;
|
|
|
case 2:
|
|
|
dialog.Description = "请选择读取印刷机设备的文本文件夹";
|
|
|
- equiType = "印刷机";
|
|
|
currFileType = "csv";
|
|
|
+ equiType = "印刷机";
|
|
|
break;
|
|
|
case 3:
|
|
|
dialog.Description = "请选择读取贴片机的文本文件夹";
|
|
|
@@ -305,17 +305,63 @@ namespace UAS_MES_NEW.Make
|
|
|
//csvData = ParseCsvFile(file);
|
|
|
csvData = ParseCsvFile<SpiData>(file, MapToSpiData);
|
|
|
|
|
|
- foreach(var item in csvData)
|
|
|
+ List<string> Barcode = new List<string>();
|
|
|
+ List<string> Date = new List<string>();
|
|
|
+
|
|
|
+ List<string> AreaPercent = new List<string>();
|
|
|
+ List<string> Height = new List<string>();
|
|
|
+ List<string> VolumePercent = new List<string>();
|
|
|
+ List<string> XOffset = new List<string>();
|
|
|
+ List<string> YOffset = new List<string>();
|
|
|
+ List<string> PadSizeX = new List<string>();
|
|
|
+ List<string> PadSizeY = new List<string>();
|
|
|
+ List<string> Area = new List<string>();
|
|
|
+ List<string> HeightPercent = new List<string>();
|
|
|
+ List<string> Volume = new List<string>();
|
|
|
+ List<string> Result = new List<string>();
|
|
|
+
|
|
|
+ foreach (var item in csvData)
|
|
|
{
|
|
|
- sql.Append($@"INSERT INTO steptestdetail (std_id,std_sn,std_makecode,
|
|
|
+ Barcode.Add(item.Barcode);
|
|
|
+ Date.Add(item.Date);
|
|
|
+ Result.Add(item.Result);
|
|
|
+
|
|
|
+ AreaPercent.Add(item.AreaPercent);
|
|
|
+ Height.Add(item.Height);
|
|
|
+ VolumePercent.Add(item.VolumePercent);
|
|
|
+ XOffset.Add(item.XOffset);
|
|
|
+ YOffset.Add(item.YOffset);
|
|
|
+ PadSizeX.Add(item.PadSizeX);
|
|
|
+ PadSizeY.Add(item.PadSizeY);
|
|
|
+ Area.Add(item.Area);
|
|
|
+ HeightPercent.Add(item.HeightPercent);
|
|
|
+ Volume.Add(item.Volume);
|
|
|
+ }
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append($@"INSERT INTO steptestdetail (std_id,std_sn,std_makecode,
|
|
|
std_testresult,std_class,std_actualvalue,
|
|
|
- std_rescode,STD_SUBCLASS1) VALUES (steptestdetail_seq.nextval,v_sn,v_wo,
|
|
|
- decode(v_testres,'PASS','OK','NG','NG'),v_equi_type,'notfound',
|
|
|
- v_sourcecode,v_equi_type)");
|
|
|
+ std_rescode,STD_SUBCLASS1,STD_VALUE1,
|
|
|
+ STD_VALUE2,STD_VALUE3,STD_VALUE4,
|
|
|
+ STD_VALUE5,STD_VALUE6,STD_VALUE7,
|
|
|
+ STD_VALUE8,STD_VALUE9,STD_VALUE10)
|
|
|
+ (select steptestdetail_seq.nextval,:Barcode,'{ma_code.Text}',
|
|
|
+ :Result,'{equiType}','notfound',
|
|
|
+ '{User.UserSourceCode}','{equiType}',:AreaPercent,
|
|
|
+ :Height,:VolumePercent,:XOffset,
|
|
|
+ :YOffset,:PadSizeX,:PadSizeY,
|
|
|
+ :Area,:HeightPercent,:Volume from dual)");
|
|
|
+
|
|
|
+ dh.BatchInsert(sql.GetString(),
|
|
|
+ new string[] { "Barcode", "Result", "AreaPercent",
|
|
|
+ "Height" ,"VolumePercent","XOffset",
|
|
|
+ "YOffset","PadSizeX","PadSizeY",
|
|
|
+ "Area","HeightPercent","Volume"},
|
|
|
+ Barcode.ToArray(), Result.ToArray(), AreaPercent.ToArray(),
|
|
|
+ Height.ToArray(), VolumePercent.ToArray(), XOffset.ToArray(),
|
|
|
+ YOffset.ToArray(), PadSizeX.ToArray(), PadSizeY.ToArray(),
|
|
|
+ Area.ToArray(), HeightPercent.ToArray(), Volume.ToArray());
|
|
|
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
string xmlContent = File.ReadAllText(file);
|
|
|
if (ConsoleLog(xmlContent, file))
|
|
|
{
|
|
|
@@ -332,6 +378,103 @@ namespace UAS_MES_NEW.Make
|
|
|
List<PrintData> priMacData;
|
|
|
priMacData = ParseCsvFile<PrintData>(file, MapToPriMacData);
|
|
|
|
|
|
+ List<string> BarCode = new List<string>();
|
|
|
+ List<string> TimeStamp = new List<string>();
|
|
|
+ List<string> FileName = new List<string>();
|
|
|
+ List<string> ProgramRunning = new List<string>();
|
|
|
+
|
|
|
+ List<string> CycleTime = new List<string>();
|
|
|
+ List<string> DSPIResult_2 = new List<string>();
|
|
|
+ List<string> PrintSpeed = new List<string>();
|
|
|
+ List<string> FrontSQGPress = new List<string>();
|
|
|
+ List<string> RearSQGPress = new List<string>();
|
|
|
+ List<string> PrintMode = new List<string>();
|
|
|
+
|
|
|
+ List<string> SnapOffDistance = new List<string>();
|
|
|
+ List<string> SnapOffSpeed = new List<string>();
|
|
|
+ List<string> SnapOffDelay = new List<string>();
|
|
|
+ List<string> SQGUpSpeed = new List<string>();
|
|
|
+ List<string> SQGDownSpeed = new List<string>();
|
|
|
+ List<string> SQGUpFirst = new List<string>();
|
|
|
+ List<string> SQGHeightAtSnapOff = new List<string>();
|
|
|
+ List<string> CleaningAfterLastBoard = new List<string>();
|
|
|
+ List<string> CleaningFrequency = new List<string>();
|
|
|
+ List<string> CleaningSpeed = new List<string>();
|
|
|
+
|
|
|
+ List<string> CleaningType = new List<string>();
|
|
|
+ List<string> AddSPMode = new List<string>();
|
|
|
+
|
|
|
+ List<string> PrintDirection = new List<string>();
|
|
|
+ List<string> PCBSize = new List<string>();
|
|
|
+ List<string> TableUpX = new List<string>();
|
|
|
+ List<string> TableUpY1 = new List<string>();
|
|
|
+ List<string> TableUpY2 = new List<string>();
|
|
|
+
|
|
|
+ foreach (var item in priMacData)
|
|
|
+ {
|
|
|
+ BarCode.Add(item.BarCode);
|
|
|
+ TimeStamp.Add(item.TimeStamp);
|
|
|
+ FileName.Add(item.FileName);
|
|
|
+ ProgramRunning.Add(item.ProgramRunning);
|
|
|
+
|
|
|
+ CycleTime.Add(item.CycleTime);
|
|
|
+ DSPIResult_2.Add(item._2DSPIResult);
|
|
|
+ PrintSpeed.Add(item.PrintSpeed);
|
|
|
+ FrontSQGPress.Add(item.FrontSQGPress);
|
|
|
+ RearSQGPress.Add(item.RearSQGPress);
|
|
|
+ PrintMode.Add(item.PrintMode);
|
|
|
+
|
|
|
+ SnapOffDistance.Add(item.SnapOffDistance);
|
|
|
+ SnapOffSpeed.Add(item.SnapOffSpeed);
|
|
|
+ SnapOffDelay.Add(item.SnapOffDelay);
|
|
|
+ SQGUpSpeed.Add(item.SQGUpSpeed);
|
|
|
+ SQGDownSpeed.Add(item.SQGDownSpeed);
|
|
|
+ SQGUpFirst.Add(item.SQGUpFirst);
|
|
|
+ SQGHeightAtSnapOff.Add(item.SQGHeightAtSnapOff);
|
|
|
+ CleaningAfterLastBoard.Add(item.CleaningAfterLastBoard);
|
|
|
+ CleaningFrequency.Add(item.CleaningFrequency);
|
|
|
+ CleaningSpeed.Add(item.CleaningSpeed);
|
|
|
+
|
|
|
+ CleaningType.Add(item.CleaningType);
|
|
|
+ AddSPMode.Add(item.AddSPMode);
|
|
|
+
|
|
|
+ PrintDirection.Add(item.PrintDirection);
|
|
|
+ PCBSize.Add(item.PCBSize);
|
|
|
+ TableUpX.Add(item.TableUpX);
|
|
|
+ TableUpY1.Add(item.TableUpY1);
|
|
|
+ TableUpY2.Add(item.TableUpY2);
|
|
|
+ }
|
|
|
+
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append($@"INSERT INTO steptestdetail (std_id,std_sn,std_makecode,STD_TESTTIME,STD_CLASS,STD_SUBCLASS1,
|
|
|
+ STD_SUBCLASS2,STD_SUBCLASS3,STD_VALUE1,STD_VALUE2,STD_VALUE3,STD_VALUE4,
|
|
|
+ STD_VALUE5,STD_VALUE6,STD_VALUE7,STD_VALUE8,STD_VALUE9,
|
|
|
+ STD_VALUE10,STD_VALUE11,std_value12,std_value13,std_value14,
|
|
|
+ std_value15,std_value16,
|
|
|
+ STD_TESTRESULT,std_value18,std_value19,std_value20,std_value21,
|
|
|
+ std_rescode)
|
|
|
+ (select steptestdetail_seq.nextval,:BarCode,'{ma_code.Text}',to_date(:TimeStamp,'yyyy-mm-dd hh24:mi:ss'),:FileName,:ProgramRunning,
|
|
|
+ :CycleTime,:DSPIResult2,:PrintSpeed,:FrontSQGPress,:RearSQGPress,:PrintMode,
|
|
|
+ :SnapOffDistance,:SnapOffSpeed,:SnapOffDelay,:SQGUpSpeed,:SQGDownSpeed,
|
|
|
+ :SQGUpFirst,:SQGHeightAtSnapOff,:CleaningAfterLastBoard,:CleaningFrequency,:CleaningSpeed,
|
|
|
+ :CleaningType,:AddSPMode,
|
|
|
+ :PrintDirection,:PCBSize,:TableUpX,:TableUpY1,:TableUpY2,
|
|
|
+ '{User.UserSourceCode}' from dual)");
|
|
|
+
|
|
|
+ dh.BatchInsert(sql.GetString(),
|
|
|
+ new string[] { "BarCode", "TimeStamp", "FileName","ProgramRunning",
|
|
|
+ "CycleTime","DSPIResult_2","PrintSpeed","FrontSQGPress","RearSQGPress","PrintMode",
|
|
|
+ "SnapOffDistance","SnapOffSpeed","SnapOffDelay","SQGUpSpeed","SQGDownSpeed",
|
|
|
+ "SQGUpFirst","SQGHeightAtSnapOff","CleaningAfterLastBoard","CleaningFrequency","CleaningSpeed",
|
|
|
+ "CleaningType","AddSPMode",
|
|
|
+ "PrintDirection","PCBSize","TableUpX","TableUpY1","TableUpY2"},
|
|
|
+ BarCode.ToArray(), TimeStamp.ToArray(), FileName.ToArray(), ProgramRunning.ToArray(),
|
|
|
+ CycleTime.ToArray(), DSPIResult_2.ToArray(), PrintSpeed.ToArray(), FrontSQGPress.ToArray(), RearSQGPress.ToArray(), PrintMode.ToArray(),
|
|
|
+ SnapOffDistance.ToArray(), SnapOffSpeed.ToArray(), SnapOffDelay.ToArray(), SQGUpSpeed.ToArray(), SQGDownSpeed.ToArray(),
|
|
|
+ SQGUpFirst.ToArray(), SQGHeightAtSnapOff.ToArray(), CleaningAfterLastBoard.ToArray(), CleaningFrequency.ToArray(), CleaningSpeed.ToArray(),
|
|
|
+ CleaningType.ToArray(), AddSPMode.ToArray(),
|
|
|
+ PrintDirection.ToArray(), PCBSize.ToArray(), TableUpX.ToArray(), TableUpY1.ToArray(), TableUpY2.ToArray());
|
|
|
+
|
|
|
string xmlContent = File.ReadAllText(file);
|
|
|
if (ConsoleLog(xmlContent, file))
|
|
|
{
|