You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
434 lines
13 KiB
434 lines
13 KiB
using System;
|
|
using System.Configuration;
|
|
|
|
namespace AutoFileCopyNet
|
|
{
|
|
public sealed class GetConfigurationSettings
|
|
{
|
|
/// <summary>
|
|
/// 连接网络次数,配置如果是数字,按照配置的数字次数进行连接,如果配置成UNLIMIT
|
|
/// 如果设置为数字1..10000按照设定的数据循环链接网络
|
|
/// 如果设置为UNLIMIT则直到网络连接成功
|
|
/// </summary>
|
|
public static string conn_frequency
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置a文件
|
|
return ConfigurationSettings.AppSettings["conn_frequency"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "5";
|
|
}
|
|
}
|
|
}
|
|
|
|
#region 远红外设备拷贝文件的频率,单位为分钟,默认值为10分钟拷贝一次
|
|
/// <summary>
|
|
/// 远红外设备拷贝文件的频率,单位为分钟,默认值为10分钟拷贝一次
|
|
/// </summary>
|
|
public static string yhw_frequency
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["yhw_frequency"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "10";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 客户端网络预警的频率,单位为分钟,默认值为2分钟一次
|
|
/// <summary>
|
|
/// 客户端网络预警的频率,单位为分钟,默认值为2分钟一次
|
|
/// </summary>
|
|
public static string cwaring_frequency
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["cwaring_frequency"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "10";
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 设置设备监控频率,默认为1分钟
|
|
/// <summary>
|
|
/// 设置设备监控频率,默认为1分钟
|
|
/// </summary>
|
|
public static string MonitorLever
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["MonitorLever"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "10";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 激光切设备解析文件的频率,单位为分钟,默认值为30分钟解析一次
|
|
/// <summary>
|
|
/// 激光切设备解析文件的频率,单位为分钟,默认值为30分钟解析一次
|
|
/// </summary>
|
|
public static string jgq_frequency
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["jgq_frequency"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "30";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 海天设备解析文件的频率,单位为分钟,默认值为30分钟解析一次
|
|
/// <summary>
|
|
/// 海天设备解析文件的频率,单位为分钟,默认值为30分钟解析一次
|
|
/// </summary>
|
|
public static string ht_frequency
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["ht_frequency"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "30";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 恩格尔设备解析文件的频率,单位为分钟,默认值为30分钟解析一次
|
|
/// <summary>
|
|
/// 恩格尔设备解析文件的频率,单位为分钟,默认值为30分钟解析一次
|
|
/// </summary>
|
|
public static string engel_frequency
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["engel_frequency"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "30";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 获取设备IP地址
|
|
/// <summary>
|
|
/// 获取设备IP地址
|
|
/// </summary>
|
|
public static string Equipment_IP
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["Equipment_IP"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 设置震动焊设备配置参数地址的节点名称(也就是OPC SERVIER服务器Device Name)名称
|
|
/// <summary>
|
|
/// 设置震动焊设备配置参数地址的节点名称(也就是OPC SERVIER服务器Device Name)名称
|
|
/// </summary>
|
|
public static string OPC_DeviceName
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["OPC_DeviceName"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 设置KepGroup_DataChange事件更新频率,单位是秒,默认当前设置的是3秒更新一次数据
|
|
/// <summary>
|
|
/// 设置KepGroup_DataChange事件更新频率,单位是秒,默认当前设置的是3秒更新一次数据
|
|
/// </summary>
|
|
public static string UpdateRate
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationSettings.AppSettings["UpdateRate"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "1000";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 定义设备类型:恩格尔注塑机
|
|
/// <summary>
|
|
/// 定义设备类型:恩格尔注塑机
|
|
/// </summary>
|
|
public static string DCS_ET_ENGEL_TYPE
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCS_ET_ENGEL_TYPE"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "INJECT_ENGEL";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 定义设备类型:远红外设备
|
|
/// <summary>
|
|
/// 定义设备类型:远红外设备
|
|
/// </summary>
|
|
public static string DCS_ET_YHW_TYPE
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCS_ET_YHW_TYPE"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "YHWSB";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 定义设备类型:激光切
|
|
/// <summary>
|
|
/// 定义设备类型:激光切
|
|
/// </summary>
|
|
public static string DCS_ET_JENOPTIK_TYPE
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCS_ET_JENOPTIK_TYPE"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "LASER_JENOPTIK";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 定义设备类型:必诺震动焊
|
|
/// <summary>
|
|
/// 定义设备类型:必诺震动焊
|
|
/// </summary>
|
|
public static string DCS_ET_BIELOMATIK_TYPE
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCS_ET_BIELOMATIK_TYPE"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "WELD_BIELOMATIK";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 定义设备类型:海天注塑机
|
|
/// <summary>
|
|
/// 定义设备类型:海天注塑机
|
|
/// </summary>
|
|
public static string DCS_ET_HAITIAN_TYPE
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCS_ET_HAITIAN_TYPE"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "INJECT_HAITIAN";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 文件的存储目录
|
|
/// <summary>
|
|
/// 文件的存储目录
|
|
/// </summary>
|
|
public static string DCSFilesPath
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
String filePath = ConfigurationManager.AppSettings["DCSFilesPath"].ToString();
|
|
if (filePath[filePath.Length - 1] != System.IO.Path.DirectorySeparatorChar)
|
|
{
|
|
filePath += System.IO.Path.DirectorySeparatorChar;
|
|
}
|
|
return filePath;
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 本地的映射驱动名称
|
|
/// <summary>
|
|
/// 本地的映射驱动名称
|
|
/// </summary>
|
|
public static string DCSLocalDriverPath
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCSLocalDriverPath"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "X:";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 访问远程网络用户名
|
|
/// <summary>
|
|
/// 访问远程网络用户名
|
|
/// </summary>
|
|
public static string DCSNetUser
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCSNetUser"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 访问网络用户密码
|
|
/// <summary>
|
|
/// 访问网络用户密码
|
|
/// </summary>
|
|
public static string DCSNetPwd
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["DCSNetPwd"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 系统写日志文件路径,不包含日志文件名。日志文件名会更具日期自动创建
|
|
/// <summary>
|
|
/// 系统写日志文件路径,不包含日志文件名。日志文件名会更具日期自动创建
|
|
/// </summary>
|
|
public static string LOGFILEPATH
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
|
|
return ConfigurationManager.AppSettings["LOGFILEPATH"].ToString();
|
|
}
|
|
catch
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|
|
|