public async void QueryCineastAndProcess(SimilarityQuery query, bool camera) { bool f = false; var res = await Task.Run(async() => { var results = await Task.Run(async() => await CineastWrapper.ExecuteQuery(query, 100, 100)); Debug.Log("Results received. Fetching objectdata"); await ObjectRegistry.Initialize(false); // Works due to collection being less than 100 and 100 are prefetched Debug.Log("Objectdata Fetched"); await ObjectRegistry.BatchFetchObjectMetadata(ObjectRegistry.Objects); Debug.Log("Metadata fetched"); Debug.Log("Fetched resutls: " + results.results.Count); f = true; return(results); }); Debug.Log("Handling Result"); while (f == false) { Debug.Log("waiting"); } Debug.Log("finished"); HandleCineastResult(ObjectRegistry.Objects, camera); // TODO more sophisticated }
public async void QueryCineastAndProcess(SimilarityQuery query) { var res = await Task.Run(async() => { var results = await Task.Run(async() => await CineastWrapper.ExecuteQuery(query, 100, 100)); Debug.Log("Results received. Fetching objectdata"); await ObjectRegistry.Initialize(false); // Works due to collection being less than 100 and 100 are prefetched Debug.Log("Objectdata Fetched"); await ObjectRegistry.BatchFetchObjectMetadata(ObjectRegistry.Objects); Debug.Log("Metadata fetched"); return(results); }); HandleCineastResult(ObjectRegistry.Objects); // TODO more sophisticated }
public void parseToPictureData(List <ObjectData> list, List <POICoordinatesObject> poilist) { List <ObjectData> newList = list; if (poilist.Count != 0) { newList = FilterToDistance(list, poilist); } pictureDataList = new List <PictureData>(); int id = 0; string url; string time; double lat = 0; double lon = 0; float hea; foreach (var VARIABLE in newList) { url = CineastWrapper.GetMediaUrlOf(VARIABLE); time = MetadataUtils.GetDateTime(VARIABLE.Metadata); lat = MetadataUtils.GetLatitude(VARIABLE.Metadata); lon = MetadataUtils.GetLongitude(VARIABLE.Metadata); hea = Convert.ToSingle(MetadataUtils.GetBearing(VARIABLE.Metadata)); hea = 0; Debug.Log("GET URLS " + url); Debug.Log("THESE ARE TIME: " + time); if (url == "http://10.34.58.145/objects/Ans_05459-007-AL-FL.jpg") { hea = 160; } if (url == "http://10.34.58.145/objects/barfuesserplatz-parkplatz-lohnhof.png") { hea = 90; } if (url == "http://10.34.58.145/objects/barfuesserplatz-kohlenberg.png") { hea = 90; } if (url == "http://10.34.58.145/objects/Fel_008898-RE.jpg.png") { hea = 90; } if (url == "http://10.34.58.145/objects/Com_M06-0079-0004.jpg") { hea = 270; } if (url == "http://10.34.58.145/objects/barfuesserplatz-lohnhof-schnee.png") { hea = 90; } if (url == "http://10.34.58.145/objects/Ans_05395-02-001.jpg") { hea = 270; } if (url == "http://10.34.58.145/objects/Ans_05395-01-016.jpg") { hea = 0; } if (url == "http://10.34.58.145/objects/Barfuesserirche_ganz.jpg") { hea = 180; } if (url == "http://10.34.58.145/objects/Dia_287-01946.jpg") { hea = 300; } if (url == "http://10.34.58.145/objects/Ans_05395-01-003.jpg") { hea = 0; } if (url == "http://10.34.58.145/objects/Basel_2012-08_Mattes_1_(206).JPG") { hea = 90; } if (url == "http://10.34.58.145/objects/Ans_02112.jpg") { hea = 240; } if (url == "http://10.34.58.145/objects/Com_M06-0079-0002.jpg") { hea = 290; } if (url == "http://10.34.58.145/objects/Ans_05395-01-001.jpg") { hea = 200; } //Temporary fix if (time != "" && activate_temp) { DateTime dateTime = DateTime.Parse(MetadataUtils.GetDateTime(VARIABLE.Metadata)); if (lowerbound < dateTime && dateTime < upperbound) { Debug.Log("TIME DEBUG: " + MetadataUtils.GetDateTime(VARIABLE.Metadata) + " CURRENT: LOWER " + lowerbound + " UP " + upperbound); pictureDataList.Add(new PictureData(id, url, lat, lon, hea, time)); FetchedList.Add(new PictureData(id, url, lat, lon, hea, time)); } else { continue; } } else { pictureDataList.Add(new PictureData(id, url, lat, lon, hea, time)); FetchedList.Add(new PictureData(id, url, lat, lon, hea, time)); } id++; backupkeys.Add(id); Debug.Log("No fetchedlid " + FetchedList.Count); } }