示例#1
0
 public static SensorAT DuplicateSensor(SensorAT sensorAT, AT at)
 {
     var newSensorAT = new SensorAT();
     newSensorAT.SetName(at.GetName() + "-" + sensorAT.GetName());
     newSensorAT.SetCreationDate(new DateTime());
     newSensorAT.SetDeleted(false);
     newSensorAT.SetKm(sensorAT.GetKm());
     newSensorAT.SetLane(sensorAT.GetLane());
     newSensorAT.SetState(sensorAT.GetState());
     newSensorAT.SetStatus(true);
     newSensorAT.SetUpdateDate(new DateTime());
     newSensorAT.SetUser(sensorAT.GetUser());
     newSensorAT.SetWay(sensorAT.GetWay());
     newSensorAT.SetAt(at);
     return newSensorAT;
 }
示例#2
0
 public static SensorAT CreateSensor(User user, AT at, int index)
 {
     var newSensorAT = new SensorAT();
     newSensorAT.SetName(at.GetName() + "-" + index);
     newSensorAT.SetCreationDate(new DateTime());
     newSensorAT.SetDeleted(false);
     newSensorAT.SetKm(Convert.ToSingle(105.7));
     newSensorAT.SetLane(index);
     newSensorAT.SetState(1);
     newSensorAT.SetStatus(true);
     newSensorAT.SetUpdateDate(new DateTime());
     newSensorAT.SetUser(user);
     newSensorAT.SetWay(1);
     newSensorAT.SetAt(at);
     return newSensorAT;
 }
示例#3
0
 public static AT DuplicateAT(AT at, int index)
 {
     var newAt = new AT();
     newAt.SetName(at.GetName() + "-" + index);
     newAt.SetConstructor(at.GetConstructor());
     newAt.SetCreationDate(new DateTime());
     newAt.SetDeleted(false);
     newAt.SetIpAddress(at.GetIpAddress());
     newAt.SetPhysicalAddress(at.GetPhysicalAddress());
     newAt.SetPort(at.GetPort());
     newAt.SetStatus(true);
     newAt.SetType(at.GetType());
     newAt.SetUpdateDate(new DateTime());
     newAt.SetUser(at.GetUser());
     return newAt;
 }
示例#4
0
        public static SensorAT DuplicateSensor(SensorAT sensorAT, AT at)
        {
            var newSensorAT = new SensorAT();

            newSensorAT.SetName(at.GetName() + "-" + sensorAT.GetName());
            newSensorAT.SetCreationDate(new DateTime());
            newSensorAT.SetDeleted(false);
            newSensorAT.SetKm(sensorAT.GetKm());
            newSensorAT.SetLane(sensorAT.GetLane());
            newSensorAT.SetState(sensorAT.GetState());
            newSensorAT.SetStatus(true);
            newSensorAT.SetUpdateDate(new DateTime());
            newSensorAT.SetUser(sensorAT.GetUser());
            newSensorAT.SetWay(sensorAT.GetWay());
            newSensorAT.SetAt(at);
            return(newSensorAT);
        }
示例#5
0
        public static AT DuplicateAT(AT at, int index)
        {
            var newAt = new AT();

            newAt.SetName(at.GetName() + "-" + index);
            newAt.SetConstructor(at.GetConstructor());
            newAt.SetCreationDate(new DateTime());
            newAt.SetDeleted(false);
            newAt.SetIpAddress(at.GetIpAddress());
            newAt.SetPhysicalAddress(at.GetPhysicalAddress());
            newAt.SetPort(at.GetPort());
            newAt.SetStatus(true);
            newAt.SetType(at.GetType());
            newAt.SetUpdateDate(new DateTime());
            newAt.SetUser(at.GetUser());
            return(newAt);
        }
示例#6
0
        public static SensorAT CreateSensor(User user, AT at, int index)
        {
            var newSensorAT = new SensorAT();

            newSensorAT.SetName(at.GetName() + "-" + index);
            newSensorAT.SetCreationDate(new DateTime());
            newSensorAT.SetDeleted(false);
            newSensorAT.SetKm(Convert.ToSingle(105.7));
            newSensorAT.SetLane(index);
            newSensorAT.SetState(1);
            newSensorAT.SetStatus(true);
            newSensorAT.SetUpdateDate(new DateTime());
            newSensorAT.SetUser(user);
            newSensorAT.SetWay(1);
            newSensorAT.SetAt(at);
            return(newSensorAT);
        }
示例#7
0
        public virtual void Test1()
        {
            DeleteBase("sict");
            var odb  = Open("sict");
            var user = Popula(odb);
            var at   = CreateAT(user);

            odb.Store(at);
            odb.Store(CreateSensor(user, at, 1));
            odb.Store(CreateSensor(user, at, 2));
            odb.Store(CreateSensor(user, at, 3));
            odb.Store(CreateSensor(user, at, 4));
            odb.Close();
            odb = Open("sict");
            var query1 = odb.Query <AT>();
            var ats    = query1.Execute <AT>();
            var nbAts  = ats.Count;

            at = ats.GetFirst();
            AT       newAT     = null;
            SensorAT newSensor = null;
            IQuery   query     = odb.Query <SensorAT>();

            query.Descend("at.name").Constrain(at.GetName()).Equal();
            query.Descend("lane").OrderAscending();
            var sensors = query.Execute <SensorAT>();

            Println("Duplicando AT " + at.GetName());
            for (var i = 0; i < 10; i++)
            {
                newAT = DuplicateAT(at, nbAts + i + 1);
                odb.Store(newAT);
                sensors.Reset();
                while (sensors.HasNext())
                {
                    newSensor = DuplicateSensor(sensors.Next(), newAT);
                    odb.Store(newSensor);
                }
            }
            // println("AT " + newAT.getName()+" created");
            odb.Close();
        }
示例#8
0
 public static AT CreateAT(User user)
 {
     var constructor = new Constructor();
     constructor.SetCreationDate(new DateTime());
     constructor.SetName("ndatabase");
     constructor.SetDescription("NDatabase");
     var newAt = new AT();
     newAt.SetName("AT1");
     newAt.SetConstructor(constructor);
     newAt.SetCreationDate(new DateTime());
     newAt.SetDeleted(false);
     newAt.SetIpAddress("1.1.1.1");
     newAt.SetPhysicalAddress("A01");
     newAt.SetPort(4000);
     newAt.SetStatus(true);
     newAt.SetType("Type1");
     newAt.SetUpdateDate(new DateTime());
     newAt.SetUser(user);
     return newAt;
 }
示例#9
0
        public static AT CreateAT(User user)
        {
            var constructor = new Constructor();

            constructor.SetCreationDate(new DateTime());
            constructor.SetName("ndatabase");
            constructor.SetDescription("NDatabase");
            var newAt = new AT();

            newAt.SetName("AT1");
            newAt.SetConstructor(constructor);
            newAt.SetCreationDate(new DateTime());
            newAt.SetDeleted(false);
            newAt.SetIpAddress("1.1.1.1");
            newAt.SetPhysicalAddress("A01");
            newAt.SetPort(4000);
            newAt.SetStatus(true);
            newAt.SetType("Type1");
            newAt.SetUpdateDate(new DateTime());
            newAt.SetUser(user);
            return(newAt);
        }
示例#10
0
 public virtual void SetAt(AT at)
 {
     this.at = at;
 }
示例#11
0
 public virtual void SetAt(AT at)
 {
     this.at = at;
 }