Exemple #1
0
        public ChartDTO GetChartDataInc(DateTime?lastReceivedDate, bool canChangeHead)
        {
            //mSyncLast = null;

            IsNew = false;

            // 刷新状态
            SensorHelper <object> helper = new SensorHelper <object>();

            mSensor = helper.SelectSingle <SensorEntity>(string.Format("SensorID = '{0}'", mSensor.SensorID.ToString().ToUpper()), string.Empty);

            SensorDataHeadBll bllHead = new SensorDataHeadBll();

            SensorDataHeadEntity eHead = bllHead.GetNewestSensorDataHeadBySensorID(Sensor.SensorID.ToString().ToUpper());

            if (eHead == null)
            {
                return(null);
            }
            else
            {
                if (eHead.IsCompressed != null && eHead.IsCompressed.HasValue && eHead.IsCompressed.Value)
                {
                    ChartDTO chartData = new ChartDTO();
                    chartData.IsAxisXCustomLabels = false;
                    chartData.ChartTitle          = GetChartTitle();
                    chartData.IsReset             = true;
                    return(chartData);
                }

                if (mHeadEntity != null && eHead.SensorDataHeadID == mHeadEntity.SensorDataHeadID && lastReceivedDate != null && lastReceivedDate.HasValue)
                {
                    return(GetChartDataInc(eHead, lastReceivedDate.Value));
                }
                else
                {
                    if (canChangeHead)
                    {
                        mSensorData = null;
                        ChartDTO dtoChart = GetChartDataByHead(eHead);
                        dtoChart.IsReset = true;
                        IsNew            = true;
                        return(dtoChart);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #2
0
        public SensorStatusDTO GetStatusData()
        {
            // 刷新状态
            SensorHelper <object> helper = new SensorHelper <object>();

            mSensor = helper.SelectSingle <SensorEntity>(string.Format("SensorID = '{0}'", mSensor.SensorID.ToString().ToUpper()), string.Empty);

            SensorDataHeadBll    bllHead = new SensorDataHeadBll();
            SensorDataHeadEntity eHead   = bllHead.GetNewestSensorDataHeadBySensorID(Sensor.SensorID.ToString().ToUpper());

            if (eHead == null)
            {
                SensorStatusDTO dtoStatus = new SensorStatusDTO();
                dtoStatus.SensorCaption = mSensor.SensorName;
                dtoStatus.SensorStatus  = mSensor.PositionMark;
                return(dtoStatus);
            }

            if (eHead.IsCompressed != null && eHead.IsCompressed.HasValue && eHead.IsCompressed.Value)
            {
                SensorStatusDTO dtoStatus = new SensorStatusDTO();
                dtoStatus.SensorCaption = mSensor.SensorName;
                dtoStatus.SensorStatus  = mSensor.PositionMark;
                return(dtoStatus);
            }

            if (Convert.ToInt32(Sensor.SensorType).Equals(Convert.ToInt32(Common.Consts.SensorType.Sterilizer)))
            {
                // 灭菌
                return(GetStatusData(eHead));
            }
            else if (Convert.ToInt32(Sensor.SensorType).Equals(Convert.ToInt32(Common.Consts.SensorType.Washer)))
            {
                // 清洗
                return(GetStatusData(eHead));
            }
            else
            {
                logger.WarnFormat("未处理的设备类型([传感器:{0},设备类型:{1}])", Sensor.SensorKey, Sensor.SensorType);

                return(null);
            }
        }
Exemple #3
0
        public ChartDTO GetChartData()
        {
            mSyncLast = null;
            mDataDic  = new Dictionary <string, DataRow[]>();

            IsNew = true;

            mProgramData = null;

            mShowPropertyDic = GetShowPropertyData();

            // 刷新状态
            SensorHelper <object> helper = new SensorHelper <object>();

            mSensor = helper.SelectSingle <SensorEntity>(string.Format("SensorID = '{0}'", mSensor.SensorID.ToString().ToUpper()), string.Empty);

            SensorDataHeadBll    bllHead = new SensorDataHeadBll();
            SensorDataHeadEntity eHead   = bllHead.GetNewestSensorDataHeadBySensorID(Sensor.SensorID.ToString().ToUpper());

            if (eHead == null)
            {
                ChartDTO chartData = new ChartDTO();
                chartData.ChartTitle = GetChartTitle();
                return(chartData);
            }
            else
            {
                if (eHead.IsCompressed != null && eHead.IsCompressed.HasValue && eHead.IsCompressed.Value)
                {
                    ChartDTO chartData = new ChartDTO();
                    chartData.ChartTitle = GetChartTitle();
                    return(chartData);
                }

                //SensorDataLineBll bllLine = new SensorDataLineBll();
                //mSectionList = bllLine.GetSensorDataLineByDataType(eHead.SensorDataHeadID.ToString(), Utility.GetEnumValue(DataType.Body_SectionTitle));
                mProgramData = GetProgramData(eHead);

                return(GetChartDataByHead(eHead));
            }
        }
Exemple #4
0
        public ChartDTO GetChartData()
        {
            //mSyncLast = null;

            IsNew = true;

            mShowPropertyDic = GetShowPropertyData();

            // 刷新状态
            SensorHelper <object> helper = new SensorHelper <object>();

            mSensor = helper.SelectSingle <SensorEntity>(string.Format("SensorID = '{0}'", mSensor.SensorID.ToString().ToUpper()), string.Empty);

            SensorDataHeadBll    bllHead = new SensorDataHeadBll();
            SensorDataHeadEntity eHead   = bllHead.GetNewestSensorDataHeadBySensorID(Sensor.SensorID.ToString().ToUpper());

            if (eHead == null)
            {
                ChartDTO chartData = new ChartDTO();
                chartData.IsAxisXCustomLabels = false;
                chartData.ChartTitle          = GetChartTitle();
                return(chartData);
            }
            else
            {
                if (eHead.IsCompressed != null && eHead.IsCompressed.HasValue && eHead.IsCompressed.Value)
                {
                    ChartDTO chartData = new ChartDTO();
                    chartData.IsAxisXCustomLabels = false;
                    chartData.ChartTitle          = GetChartTitle();
                    return(chartData);
                }

                return(GetChartDataByHead(eHead));
            }
        }
Exemple #5
0
        public ChartDTO GetChartDataInc(DateTime?lastReceivedDate, bool canChangeHead)
        {
            mSyncLast = null;
            mDataDic  = new Dictionary <string, DataRow[]>();

            IsNew = false;

            mProgramData = null;

            // 刷新状态
            SensorHelper <object> helper = new SensorHelper <object>();

            mSensor = helper.SelectSingle <SensorEntity>(string.Format("SensorID = '{0}'", mSensor.SensorID.ToString().ToUpper()), string.Empty);

            SensorDataHeadBll bllHead = new SensorDataHeadBll();

            SensorDataHeadEntity eHead = bllHead.GetNewestSensorDataHeadBySensorID(Sensor.SensorID.ToString().ToUpper());

            if (eHead == null)
            {
                return(null);
            }
            else
            {
                if (mHeadEntity != null && eHead.SensorDataHeadID != mHeadEntity.SensorDataHeadID && !canChangeHead)
                {
                    return(null);
                }

                if (eHead.IsCompressed != null && eHead.IsCompressed.HasValue && eHead.IsCompressed.Value)
                {
                    if (canChangeHead)
                    {
                        ChartDTO chartData = new ChartDTO();
                        chartData.ChartTitle = GetChartTitle();
                        chartData.IsReset    = true;
                        return(chartData);
                    }
                    else
                    {
                        return(null);
                    }
                }

                //SensorDataLineBll bllLine = new SensorDataLineBll();
                //mSectionList = bllLine.GetSensorDataLineByDataType(eHead.SensorDataHeadID.ToString(), Utility.GetEnumValue(DataType.Body_SectionTitle));

                if (mHeadEntity != null && eHead.SensorDataHeadID == mHeadEntity.SensorDataHeadID && lastReceivedDate != null && lastReceivedDate.HasValue)
                {
                    mProgramData = GetProgramDataInc(eHead, lastReceivedDate.Value);

                    if (Convert.ToInt32(Sensor.SensorType).Equals(Convert.ToInt32(Common.Consts.SensorType.Sterilizer)))
                    {
                        // 灭菌
                        return(GetSterilizerChartDataInc(eHead, lastReceivedDate.Value));
                    }
                    else if (Convert.ToInt32(Sensor.SensorType).Equals(Convert.ToInt32(Common.Consts.SensorType.Washer)))
                    {
                        // 清洗
                        return(GetWasherChartDataInc(eHead, lastReceivedDate.Value));
                    }
                    else
                    {
                        logger.WarnFormat("未处理的设备类型([传感器:{0},设备类型:{1}])", Sensor.SensorKey, Sensor.SensorType);

                        return(null);
                    }
                }
                else
                {
                    if (canChangeHead)
                    {
                        mSensorData = null;
                        ChartDTO dtoChart = GetChartDataByHead(eHead);
                        dtoChart.IsReset = true;
                        IsNew            = true;
                        return(dtoChart);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }