Example #1
0
        private void initClass(string strUrl, string strUrl_ALE, string strRicName, AntControlMode antMode, int intPort, int intAlarmId, int intGreenId)
        {
            clsLog = new Log(@".\RFID_MW", "MW", 30, true);

            client  = new RICManagerEXClient(strUrl);
            Ale     = new ALEService();
            Ale.Url = strUrl_ALE;

            //client.setAutoReadingControl(strRicName, (int)antMode);

            client.getWebservice();

            strRICName = strRicName;

            StratEventServer(intPort);

            SetSubScrib();

            intAlarmID = intAlarmId;
            intGreenID = intGreenId;

            //if (antMode == AntControlMode.Always)
            //    StartReading();
            //else
            //    StopReading();

            TurnOnAlarm(100);
        }
Example #2
0
        /// <summary>
        /// 클래스 초기화(폼 로드하기 전에 하는게 좋다.)
        /// </summary>
        /// <param name="frm"></param>
        public file_backup(Form frm, string backupFolder, Function.Util.Log log = null)
        {
            frm.Load       += Frm_Load;
            frm.FormClosed += Frm_FormClosed;

            //1시간에 1번씩 체크
            //_tmr = new System.Threading.Timer(new TimerCallback(DoBackup), null, 1000 * 60 * 60, 1000 * 60 * 60);

            //테스트용 1분
            _tmr = new System.Threading.Timer(new TimerCallback(DoBackup), null, 1000 * 60, 1000 * 60);


            _backupFolder = backupFolder;

            if (!Directory.Exists(_backupFolder))
            {
                Directory.CreateDirectory(_backupFolder);
            }

            _dtLastDelWork = new DateTime(2000, 1, 1);


            if (log != null)
            {
                _log = log;
            }
            else
            {
                log = new Util.Log(backupFolder, "BackupLog", 30, true);
            }
        }
Example #3
0
        /// <summary>
        /// Log 클래스를 초기화 시킨다.프로그램 폴더에 Log_PlcModule폴더에 Log가 기록.
        /// </summary>
        /// <param name="strLogFileName">Log파일 생성 이름</param>
        private void InitClass(string folderPath, string strLogFileName)
        {
            strLogFileName = strLogFileName.Trim();

            if (strLogFileName == string.Empty)
            {
                strLogFileName = "PlcCommLog";
            }

            plc.log = new Log(folderPath, strLogFileName, 30, true);
            log     = plc.log;


            //변수 및 이벤트 연결..
            this.dtAddress = plc.dtAddress;

            strLogHeader = enPLCType.ToString();
        }