Ejemplo n.º 1
0
        public static AlarmLimitModel GetAllLimit(string tagname)
        {
            AlarmLimitModel AlarmLimit = new AlarmLimitModel();

            //string sqlStr = "SELECT department_name,FullTagName,FDC_Tag,Limit_Max,Limit_Max_Type,IsHiEnable,Limit_Min,Limit_Min_Type,IsLoEnable,delayTime FROM vw_eq_limit where fulltagName = '" + tagname + "'";
            //DataSet DeptDS = DBConnector.executeQuery("Intouch", sqlStr);
            //AlarmLimit = (from dept in DeptDS.Tables[0].AsEnumerable()
            //              select new AlarmLimitModel
            //              {
            //                  department_name = dept.Field<string>("department_name"),
            //                  FullTagName = dept.Field<string>("FullTagName"),
            //                  FDC_Tag = dept.Field<string>("FDC_Tag"),
            //                  Limit_Max = dept.Field<double?>("Limit_Max"),
            //                  Limit_Max_Type = dept.Field<double?>("Limit_Max_Type"),
            //                  IsHiEnable = dept.Field<bool?>("IsHiEnable"),
            //                  Limit_Min = dept.Field<double?>("Limit_Min"),
            //                  Limit_Min_Type = dept.Field<double?>("Limit_Min_Type"),
            //                  IsLoEnable = dept.Field<bool?>("IsLoEnable"),
            //                  DelayTime = dept.Field<int>("delayTime")
            //              }).FirstOrDefault();

            AlarmLimit.FullTagName = tagname;
            AlarmLimit.FDC_Tag     = tagname;
            AlarmLimit.Limit_Max   = 32766;
            AlarmLimit.Limit_Min   = -32767;
            AlarmLimit.DelayTime   = 0;
            AlarmLimit.IsHiEnable  = true;
            AlarmLimit.IsLoEnable  = true;

            return(AlarmLimit);
        }
Ejemplo n.º 2
0
        public static AlarmLimitModel GetLimit(string tagname)
        {
            AlarmLimitModel AlarmLimit = new AlarmLimitModel();

            string sqlStr = "SELECT department_name,FullTagName,FDC_Tag,Limit_Max,Limit_Max_Type,IsHiEnable,Limit_Min,Limit_Min_Type,IsLoEnable,delayTime FROM vw_eq_limit where fulltagName = '" + tagname + "'";

            DataSet DeptDS = DBConnector.executeQuery("Intouch", sqlStr);

            AlarmLimit = (from dept in DeptDS.Tables[0].AsEnumerable()
                          select new AlarmLimitModel
            {
                department_name = dept.Field <string>("department_name"),
                FullTagName = dept.Field <string>("FullTagName"),
                FDC_Tag = dept.Field <string>("FDC_Tag"),
                Limit_Max = dept.Field <double?>("Limit_Max"),
                Limit_Max_Type = dept.Field <double?>("Limit_Max_Type"),
                IsHiEnable = dept.Field <bool?>("IsHiEnable"),
                Limit_Min = dept.Field <double?>("Limit_Min"),
                Limit_Min_Type = dept.Field <double?>("Limit_Min_Type"),
                IsLoEnable = dept.Field <bool?>("IsLoEnable"),
                DelayTime = dept.Field <int>("delayTime")
            }).FirstOrDefault();

            return(AlarmLimit);
        }