/// <summary>
        /// 初始化多功能参数
        /// </summary>
        private void initDgnControl()
        {
            //加载当前系统配置
            CLDC_DataCore.Const.GlobalUnit.g_SystemConfig = new CLDC_DataCore.SystemModel.SystemInfo();
            CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.Load();
            CLDC_DataCore.Const.GlobalUnit.Log      = new CLDC_DataCore.Function.RunLog();
            CLDC_DataCore.Const.GlobalUnit.FrameLog = new CLDC_DataCore.Function.RunLogFrame();
            int bwCount = GlobalUnit.GetConfig(CLDC_DataCore.Const.Variable.CTC_BWCOUNT, 24);

            CLDC_DataCore.Const.GlobalUnit.g_CUS = new CLDC_DataCore.CusModel(bwCount, 1);
            CLDC_DataCore.Const.GlobalUnit.g_CUS.Load();

            //通讯数据线程
            //Comm.GlobalUnit.m_485DataControl = new Comm.VerifyMsgControl(); //485消息组件
            //Comm.GlobalUnit.m_485DataControl.IsMsg = true;
            //Comm.GlobalUnit.m_485DataControl.ShowMsg += new Comm.VerifyMsgControl.OnShowMsg(dteShow485Message);
            //消息数据线程
            CLDC_DataCore.Const.GlobalUnit.g_MsgControl          = new CLDC_DataCore.VerifyMsgControl(); //普通消息组件
            CLDC_DataCore.Const.GlobalUnit.g_MsgControl.IsMsg    = true;
            CLDC_DataCore.Const.GlobalUnit.g_MsgControl.ShowMsg += new CLDC_DataCore.VerifyMsgControl.OnShowMsg(dteMessage);

            //  th485Msg = new Thread(Comm.GlobalUnit.m_485DataControl.DoWork);
            //  th485Msg.Start();
            thMessageMsg = new Thread(CLDC_DataCore.Const.GlobalUnit.g_MsgControl.DoWork);
            thMessageMsg.Start();

            //测试按钮不可用
            Menu_Test.Enabled = false;
            //联机
            //CLDC_DataCore.Function.ThreadCallBack.Call(new CLDC_DataCore.Function.CallBack(InitEquip), 1000);
        }
 /// <summary>
 /// 取电能表平均值修约精度
 /// </summary>
 /// <returns>精度</returns>
 protected int getAvgPrecision()
 {
     return(GlobalUnit.GetConfig(CLDC_DataCore.Const.Variable.CTC_WC_AVGPRECISION, 4));
     //if (m_WuChaPara.MeterLevel <= 0.05F)
     //    return 4;
     //else if (m_WuChaPara.MeterLevel >= 0.1F && m_WuChaPara.MeterLevel <= 0.5F)
     //    return 3;
     //else
     //    return 2;
 }
Example #3
0
        public StatisticsDAC(GlobalUnit unit)
        {
            InitializeComponent();
            this.unit = unit;

            gridViews = new DataGridView[8];
            for (int i = 0; i < 8; i++)
            {
                gridViews[i] = (DataGridView)(this.Controls.Find("dataGridView1" + i.ToString(), true)[0]);
            }
        }
        public StatisticsADC(GlobalUnit unit)
        {
            InitializeComponent();
            this.unit = unit;

            gridViews    = new DataGridView[6];
            gridViews[0] = dataGridView1;
            gridViews[1] = dataGridView2;
            gridViews[2] = dataGridView2_1;

            gridViews[3] = dataGridView3;
            gridViews[4] = dataGridView4;
            gridViews[5] = dataGridView4_1;
        }
Example #5
0
        private void діаграмаРоботиАЦПToolStripMenuItem_Click(object sender, EventArgs e)
        {
            comboParametrs par  = ReadDataFromFields();
            GlobalUnit     unit = new GlobalUnit();

            unit.adcInst = new PFI.ADCConv.ADC(par.quantity, par.alpha, par.delta);

            if (chkbxWeightsByHands.Checked)
            {
                unit.IsWeightsByHands = true;
            }

            ADCTimeDiagram form = new ADCTimeDiagram(unit);

            form.Show();
        }
Example #6
0
        private void XPGKS_Click(object sender, EventArgs e)
        {
            comboParametrs par  = ReadDataFromFields();
            GlobalUnit     unit = new GlobalUnit();

            unit.adcInst = new PFI.ADCConv.ADC(par.quantity, par.alpha, par.delta);

            if (chkbxWeightsByHands.Checked)
            {
                unit.IsWeightsByHands = true;
            }

            var form = new GKSharacteristicOfTransformationStraightComb(unit);

            form.Show();
        }
