예제 #1
0
 /// <summary>
 /// 设置被试电磁阀的电磁铁状态24V:左、中、右
 /// </summary>
 /// <param name="state"></param>
 protected void SetTestValveState_24V(TestValveState state)
 {
     //Group["被试阀电压切换缓存"] = false;
     //switch (state)
     //{
     //    case TestValveState.左位:
     //        Group["被试阀右控缓存_24V"] = false;
     //        Group["被试阀左控缓存_24V"] = true;
     //        break;
     //    case TestValveState.右位:
     //        Group["被试阀右控缓存_24V"] = true;
     //        Group["被试阀左控缓存_24V"] = false;
     //        break;
     //    default:
     //        Group["被试阀右控缓存_24V"] = false;
     //        Group["被试阀左控缓存_24V"] = false;
     //        break;
     //}
 }
예제 #2
0
        /// <summary>
        /// 设置控制油路先导级的启闭状态,原理图中阀8
        /// </summary>
        /// <param name="state">左位,右位,中位</param>
        public void SetTestValveStatePilot(TestValveState state)
        {
            //switch (state)
            //{
            //    case TestValveState.左位:
            //        Group["阀8右控缓存"] = false;
            //        Group["阀8左控缓存"] = true;
            //        break;
            //    case TestValveState.右位:
            //        Group["阀8右控缓存"] = true;
            //        Group["阀8左控缓存"] = false;
            //        break;
            //    default:
            //        Group["阀8右控缓存"] = false;
            //        Group["阀8左控缓存"] = false;
            //        break;

            //}
        }
예제 #3
0
 /// <summary>
 /// 设置被试电磁阀的电磁铁状态22V:左、中、右
 /// </summary>
 /// <param name="state"></param>
 public void SetTestValveState_22V(TestValveState state)
 {
     //Group["被试阀电压切换缓存"] = true;
     //switch (state)
     //{
     //    case TestValveState.左位:
     //        Group["被试阀右控缓存_22V"] = false;
     //        Group["被试阀左控缓存_22V"] = true;
     //        break;
     //    case TestValveState.右位:
     //        Group["被试阀右控缓存_22V"] = true;
     //        Group["被试阀左控缓存_22V"] = false;
     //        break;
     //    default:
     //        Group["被试阀右控缓存_22V"] = false;
     //        Group["被试阀左控缓存_22V"] = false;
     //        break;
     //}
     LOG.Debug("电磁铁22V电源被设置为" + state.ToString());
 }
예제 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="state"></param>
        private void SteadystatePreeesureSingleSide(TestValveState state)
        {
            if (state == TestValveState.中位)
            {
                return;
            }

            CurvePanel panel = new CurvePanel();

            panel.Title  = TestType.稳态压差流量特性试验.ToString() + "(" + state.ToString() + ")";
            panel.XLabel = "流量(L/Min)";
            panel.YLabel = "压差(MPa)";
            Curve curvePT = new Curve();
            Curve curvePA = new Curve();
            Curve curvePB = new Curve();
            Curve curveAT = new Curve();
            Curve curveBT = new Curve();

            //添加曲线
            panel.AddCurve(curvePT);
            panel.AddCurve(curvePA);
            panel.AddCurve(curvePB);
            panel.AddCurve(curveAT);
            panel.AddCurve(curveBT);
            //添加曲线名称
            curvePT.Name = "PT口";
            curvePA.Name = "PA口";
            curvePB.Name = "PB口";
            curveAT.Name = "AT口";
            curveBT.Name = "BT口";


            this.SetCircuitState(CircuitState.PABTOut);
            this.SetThrottleValve(100f);
            this.SetTestValveState(state);
            this.SetSourcePre(this.额定压力);
            float 最大流量 = (float)(this.额定流量);

            this.SetSourceFlow(0);
            Pause(3000);

            const int div_cnt     = 10;
            const int measure_cnt = 10;

            float pressure_A = 0;
            float pressure_B = 0;
            float pressure_P = 0;
            float pressure_T = 0;
            float delta_q    = (float)(最大流量 / div_cnt);

            float flow = 0;

            for (int i = 0; i <= div_cnt; i++)
            {
                this.SetSourceFlow(i * delta_q);

                //读取压力流量数据
                flow       = 0;
                pressure_A = 0;
                pressure_B = 0;
                pressure_P = 0;
                pressure_T = 0;
                for (int j = 0; j < measure_cnt; j++)
                {
                    Pause(500);
                    flow       += this.当前流量绝对值 / measure_cnt;
                    pressure_A += this.当前A口压力 / measure_cnt;
                    pressure_B += this.当前B口压力 / measure_cnt;
                    pressure_P += this.当前P口压力 / measure_cnt;
                    pressure_T += this.当前T口压力 / measure_cnt;
                }
                //将数据添加到曲线
                curvePT.AddPoint(flow, pressure_P - pressure_T);
                curvePA.AddPoint(flow, pressure_P - pressure_A);
                curvePB.AddPoint(flow, pressure_P - pressure_B);
                curveAT.AddPoint(flow, pressure_A - pressure_T);
                curveBT.AddPoint(flow, pressure_B - pressure_T);
            }
            this.SetSourcePre(0);
            this.SetSourceFlow(0);
            SetTestValveState(TestValveState.中位);
            this.SetThrottleValve(50f);

            this.dictCurvePanel.Remove(panel.Title);
            this.dictCurvePanel.Add(panel.Title, panel);
        }
