AnchorTest/AnchorsTest/Configuration.cs
Станислав Хозяенок e23330cea9 Update
2024-07-09 12:15:14 +07:00

86 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AnchorsTest
{
internal class Configuration
{
static Configuration instance = null;
public string MTEHost { get; set; }
public string MTEPort { get; set; }
public string RTLSHost { get; set; }
public string RTLSPort { get; set; }
public string RTLSHTTPSPort { get; set; }
public string RTLSToken { get; set; }
// Время обновления в ms
public int UpdateTime { get; set; }
public string RTLSUserName { get; set; }
public string RTLSPassword { get; set; }
public int TrackingTag { get; set; }
public string File1Path { get; set; }
public string File2Path { get; set; }
public string FileTagSuffix { get; set; }
public bool IsTimerRunning = false;
public int counterGet;
public Configuration()
{
RTLSHost = "192.168.10.5";
RTLSPort = "80";
RTLSPort = "443";
MTEHost = "192.168.10.3";
MTEPort = "8001";
UpdateTime = 1000;
RTLSUserName = "system";
RTLSPassword = "admin";
TrackingTag = 20006142;
File1Path = "";
File2Path = "";
FileTagSuffix = "";
counterGet = 0;
}
public static Configuration Get
{
get
{
if (instance == null)
{
instance = new Configuration();
}
return instance;
}
}
public void LoadConfigFromJSConfig(JSConfig config)
{
if (config.MTEHost != null) { MTEHost = config.MTEHost; }
if (config.MTEPort != null) { MTEPort = config.MTEPort; }
if (config.RTLSHost != null) { RTLSHost = config.RTLSHost; }
if (config.RTLSPort != null) { RTLSPort = config.RTLSPort; }
if (config.UpdateTime != 0) { UpdateTime = config.UpdateTime; };
}
public JSConfig GetJSConfig()
{
JSConfig jsConfig = new JSConfig();
jsConfig.UpdateTime = UpdateTime;
jsConfig.RTLSHost = RTLSHost;
jsConfig.MTEHost = MTEHost;
jsConfig.MTEPort = MTEPort;
jsConfig.RTLSPort = RTLSPort;
return jsConfig;
}
}
}