예제 #1
0
 public JFCM_JogMove_S()
 {
     string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();
     DeclearInitParam(JFParamDescribe.Create("轴ID", typeof(string), JFValueLimit.Options, allAxisIDs), "");
     DeclearInitParam(JFParamDescribe.Create("正向移动", typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearOutput("执行结果", typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #2
0
        void CreateInitParamDescribes()
        {
            if (null == initParamDescribes)
            {
                initParamDescribes = new SortedDictionary <string, JFParamDescribe>();
            }
            initParamDescribes.Clear();
            JFParamDescribe pd = JFParamDescribe.Create("配置文件", typeof(string), JFValueLimit.FilePath, null, "HTM板卡库配置文件");

            initParamDescribes.Add("配置文件", pd);

            pd = JFParamDescribe.Create("使用凌华控制卡", typeof(string), JFValueLimit.Options, yesnoRange, "是否使用凌华控制卡");
            initParamDescribes.Add("使用凌华控制卡", pd);
            pd = JFParamDescribe.Create("使用HTM控制卡", typeof(string), JFValueLimit.Options, yesnoRange, "是否使用HTM控制卡");
            initParamDescribes.Add("使用HTM控制卡", pd);
            pd = JFParamDescribe.Create("板卡打开模式", typeof(string), JFValueLimit.Options, openModeRange);
            initParamDescribes.Add("板卡打开模式", pd);
            object[] minValueZero = new object[] { 0 };
            pd = JFParamDescribe.Create("最大轴数", typeof(int), JFValueLimit.MinLimit, minValueZero);
            initParamDescribes.Add("最大轴数", pd);
            pd = JFParamDescribe.Create("最大IO数量", typeof(int), JFValueLimit.MinLimit, minValueZero);
            initParamDescribes.Add("最大IO数量", pd);
            pd = JFParamDescribe.Create("其他设备数量", typeof(int), JFValueLimit.MinLimit, minValueZero);
            initParamDescribes.Add("其他设备数量", pd);
            pd = JFParamDescribe.Create("模块数量", typeof(int), JFValueLimit.MinLimit, minValueZero);
            initParamDescribes.Add("模块数量", pd);
            pd = JFParamDescribe.Create("设备序号", typeof(int), JFValueLimit.MinLimit, minValueZero);
            initParamDescribes.Add("设备序号", pd);
        }
예제 #3
0
        /// <summary>
        /// 为Recipe添加一个配置项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btAddItem_Click(object sender, EventArgs e)
        {
            FormXCfgItemEdit fmGenItem = new FormXCfgItemEdit();

            fmGenItem.SetItemAllowedTypes(new Type[]
                                          { typeof(int), typeof(double), typeof(string), typeof(bool), typeof(PointF),
                                            typeof(List <int>), typeof(List <double>), typeof(List <string>), typeof(List <bool>), typeof(List <PointF>) });
            if (DialogResult.OK == fmGenItem.ShowDialog())
            {
                string[] allItemNames = _recipe.AllItemNames();
                if (null != allItemNames && allItemNames.Contains(fmGenItem.GetItemName()))
                {
                    MessageBox.Show("添加数据项失败,已包含数据项:" + fmGenItem.GetItemName());
                    return;
                }
                _recipe.AddItem(fmGenItem.GetItemName(), fmGenItem.GetItemValue());
                UcJFParamEdit pe = new UcJFParamEdit();
                //if (fmGenItem.GetItemType().IsPrimitive)
                pe.Height        = 23;
                pe.Width         = 500;
                pe.IsHelpVisible = false;

                pe.SetParamDesribe(JFParamDescribe.Create(fmGenItem.GetItemName(), fmGenItem.GetItemType(), JFValueLimit.NonLimit, null)); //pe.SetParamType(fmGenItem.GetItemType());
                pe.SetParamValue(fmGenItem.GetItemValue());
                pe.IsValueReadOnly = false;                                                                                                //添加后状态为可编辑
                tableLayoutPanel1.Controls.Add(pe);
                Button btDel = new Button();
                btDel.Text   = "删除";
                btDel.Tag    = fmGenItem.GetItemName();
                btDel.Click += OnDelButtonClick;
                tableLayoutPanel1.Controls.Add(btDel);
                _lstItems.Add(pe);
                _lstDeleteItemButtons.Add(btDel);
            }
        }
예제 #4
0
 public JFCM_SetHomeParam_S()
 {
     string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();
     DeclearInitParam(JFParamDescribe.Create("轴ID", typeof(string), JFValueLimit.Options, allAxisIDs), "");
     DeclearInitParam(JFParamDescribe.Create("轴归零参数", typeof(JFHomeParam), JFValueLimit.Options, allAxisIDs), new JFHomeParam());
     DeclearOutput("执行结果", typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #5
0
 public JFCM_SetDO_S()
 {
     string[] allDoNames = JFHubCenter.Instance.MDCellNameMgr.AllDoNames();
     DeclearInitParam(JFParamDescribe.Create("DO通道名称", typeof(string), JFValueLimit.Options, allDoNames), "");
     DeclearInitParam(JFParamDescribe.Create("DO状态", typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearOutput("执行结果", typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #6
0
 public JFCM_LineMove_D()
 {
     string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();
     DeclearInitParam(JFParamDescribe.Create("轴ID列表", typeof(string[]), JFValueLimit.NonLimit, null), new string[] { });
     DeclearInput("目标位置列表", typeof(double), new double[] { });
     DeclearInput("绝对位置模式", typeof(bool), true);
     DeclearOutput("执行结果", typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
 /// <summary>
 /// 获取指定名称的初始化参数的信息
 /// </summary>
 /// <param name="name"></param>
 /// <returns>如果name不在InitParamNames中,则返回一个空值</returns>
 public virtual JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == "InnerMethodFlowText")
     {
         return(JFParamDescribe.Create(name, typeof(string), JFValueLimit.NonLimit, null));
     }
     return(null);
 }
예제 #8
0
 public JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == "Int")
     {
         return(JFParamDescribe.Create(name, typeof(int), JFValueLimit.NonLimit, null));
     }
     throw new Exception();
 }
예제 #9
0
 public JFCM_SetLightIntensity_D()
 {
     string[] allLightChannelIDs = JFHubCenter.Instance.MDCellNameMgr.AllLightChannelNames();
     DeclearInitParam(JFParamDescribe.Create("自动切换到开关模式", typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearInitParam(JFParamDescribe.Create("自动使能", typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearInput("光源通道ID", typeof(string), "");
     DeclearInput("光照强度", typeof(int), -1);
 }
예제 #10
0
 /// <summary>
 /// 获取指定名称的初始化参数的信息
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == InitParamNames[0])
     {
         return(JFParamDescribe.Create(name, typeof(double), JFValueLimit.NonLimit, null));
     }
     throw new ArgumentException("初始化参数项名称不存在:" + name);
 }
예제 #11
0
 public JFMC_WaitP2P_D()
 {
     string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();
     DeclearInput(PN_AxisID, typeof(string), "");
     DeclearInput(PN_TimeoutMilliSeconds, typeof(int), -1);
     DeclearInitParam(JFParamDescribe.Create(PN_CycleMilliSeconds, typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 10, 1000 }), 50);
     DeclearOutput(ON_Result, typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #12
0
 public JFCM_WaitLineMove_D()
 {
     DeclearInitParam(PN_AxisID, typeof(string[]), new string[] { });
     DeclearInput(PN_TimeoutMilliSeconds, typeof(int), -1);
     DeclearInitParam(JFParamDescribe.Create(PN_CycleMilliSeconds, typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 10, 1000 }), 50);
     DeclearInput(PN_AbsMode, typeof(bool), true);
     DeclearOutput(ON_Result, typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #13
0
        void AdjustView()
        {
            if (InvokeRequired)
            {
                Invoke(new Action(AdjustView));
                return;
            }
            pnInputParam.Controls.Clear();
            pnOutputParam.Controls.Clear();
            if (null == _method)
            {
                lbInfo.Text       = " 方法未设置";
                btSetSave.Enabled = false;
                btCancel.Enabled  = false;
                btAction.Enabled  = false;
                return;
            }
            lbInfo.Text       = " ";
            _isEditting       = false;
            btSetSave.Enabled = true;
            btCancel.Enabled  = true;
            btAction.Enabled  = true;
            string[] inputNames = _method.MethodInputNames;

            if (inputNames != null)
            {
                foreach (string inputName in inputNames)
                {
                    UcJFParamEdit ucParam = new UcJFParamEdit();
                    ucParam.IsHelpVisible = false;
                    ucParam.Height        = 50;

                    //ucParam.SetParamType(_cfg.GetItemValue(itemName).GetType());//ucParam.SetParamDesribe(_station.GetCfgParamDescribe(itemName));
                    ucParam.SetParamDesribe(JFParamDescribe.Create(inputName, _method.GetMethodInputType(inputName), JFValueLimit.NonLimit, null));
                    ucParam.SetParamValue(_method.GetMethodInputValue(inputName));
                    pnInputParam.Controls.Add(ucParam);
                    ucParam.IsValueReadOnly = true;
                }
            }

            string[] outputNames = _method.MethodOutputNames;
            if (null != outputNames)
            {
                foreach (string outputName in outputNames)
                {
                    UcJFParamEdit ucParam = new UcJFParamEdit();
                    ucParam.IsHelpVisible = false;
                    ucParam.Height        = 50;

                    //ucParam.SetParamType(_cfg.GetItemValue(itemName).GetType());//ucParam.SetParamDesribe(_station.GetCfgParamDescribe(itemName));
                    ucParam.SetParamDesribe(JFParamDescribe.Create(outputName, _method.GetMethodOutputType(outputName), JFValueLimit.NonLimit, null));
                    ucParam.SetParamValue(_method.GetMethodOutputValue(outputName));
                    pnOutputParam.Controls.Add(ucParam);
                    ucParam.IsValueReadOnly = false;
                }
            }
        }
예제 #14
0
 //static string ON_ErrorInfo = "错误信息";
 public JFSM_WaitSysPoolBool_S()
 {
     DeclearInitParam(PN_SysPoolItemName, typeof(string), "");
     DeclearInitParam(PN_TargetVal, typeof(bool), true);
     DeclearInitParam(JFParamDescribe.Create(PN_CycleMilliSeconds, typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 10, 1000 }), 50);
     DeclearInitParam(PN_TimeoutMilliSeconds, typeof(int), -1);
     DeclearOutput(ON_Result, typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
     //DeclearOutput(ON_ErrorInfo, typeof(string), "No-Option");
 }
예제 #15
0
        public override JFParamDescribe GetInitParamDescribe(string name)
        {
            if (name == PN_SysPoolItemName)
            {
                return(JFParamDescribe.Create(PN_SysPoolItemName, typeof(string), JFValueLimit.Options, JFHubCenter.Instance.DataPool.AllItemKeys));
            }

            return(base.GetInitParamDescribe(name));
        }
예제 #16
0
 public JFCM_WaitDO_S()
 {
     string[] allDoNames = JFHubCenter.Instance.MDCellNameMgr.AllDoNames();
     DeclearInitParam(JFParamDescribe.Create(PN_DOID, typeof(string), JFValueLimit.Options, allDoNames), "");
     DeclearInitParam(JFParamDescribe.Create(PN_TimeoutMilliSeconds, typeof(int), JFValueLimit.NonLimit, null), -1);
     DeclearInitParam(JFParamDescribe.Create(PN_CycleMilliSeconds, typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 10, 1000 }), 50);
     DeclearInitParam(JFParamDescribe.Create(PN_WaitDOStatus, typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearOutput(ON_Result, typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #17
0
 public override JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == PN_CmrID)
     {
         string[] allCmrIDs = JFHubCenter.Instance.InitorManager.GetIDs(typeof(IJFDevice_Camera));
         return(JFParamDescribe.Create(PN_CmrID, typeof(string), JFValueLimit.Options, allCmrIDs));
     }
     return(base.GetInitParamDescribe(name));
 }
예제 #18
0
 public JFCM_P2P_D()
 {
     //string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();
     //DeclearInput("轴ID", typeof(string), "");
     string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();
     DeclearInitParam(JFParamDescribe.Create("轴ID", typeof(string), JFValueLimit.Options, allAxisIDs), "");
     DeclearInput("目标位置", typeof(double), 0);
     DeclearInput("绝对位置模式", typeof(bool), true);
     DeclearOutput("执行结果", typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
 }
예제 #19
0
        public JFCM_WaitLineMove_S()
        {
            string[] allAxisIDs = JFHubCenter.Instance.MDCellNameMgr.AllAxisNames();

            DeclearInitParam(JFParamDescribe.Create(PN_AxisID, typeof(string[]), JFValueLimit.NonLimit, null), new string[] { });
            DeclearInitParam(JFParamDescribe.Create(PN_TimeoutMilliSeconds, typeof(int), JFValueLimit.NonLimit, null), -1);
            DeclearInitParam(JFParamDescribe.Create(PN_AbsMode, typeof(bool), JFValueLimit.NonLimit, null), true);
            DeclearInitParam(JFParamDescribe.Create(PN_CycleMilliSeconds, typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 10, 1000 }), 50);
            DeclearOutput(ON_Result, typeof(JFWorkCmdResult), JFWorkCmdResult.UnknownError);
        }
예제 #20
0
 private void UcMotion_Load(object sender, EventArgs e)
 {
     _isFormLoaded = true;
     ucLineParam.SetParamDesribe(JFParamDescribe.Create("运动参数", typeof(JFMotionParam), JFValueLimit.NonLimit, null));
     //JFMotionParam mp = new JFMotionParam() { vs = 0, vm = 0,ve = 0, acc =0, dec =0, curve  =0, jerk  = 0};
     //ucLineParam.SetParamValue(mp);
     ucArcParam.SetParamDesribe(JFParamDescribe.Create("运动参数", typeof(JFMotionParam), JFValueLimit.NonLimit, null));
     //ucArcParam.SetParamValue(mp);
     AdjustUI();
 }
예제 #21
0
 public override JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == PN_StationCfgItemName)
     {
         if (null == _station)
         {
             return(JFParamDescribe.Create(PN_StationCfgItemName, typeof(string), JFValueLimit.Options, new string[] { }));
         }
         return(JFParamDescribe.Create(PN_StationCfgItemName, typeof(string), JFValueLimit.Options, _station.Config.AllItemNames()));
     }
     return(base.GetInitParamDescribe(name));
 }
예제 #22
0
        /// <summary>
        /// 获取指定名称的初始化参数的信息
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public JFParamDescribe GetInitParamDescribe(string name)
        {
            _CheckInitName(name, "GetInitParamDescribe");
            JFParamDescribe ret = null;

            if (name == "IP")
            {
                ret = JFParamDescribe.Create(name, typeof(string), JFValueLimit.NonLimit, null, "相机IP地址");
            }

            return(ret);
        }
예제 #23
0
 private void cbItemType_SelectedValueChanged(object sender, EventArgs e)
 {
     if (cbItemType.SelectedIndex < 0)
     {
         return;
     }
     if (string.IsNullOrEmpty(tbItemName.Text))
     {
         return;
     }
     ucItemValue.SetParamDesribe(JFParamDescribe.Create(tbItemName.Text, cbItemType.SelectedItem as Type, JFValueLimit.NonLimit, null));
 }
예제 #24
0
 public override JFParamDescribe GetInitParamDescribe(string name)
 {
     //if (name == PN_SysPoolItemName)
     //    return JFParamDescribe.Create(PN_SysPoolItemName, typeof(string), JFValueLimit.Options, JFHubCenter.Instance.DataPool.AllItemKeys);
     /*else */ if (name == PN_LocPoolItemName)
     {
         if (null != _owner)
         {
             return(JFParamDescribe.Create(PN_LocPoolItemName, typeof(string), JFValueLimit.Options, _owner.DataPool.Keys.ToArray()));
         }
     }
     return(base.GetInitParamDescribe(name));
 }
예제 #25
0
 public JFCM_SetLightTrigParam_S()
 {
     string[] allLightChannelIDs = JFHubCenter.Instance.MDCellNameMgr.AllTrigChannelNames(); //所有光源触发通道名称(不是开关式光源)
     DeclearInitParam(JFParamDescribe.Create("触发通道ID", typeof(string), JFValueLimit.Options, allLightChannelIDs), "");
     DeclearInitParam(JFParamDescribe.Create("自动切换到触发模式", typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearInitParam(JFParamDescribe.Create("自动使能", typeof(bool), JFValueLimit.NonLimit, null), true);
     DeclearInitParam(JFParamDescribe.Create("触发强度", typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 0, 255 }), -1);
     DeclearInitParam(JFParamDescribe.Create("忽略不支持强度设置", typeof(bool), JFValueLimit.NonLimit, null), false);
     DeclearInitParam(JFParamDescribe.Create("触发时长", typeof(int), JFValueLimit.MinLimit, new object[] { 0 }), -1);
     DeclearInitParam(JFParamDescribe.Create("忽略不支持时长设置", typeof(bool), JFValueLimit.NonLimit, null), false);
     DeclearInitParam(JFParamDescribe.Create("输入源通道", typeof(int[]), JFValueLimit.NonLimit, null), new int[] { });
     DeclearInitParam(JFParamDescribe.Create("忽略不支持源通道设置", typeof(bool), JFValueLimit.NonLimit, null), false);
 }
예제 #26
0
        /// <summary>
        /// 获取指定名称的初始化参数的信息
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public JFParamDescribe GetInitParamDescribe(string name)
        {
            if (name == _initParamNames[0])
            {
                return(JFParamDescribe.Create(name, typeof(string), JFValueLimit.FilePath, null));
            }
            else if (name == _initParamNames[1])
            {
                return(JFParamDescribe.Create(name, typeof(string), JFValueLimit.Options, new string[] { "新创建", "报错" }));
            }

            throw new ArgumentOutOfRangeException();
        }
예제 #27
0
        void CreateInitParamDescribes()
        {
            if (paramDescribes == null)
            {
                paramDescribes = new SortedDictionary <string, JFParamDescribe>();
            }
            paramDescribes.Clear();
            JFParamDescribe pd = JFParamDescribe.Create("连接方式", typeof(string), JFValueLimit.Options, linkModeParamRange, "计算机与光源控制器的连接方式");

            paramDescribes.Add("连接方式", pd);
            pd = JFParamDescribe.Create("连接参数", typeof(string), JFValueLimit.NonLimit, null, "在指定的连接方式下,使用此参数与相机建立连接");
            paramDescribes.Add("连接参数", pd);
        }
 public JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == _initParamNames[0])
     {
         return(JFParamDescribe.Create(name, typeof(CardType), JFValueLimit.NonLimit, null));
     }
     else if (name == _initParamNames[1])
     {
         return(JFParamDescribe.Create(name, typeof(int), JFValueLimit.MinLimit | JFValueLimit.MaxLimit, new object[] { 0, 31 }));
     }
     else
     {
         throw new ArgumentException("不支持的初始化参数名:" + name);
     }
 }
예제 #29
0
        /// <summary>
        /// 获取指定名称的初始化参数的信息
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public JFParamDescribe GetInitParamDescribe(string name)
        {
            if (name == InitParamNames[0])
            {
                JFInitorManager devMgr    = JFHubCenter.Instance.InitorManager;
                string[]        allDevIDs = devMgr.GetIDs(typeof(IJFDevice));
                return(JFParamDescribe.Create(name, typeof(string), JFValueLimit.Options, allDevIDs));
            }
            else if (name == InitParamNames[1])
            {
                return(JFParamDescribe.Create(name, typeof(bool), JFValueLimit.NonLimit, null));
            }

            throw new ArgumentException("非法的输入参数项,名称:" + name);
        }
예제 #30
0
 public override JFParamDescribe GetInitParamDescribe(string name)
 {
     if (name == PN_DevChnName)
     {
         NamedChnType chnType = (NamedChnType)GetInitParamValue(PN_DevChnType);
         if (_station != null && chnType != NamedChnType.None)
         {
             string[] devChnNames = _station.AllDecDevChnNames(chnType);
             return(JFParamDescribe.Create(PN_DevChnName, typeof(string), JFValueLimit.Options, devChnNames));
         }
         //日后添加可选的设备名称
         //if(_station != null)
         //    string[] allDevNames =
     }
     return(base.GetInitParamDescribe(name));
 }