Exemplo n.º 1
0
 public CTsTtVariable(CTsInstrFactory.TtTarget ttTarget, CVariable variable)
     : base(variable)
 {
     if (String.Equals(variable.GetType().FullName, typeof(CVariableBool).FullName))
         Value = Convert.ToInt32(Convert.ToBoolean(variable.value)).ToString();
     Location = ttTarget.Identifier;
     Path = ttTarget.prefix + Path;
 }
Exemplo n.º 2
0
 public CVariableArray(CVariable Var, uint Index)
 {
     // TODO: Complete member initialization
     this.Variable = Var;
     this.path = Var.path;
     this.Location = Var.Location;
     this.Index = Index;
 }
Exemplo n.º 3
0
        private void parseVariable(CVariable var)
        {
            if (String.Equals(var.GetType().FullName, typeof(CVariableDouble).FullName))
                Value = var.value.ToString().Replace(',', '.');
            else
                Value = var.value.ToString();

            Name = var.name;
            Path = var.path.TrimEnd('/');

            Location = var.Location;
        }
Exemplo n.º 4
0
        public CTsVariable(CVariable var)
        {
            if (String.Equals(var.GetType().FullName, typeof(CVariableArray).FullName))
            {
                CVariableArray v = (CVariableArray)var;
                parseVariable((CVariable)v.value);
                Index = v.Index;
            }
            else
            {
                parseVariable(var);
            }

            logger.Debug("OK");
        }
Exemplo n.º 5
0
 private static CTsVariable translateLocation(CVariable variable)
 {
     if (dictionnary.Contains(variable.Location))
     {
         Target t = (Target)dictionnary[variable.Location];
         if (String.Equals(t.GetType().FullName, typeof(CbTarget).FullName))
         {
             return new CTsCbVariable((CbTarget)t, variable);
         }
         else if (String.Equals(t.GetType().FullName, typeof(TtTarget).FullName))
         {
             return new CTsTtVariable((TtTarget)t, variable);
         }
         else
         {
             throw new FormatException("This type of target is not managed");
         }
     }
     else
     {
         string message = String.Format("Requested Location \"{0}\" is not defined inside configuration file", variable.Location);
         logger.Error(message);
         throw new FormatException(message);
     }
 }
Exemplo n.º 6
0
 private void testIfVariableAsReal(CVariable var, double expectedValue)
 {
     Assert.IsNotNull(var);
     Assert.IsInstanceOf<CVariableDouble>(var);
     Assert.IsTrue(var.value is double);
     Assert.AreEqual(var.value, expectedValue);
 }
Exemplo n.º 7
0
 private void testIfVariableAsInteger(CVariable var, int expectedValue)
 {
     Assert.IsNotNull(var);
     Assert.IsInstanceOf<CVariableInt>(var);
     Assert.IsTrue(var.value is Int32);
     Assert.AreEqual(var.value, expectedValue);
 }
Exemplo n.º 8
0
        private void testIfVariableAsBoolean(CVariable var, bool expectedValue)
        {
            Assert.IsNotNull(var);

            Assert.IsInstanceOf<CVariableBool>(var);
            Assert.IsTrue(var.value is bool);
            Assert.AreEqual(var.value, expectedValue);
        }
Exemplo n.º 9
0
 public CTsCbVariable(CTsInstrFactory.CbTarget cbTarget, CVariable variable)
     : base(variable)
 {
     Location = cbTarget.Identifier;
 }
Exemplo n.º 10
0
 public CTsCbVariable(CVariable var)
     : base(var)
 {
 }
Exemplo n.º 11
0
 public CTsTtVariable(CVariable var)
     : base(var)
 {
 }