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

            ui.CommuniPortConfig = p.CommuniPortConfig;
        }
Example #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);
        }
Example #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;
        }
Example #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);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="p"></param>
 public CommuniPortConfigController(CommuniPortConfigParameter p)
 {
     this.Model = p;
 }
Example #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="p"></param>
 public CommuniPortConfigController(CommuniPortConfigParameter p)
 {
     this.Model = p;
 }
Example #7
0
 /// <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;
 }