/// <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); } }
/// <summary> /// 포 초기화 작업을 한다. /// </summary> private void InitForm() { try { strPrgName = "ORACLE I/F"; clsLog = new Function.Util.Log(Application.StartupPath + "\\Log_Oracle_IF", "Oracle_IF", 30, true); clsRemote = new clsRemoting(intPort, strUri); control.Invoke_Control_Text(lblSvrInfo, "URI : " + clsRemote.strFullUri); control.Invoke_Control_Color(lblSvrInfo, Color.Yellow, null); clsRemote.HttpChannel_SeverLoad(typeof(Function.Advenced.clsOracle_IF), false, false); control.Invoke_Control_Text(lblSvrStatus, "Svr\r\nStarting"); control.Invoke_Control_Color(lblSvrStatus, null, Color.RoyalBlue); //Function.Component.Spread.Invoke_RowCount(fpLog, fpLog.ActiveSheet, 0); //clsOracle_IF.strConn = OleDB.Set_connectionString(OleDB.enProvider.MSSql, "admin\\sqlexpress", "namsun", "sa", "piss"); clsOracle_IF.isServer = true; clsOracle_IF.evtdsExcute = new clsOracle_IF.deldsExcute(evtdsExcute); clsOracle_IF.evtdsExcuteError = new clsOracle_IF.deldsExcuteError(evtdsExcuteError); SetMessage(false, "Server Started.", false); } catch (Exception ex) { ProcException(ex, "InitForm"); } }
private void initClass(string strUrl, string strUrl_ALE, string strRicName, AntControlMode antMode, int intPort, int intAlarmId, int intGreenId) { clsLog = new Function.Util.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); }
public MsSQL(Function.Util.Log log = null) { _log = log; if (strIP != string.Empty) { Set_ConnectionString(strIP, strDataBase, strID, strPass); } }
public frmMain() { InitializeComponent(); vari.Init(); SavePosition_Setting = vari.Pgm_Setting; btnSetting.Image = Function.resIcon16.save; btnSearch.Image = Function.resIcon16.search_file; btnCondition_reset.Image = Function.resIcon16.redo; btnExcelSave.Image = Function.resIcon16.Excel; vari.ImgList.Images.Add(Function.resIcon16.server); vari.ImgList.Images.Add(Function.resIcon16.search_web); tabControl1.ImageList = vari.ImgList; tabMonitoring.ImageIndex = 0; tabSearching.ImageIndex = 1; clsLog = new Function.Util.Log(vari.Pgm_Path + "\\log", "log", 0, true); //plc auth AppAuth.Auth.Add("cQjVhgrEPBEfab5nTuCa5mcmhvAK5kp1bzUkY5jfYJ0="); #if (!Test) btnTest.Visible = false; #endif //테스트용 데이터 strTest = (@"W0LJC7E8XHB2432045777F06970G30OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432055778F06971G31OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432065779F06972G32OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432075780F06973G33OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432085781F06974G34OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432095782F06975G35OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432105783F06976G36OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432115784F06977G37OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432125785F06978G38OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432135786F06979G39OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432145787F06980G40OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432155788F06981G41OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432165789F06982G42OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432175790F06983G43OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432185791F06984G44OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432195792F06985G45OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432205793F06986G46OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432215794F06987G47OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432225795F06988G48OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432235796F06989G49OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK W0LJC7E8XHB2432245797F06990G50OK10017093OK10027093OK10037093OK10048001OK10047093OK10057093OK10067007OK10077093OK10081011OK10127093OK112B7093OK10137093OK10147093OK114B7093OK10157705OK115A7093OK115B7093OK1016116BOK70937099OK10177093OK10187093OK118B7093OK" ).Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); }
private void thTest(object obj) { if (isTestWork) { return; } try { isTestWork = true; if (log == null) { string fld = ".\\TestLog"; if (!Function.system.clsFile.FolderExists(fld)) { Function.system.clsFile.FolderCreate(fld); } log = new Function.Util.Log(fld, "TestLog", 30, true); } //address, interval, from, to string[] param = (string[])obj; lngTestTimes++; if (lngTestTimes == 1) { decTestValue = decimal.Parse(param[2]); decTestMaxValue = decimal.Parse(param[3]); log.WLog("PlcTest를 시작합니다.[IP]{0} [Port]{1} [PlcType]{2} [ValueFrom]{3} [ValueTo]{4}", Comm.IPAddress, Comm.Port, Comm.enPLCType, decTestValue, decTestMaxValue); } else if ((lngTestTimes % 100) == 0) { log.WLog("PlcTest {0}번째 진행중 [현재값]{1}", lngTestTimes, decTestValue); } Comm.WriteOrder(param[0], int.Parse(decTestValue.ToString())); Function.form.control.Invoke_Control_Text(lblTestMsg, string.Format("[{0}] Value:{1}", DateTime.Now.ToString("HH:mm:ss"), decTestValue)); decTestValue++; } catch (Exception ex) { log.WLog_Exception("thTest", ex); Function.form.control.Invoke_Control_Text(lblTestMsg, ex.Message); } finally { isTestWork = false; } }
/// <summary> /// SQL DB 연결 Class 생성 /// </summary> /// <param name="strServer">서버 IP / 이름</param> /// <param name="strDB">DataBase이름</param> /// <param name="strID">ID</param> /// <param name="strPassword">Password</param> public MsSQL(string strServer, string strDB, string strID, string strPassword, Function.Util.Log log = null) { _log = log; //id와 암호가 설정 되어 있지 않으면 윈도우 인증 if (strID.Equals(string.Empty) && strPassword.Equals(string.Empty)) { Set_ConnectionString_ByWindowsAut(strServer, strDB); } else { Set_ConnectionString(strServer, strDB, strID, strPassword); } }
public frmNewLists() { InitializeComponent(); fnc.Init_Vari(); SavePosition = true; SaveConfigFileType = Function.form.enConfigFileType.ConfigXml; SavePosition_Setting = vari.Setting; clsLog = new Function.Util.Log(vari.pgm_path + "\\Log", "Log", 30, true); #if (!DEBUG) button1.Visible = false; #endif }
public clsJuno(string strip, int intport, string strLogFileName) { strIP = strip; intPort = intport; clsLog = new Function.Util.Log(@".\JunoF", strLogFileName, 10, true); if (!InitRFSet()) //RF parser 라이브러리를 사용하기 위한 초기화 세팅작업입니다. 이벤트콜백함수도 여기서 등록합니다. { throw new Exception("RF Set error"); } //// Write시 MaxLength 를 설정하는 UI 관련 로직입니다. //int nSize = Convert.ToInt32(tbx_write_size.Text) * 2; //if (rbn_writeTag_Hex.Checked == true) // tbx_writeTag_Input.MaxLength = nSize * 2; //else // tbx_writeTag_Input.MaxLength = nSize; }
private void frmNewLists_Load(object sender, EventArgs e) { #if (DEBUG) this.Text += "[DEBUG]"; #endif this.Text += " v." + Application.ProductVersion; //시작시간 inpHeadStartTime.Value = Fnc.Date2String(DateTime.Now, Fnc.enDateType.DateTime); //텔레그램 전송 로그 cTelLg = new Function.Util.Log(vari.pgm_path + "\\LOG", "TEL_SEND_LOG", 30, true); vari.Setting.Group_Select("PGM"); //설정된 전화번호 가져오기 vari.HP = vari.Setting.Value_Get("PGM", "HP", ""); inpHP.Value = vari.HP; //텔래그램 연결 btnHPConn_Click(null, null); sItems = new string[] { "Binance" //0 , "Bithumb" //1 , "BinanceWallet" //2 , "Upbit" //3 , "bittrex(미동작)" //4 , "Upbit공지" //5 , "Bithumb공지" //6 , "huobi코리아공지" //7 , "huobi프로공지" //8 , "Coinnest공지(미사용)" //9 }; sUrls = new string[] { "https://www.binance.com/api/v1/ticker/allPrices" //바이낸스 가격 , "https://api.bithumb.com/public/ticker/all" //빗썸 , "https://www.binance.com/assetWithdraw/getAllAsset.html" //바이낸스 지갑 , "https://crix-api.upbit.com/v1/crix/trends/change_rate" //upbit 가격 , "https://bittrex.com/api/v1.1/public/getmarketsummaries" //비트렉스 가격 , "https://api-manager.upbit.com/api/v1/notices?page=1&per_page=5" //업비트 공지 , "https://bithumb.cafe/notice" //빗썸공지 , "https://api.huobi.co.kr/v1/notice/list?language=ko-KR&limit=5&currPage=1" //후오비코리아 공지 , "" , "https://www.coinnest.co.kr/gonggao/" //코인네스트 공지 }; cItems = new clsItem[sItems.Length]; tmrWork = new System.Threading.Timer[cItems.Length]; int idx = 0; foreach (string item in sItems) { cItems[idx] = new clsItem(idx, item, sUrls[idx]); cItems[idx].lstItem = new ListViewItem(new string[] { "", item, "0", "" }); lstNew.Items.Add(cItems[idx].lstItem); #if (!no_tmr) switch (idx) { case 0: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thBinance), cItems[idx], 1000, 5000); break; case 1: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thBithumb), cItems[idx], 1000, 5000); break; case 2: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thBinanceWallet), cItems[idx], 1000, 5000); break; case 3: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thUpbit), cItems[idx], 1000, 5000); break; case 5: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thUpbitNotice), cItems[idx], 1000, 5000); break; case 6: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thBithumbNotice), cItems[idx], 1000, 5000); break; case 7: tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thHoubiNotice), cItems[idx], 1000, 5000); break; case 8: //tmrWork[idx] = new System.Threading.Timer(new TimerCallback(thCoinnestNotice), cItems[idx], 1000, 5000); break; } #endif idx++; } //설정 ?분 간격으로 문자 보냄 tmrChkAlive = new System.Threading.Timer(new TimerCallback(thChkAlive), null, 1000, 1000 * 60 * vari.ChkInterval); }
public MsSQL(strConnect str, Function.Util.Log log = null) { _log = log; Set_ConnectionString(str); }
public OracleDB(Function.Util.Log log = null) { Log = log; }
/// <summary> /// 객체를 생성 하면서 connetion string을 설정 한다. /// </summary> /// <param name="strConnectionString"></param> public OracleDB(string strConnectionString, Function.Util.Log log = null) { Log = log; connectionString = strConnectionString; }
/// <summary> /// 객체를 생성 하면서 Connection String 만든다. /// </summary> /// <param name="strConn"></param> public OracleDB(strConnect strConn, Function.Util.Log log = null) { Log = log; Set_ConnectionString(strConn); }
/// <summary> /// 객체를 생성 하면서 Connection String 만든다. /// </summary> /// <param name="strIP"></param> /// <param name="strDB"></param> /// <param name="strID"></param> /// <param name="strPassword"></param> public OracleDB(string strTNS, string strID, string strPassword, Function.Util.Log log = null) { Log = log; connectionString = Get_ConnectionString(strTNS, strID, strPassword); }