public SimulateUnitSeries ChangeDataType(string _datatype)
        {
            int factor = 1;

            switch (model.Base)
            {
            case "D":
                if (model is SimulateDWordModel)
                {
                    factor = 2;
                }
                if (model is SimulateFloatModel)
                {
                    factor = 2;
                }
                break;

            default:
                factor = 1;
                break;
            }
            SimulateVariableModel svmodel = SimulateVariableModel.Create(model.Name, model.Size * factor, _datatype);

            if (svmodel == null)
            {
                return(null);
            }
            SimulateUnitSeries ret = new SimulateUnitSeries(svmodel);

            ret.Name = Name;
            ret.Var  = Var;
            return(ret);
        }
        static private SimulateVariableUnit _Create(string _name)
        {
            SimulateBitUnit sbunit = new SimulateBitUnit();

            if (sbunit._Check_Name(_name))
            {
                sbunit.Name = _name;
                return(sbunit);
            }
            SimulateWordUnit swunit = new SimulateWordUnit();

            if (swunit._Check_Name(_name))
            {
                swunit.Name = _name;
                return(swunit);
            }
            SimulateDWordUnit sdwunit = new SimulateDWordUnit();

            if (sdwunit._Check_Name(_name))
            {
                sdwunit.Name = _name;
                return(sdwunit);
            }
            SimulateFloatUnit sfunit = new SimulateFloatUnit();

            if (sfunit._Check_Name(_name))
            {
                sfunit.Name = _name;
                return(sfunit);
            }
            SimulateUnitSeries ssunit = new SimulateUnitSeries();

            if (ssunit._Check_Name(_name))
            {
                ssunit.Name = _name;
                ssunit.CreateExpand();
                return(ssunit);
            }
            return(null);
        }
        static private SimulateVariableUnit _Create(string _name, string type)
        {
            switch (type)
            {
            case "BIT":
                SimulateBitUnit sbunit = new SimulateBitUnit();
                if (sbunit._Check_Name(_name))
                {
                    sbunit.Name = _name;
                    return(sbunit);
                }
                break;

            case "WORD":
                SimulateWordUnit swunit = new SimulateWordUnit();
                if (swunit._Check_Name(_name))
                {
                    swunit.Name = _name;
                    return(swunit);
                }
                break;

            case "DWORD":
                SimulateDWordUnit sdwunit = new SimulateDWordUnit();
                if (sdwunit._Check_Name(_name))
                {
                    sdwunit.Name = _name;
                    return(sdwunit);
                }
                break;

            case "FLOAT":
                SimulateFloatUnit sfunit = new SimulateFloatUnit();
                if (sfunit._Check_Name(_name))
                {
                    sfunit.Name = _name;
                    return(sfunit);
                }
                break;

            case "PULSE":
                SimulatePulseUnit spunit = new SimulatePulseUnit();
                if (spunit._Check_Name(_name))
                {
                    spunit.Name = _name;
                    return(spunit);
                }
                break;

            default:
                SimulateUnitSeries ssunit = new SimulateUnitSeries();
                if (ssunit._Check_Name(_name))
                {
                    ssunit.Name = _name;
                    ssunit.CreateExpand();
                    return(ssunit);
                }
                break;
            }
            return(null);
        }