static void Main(string[] args) { Manager _manager = new WifiLocalization.Manager(); DeviceModel User = new DeviceModel(); List<LocationModel> OfflineMapList = new List<LocationModel>(); string xlPath = "C:/Users/Tarek/Desktop/ResearchLab_Database_6x7.xls"; for (int i = 1; i <= 2; i++) { LocationModel Offline = new LocationModel(); Offline.XValue = Helper.ObjectToDouble(_manager.ReadOfflineDB(xlPath, i, "K4:K45")); Offline.YValue = Helper.ObjectToDouble(_manager.ReadOfflineDB(xlPath, i, "L4:L45")); char ch = 'B'; for (int j = 1; j <= 5; j++) { Offline.RSSValueList.Add(Helper.ObjectToDouble(_manager.ReadOfflineDB(xlPath, i, ch + "4:" + ch++ + "45"))); } OfflineMapList.Add(Offline); } User.Mac = "AA:BB:CC:DD"; User.Name = "TestUser"; User.Property.KNN = 3; User.Property.Threshold = 1; User.Property.Exponent = 2; User.RSSValue = new double[OfflineMapList[0].RSSValueList.Count()]; for (int i = 0; i < OfflineMapList[0].RSSValueList.Count(); i++) { User.RSSValue[i] = OfflineMapList[0].RSSValueList[i][0]; } User.GetLocation(OfflineMapList[0]); double[] u1 = new double[] { }; double[] u2 = new double[] { }; User.GetStatistics(Helper.Magnitude(u1, u2), Helper.Magnitude(OfflineMapList[0].XValue, OfflineMapList[0].YValue)); User.DisplayInfo(); User.Property.DisplayInfo(); //user.GetLocation(); Console.ReadKey(); }
static void Main(string[] args) { Manager _manager = new WifiLocalization.Manager(); DeviceModel User = new DeviceModel(); List <LocationModel> OfflineMapList = new List <LocationModel>(); string xlPath = "C:/Users/Tarek/Desktop/ResearchLab_Database_6x7.xls"; for (int i = 1; i <= 2; i++) { LocationModel Offline = new LocationModel(); Offline.XValue = Helper.ObjectToDouble(_manager.ReadOfflineDB(xlPath, i, "K4:K45")); Offline.YValue = Helper.ObjectToDouble(_manager.ReadOfflineDB(xlPath, i, "L4:L45")); char ch = 'B'; for (int j = 1; j <= 5; j++) { Offline.RSSValueList.Add(Helper.ObjectToDouble(_manager.ReadOfflineDB(xlPath, i, ch + "4:" + ch++ + "45"))); } OfflineMapList.Add(Offline); } User.Mac = "AA:BB:CC:DD"; User.Name = "TestUser"; User.Property.KNN = 3; User.Property.Threshold = 1; User.Property.Exponent = 2; User.RSSValue = new double[OfflineMapList[0].RSSValueList.Count()]; for (int i = 0; i < OfflineMapList[0].RSSValueList.Count(); i++) { User.RSSValue[i] = OfflineMapList[0].RSSValueList[i][0]; } User.GetLocation(OfflineMapList[0]); double[] u1 = new double[] { }; double[] u2 = new double[] { }; User.GetStatistics(Helper.Magnitude(u1, u2), Helper.Magnitude(OfflineMapList[0].XValue, OfflineMapList[0].YValue)); User.DisplayInfo(); User.Property.DisplayInfo(); //user.GetLocation(); Console.ReadKey(); }