schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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<bool>(m_strIniPath, "server", "simulator", true);
                    m_iMode = IniHelper.IniGetValue<bool>(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<bool>(m_strIniPath, "server", "simulator", (value == SIMULATOR_MODE));
                }
            }
        }
 
        public static string Output_Path
        {
            get
            {
                return IniHelper.IniGetValue<string>(m_strIniPath, "server", "output_path", "");
            }
            set
            {
                IniHelper.IniWriteValue<string>(m_strIniPath, "server", "output_path", value);
            }
        }
    }
}