Exemplo n.º 1
0
 /* Returns all beacons in DB */
 public List <Beacon> GetBeacons()
 {
     using (IndoorPositioningContext db = new IndoorPositioningContext())
     {
         var beacons = db.Beacons.ToList();
         return(beacons);
     }
 }
Exemplo n.º 2
0
 /* Returns all gateways in DB */
 public List <Gateway> GetGateways()
 {
     using (IndoorPositioningContext db = new IndoorPositioningContext())
     {
         var gateways = db.Gateways.ToList();
         return(gateways);
     }
 }
Exemplo n.º 3
0
 /* Returns all environments in DB */
 public List <Environment> GetEnvironments()
 {
     using (IndoorPositioningContext db = new IndoorPositioningContext())
     {
         var beacons = db.Environments.ToList();
         return(beacons);
     }
 }
Exemplo n.º 4
0
        /* Deletes the given beacon */
        public Beacon DeleteBeacon(Beacon beacon)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                db.Beacons.Remove(beacon);
                db.SaveChanges();

                return(beacon);
            }
        }
Exemplo n.º 5
0
        /* Adds new beacon */
        public Beacon NewBeacon(Beacon beacon)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                db.Beacons.Add(beacon);
                db.SaveChanges();

                return(beacon);
            }
        }
Exemplo n.º 6
0
 /* Returns the beacon with given id */
 public Beacon GetBeaconById(int id)
 {
     using (IndoorPositioningContext db = new IndoorPositioningContext())
     {
         var beacon = db.Beacons
                      .Where(b => b.BeaconId == id)
                      .FirstOrDefault();
         return(beacon);
     }
 }
Exemplo n.º 7
0
        /* Deletes the given gateway */
        public Gateway DeleteGateway(Gateway gateway)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                db.Gateways.Remove(gateway);
                db.SaveChanges();

                return(gateway);
            }
        }
Exemplo n.º 8
0
        /* Updates the given environment */
        public Environment UpdateEnvironment(Environment environment)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                db.Environments.Update(environment);
                db.SaveChanges();

                return(environment);
            }
        }
Exemplo n.º 9
0
        /* Adds new gateway */
        public Gateway NewGateway(Gateway gateway)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                db.Gateways.Add(gateway);
                db.SaveChanges();

                return(gateway);
            }
        }
Exemplo n.º 10
0
        /* Adds new fingerprinting record */
        public Fingerprinting NewFingerprint(Fingerprinting fingerprinting)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                db.Fingerprintings.Add(fingerprinting);
                db.SaveChanges();

                return(fingerprinting);
            }
        }
Exemplo n.º 11
0
 /* Returns the gateway with given id */
 public Gateway GetGatewayById(int id)
 {
     using (IndoorPositioningContext db = new IndoorPositioningContext())
     {
         var gateway = db.Gateways
                       .Where(b => b.GatewayId == id)
                       .FirstOrDefault();
         return(gateway);
     }
 }
Exemplo n.º 12
0
        /* Finds the beacon with macAddress */
        public Beacon GetBeacon(string macAddress)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                var beacon = db.Beacons
                             .Where(b => b.MACAddress == macAddress)
                             .FirstOrDefault();

                return(beacon);
            }
        }
Exemplo n.º 13
0
        /* Finds the gateway with macAddress */
        public Gateway GetGateway(string macAddress)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                var gateway = db.Gateways
                              .Where(b => b.MACAddress == macAddress)
                              .FirstOrDefault();

                return(gateway);
            }
        }
Exemplo n.º 14
0
        /* Gets the fingerprinting records of the given environment */
        public List <Fingerprinting> GetFingerprinting(int environmentId)
        {
            using (IndoorPositioningContext db = new IndoorPositioningContext())
            {
                var fingerprintings = db.Fingerprintings
                                      .Where(b => b.EnvironmentId == environmentId)
                                      .OrderBy(b => b.Xaxis)
                                      .ThenBy(b => b.Yaxis)
                                      .ThenBy(b => b.Timestamp)
                                      .ThenBy(b => b.GatewayId)
                                      .ToList();

                return(fingerprintings);
            }
        }
Exemplo n.º 15
0
 public TrainingValuesHandler(IndoorPositioningContext db)
 {
     this.db = db;
 }
Exemplo n.º 16
0
 public Parsers(IndoorPositioningContext dbcontext)
 {
     db = dbcontext;
 }
Exemplo n.º 17
0
 public KnnsHandler(IndoorPositioningContext db)
 {
     this.db = db;
 }
Exemplo n.º 18
0
 public StoreysHandler(IndoorPositioningContext db)
 {
     this.db = db;
 }
Exemplo n.º 19
0
 public SpacesHandler(IndoorPositioningContext dbcontext)
 {
     db = dbcontext;
 }
Exemplo n.º 20
0
 public BeaconsHandler(IndoorPositioningContext dbcontext)
 {
     db = dbcontext;
 }
Exemplo n.º 21
0
 public BuildingsHandler(IndoorPositioningContext dbcontext)
 {
     db = dbcontext;
 }
 public TrackerLocationsHandler(IndoorPositioningContext db)
 {
     this.db = db;
 }
Exemplo n.º 23
0
 public AddressesHandler(IndoorPositioningContext dbcontext)
 {
     db = dbcontext;
 }