using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using XImaging.Automation.Library.HxDriverLib; namespace BiosenSocketService.Entity { class DeviceEnvrionment { public static readonly int SIMULATOR_MODE = 0; public static readonly int PHYSICAL_MODE = 1; private static string m_strAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); private static string m_strIniPath = m_strAssemblyPath + @"\config.ini"; private static int m_iMode = -1; public static int Run_Mode { get { if (m_iMode < 0) { bool n = IniHelper.IniGetValue(m_strIniPath, "server", "simulator", true); m_iMode = IniHelper.IniGetValue(m_strIniPath, "server", "simulator", true) ? SIMULATOR_MODE : PHYSICAL_MODE; } return m_iMode; } set { if (value == SIMULATOR_MODE || value == PHYSICAL_MODE) { m_iMode = value; IniHelper.IniWriteValue(m_strIniPath, "server", "simulator", (value == SIMULATOR_MODE)); } } } public static string Output_Path { get { return IniHelper.IniGetValue(m_strIniPath, "server", "output_path", ""); } set { IniHelper.IniWriteValue(m_strIniPath, "server", "output_path", value); } } } }