示例#1
0
        public void UpdateViewer()
        {
            UCCommuniPortConfigUI      ui = (UCCommuniPortConfigUI)_v.UC;
            CommuniPortConfigParameter p  = (CommuniPortConfigParameter)this.Model;

            ui.CommuniPortConfig = p.CommuniPortConfig;
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        static public IController Create(IParameter p)
        {
            IController c = null;

            if (p is StringParameter)
            {
                c = new StringParameterController((StringParameter)p);
            }
            else if (p is CommuniPortConfigParameter)
            {
                CommuniPortConfigParameter p2 = (CommuniPortConfigParameter)p;
                c = new CommuniPortConfigController(p2);
            }
            else if (p is NumberParameter)
            {
                NumberParameter numP = (NumberParameter)p;
                c = new NumberParameterController(numP);
            }
            else if (p is EnumParameter)
            {
                EnumParameter enumP = (EnumParameter)p;
                c = new EnumParameterController(enumP);
            }

            if (c == null)
            {
                throw new ArgumentException(p.ToString());
            }
            return(c);
        }
示例#3
0
        public void UpdateModel()
        {
            //throw new NotImplementedException();
            //this.CommuniPortConfigParameter .CommuniPortConfig = this.CommuniPortConfigUI .
            UCCommuniPortConfigUI      ui = (UCCommuniPortConfigUI)_v.UC;
            CommuniPortConfigParameter p  = (CommuniPortConfigParameter)this.Model;

            p.CommuniPortConfig = ui.CommuniPortConfig;
        }
示例#4
0
        //private ICommuniPortConfig _communiPortConfig;
        #endregion //CommuniPortConfig

        #region GetCommuniPortConfig
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private IParameter GetCommuniPortConfig()
        {
            IParameter p = this.CommuniPortConfigGroup.Parameters[PN_COMMUNIPORTCONFIG];

            if (p == null)
            {
                p = new CommuniPortConfigParameter(PN_COMMUNIPORTCONFIG,
                                                   NullCommuniPortConfig.Default, PO_COMMUNIPORTCONFIG);
                // not need
                //
                //p.Text = "";
                this.CommuniPortConfigGroup.Parameters.Add(p);
            }
            return(p);
        }
示例#5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="p"></param>
 public CommuniPortConfigController(CommuniPortConfigParameter p)
 {
     this.Model = p;
 }
示例#6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="p"></param>
 public CommuniPortConfigController(CommuniPortConfigParameter p)
 {
     this.Model = p;
 }
示例#7
0
文件: StationBase.cs 项目: hkiaipc/C3
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private IParameter GetCommuniPortConfig()
 {
     IParameter p = this.CommuniPortConfigGroup.Parameters[PN_COMMUNIPORTCONFIG];
     if (p == null)
     {
         p = new CommuniPortConfigParameter(PN_COMMUNIPORTCONFIG,
             NullCommuniPortConfig.Default, PO_COMMUNIPORTCONFIG);
         // not need
         //
         //p.Text = "";
         this.CommuniPortConfigGroup.Parameters.Add(p);
     }
     return p;
 }