Esempio n. 1
0
        /// <summary>
        /// 변수 초기화
        /// </summary>
        public static void Init()
        {
            Pgm_Path             = System.Windows.Forms.Application.StartupPath;
            Pgm_Setting_FileName = $"{Pgm_Path}\\{Pgm_Setting_FileName}";
            bool rb = false;

            Pgm_Setting = new Setting(Pgm_Setting_FileName);

            Pgm_Setting.Group_Select("PGM");

            //기기 id
            StationID       = Pgm_Setting.Value_Get("StationID", "DEV_01");
            iTestSeq        = Fnc.obj2int(Pgm_Setting.Value_Get("TestSeq", "0"));
            TorqueImagePath = Pgm_Setting.Value_Get("TorqueImagePath", "");
            bIF_Chk         = Fnc.obj2Bool(Pgm_Setting.Value_Get("IF_Check", "False"));


            //db 정보 로드
            Pgm_Setting.Group_Select("MsSql");

            conn.strIP       = Pgm_Setting.Value_Get("IP", string.Empty);
            conn.strDataBase = Pgm_Setting.Value_Get("DataBase", string.Empty);
            conn.strID       = Pgm_Setting.Value_Get("ID", string.Empty);
            conn.strPass     = Pgm_Setting.Value_Get("PassWords", string.Empty);

            //plc 기초 값 로드  N7:0,L2
            plc_default.RSLINX_ID   = "opcda://localhost/RSLinx OPC Server";
            plc_default.Topic_Name  = "Torque";
            plc_default.Add_Trigger = "[Torque]R7001:0,L2";
            plc_default.Add_Ack     = "[Torque]R7002:0,L2";
            plc_default.Add_Confirm = "[Torque]R7003:0,L2";
            plc_default.Add_Info    = "[Torque]R7004:0,L16";
            plc_default.Add_Data    = "[Torque]R7000:0,L200";

            Pgm_Setting.Group_Select("PLC");

            plc.RSLINX_ID = vari.Pgm_Setting.Value_Get("RSLINX_ID");

            if (plc.RSLINX_ID?.Equals(string.Empty) == false)
            {
                plc.Topic_Name  = vari.Pgm_Setting.Value_Get("TOPIC_NAME");
                plc.Add_Trigger = vari.Pgm_Setting.Value_Get("ADD_TRIGGER");
                plc.Add_Ack     = vari.Pgm_Setting.Value_Get("ADD_ACK");
                plc.Add_Confirm = vari.Pgm_Setting.Value_Get("ADD_CONFIRM");
                plc.Add_Info    = vari.Pgm_Setting.Value_Get("ADD_INFO");
                plc.Add_Data    = vari.Pgm_Setting.Value_Get("ADD_DATA");
            }
            else
            {
                plc = plc_default;
            }


            //프로그램 설정
            Pgm_Setting.Group_Select("PGM");
            OpMode = (enOpMode)Fnc.obj2int(vari.Pgm_Setting.Value_Get("OPMODE", "0"));
        }
Esempio n. 2
0
        public frmMassenger()
        {
            InitializeComponent();


            config = new Setting("config.xml", true);

            this.SaveConfigFileType = Function.form.enConfigFileType.ConfigXml;
            this.SavePosition       = true;

            this.SavePosition_Setting = config;

            textBox1.Text = config.Value_Get("PgmSetting", "PhoneNumber", enSettingValueType.Value);
        }