예제 #5
0
 /// <summary>
 /// 设置被试阀至指定工位
 /// </summary>
 /// <param name="state"></param>
 protected override void SetTestValveState(TestValveState state)
 {
     MessageBox.Show("请手动将被试阀切换至" + state.ToString());
 }
예제 #6
0
 protected override void SetTestValveState(TestValveState state)
 {
     this.SetTestValveStatePilot(state);
 }
예제 #7
0
        //private void Run(Object stateInfo)
        //{
        //    LOG.Info("试验开始...");
        //    LOG.Info(String.Format("当前选择的试验元件型号为:{0}", this.型号));
        //    try
        //    {
        //        this.SetOfSelectFlowMeter((float)this.额定流量);
        //        this.decideOnAdjPropValve((float)this.额定流量);
        //        this.SelectFlowMeter();

        //        recordor.StartRecord();//开始记录
        //        LOG.Info("开始记录数据");
        //        foreach (TestType testType in this.试验类型列表)
        //        {
        //            LOG.Info(testType.ToString() + " 开始");
        //            RunTest(testType);
        //            LOG.Info(testType.ToString() + " 结束");
        //        }
        //        recordor.EndRecort();//stop record and save data to folder named "report"
        //        LOG.Info("停止记录数据");
        //        this.SaveReportToDB();
        //        LOG.Info("试验报告已转为BLOB");
        //        this.SaveTestData();//save data to Mysql database
        //        LOG.Info("试验记录以保存到数据库,如有需要请在中央控制室查看");
        //        this.SetSourceFlow(0);
        //        this.SetSourcePre(0);//1102
        //        this.SetFlowMeasureValveOn();//1031
        //        this.SetCircuitState(CircuitState.ALLOn);
        //        _tested = true;//表示该阀做过试验
        //    }
        //    catch (BallValveOperateTimeOutException e)
        //    {
        //        LOG.Error("球阀操作超时,试验终止");
        //        this.SetSourceFlow(0);
        //        this.SetSourcePre(0);//1102
        //    }
        //    catch (TestAbortException e)
        //    {
        //        LOG.Error("试验被用户主动终止");
        //    }
        //    catch (Exception e)
        //    {
        //        LOG.Debug(e);
        //        throw e;
        //    }
        //    finally
        //    {
        //        this.heartbeatTimer.Enabled = false;
        //    }

        //    //此处使能启动按钮
        //    //此处禁掉暂停按钮
        //    TestEndEvent();//触发button使能状态改变的事件
        //    //this.SetSourceFlow(0);
        //    //this.SetSourcePre(0);//移到上面了,先把压力流量卸下来再操作球阀打开
        //    LOG.Info("试验结束,请打印实验报告...");
        //}


        protected virtual void SetTestValveState(TestValveState state)
        {
        }