清理无用代码
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
using JinYuan.CommunicationLib.Enum;
|
||||
using HslCommunication.ModBus;
|
||||
using JinYuan.CommunicationLib.Enum;
|
||||
using JinYuan.DataConvertLib;
|
||||
using JinYuan.Helper;
|
||||
using JinYuan.MES.Enums;
|
||||
using JinYuan.MES.Models;
|
||||
using JinYuan.Models;
|
||||
using JinYuan.VirtualDataLibrary;
|
||||
using PLCCommunication;
|
||||
using PLCCommunication.Language;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using HslCommunication.ModBus;
|
||||
|
||||
namespace JinYuan.ControlCenters
|
||||
{
|
||||
@@ -195,10 +191,10 @@ namespace JinYuan.ControlCenters
|
||||
//CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "称重不良", DataCount = 0 });
|
||||
//CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "铜极耳剪切不良", DataCount = 0 });
|
||||
//CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "铝极耳剪切不良", DataCount = 0 });
|
||||
|
||||
CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "扫码不良", DataCount = 0 });
|
||||
|
||||
CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "扫码不良", DataCount = 0 });
|
||||
CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "MES不良", DataCount = 0 });
|
||||
CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "其他不良" , DataCount = 0 });
|
||||
CommonMethods.Lst_DefectTypeQty.Add(new ChartDataType { DataType = "其他不良", DataCount = 0 });
|
||||
|
||||
}
|
||||
else //读取PLC数据
|
||||
@@ -423,14 +419,14 @@ namespace JinYuan.ControlCenters
|
||||
string _anemometerAddress = "D15000";//风速仪起始地址
|
||||
if (CommonMethods.mesConfig.isUpMes)
|
||||
{
|
||||
JYResult<byte[]> jYResult = CommonMethods.PlcLink.ReadValue<JYResult<byte[]>>(_anemometerAddress, Data_Type.ArrByte,150);
|
||||
JYResult<byte[]> jYResult = CommonMethods.PlcLink.ReadValue<JYResult<byte[]>>(_anemometerAddress, Data_Type.ArrByte, 150);
|
||||
List<float> _anemograph = GetList<float>(_anemometerNumber, 0);//初始化列表
|
||||
List<string> _anemometerName=new List<string>();
|
||||
List<string> _anemometerName = new List<string>();
|
||||
string _mesage = "";
|
||||
for (int i=0;i< _anemometerNumber;i++)
|
||||
for (int i = 0; i < _anemometerNumber; i++)
|
||||
{
|
||||
//初始化风速仪名称
|
||||
int _temple = i+1;
|
||||
int _temple = i + 1;
|
||||
string _name = "风速仪" + _temple.ToString();
|
||||
_anemometerName.Add(_name);
|
||||
|
||||
@@ -440,22 +436,22 @@ namespace JinYuan.ControlCenters
|
||||
//
|
||||
// 写csv文件
|
||||
string productName = string.Empty;
|
||||
string fileName=string.Empty;
|
||||
string filePath=string.Empty;
|
||||
string fileName = string.Empty;
|
||||
string filePath = string.Empty;
|
||||
DateTime nowDate = DateTime.Now;
|
||||
string fileTitle= "工序名称,生产机台编号,拉线,型号,物料编号,操作人员,班次,采集时间,";
|
||||
string fileContent= $"预焊工序,{CommonMethods.mesConfig.equipNum},{CommonMethods.mesConfig.lineCode},{productName},{CommonMethods.mesConfig.MaterialCode},{CommonMethods.mesConfig.mesUserName},{CommonMethods.strClass},{nowDate.ToString("yyyy-MM-dd HH:mm:ss")},";
|
||||
string fileTitle = "工序名称,生产机台编号,拉线,型号,物料编号,操作人员,班次,采集时间,";
|
||||
string fileContent = $"预焊工序,{CommonMethods.mesConfig.equipNum},{CommonMethods.mesConfig.lineCode},{productName},{CommonMethods.mesConfig.MaterialCode},{CommonMethods.mesConfig.mesUserName},{CommonMethods.strClass},{nowDate.ToString("yyyy-MM-dd HH:mm:ss")},";
|
||||
filePath = $@"{CommonMethods.strAnemographpath}\{nowDate.Year}\{nowDate.Month}";
|
||||
fileName = $@"{nowDate.Day}.csv";
|
||||
|
||||
for (int j = 0; j < _anemometerNumber; j++)
|
||||
{
|
||||
fileTitle = fileTitle +","+ _anemometerName[j];
|
||||
{
|
||||
fileTitle = fileTitle + "," + _anemometerName[j];
|
||||
fileContent = fileContent + "," + _anemograph[j];
|
||||
}
|
||||
CSVHelper<object>.WriterCSV(filePath, fileName, fileTitle, fileContent);
|
||||
|
||||
|
||||
|
||||
|
||||
if (false)//待确认接口
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user