Ejemplo n.º 1
0
        /// <summary>
        /// start
        /// </summary>
        public Form1()
        {
            SqlAccess            sql   = new SqlAccess();
            Mes_Device_SqlAccess MDsql = new Mes_Device_SqlAccess();

            Mes_Product_SqlAccess MPsql = new Mes_Product_SqlAccess();

            InitializeComponent();
            init_stringArray_name();



            //获取所有可检测项
            GetAllCheckColumns();
            System.Timers.Timer tmr = new System.Timers.Timer(5000);
            tmr.Elapsed  += new ElapsedEventHandler(OtherTheard);
            tmr.AutoReset = true;
            tmr.Enabled   = true;
            GC.KeepAlive(tmr);///定时执行


            System.Timers.Timer Insert_Alarm_Log = new System.Timers.Timer(5000);
            Insert_Alarm_Log.Elapsed  += new ElapsedEventHandler(Insert_Alarm_Log_Data);
            Insert_Alarm_Log.AutoReset = true;
            Insert_Alarm_Log.Enabled   = true;
            GC.KeepAlive(Insert_Alarm_Log);///定时执行



            ////MessageBox.Show("软件开启成功");
            ////Mes_Device_SqlAccess MDsql = new Mes_Device_SqlAccess();

            ////gengsi_jialiao_realtime[1] = MDsql.ExecuteQuery("SELECT * FROM DBO.Live WHERE TagName='" + gengsi_jialiao_realtime_datakey[0] + "'");

            ////MDsql.close_sql();

            ////Mes_Product_SqlAccess MPsql = new Mes_Product_SqlAccess();

            ////Mes_Device_SqlAccess MDsql = new Mes_Device_SqlAccess();

            ////SELECT * FROM DBO.Live WHERE TagName='JX_JXJD'
            ////SELECT * FROM spc.PPA_TAG_PARA ptp WHERE  ptp.Para_NAME LIKE '%梗丝%'
            ////String[] MPds = MPsql.ExecuteQuery("SELECT * FROM [nymes].[VIEW_CUT_PLANS]");
            ////DataTable MPdt = MPds.Tables[0];
            ////DataRow MPdr = MPdt.Rows[0];

            //// String result = MDsql.ExecuteQuery("SELECT * FROM DBO.Live WHERE TagName='GS_GZQSF'");


            ////UpdateOldTime("201711091849");
            ////UpdateOldTime("1");
            label1.Text = "正在存储数据...";

            //// label1.Text = result;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 查询标准值
 /// </summary>
 public void findStandardValue(string[] dataString, string[] keyString)
 {
     for (int i = 0; i < keyString.Length; i++)
     {
         dataString[i + 1] = "";
         dataString[i + 1] = Mes_Device_SqlAccess.ExecuteQuery("SELECT * FROM DBO.Live WHERE TagName='" + keyString[i] + "_SET'");
         if (dataString[i + 1].Length >= 20)
         {
             dataString[i + 1] = dataString[i + 1].Substring(0, 18);
         }
     }
 }