Exemplo n.º 1
0
        private void fthread()
        {
            while (!StaticClass.SystemOut)
            {
                try
                {
                    //调用服务端接口,看能否正常调用来判断服务端是否开启
                    var response = ServiceFactory.Create <IRemoteStateService>().GetLastReciveTime();
                    PointDefineGetByDevpropertIDRequest PointDefineRequest = new PointDefineGetByDevpropertIDRequest();
                    PointDefineRequest.DevpropertID = 3;
                    if (pointDefineControlList.Count == 0 || GetDefineChangeFlg())
                    {
                        pointDefineControlList = pointDefineService.GetPointDefineCacheByDevpropertID(PointDefineRequest).Data;
                    }

                    getdata();
                    var           nowtime = Model.RealInterfaceFuction.GetServerNowTime();
                    MethodInvoker In      = new MethodInvoker(() => refresh(nowtime, pointDefineControlList));
                    if (this.InvokeRequired)
                    {
                        this.BeginInvoke(In);
                    }
                }
                catch (Exception ex)
                {
                    Basic.Framework.Logging.LogHelper.Error(ex.ToString());
                }
                Thread.Sleep(3000);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取点号
        /// </summary>
        private void getpoint()
        {
            DataTable dt = new DataTable();

            cmb_adr.Properties.Items.Clear();
            PointDefineGetByDevpropertIDRequest pointDefineRequest = new PointDefineGetByDevpropertIDRequest();

            pointDefineRequest.DevpropertID = 7;
            dt = Basic.Framework.Common.ObjectConverter.ToDataTable <Jc_DefInfo>(pointDefineService.GetPointDefineCacheByDevpropertID(pointDefineRequest).Data);
            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmb_adr.Properties.Items.Add(dt.Rows[i]["point"].ToString());
                }
            }
            if (obj.analogpoint != "")
            {
                for (int i = 0; i < cmb_adr.Properties.Items.Count; i++)
                {
                    if (obj.analogpoint == cmb_adr.Properties.Items[i].ToString())
                    {
                        cmb_adr.SelectedIndex = i;
                        break;
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取所有分站
        /// </summary>
        /// <returns></returns>
        public static List <Jc_DefInfo> GetAllSubstation()
        {
            var req = new PointDefineGetByDevpropertIDRequest
            {
                DevpropertID = 0
            };
            var res = PointDefineService.GetPointDefineCacheByDevpropertID(req);

            if (!res.IsSuccess)
            {
                throw new Exception(res.Message);
            }
            return(res.Data);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取所有分站对象
        /// </summary>
        /// <returns></returns>
        public static List <Jc_DefInfo> GetStationAllSystemPointDefineItems()
        {
            List <Jc_DefInfo> items = new List <Jc_DefInfo>();
            PointDefineGetByDevpropertIDRequest pointDefineRequest = new PointDefineGetByDevpropertIDRequest();

            pointDefineRequest.DevpropertID = 0;
            var result = allSystemPointDefineService.GetPointDefineCacheByDevpropertID(pointDefineRequest);

            if (result.IsSuccess && result.Data != null)
            {
                items = result.Data.FindAll(a => a.Upflag != "1");//增加处理,下发初始化时,不下发从子系统同步的数据(通过upflag=1表示子系统同步的数据)  20180131
            }
            return(items);
        }
        /// <summary>通过设备性质查找测点
        /// </summary>
        /// <param name="com"></param>
        /// <returns></returns>
        public static List <Jc_DefInfo> QueryPointByDevpropertIDCache(int DevPropertID)
        {
            PointDefineGetByDevpropertIDRequest PointDefineRequest = new PointDefineGetByDevpropertIDRequest();

            PointDefineRequest.DevpropertID = DevPropertID;
            var result = _PointDefineService.GetPointDefineCacheByDevpropertID(PointDefineRequest);

            if (result.IsSuccess == true)
            {
                return(result.Data);
            }
            else
            {
                throw new Exception(result.Message);
            }
        }
Exemplo n.º 6
0
        private void RealKZControl_Load(object sender, EventArgs e)
        {
            inigrid();
            try
            {
                getdata();
                var nowtime = Model.RealInterfaceFuction.GetServerNowTime();

                PointDefineGetByDevpropertIDRequest PointDefineRequest = new PointDefineGetByDevpropertIDRequest();
                PointDefineRequest.DevpropertID = 3;
                List <Jc_DefInfo> pointDefineControlList = pointDefineService.GetPointDefineCacheByDevpropertID(PointDefineRequest).Data;

                refresh(nowtime, pointDefineControlList);
            }
            catch (Exception ex)
            {
                Basic.Framework.Logging.LogHelper.Error(ex);
            }
            //timer1.Enabled = true;
            freshthread = new Thread(new ThreadStart(fthread));
            freshthread.Start();
        }
Exemplo n.º 7
0
        /// <summary>
        ///     通过设备性质查找测点
        /// </summary>
        /// <param name="com"></param>
        /// <returns></returns>
        public static IList <Jc_DefInfo> QueryPointByDevpropertIDCache(int DevPropertID)
        {
            //IJC_DEFService DEFService = ServiceFactory.CreateService<IJC_DEFService>();
            //return DEFService.QueryPointByDevpropertIDCache(DevPropertID);

            //var pointDefineCacheRequest = new PointDefineCacheGetByConditonRequest
            //{
            //    Predicate =
            //        a => (a.DevPropertyID == DevPropertID) && (a.Activity == "1") && (a.InfoState != InfoState.Delete)
            //};
            //var res = PointDefineService.GetPointDefineCacheByDynamicCondition(pointDefineCacheRequest);
            var req = new PointDefineGetByDevpropertIDRequest
            {
                DevpropertID = DevPropertID
            };
            var res = PointDefineService.GetPointDefineCacheByDevpropertID(req);

            if (!res.IsSuccess)
            {
                throw new Exception(res.Message);
            }
            return(res.Data);
        }
 public BasicResponse <List <Jc_DefInfo> > GetPointDefineCacheByDevpropertID(PointDefineGetByDevpropertIDRequest PointDefineRequest)
 {
     return(_PointDefineService.GetPointDefineCacheByDevpropertID(PointDefineRequest));
 }
Exemplo n.º 9
0
        private void SensorCalibration_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("PointId");
                dt.Columns.Add("Point");
                dt.Columns.Add("Position");
                dt.Columns.Add("DevName");
                dt.Columns.Add("UpAarmValue");
                dt.Columns.Add("DownAarmValue");
                dt.Columns.Add("UpDdValue");
                dt.Columns.Add("DownDdValue");
                dt.Columns.Add("UpHfValue");
                dt.Columns.Add("DownHfValue");
                dt.Columns.Add("LC2");
                dt.Columns.Add("SeniorGradeAlarmValue");
                dt.Columns.Add("SeniorGradeTimeValue");
                //object[] obj = new object[13];
                //obj[0] = "1";
                //obj[1] = "001A010";
                //obj[2] = "10101工作面甲烷";
                //obj[3] = "甲烷传感器";
                //obj[4] = "1.0/0.9";
                //obj[5] = "0/0";
                //obj[6] = "1.5/1.4";
                //obj[7] = "0/0";
                //obj[8] = "0.9/0.9";
                //obj[9] = "0/0";
                //obj[10] = "40/40";
                //obj[11] = "0.5/0.8/1.0/1.5";
                //obj[12] = "1/2/3/4";
                //dt.Rows.Add(obj);

                PointDefineGetByDevpropertIDRequest PointDefineRequest = new PointDefineGetByDevpropertIDRequest();
                PointDefineRequest.DevpropertID = 1;
                List <Jc_DefInfo> defList = pointDefineService.GetPointDefineCacheByDevpropertID(PointDefineRequest).Data;
                //defList = defList.FindAll(a => a.Z2 != a.DeviceInfoItem.UpAarmValue || a.Z3 != a.DeviceInfoItem.UpDdValue || a.Z4 != a.DeviceInfoItem.UpHfValue
                //    || a.Z6 != a.DeviceInfoItem.DownAarmValue || a.Z7 != a.DeviceInfoItem.DownDdValue || a.Z8 != a.DeviceInfoItem.DownHfValue);
                List <Jc_DefInfo> allSensorDefineNotMatchList = new List <Jc_DefInfo>();
                foreach (Jc_DefInfo def in defList)
                {
                    if (def.Z2 != def.DeviceInfoItem.UpAarmValue)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (def.Z3 != def.DeviceInfoItem.UpDdValue)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (def.Z4 != def.DeviceInfoItem.UpHfValue)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (def.Z6 != def.DeviceInfoItem.DownAarmValue)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (def.Z7 != def.DeviceInfoItem.DownDdValue)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (def.Z8 != def.DeviceInfoItem.DownHfValue)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    string[] GradingAlarmLevel = def.Bz8.Split(',');
                    if (GradingAlarmLevel.Length < 4)
                    {
                        GradingAlarmLevel = new string[4] {
                            "0", "0", "0", "0"
                        };
                    }
                    if (float.Parse(GradingAlarmLevel[0]) != def.DeviceInfoItem.SeniorGradeAlarmValue1)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (float.Parse(GradingAlarmLevel[1]) != def.DeviceInfoItem.SeniorGradeAlarmValue2)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (float.Parse(GradingAlarmLevel[2]) != def.DeviceInfoItem.SeniorGradeAlarmValue3)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (float.Parse(GradingAlarmLevel[3]) != def.DeviceInfoItem.SeniorGradeAlarmValue4)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    string[] GradingAlarmTime = def.Bz9.Split(',');
                    if (GradingAlarmTime.Length < 4)
                    {
                        GradingAlarmTime = new string[4] {
                            "0", "0", "0", "0"
                        };
                    }
                    if (float.Parse(GradingAlarmTime[0]) != def.DeviceInfoItem.SeniorGradeTimeValue1)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (float.Parse(GradingAlarmTime[1]) != def.DeviceInfoItem.SeniorGradeTimeValue2)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (float.Parse(GradingAlarmTime[2]) != def.DeviceInfoItem.SeniorGradeTimeValue3)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                    if (float.Parse(GradingAlarmTime[3]) != def.DeviceInfoItem.SeniorGradeTimeValue4)
                    {
                        allSensorDefineNotMatchList.Add(def);
                    }
                }
                foreach (Jc_DefInfo def in allSensorDefineNotMatchList)
                {
                    object[] obj = new object[13];
                    obj[0]  = def.PointID;
                    obj[1]  = def.Point;
                    obj[2]  = def.Wz;
                    obj[3]  = def.DevName;
                    obj[4]  = def.Z2 + "/" + def.DeviceInfoItem.UpAarmValue;
                    obj[5]  = def.Z6 + "/" + def.DeviceInfoItem.DownAarmValue;
                    obj[6]  = def.Z3 + "/" + def.DeviceInfoItem.UpDdValue;
                    obj[7]  = def.Z7 + "/" + def.DeviceInfoItem.DownDdValue;
                    obj[8]  = def.Z4 + "/" + def.DeviceInfoItem.UpHfValue;
                    obj[9]  = def.Z8 + "/" + def.DeviceInfoItem.DownHfValue;
                    obj[10] = "";
                    obj[11] = def.Bz8 + "/" + def.DeviceInfoItem.SeniorGradeAlarmValue1 + "," + def.DeviceInfoItem.SeniorGradeAlarmValue2
                              + "," + def.DeviceInfoItem.SeniorGradeAlarmValue3 + "," + def.DeviceInfoItem.SeniorGradeAlarmValue4;
                    obj[12] = def.Bz9 + "/" + def.DeviceInfoItem.SeniorGradeTimeValue1 + "," + def.DeviceInfoItem.SeniorGradeTimeValue2
                              + "," + def.DeviceInfoItem.SeniorGradeTimeValue3 + "," + def.DeviceInfoItem.SeniorGradeTimeValue4;
                    dt.Rows.Add(obj);
                }

                gridControl1.DataSource = dt;
            }
            catch (Exception ex)
            {
                Basic.Framework.Logging.LogHelper.Error(ex);
            }
        }
Exemplo n.º 10
0
        public BasicResponse <List <Jc_DefInfo> > GetPointDefineCacheByDevpropertID(PointDefineGetByDevpropertIDRequest PointDefineRequest)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/PersonPointDefine/GetPointDefineCacheByDevpropertID?token=" + Token, JSONHelper.ToJSONString(PointDefineRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <List <Jc_DefInfo> > >(responseStr));
        }