Ejemplo n.º 1
0
        public DefineClass.ST_FURNACE_REALTIME_INFORMATION stFURNACE_REALTIME_INFORMATION;  // 공업로 실시간 상태정보



        public MainClass(MainForm mf)
        {
            /*****************************************************************************
             * Initialize Object
             ******************************************************************************/
            // Current MainForm Ojbect (for Handling GUI)
            this.m_MainForm = mf;

            this.m_SQLClass    = new SQLClass(this);
            this.m_SysLogClass = new SysLogClass(this);
            this.m_UtilsClass  = new UtilsClass(this);

            this.m_Define_Class = new DefineClass(this);
            // SQL 연결 수행 (접속이 실패할 경우 에러 코드를 포함한 Message 가 팝업됨)

            this.m_SQLClass.SqlConnect();



            /*****************************************************************************
             * Initialize Variable
             ******************************************************************************/
            this.isLoginUser = false;
            this.m_Define_Class.isDebugMode = false;


            /*****************************************************************************
             * Initialize Struct
             ******************************************************************************/
            this.stBILLET_INFOMATION = new DefineClass.ST_BILLET_INFOMATION[this.m_Define_Class.MAX_BILLET_IN_FURNACE];

            this.stFURNACE_REALTIME_INFORMATION = new DefineClass.ST_FURNACE_REALTIME_INFORMATION();
            this.stFURNACE_REALTIME_INFORMATION.fZone_Temperature     = new float[this.m_Define_Class.MAX_ZONE_IN_FURNACE];
            this.stFURNACE_REALTIME_INFORMATION.fZone_Avg_Temperature = new float[this.m_Define_Class.MAX_ZONE_IN_FURNACE];

            this.m_L1LinkClass   = new L1LinkClass(this, (int)DefineClass.TIMER_INTERVAL.TWO_SEC);
            this.m_L3LinkClass   = new L3LinkClass(this, (int)DefineClass.TIMER_INTERVAL.TWO_SEC);
            this.m_TrackingClass = new TrackingClass(this, (int)DefineClass.TIMER_INTERVAL.TWO_SEC);
            //this.m_ThermalModelClass = new ThermalModelClass(this, (int)DefineClass.TIMER_INTERVAL.TWO_SEC);
            this.m_ThermalModelClass = new ThermalModelClass(this, this.m_Define_Class.nDangjinThermalCalPeriod);
        }
Ejemplo n.º 2
0
 public void DebugLog(Object obj, string msg)
 {
     if (this.m_MainClass.m_Define_Class.isDebugMode)
     {
         Console.WriteLine(string.Format("[{0}] DebugLog Message[{1}]: [ {2} ]", UtilsClass.getCurrentTime(), obj.ToString(), msg));
     }
 }
Ejemplo n.º 3
0
        public void SystemLog(int code, Object obj, string msg)
        {
            try
            {
                SqlConnection sqlCon = new SqlConnection();
                sqlCon.ConnectionString = this.m_MainClass.m_SQLClass.sqlConnectionString;
                sqlCon.Open();

                String query = string.Format("INSERT INTO [dbo].[SYSTEM_EVENT_LOG] ([TIMESTAMP]" +
                                             ",[CODENO],[LOCATION],[MESSAGE],[VALUE_1],[VALUE_2]) VALUES (SYSDATETIME()" +
                                             ",{0},'{1}','{2}','','')", code, obj.ToString(), msg);

                this.m_MainClass.m_SQLClass.executeNonQuerySQL(query, sqlCon);
                Console.WriteLine(string.Format("[{0}] SystemLog Message[{1}]: [ {2} ]", UtilsClass.getCurrentTime(), obj.ToString(), msg));

                sqlCon.Close();
            }
            catch (Exception e)
            {
                this.TryCatchLog(this, e.Message);
            }
        }
Ejemplo n.º 4
0
 public void TryCatchLog(Object obj, string msg)
 {
     Console.WriteLine(string.Format("[{0}] TryCatchLog Message[{1}]: [ {2} ]", UtilsClass.getCurrentTime(), obj.ToString(), msg));
 }