using Hanhe.iWCS.Common;
|
using Hanhe.iWCS.MData;
|
using MongoDB.Bson;
|
using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace Hanhe.iWCS.JingmenGEMTwoProtocol
|
{
|
|
public class Settings
|
{
|
|
#region 设备信息
|
private static string _plcInfo = "";
|
private static string plcInfo {
|
get {
|
if (_plcInfo == "") {
|
_plcInfo = XmlHelper.GetElementValue("plcInfo");
|
}
|
return _plcInfo;
|
}
|
}
|
public static List<PlcInfo> GetPlcInfo() {
|
return JsonConvert.DeserializeObject<List<PlcInfo>>(plcInfo);
|
}
|
public class PlcInfo
|
{
|
public string device { get; set; }
|
public string deviceType { get; set; }
|
public string ip { get; set; }
|
public int readAddr { get; set; }
|
public int writeAddr { get; set; }
|
public int FyReadAddr { get; set; }
|
public int FyWriteAddr { get; set; }
|
public int FyEmpReadAddr { get; set; }
|
public int FyEmpWriteAddr { get; set; }
|
public string location { get; set; }
|
public string Extend { get; set; }
|
public int enable { get; set; }
|
public int port { get; set; }
|
}
|
#endregion
|
|
#region _OITcpServerUrl
|
private static string _OITcpServerUrl = "";
|
public static string OITcpSeverUrl {
|
get {
|
if (_OITcpServerUrl == "") {
|
_OITcpServerUrl = XmlHelper.GetElementValue("OITcpServerUrl");
|
}
|
return _OITcpServerUrl;
|
}
|
}
|
#endregion
|
|
#region MESUrl
|
private static string _MESUrl = "";
|
public static string MESUrl
|
{
|
get
|
{
|
if (_MESUrl == "")
|
{
|
_MESUrl = XmlHelper.GetElementValue("mesurl");
|
}
|
return _MESUrl;
|
}
|
}
|
#endregion
|
|
#region MESUrl2
|
private static string _MESUrl2 = "";
|
public static string MESUrl2
|
{
|
get
|
{
|
if (_MESUrl2 == "")
|
{
|
_MESUrl2 = XmlHelper.GetElementValue("mesurl2");
|
}
|
return _MESUrl2;
|
}
|
}
|
#endregion
|
|
#region BGIP
|
private static string _BGIP = "";
|
public static string BGip
|
{
|
get
|
{
|
if (_BGIP == "")
|
{
|
_BGIP = XmlHelper.GetElementValue("BGIP");
|
}
|
return _BGIP;
|
}
|
}
|
#endregion
|
|
#region BGPORT
|
private static string _BGPORT = "";
|
public static string BGPort
|
{
|
get
|
{
|
if (_BGPORT == "")
|
{
|
_BGPORT = XmlHelper.GetElementValue("BGPORT");
|
}
|
return _BGPORT;
|
}
|
}
|
#endregion
|
|
#region mesOpen
|
private static string _mesOpen = "";
|
public static string mesOpen
|
{
|
get
|
{
|
if (_mesOpen == "")
|
{
|
_mesOpen = XmlHelper.GetElementValue("mesOpen");
|
}
|
return _mesOpen;
|
}
|
}
|
#endregion
|
|
#region packChange
|
private static string _packChange = "";
|
public static string packChange
|
{
|
get
|
{
|
if (_packChange == "")
|
{
|
_packChange = XmlHelper.GetElementValue("packChange");
|
}
|
return _packChange;
|
}
|
}
|
#endregion
|
|
#region packageDate
|
private static string _packageDate = "";
|
public static string packageDate
|
{
|
get
|
{
|
if (_packageDate == "")
|
{
|
_packageDate = XmlHelper.GetElementValue("packageDate");
|
}
|
return _packageDate;
|
}
|
}
|
#endregion
|
|
#region productDate
|
private static string _productDate = "";
|
public static string productDate
|
{
|
get
|
{
|
if (_productDate == "")
|
{
|
_productDate = XmlHelper.GetElementValue("productDate");
|
}
|
return _productDate;
|
}
|
}
|
#endregion
|
|
#region Wait01
|
private static string _Wait01 = "";
|
public static string Wait01
|
{
|
get
|
{
|
if (_Wait01 == "")
|
{
|
_Wait01 = XmlHelper.GetElementValue("Wait01");
|
}
|
return _Wait01;
|
}
|
}
|
#endregion
|
|
#region Wait02
|
private static string _Wait02 = "";
|
public static string Wait02
|
{
|
get
|
{
|
if (_Wait02 == "")
|
{
|
_Wait02 = XmlHelper.GetElementValue("Wait02");
|
}
|
return _Wait02;
|
}
|
}
|
#endregion
|
|
#region timecuo
|
private static string _TimeCuo = "";
|
public static string TimeCuo
|
{
|
get
|
{
|
if (_TimeCuo == "")
|
{
|
_TimeCuo = XmlHelper.GetElementValue("timecuo");
|
}
|
return _TimeCuo;
|
}
|
}
|
#endregion
|
|
#region SendERPTaskType
|
private static string _SendERPTaskType = "";
|
public static string SendERPTaskType
|
{
|
get
|
{
|
if (_SendERPTaskType == "")
|
{
|
_SendERPTaskType = XmlHelper.GetElementValue("SendERPTaskType");
|
}
|
return _SendERPTaskType;
|
}
|
}
|
#endregion
|
|
|
#region huoWeiCode
|
private static string _HouWeiCode = "";
|
public static string houWeiCode
|
{
|
get
|
{
|
if (_HouWeiCode == "")
|
{
|
_HouWeiCode = XmlHelper.GetElementValue("huoWeiCode");
|
}
|
return _HouWeiCode;
|
}
|
}
|
|
public static List<HuoWeiCode> GetHouWeiCodeo()
|
{
|
return JsonConvert.DeserializeObject<List<HuoWeiCode>>(houWeiCode);
|
}
|
|
/// <summary>
|
/// {"device":"1"ip:"192.168.1.100","readAddr":100,"writeAddr":101,"location":"AAA"},
|
/// </summary>
|
public class HuoWeiCode
|
{
|
public string task { get; set; }
|
public string taskType { get; set; }
|
public string location { get; set; }
|
}
|
#endregion
|
|
#region sendBit
|
private static string _SendBit = "";
|
public static string sendBit
|
{
|
get
|
{
|
if (_SendBit == "")
|
{
|
_SendBit = XmlHelper.GetElementValue("sendBit");
|
}
|
return _SendBit;
|
}
|
}
|
|
public static List<SendBit> GetSendBit()
|
{
|
return JsonConvert.DeserializeObject<List<SendBit>>(sendBit);
|
}
|
|
/// <summary>
|
/// {"device":"1"ip:"192.168.1.100","readAddr":100,"writeAddr":101,"location":"AAA"},
|
/// </summary>
|
public class SendBit
|
{
|
public string task { get; set; }
|
public string taskType { get; set; }
|
public string bit { get; set; }
|
public int agv { get; set; }
|
public string floor { get; set; }
|
}
|
#endregion
|
|
#region BatteryTime
|
private static string _BatteryTime = "";
|
public static string BatteryTime
|
{
|
get
|
{
|
if (_BatteryTime == "")
|
{
|
_BatteryTime = XmlHelper.GetElementValue("BatteryTime");
|
}
|
return _BatteryTime;
|
}
|
}
|
#endregion
|
|
#region 小车信息
|
private static string _ChargingPile = "";
|
private static string ChargingPile
|
{
|
get
|
{
|
if (_ChargingPile == "")
|
{
|
_ChargingPile = XmlHelper.GetElementValue("ChargingPile");
|
}
|
return _ChargingPile;
|
}
|
}
|
public static List<ChargingPileInfo> GetChargingPile()
|
{
|
return JsonConvert.DeserializeObject<List<ChargingPileInfo>>(ChargingPile);
|
}
|
public class ChargingPileInfo
|
{
|
public string agvNo { get; set; }
|
public string agvType { get; set; }
|
public string charginGroup { get; set; }
|
public string charginIP { get; set; }
|
public string agvBit { get; set; }
|
public string enable { get; set; }
|
}
|
#endregion
|
|
#region 写入电量车号
|
private static string _ChargingAgvNo = "";
|
private static string ChargingAgvNo
|
{
|
get
|
{
|
if (_ChargingAgvNo == "")
|
{
|
_ChargingAgvNo = XmlHelper.GetElementValue("ChargingAgvNo");
|
}
|
return _ChargingAgvNo;
|
}
|
}
|
public static string[] GetChargingAgvNo()
|
{
|
return JsonConvert.DeserializeObject<List<string>>(ChargingAgvNo).ToArray();
|
}
|
#endregion
|
|
#region AGVLocation
|
private static string _AGVLocation = "";
|
private static string AGVLocationList
|
{
|
get
|
{
|
if (_AGVLocation == "")
|
{
|
_AGVLocation = XmlHelper.GetElementValue("AGVLocation");
|
}
|
return _AGVLocation;
|
}
|
}
|
|
private static List<AGVLocation> AGVLocations = new List<AGVLocation>();
|
public static List<AGVLocation> GetAGVLocationList()
|
{
|
if (AGVLocations.Count == 0 && AGVLocationList != "")
|
{
|
AGVLocations = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AGVLocation>>(AGVLocationList);
|
}
|
return AGVLocations;
|
}
|
|
public class AGVLocation
|
{
|
|
public string machineLoc { get; set; }
|
public string[] ddLoc { get; set; }
|
public int Enabel { get; set; }
|
}
|
|
#endregion
|
|
#region DDSite
|
private static string _DDSite = "";
|
private static string DDSiteList
|
{
|
get
|
{
|
if (_DDSite == "")
|
{
|
_DDSite = XmlHelper.GetElementValue("DDSite");
|
}
|
return _DDSite;
|
}
|
}
|
|
private static List<DDSiteModel> DDSites = new List<DDSiteModel>();
|
public static List<DDSiteModel> GetDDSiteList()
|
{
|
if (DDSites.Count == 0 && DDSiteList != "")
|
{
|
DDSites = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DDSiteModel>>(DDSiteList);
|
}
|
return DDSites;
|
}
|
|
public class DDSiteModel
|
{
|
|
public string ddLoc { get; set; }
|
public int[] Site { get; set; }
|
public int quantity { get; set; }
|
public int Enable { get; set; }
|
}
|
|
#endregion
|
|
#region AGVState
|
private static string _AGVState = "";
|
private static string AGVStateList
|
{
|
get
|
{
|
if (_AGVState == "")
|
{
|
_AGVState = XmlHelper.GetElementValue("AGVState");
|
}
|
return _AGVState;
|
}
|
}
|
|
private static List<AGVState> AGVStates = new List<AGVState>();
|
public static List<AGVState> GetAGVStateList()
|
{
|
if (AGVStates.Count == 0 && AGVStateList != "")
|
{
|
AGVStates = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AGVState>>(AGVStateList);
|
}
|
return AGVStates;
|
}
|
|
public class AGVState
|
{
|
|
public string AgvNo { get; set; }
|
public string ip { get; set; }
|
public int port { get; set; }
|
public int readAddr { get; set; }
|
public int writeAddr { get; set; }
|
public int enable { get; set; }
|
}
|
#endregion
|
|
#region Connectingbits
|
private static string _Connectingbits = "";
|
private static string ConnectingbitsList
|
{
|
get
|
{
|
if (_Connectingbits == "")
|
{
|
_Connectingbits = XmlHelper.GetElementValue("Connectingbits");
|
}
|
return _Connectingbits;
|
}
|
}
|
|
private static List<ConnectingbitsModel> connectingbits = new List<ConnectingbitsModel>();
|
public static List<ConnectingbitsModel> GetConnectingbitsList()
|
{
|
if (connectingbits.Count == 0 && ConnectingbitsList != "")
|
{
|
connectingbits = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ConnectingbitsModel>>(ConnectingbitsList);
|
}
|
return connectingbits;
|
}
|
|
public class ConnectingbitsModel
|
{
|
public string locCode { get; set; }
|
public int[] agvSite { get; set; }
|
public int enable { get; set; }
|
}
|
#endregion
|
|
#region DGConnectingbits
|
private static string _DGConnectingbits = "";
|
private static string DGConnectingbitsList
|
{
|
get
|
{
|
if (_DGConnectingbits == "")
|
{
|
_DGConnectingbits = XmlHelper.GetElementValue("DGConnectingbits");
|
}
|
return _DGConnectingbits;
|
}
|
}
|
|
private static List<DGConnectingbitsModel> DGconnectingbits = new List<DGConnectingbitsModel>();
|
public static List<DGConnectingbitsModel> GetDGConnectingbitsList()
|
{
|
if (DGconnectingbits.Count == 0 && DGConnectingbitsList != "")
|
{
|
DGconnectingbits = Newtonsoft.Json.JsonConvert.DeserializeObject<List<DGConnectingbitsModel>>(DGConnectingbitsList);
|
}
|
return DGconnectingbits;
|
}
|
|
public class DGConnectingbitsModel
|
{
|
public string locCode { get; set; }
|
public int[] agvSite { get; set; }
|
public int enable { get; set; }
|
}
|
#endregion
|
|
#region ThirdUrl
|
private static string _ThirdUrl = "";
|
private static string ThirdUrlList
|
{
|
get
|
{
|
if (_ThirdUrl == "")
|
{
|
_ThirdUrl = XmlHelper.GetElementValue("ThirdUrl");
|
}
|
return _ThirdUrl;
|
}
|
}
|
|
private static List<ThirdUrl> ThirdUrls = new List<ThirdUrl>();
|
public static List<ThirdUrl> GetThirdUrlList()
|
{
|
if (ThirdUrls.Count == 0 && ThirdUrlList != "")
|
{
|
ThirdUrls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThirdUrl>>(ThirdUrlList);
|
}
|
return ThirdUrls;
|
}
|
|
public class ThirdUrl
|
{
|
|
public string UrlNo { get; set; }
|
public string UrlSign { get; set; }
|
public string Url { get; set; }
|
public int enable { get; set; }
|
}
|
#endregion
|
|
#region wareInfo
|
private static string _wareInfo = "";
|
private static string wareInfoList
|
{
|
get
|
{
|
if (_wareInfo == "")
|
{
|
_wareInfo = XmlHelper.GetElementValue("wareInfo");
|
}
|
return _wareInfo;
|
}
|
}
|
|
private static List<wareInfo> wareInfos = new List<wareInfo>();
|
public static List<wareInfo> GetwareInfoList()
|
{
|
if (wareInfos.Count == 0 && wareInfoList != "")
|
{
|
wareInfos = Newtonsoft.Json.JsonConvert.DeserializeObject<List<wareInfo>>(wareInfoList);
|
}
|
return wareInfos;
|
}
|
|
public class wareInfo
|
{
|
|
public string wareName { get; set; }
|
public string ip { get; set; }
|
public int port { get; set; }
|
public int readAddr { get; set; }
|
public int writeAddr { get; set; }
|
public int enable { get; set; }
|
}
|
#endregion
|
|
#region LoginInfo
|
private static string _LoginInfo = "";
|
public static string LoginInfo
|
{
|
get
|
{
|
if (_LoginInfo == "")
|
{
|
_LoginInfo = XmlHelper.GetElementValue("LoginInfo");
|
}
|
return _LoginInfo;
|
}
|
}
|
#endregion
|
|
#region SqlServer2
|
private static string _SqlServer2 = "";
|
public static string SqlServer2
|
{
|
get
|
{
|
if (_SqlServer2 == "")
|
{
|
_SqlServer2 = XmlHelper.GetElementValue("SqlServer2");
|
}
|
return _SqlServer2;
|
}
|
}
|
#endregion
|
|
#region SqlServer1
|
private static string _SqlServer1 = "";
|
public static string SqlServer1
|
{
|
get
|
{
|
if (_SqlServer1 == "")
|
{
|
_SqlServer1 = XmlHelper.GetElementValue("SqlServer1");
|
}
|
return _SqlServer1;
|
}
|
}
|
#endregion
|
|
#region _SqlServer
|
private static string _SqlServer = "";
|
public static string SqlServer
|
{
|
get
|
{
|
if (_SqlServer == "")
|
{
|
_SqlServer = XmlHelper.GetElementValue("SqlServer");
|
}
|
return _SqlServer;
|
}
|
}
|
#endregion
|
|
|
}
|
}
|