Example #7
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            comboParametrs par  = ReadDataFromFields();
            GlobalUnit     unit = new GlobalUnit();

            unit.adcInst = new PFI.ADCConv.ADC(par.quantity, par.alpha, par.delta);

            if (chkbxWeightsByHands.Checked)
            {
                unit.IsWeightsByHands = true;
            }

            var form = new StatisticsGKS(unit);

            form.Show();
        }
Example #8
0
        private void рохрахуватиСтатистикуЦАПToolStripMenuItem_Click(object sender, EventArgs e)
        {
            comboParametrs par  = ReadDataFromFields();
            GlobalUnit     unit = new GlobalUnit();

            unit.dacInst = new DAC(par.quantity, par.alpha, par.delta);

            if (chkbxWeightsByHands.Checked)
            {
                unit.IsWeightsByHands = true;
            }

            StatisticsDAC form = new StatisticsDAC(unit);

            form.Show();
        }
Example #9
0
        private void цАПToolStripMenuItem_Click(object sender, EventArgs e)
        {
            comboParametrs par = ReadDataFromFields();

            GlobalUnit unit = new GlobalUnit();

            unit.dacInst = new DAC(par.quantity, par.alpha, par.delta);

            if (chkbxWeightsByHands.Checked)
            {
                unit.SetDacWeightsByHand();
            }

            DACCharacteristicOfTransformationFullComb form = new DACCharacteristicOfTransformationFullComb(unit.dacInst);

            form.Show();
        }
Example #10
0
        public virtual void StartTest(string Adr, float U, int Index)
        {
            //还原标识
            // ReSet();
            if (!getInfo(ref TestProtocol))
            {
                return;
            }
            //Comm.GlobalUnit.ForceVerifyStop = false;
            blnStop  = false;
            MeterAdr = Adr;
            //Comm.Enum.Cus_Clfs CLFS;
            float Ub = 0;

            if (U == 100)
            {
                // CLFS = Comm.Enum.Cus_Clfs.三相三线;
                Ub = 0;
            }
            else
            {
                // CLFS = Comm.Enum.Cus_Clfs.三相四线;
                Ub = U;
            }
            ////Comm.GlobalUnit.Clfs = CLFS;//更新测量方式
            //VerifyAdapter.Helper.EquipHelper.Instance.PowerOn(
            //    U, Ub, U, 0, 0, 0, Comm.Enum.Cus_PowerYuanJian.H, 50, "1.0", true, false, false, Comm.Enum.Cus_PowerFangXiang.正向有功);
            //// m_EquipMentUnit.SetTestPoint(CLFS, U, 0F, "1.0", Comm.Enum.Cus_PowerYuanJian.H, true);    //升源
            //设置表协议参数
            setMeterData(Index);
            int bwCount = GlobalUnit.GetConfig(CLDC_DataCore.Const.Variable.CTC_BWCOUNT, 24);

            bool[] isOpen = new bool[bwCount];
            for (int i = 0; i < isOpen.Length; i++)
            {
                isOpen[i] = true;
            }
            CLDC_VerifyAdapter.Helper.EquipHelper.Instance.SetCommSwitch(isOpen);

            //开始测试
            //DoTest(Index);
            System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(DoTest), Index);
        }
        public ADCTimeDiagram(GlobalUnit unit)
        {
            this.unit = unit;

            InitializeComponent();

            cmbSignalType.DataSource    = Enum.GetNames(typeof(TypesOfSignalEnum));
            cmbSignalType.SelectedIndex = 0;

            cmdMethodOfCalibration.DataSource    = Enum.GetNames(typeof(CalibrationType));
            cmdMethodOfCalibration.SelectedIndex = 0;

            paneCode = zedGraphControl1.GraphPane;

            FontSpec fnt9 = new FontSpec("arial", 9, Color.Black, false, false, false);
            Border   bdr  = new Border(false, Color.Black, 1);

            fnt9.Border = bdr;

            FontSpec fnt12 = new FontSpec("arial", 8, Color.Black, false, false, false);

            fnt12.Border = bdr;

            zedGraphControl1.AutoScaleMode = AutoScaleMode;

            paneCode.Title.FontSpec       = fnt12;
            paneCode.Title.Text           = "Діаграма врівноваження АЦП";
            paneCode.XAxis.Title.FontSpec = fnt9;
            paneCode.XAxis.Title.Text     = "Номер такту";
            paneCode.XAxis.Scale.FontSpec = fnt9;
            FontSpec fnt9Ver = new FontSpec(fnt9);

            fnt9Ver.Angle = 180;
            paneCode.YAxis.Title.FontSpec = fnt9Ver;
            paneCode.YAxis.Title.Text     = "Аналоговий сигнал";
            paneCode.YAxis.Scale.FontSpec = fnt9Ver;

            paneCode.CurveList.Clear();
        }
        void UI_Client_Load(object sender, EventArgs e)
        {
            //取表位
            BwCount   = GlobalUnit.GetConfig(CLDC_DataCore.Const.Variable.CTC_BWCOUNT, 24);
            CheckPlan = CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.CheckPlan;
            LoadMeters();

            Chk_CheckAll.CheckValueChanged += delegate(object se, EventArgs args)
            {
                ClientTable.SelectAll(Chk_CheckAll.Checked);
            };

            label1.MouseDown        += new MouseEventHandler(FormMove);
            label1.MouseDoubleClick += new MouseEventHandler(label1_MouseDoubleClick);
            this.Resize             += new EventHandler(UI_Client_Resize);

            m_LoadOver = true;

            //设置监视器
            this.Controls.Add(UIMonitor);
            this.Controls.SetChildIndex(UIMonitor, 0);
            UIMonitor.Visible = true;

            showSchemeInfo();

            //设置状态
            if (CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.Option == CLDC_CTNProtocol.EnumOption.BZ已连接)
            {
                CLDC_DataCore.Const.GlobalUnit.g_CUS.DnbData.SetOption(CLDC_CTNProtocol.EnumOption.CZ准备扫条码);
            }

            //正式模式 | 演示模式
            Lab_Mode.Text = CLDC_DataCore.Const.GlobalUnit.g_SystemConfig.SystemMode.getValue("ISDEMO");

            //使顶层窗体最大化
            SetParentMaximized();
            CLDC_DataCore.Function.ThreadCallBack.BeginInvoke(this, new CLDC_DataCore.Function.CallBack(SetParentMaximized), 200);
        }
