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.
Aucma.Scada/HighWayIot.Config/AppConfig.cs

238 lines
7.2 KiB
C#

using HighWayIot.Common;
using System;
using System.Collections.Generic;
namespace HighWayIot.Config
{
public sealed class AppConfig
{
private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/App.InI");
private static readonly Lazy<AppConfig> lazy = new Lazy<AppConfig>(() => new AppConfig());
public static AppConfig Instance
{
get
{
return lazy.Value;
}
}
private AppConfig()
{
//stationName = "箱壳内胆组装";
//linerStoreCode = "NDJCK-001";
//foamBeforeStoreCode = "PBSCK-001";
}
public string mesConnStr
{
get { return iniHelper.IniReadValue("system", "mesConnStr"); }
set { iniHelper.IniWriteValue("system", "mesConnStr", value); }
}
public string scadaConnStr
{
get { return iniHelper.IniReadValue("system", "scadaConnStr"); }
set { iniHelper.IniWriteValue("system", "scadaConnStr", value); }
}
/// <summary>
/// 工位编号
/// </summary>
public string stationCode
{
get { return iniHelper.IniReadValue("system", "stationCode"); }
set { iniHelper.IniWriteValue("system", "stationCode", value); }
}
/// <summary>
/// 工位名称
/// </summary>
public string stationName
{
get { return iniHelper.IniReadValue("system", "stationName"); }
//get { return "箱壳内胆组装"; }
set { iniHelper.IniWriteValue("system", "stationName", value); }
}
/// <summary>
/// 箱壳库编号
/// </summary>
public string shellStoreCode
{
get { return iniHelper.IniReadValue("system", "shellStoreCode"); }
set { iniHelper.IniWriteValue("system", "shellStoreCode", value); }
}
/// <summary>
/// 内胆库编号
/// </summary>
public string linerStoreCode
{
get { return iniHelper.IniReadValue("system", "linerStoreCode"); }
set { iniHelper.IniWriteValue("system", "linerStoreCode", value); }
}
/// <summary>
/// 泡前库编号
/// </summary>
public string foamBeforeStoreCode
{
get { return iniHelper.IniReadValue("system", "foamBeforeStoreCode"); }
set { iniHelper.IniWriteValue("system", "foamBeforeStoreCode", value); }
}
/// <summary>
/// 箱壳物料类型编号
/// </summary>
public string shellMaterialType
{
get { return iniHelper.IniReadValue("system", "shellMaterialType"); }
set { iniHelper.IniWriteValue("system", "shellMaterialType", value); }
}
/// <summary>
/// 内胆物料类型编号
/// </summary>
public string linerMaterialType
{
get { return iniHelper.IniReadValue("system", "linerMaterialType"); }
set { iniHelper.IniWriteValue("system", "linerMaterialType", value); }
}
/// <summary>
/// 入库任务类型编号
/// </summary>
public int instoreTaskType
{
get { return Convert.ToInt32(iniHelper.IniReadValue("system", "instoreTaskType")); }
set { iniHelper.IniWriteValue("system", "instoreTaskType", value.ToString()); }
}
/// <summary>
/// 出库任务类型编号
/// </summary>
public int outstoreTaskType
{
get { return Convert.ToInt32(iniHelper.IniReadValue("system", "outstoreTaskType")); }
set { iniHelper.IniWriteValue("system", "outstoreTaskType", value.ToString()); }
}
/// <summary>
/// 箱壳扫码器IP
/// </summary>
public string shellHikRobotIp
{
get { return iniHelper.IniReadValue("system", "shellHikRobotIp"); }
set { iniHelper.IniWriteValue("system", "shellHikRobotIp", value); }
}
/// <summary>
/// 内胆扫码器IP
/// </summary>
public string linerHikRobotIp
{
get { return iniHelper.IniReadValue("system", "linerHikRobotIp"); }
set { iniHelper.IniWriteValue("system", "linerHikRobotIp", value); }
}
7 months ago
/// <summary>
/// 扫码枪波特率
/// </summary>
public string BaudRate
{
get { return iniHelper.IniReadValue("system", "BaudRate"); }
set { iniHelper.IniWriteValue("system", "BaudRate", value); }
}
/// <summary>
/// 串口列表
/// </summary>
public List<string> GetPortList()
{
List<string> portList = new List<string>();
string ports = iniHelper.IniReadValue("system", "Port");
if (!string.IsNullOrEmpty(ports))
{
// 将ports按分号分割
var portArray = ports.Split(';');
// 添加到列表中
foreach (var port in portArray)
{
// 去除空白字符并添加到列表
if (!string.IsNullOrEmpty(port.Trim()))
{
portList.Add(port.Trim());
}
}
}
return portList;
}
7 months ago
7 months ago
/// <summary>
/// 串口
/// </summary>
private string Port
7 months ago
{
get { return iniHelper.IniReadValue("system", "Port"); }
set { iniHelper.IniWriteValue("system", "Port", value); }
}
7 months ago
public string searchItems
{
get { return iniHelper.IniReadValue("system", "searchItems"); }
set { iniHelper.IniWriteValue("system", "searchItems", value); }
}
/// <summary>
/// 班组代码
/// </summary>
public string TeamCode
{
get { return iniHelper.IniReadValue("system", "TeamCode"); }
set { iniHelper.IniWriteValue("system", "TeamCode", value); }
}
/// <summary>
/// 班组名称
/// </summary>
public string TeamName
{
get { return iniHelper.IniReadValue("system", "TeamName"); }
set { iniHelper.IniWriteValue("system", "TeamName", value); }
}
/// <summary>
/// 用户名
/// </summary>
public string Account
{
get { return iniHelper.IniReadValue("system", "Account"); }
set { iniHelper.IniWriteValue("system", "Account", value); }
}
/// <summary>
/// 登录界面班组展示配置
/// </summary>
public string TeamConfig
{
get { return iniHelper.IniReadValue("system", "TeamConfig"); }
set { iniHelper.IniWriteValue("system", "TeamConfig", value); }
}
/// <summary>
/// 产线编号
/// </summary>
public string ProductlineCode
{
get { return iniHelper.IniReadValue("system", "ProductlineCode"); }
set { iniHelper.IniWriteValue("system", "ProductlineCode", value); }
}
}
}