Ejemplo n.º 1
0
        public QFModule CalQuFu(ShuXianCaiJiModule.SXCJModule module, List <float> list, double qfLimit, float maxForce, MachineBase machine)
        {
            QFModule   _QFModule = new QFModule();
            OKEUnivers ou        = machine as OKEUnivers;

            if (ou != null)
            {
                _QFModule.DownQF = ou.GetQuFuL();
                _QFModule.UpQF   = ou.GetQuFuH();
            }

            return(_QFModule);
        }
Ejemplo n.º 2
0
        public static float CalQF(SXCJModule module, List <float> list, Double qfLimit, float maxForce, Logger log, MachineBase machine)
        {
            float qf = 0.0f;

            try
            {
                if (module.SpecialSetting.MachineType == 2 && maxForce > 0 && list != null && list.Count > 0)
                {
                    QFModule m      = null;
                    QuFuBase quBase = QuFuFactory.GetQuFuModule(module.SpecialSetting.QFName);

ReSet:
                    if (quBase != null)
                    {
                        m = quBase.CalQuFu(module, list, qfLimit, maxForce, machine);
                    }
                    if (m == null)//无屈服过程,是否乘以参数?
                    {
                        qf = (float)(maxForce * module.SpecialSetting.QFParameter);
                    }
                    else
                    {
                        if (module.SpecialSetting.QuFuType == 1)
                        {
                            qf = m.UpQF;
                        }
                        else
                        {
                            qf = m.DownQF;
                        }
                        if (qf == 0.00f && !isRemarkQF)
                        {
                            if (module.SpecialSetting.IsDebug)
                            {
                                log.WriteLog("调用备用屈服算法通用0722!", true, false);
                            }
                            isRemarkQF = true;
                            quBase     = QuFuFactory.GetQuFuModule("通用0722");
                            goto ReSet;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.Message + "\r\n" + ex.StackTrace, true, true);
            }
            isRemarkQF = false;
            return(qf);
        }
Ejemplo n.º 3
0
        public QFModule CalQuFu(SXCJModule module, List <float> list, double qfLimit, float maxForce, MachineBase machine)
        {
            QFModule    _QFModule = new QFModule();
            FYUniversQF ou        = machine as FYUniversQF;

            if (ou != null)
            {
                float downQF = 0.00f;
                float upQF   = 0.00f;
                ou.GetQF(out downQF, out upQF);
                _QFModule.DownQF = downQF;
                _QFModule.UpQF   = upQF;
            }

            return(_QFModule);
        }
Ejemplo n.º 4
0
        private QFModule GetRealQFModule(List <QFModule> list, double qfLimit, float maxForce)
        {
            QFModule m         = null;
            QFModule m_qflimit = null;

            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    if (i == 0)
                    {
                        m = list[i];
                    }
                    else
                    {
                        if (m.QFCount <= list[i].QFCount)
                        {
                            m = list[i];
                        }
                        if (list[i].DownQF > qfLimit && list[i].DownQF < maxForce * 0.9)
                        {
                            if (m_qflimit != null)
                            {
                                if (m_qflimit.QFCount < list[i].QFCount)
                                {
                                    m_qflimit = list[i];
                                }
                            }
                            else
                            {
                                m_qflimit = list[i];
                            }
                        }
                    }
                }
            }
            if (m_qflimit != null)
            {
                return(m_qflimit);
            }
            else
            {
                return(m);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 得到集合中点数量最多的屈服过程
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private QFModule GetRealQFModule(List <QFModule> list)
        {
            QFModule m = null;

            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    if (i == 0)
                    {
                        m = list[i];
                    }
                    else
                    {
                        if (m.QFCount <= list[i].QFCount)
                        {
                            m = list[i];
                        }
                    }
                }
            }
            return(m);
        }
