Beispiel #1
0
        public async void GetEventFrames()
        {
            try
            {
                // Get AF database WebID
                string  afServerName   = "MABOTEROW7";
                string  afDatabaseName = "GoogleStreetView";
                string  url            = string.Format(@"{0}/assetdatabases?path=\\{1}\{2}", baseUrl, afServerName, afDatabaseName);
                JObject jobj           = await client.GetAsync(url);

                string webId = jobj["WebId"].ToString();

                // Get Event Frames
                string templateName = "StreetView_EFTemplate";
                //url = "https://maboterow7/piwebapi/assetdatabases/F1RDwoJtf9-ekUGM_8UYLFM6tA92lZ0EAnK0KJ745imBpvbwTUFCT1RFUk9XN1xHT09HTEVTVFJFRVRWSUVX/eventframes?templatename=StreetView_EFTemplate&sortField=starttime&sortOrder=descending&startTime=-1d";
                url = string.Format(@"{0}assetdatabases/{1}/eventframes?templatename={2}&sortField=starttime&sortOrder=descending&startTime=-1d",
                                    baseUrl, webId, templateName);
                jobj = await client.GetAsync(url);

                //Populate Combobox
                for (int i = 0; i < jobj["Items"].Count(); i++)
                {
                    StreetViewEvent svEvent = new StreetViewEvent(
                        jobj["Items"][i]["Name"].ToString(),
                        jobj["Items"][i]["StartTime"].ToString(),
                        jobj["Items"][i]["EndTime"].ToString(),
                        jobj["Items"][i]["WebId"].ToString()
                        );
                    eventFrameCb.Items.Add(svEvent);
                }
            }
            catch (Exception e) { MessageBox.Show(e.Message); }
        }
Beispiel #2
0
        private async void eventFrameCb_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                svEvent = (StreetViewEvent)eventFrameCb.SelectedItem;

                // Load timespan value information
                if (!svEvent.ValuesLoaded)
                {
                    string  url  = string.Format("{0}/streamsets/{1}/recorded", baseUrl, svEvent.WebId);
                    JObject jobj = await client.GetAsync(url);

                    //Load Event Detail
                    LoadEventDetail(jobj);
                }

                // Display the first image
                currentEventCount = 0;
                StreetViewQuery();
                ButtonCheck();

                // Populate Start and End
                startTimeLbl.Text = svEvent.StartTime.ToLocalTime().ToString();
                endTimeLbl.Text   = svEvent.EndTime.ToLocalTime().ToString();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Beispiel #3
0
        private async void GetEventFrames()
        {
            try
            {
                // Get AF database WebId
                string  afServerName   = "DNG-LEMON-AF";
                string  afDatabaseName = "GoogleStreetView";
                string  url            = string.Format(@"{0}/assetdatabases?path=\\{1}\{2}", baseUrl, afServerName, afDatabaseName);
                JObject jobj           = await client.GetAsync(url);

                string webId = jobj["WebId"].ToString();

                // Get Event Frames
                string templateName = "StreetView_EFTemplate";
                url = string.Format(@"{0}/eventframes/{1}/eventframes?templatename={2}&sortfield=starttime&sortorder=descending&starttime=*-1d",
                                    baseUrl, webId, templateName);
                jobj = await client.GetAsync(url);

                // Populate combo box
                for (int i = 0; i < jobj["Items"].Count(); i++)
                {
                    StreetViewEvent svEvent = new StreetViewEvent(
                        jobj["Items"][i]["Name"].ToString(),
                        jobj["Items"][i]["StartTime"].ToString(),
                        jobj["Items"][i]["EndTime"].ToString(),
                        jobj["Items"][i]["WebId"].ToString()
                        );
                    eventFrameCb.Items.Add(svEvent);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
        private async void eventFrameCb_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                svEvent = (StreetViewEvent)eventFrameCb.SelectedItem;
                
                if (!svEvent.ValuesLoaded)
                {
                    // Load timestamp/value information
                    string url = string.Format("{0}/streamsets/{1}/recorded", baseUrl, svEvent.WebId);
                    JObject jobj = await client.GetAsync(url);
                    LoadEventDetail(jobj);
                }

                // Display the first image
                currentEventCount = 0;
                StreetViewQuery();
                ButtonCheck();

                // Populate start and end time
                startTimeLbl.Text = svEvent.StartTime.ToLocalTime().ToString();
                endTimeLbl.Text = svEvent.EndTime.ToLocalTime().ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private async void GetEventFrames()
        {
            try
            {
                // Get AF database WebId
                string afServerName = "DNG-LEMON-AF";
                string afDatabaseName = "GoogleStreetView";
                string url = string.Format(@"{0}/assetdatabases?path=\\{1}\{2}", baseUrl, afServerName, afDatabaseName);
                JObject jobj = await client.GetAsync(url);
                string webId = jobj["WebId"].ToString();

                // Get Event Frames
                string templateName = "StreetView_EFTemplate";
                url = string.Format(@"{0}/eventframes/{1}/eventframes?templatename={2}&sortfield=starttime&sortorder=descending&starttime=*-1d",
                                            baseUrl, webId, templateName);
                jobj = await client.GetAsync(url);
                
                // Populate combo box
                for (int i = 0; i < jobj["Items"].Count(); i++)
                {
                    StreetViewEvent svEvent = new StreetViewEvent(
                        jobj["Items"][i]["Name"].ToString(),
                        jobj["Items"][i]["StartTime"].ToString(),
                        jobj["Items"][i]["EndTime"].ToString(),
                        jobj["Items"][i]["WebId"].ToString()
                        );
                    eventFrameCb.Items.Add(svEvent);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            
        }