static public SimulateVariableUnit Create(string _name, string type = "")
        {
            SimulateVariableUnit result = null;
            SpecialValue         svalue = SpecialValueManager.ValueOfName(_name);

            if (svalue != null)
            {
                type = svalue.Type;
            }
            if (type.Length == 0)
            {
                result = _Create(_name);
            }
            else
            {
                result = _Create(_name, type);
            }
            if (result == null)
            {
                return(result);
            }
            if (svalue != null)
            {
                SimulateSpecialUnit ssunit = new SimulateSpecialUnit(
                    result, svalue.CanRead, svalue.CanWrite);
                ssunit.Var = svalue.NickName;
                return(ssunit);
            }
            return(result);
        }
Example #2
0
        public void CreateObjectSpecialValueTest()
        {
            var expected = new SpecialValue();

            var c = CsvParser <SpecialValue> .FromType();

            var actual = c.CreateObject(c.CreateCsvLine(expected));

            Assert.AreEqual(expected, actual);
        }
Example #3
0
            private SpecialValue getSpecialValue(string package)
            {
                SpecialValue val = new SpecialValue();

                val.VariableName = package.Substring(this.fields[(int)DataFields.VARIABLE_NAME].Index, this.fields[(int)DataFields.VARIABLE_NAME].Size);
                val.Type         = DataType.DataTypes.SingleOrDefault(x => x.Type == package.Substring(this.fields[(int)DataFields.TYPE].Index, this.fields[(int)DataFields.TYPE].Size).Trim());
                val.Length       = Convert.ToInt32(package.Substring(this.fields[(int)DataFields.LENGTH].Index, this.fields[(int)DataFields.LENGTH].Size));
                val.Value        = package.Substring(this.fields[(int)DataFields.VALUE].Index, val.Length);
                val.StepNumber   = Convert.ToInt32(package.Substring(this.fields[(int)DataFields.VALUE].Index + val.Length, this.fields[(int)DataFields.STEP_NUMBER].Size));

                return(val);
            }
Example #4
0
 /// <summary>
 /// Creates a new symbol.
 /// </summary>
 /// <returns>The anonymous.</returns>
 /// <param name="value">Value.</param>
 /// <param name="flag">Flag.</param>
 public static Symbol CreateAnonymous(LLVMValueRef value, SpecialValue flag)
 => new Symbol(string.Empty, value)
 {
     isanonymous = true, specialvalue = flag
 };
Example #5
0
 /// <summary>
 /// 增加查询条件,查询方式默认为等于查询
 /// </summary>
 /// <param name="fieldName">字段名</param>
 /// <param name="fieldValue">字段值</param>
 /// <returns></returns>
 public SearchCondition AddSearch(string fieldName, SpecialValue fieldValue)
 {
     return(AddSearch(fieldName, fieldValue.ToString()));
 }
Example #6
0
 public void AddSelectedValue()
 {
     SpecialValue.CopiedValue = SpecialValue.GetValueAgainstSpecialValue(SelectedSpecialValue);
 }
Example #7
0
 /// <inheritdoc />
 /// <exception cref="System.ArgumentException">
 /// Thrown always since special value is not valid in an expression
 /// </exception>
 public override void VisitSpecialValue(SpecialValue value)
 {
     throw new ArgumentException("Expression cannot contain any special value");
 }
Example #8
0
 public static Value Special(SpecialValue value)
 {
     return(new Value {
         _special = value
     });
 }