Example #13
0
 public RoutineDefinition Resolve(RoutineReference routine)
 {
     // No unit reference? -> try global, then runtime.
     // Else, resolve unit and forward the request.
     if (routine.Unit == null)
     {
         try
         {
             RoutineReference r = new RoutineReference(GlobalUnit, routine.Name);
             return(GlobalUnit.Resolve(r));
         }
         catch (RoutineNotFoundException)
         {
             RoutineReference r = new RoutineReference(RuntimeGlobalUnit, routine.Name);
             return(RuntimeGlobalUnit.Resolve(r));
         }
     }
     else
     {
         var unit = routine.Unit.Resolve();
         return(unit.Resolve(routine));
     }
 }
        public GKSharacteristicOfTransformationStraightComb(GlobalUnit unit)
        {
            InitializeComponent();

            cmbxStrategyType.DataSource    = Enum.GetNames(typeof(CalibrationType));
            cmbxStrategyType.SelectedIndex = 0;

            this.unit   = unit;
            graphArrays = new PointPairList[2];

            paneCode = zedGraphControl3.GraphPane;

            FontSpec fnt9 = new FontSpec("arial", 12, Color.Black, false, false, false);
            Border   bdr  = new Border(false, Color.Black, 1);

            fnt9.Border = bdr;

            FontSpec fnt12 = new FontSpec("arial", 11, Color.Black, false, false, false);

            fnt12.Border = bdr;

            zedGraphControl3.AutoScaleMode = AutoScaleMode;

            paneCode.Title.FontSpec       = fnt12;
            paneCode.Title.Text           = "Характеристика перетворення ЦАП";
            paneCode.XAxis.Title.FontSpec = fnt9;
            paneCode.XAxis.Title.Text     = "Цифровий еквівалент";
            paneCode.XAxis.Scale.FontSpec = fnt9;
            FontSpec fnt9Ver = new FontSpec(fnt9);

            fnt9Ver.Angle = 180;
            paneCode.YAxis.Title.FontSpec = fnt9Ver;
            paneCode.YAxis.Title.Text     = "Аналоговий сигнал";
            paneCode.YAxis.Scale.FontSpec = fnt9Ver;

            paneCode.CurveList.Clear();
        }