You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
3.6 KiB
C#
125 lines
3.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Mesnac.Compressor.Entity
|
|
{
|
|
public class WorkStation
|
|
{
|
|
public WorkStation()
|
|
{
|
|
this.plcAdress = new PLCAddress();
|
|
this.Name = ConfigurationManager.AppSettings["stationName"].ToString();
|
|
plcAdress.PlcWorkAddress = ConfigurationManager.AppSettings["PlcWorkAddress"].ToString();
|
|
plcAdress.PlcReadAddress = ConfigurationManager.AppSettings["PlcReadAddress"].ToString();
|
|
plcAdress.PlcReleaseAdress = ConfigurationManager.AppSettings["PlcReleaseAdress"].ToString();
|
|
plcAdress.PlcDataAdress = ConfigurationManager.AppSettings["PlcDataAdress"].ToString();
|
|
plcAdress.PlcDataQuantity = Convert.ToInt32(ConfigurationManager.AppSettings["PlcDataQuality"]);
|
|
plcAdress.PlcQuality = ConfigurationManager.AppSettings["PlcQuality"].ToString();
|
|
DbTableName = ConfigurationManager.AppSettings["DataTableName"].ToString();
|
|
DataName = ConfigurationManager.AppSettings["DataName"].ToString();
|
|
AlarmName = ConfigurationManager.AppSettings["AlarmName"].ToString();
|
|
Ant = ConfigurationManager.AppSettings["Ant"].ToString();
|
|
}
|
|
|
|
#region 单例模式
|
|
private static WorkStation _instance;
|
|
private static readonly object syans = new object();
|
|
public static WorkStation Instance
|
|
{
|
|
get
|
|
{
|
|
if(_instance==null)
|
|
{
|
|
lock(syans)
|
|
{
|
|
_instance=new WorkStation();
|
|
}
|
|
}
|
|
return _instance;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 工位类型
|
|
/// </summary>
|
|
public string StationType { get; set; }
|
|
|
|
/// <summary>
|
|
/// 工位类型
|
|
/// </summary>
|
|
public StationState State { get; set; }
|
|
|
|
/// <summary>
|
|
/// 插入数据表名
|
|
/// </summary>
|
|
public string DbTableName;
|
|
|
|
|
|
public PLCAddress plcAdress;
|
|
|
|
public WorkTray workTray;
|
|
|
|
/// <summary>
|
|
/// 数据区对应的名字
|
|
/// </summary>
|
|
public string DataName;
|
|
|
|
/// <summary>
|
|
/// 报警区对应的名字
|
|
/// </summary>
|
|
public string AlarmName;
|
|
|
|
public string Ant;
|
|
}
|
|
|
|
//public class PLCAddress
|
|
//{
|
|
// /// <summary>
|
|
// /// PLC允许写入地址
|
|
// /// </summary>
|
|
// public string PlcReadAddress { get; set; }
|
|
|
|
// /// <summary>
|
|
// /// PLC开始工作地址
|
|
// /// </summary>
|
|
// public string PlcWorkAddress { get; set; }
|
|
|
|
// /// <summary>
|
|
// /// PLC放行地址
|
|
// /// </summary>
|
|
// public string PlcReleaseAdress { get; set; }
|
|
|
|
// /// <summary>
|
|
// /// 工作完毕
|
|
// /// </summary>
|
|
// public string WorkedAlready { get; set; }
|
|
|
|
// /// <summary>
|
|
// /// PLC参数获取起始地址
|
|
// /// </summary>
|
|
// public string PlcDataAdress { get; set; }
|
|
|
|
// /// <summary>
|
|
// /// PLC参数数量
|
|
// /// </summary>
|
|
// public int PlcDataQuantity { get; set; }
|
|
|
|
// /// <summary>
|
|
// /// Plc质量地址
|
|
// /// </summary>
|
|
// public string PlcQuality { get; set; }
|
|
//}
|
|
//public enum StationState
|
|
//{
|
|
// Namorl,
|
|
// Stop,
|
|
// Fault
|
|
//}
|
|
}
|