Ejemplo n.º 6
0
        public QFModule CalQuFu(SXCJModule module, List <float> list, double qfLimit, float maxForce, MachineBase machine)
        {
            List <QFModule> resultList = new List <QFModule>(); //屈服过程集合

            float   lastLZ  = 0.0f;                             //上个点的力值
            Boolean startQF = false;                            //开始进入屈服阶段标记
            float   upQF    = 0.0f;                             //上屈服
            float   downQF  = 0.0f;                             //下屈服
            Int32   qfCount = 0;                                //屈服点数量

            for (int i = 0; i < list.Count; i++)
            {
                float lz = list[i];
                if (lz < module.SpecialSetting.QFStartValue)
                {
                    continue;//如果在设定的有效力值之下,跳过
                }
                if (lz == maxForce)
                {
                    break;           //如果到最大力值,结束循环
                }
                if (!startQF)        //还没记录到下降
                {
                    if (lz < lastLZ) //当前力值比上一个力值小时
                    {
                        startQF = true;
                        qfCount = 1;
                        upQF    = lastLZ;
                        downQF  = lz;
                    }
                    else
                    {
                        lastLZ = lz;
                    }
                }
                else//进入屈服判断过程
                {
                    if (lz > upQF)//超过上屈服,表示屈服过程结束
                    {
                        if (qfCount > module.SpecialSetting.PrecisionGrade)//在精度范围内的点数
                        {
                            QFModule m = new QFModule();
                            m.QFCount = qfCount;
                            m.UpQF    = upQF;
                            m.DownQF  = downQF;
                            resultList.Add(m);
                        }
                        upQF    = 0.0f;
                        downQF  = 0.0f;
                        startQF = false;
                    }
                    else//曲线下降,更新下屈服
                    {
                        downQF = lz < downQF ? lz : downQF;
                    }
                    qfCount++;
                    lastLZ = lz;
                }
            }
            return(GetRealQFModule(resultList));
        }
Ejemplo n.º 7
0
        public QFModule CalQuFu(SXCJModule module, List <float> list, double qfLimit, float maxForce, MachineBase machine)
        {
            List <QFModule> resultList         = new List <QFModule>(); //屈服过程集合
            float           lastLZ             = 0.0f;                  //上个点的力值
            Boolean         startQF            = false;                 //开始进入屈服阶段标记
            float           upQF               = 0.0f;                  //上屈服
            float           downQF             = 0.0f;                  //下屈服
            Int32           qfCount            = 0;                     //屈服点数量
            Int32           tmpShangShengCount = 0;                     //连续上升计数器
            Int32           tempXiaJiangCount  = 0;

            for (int i = 0; i < list.Count; i++)
            {
                float lz = list[i];
                if (lz < module.SpecialSetting.QFStartValue)
                {
                    continue;//如果在设定的有效力值之下,跳过
                }
                if (lz == maxForce)
                {
                    break;           //如果到最大力值,结束循环
                }
                if (!startQF)        //还没记录到下降
                {
                    if (lz < lastLZ) //当前力值比上一个力值小时
                    {
                        if (tempXiaJiangCount >= module.SpecialSetting.PrecisionGrade)
                        {
                            startQF            = true;
                            qfCount            = 1;
                            upQF               = lastLZ;
                            downQF             = lz;
                            tmpShangShengCount = 0;
                        }
                        else
                        {
                            tempXiaJiangCount++;
                        }
                    }
                    else
                    {
                        lastLZ = lz;
                        if (tempXiaJiangCount != 0)
                        {
                            tempXiaJiangCount = 0;
                        }
                    }
                }
                else//进入屈服判断过程
                {
                    if (tmpShangShengCount > module.SpecialSetting.QFPoints)//连续上升N次,表示屈服过程结束
                    {
                        QFModule m = new QFModule();
                        m.QFCount = qfCount - tmpShangShengCount;
                        m.UpQF    = upQF;
                        m.DownQF  = downQF;
                        resultList.Add(m);
                        upQF    = 0.0f;
                        downQF  = 0.0f;
                        startQF = false;
                    }
                    if (lz >= lastLZ)//曲线上升或水平
                    {
                        tmpShangShengCount++;
                        tempXiaJiangCount = 0;
                    }
                    else//曲线下降,更新下屈服,并将连续上升计数器清零
                    {
                        downQF = lz < downQF ? lz : downQF;
                        if (tempXiaJiangCount >= module.SpecialSetting.PrecisionGrade)
                        {
                            tmpShangShengCount = 0;
                            tempXiaJiangCount  = 0;
                        }
                        tempXiaJiangCount++;
                    }
                    qfCount++;
                    lastLZ = lz;
                }
            }
            return(GetRealQFModule(resultList));
        }