Exemplo n.º 1
0
    // Use this to run the queries for anomaly detection
    public void AnomalyDetection()
    {
        ring.GetComponent <ProgressRing>().ResetFill();
        ring.SetActive(true);
        ProgressRing.flag3 = true;
        drop.SetActive(true);
        drop.GetComponent <Dropdown>().options.Clear();
        anoms.Clear();
        anomDevices.Clear();
        anomSkip = 0;
        filt     = string.Format("eventprocessedutctime ge '{0}' and eventprocessedutctime le '{1}' and prediction eq 1",
                                 start, end);
        sel = "deviceid";
        CustomQuery anomalyQuery = new CustomQuery(filt, "", 50, anomSkip, sel);

        StartCoroutine(_anomalies.Query <Anomaly>(anomalyQuery, AnomalyQuery));
    }
Exemplo n.º 2
0
    public void Load()
    {
        string      filter = string.Format("userId eq '{0}'", _client.User.user.userId);
        CustomQuery query  = new CustomQuery(filter);

        Debug.Log("Load data for UserId: " + _client.User.user.userId + " query:" + query);

        StartCoroutine(_table.Query <Inventory> (query, OnLoadCompleted));
    }
Exemplo n.º 3
0
    // Runs the queries. Accepts a boolean which represents whether live mode is on.
    public void RunQueries(bool live)
    {
        ResetData();
        ring.GetComponent <ProgressRing>().ResetFill();
        ring.SetActive(true);
        ProgressRing.flag  = true;
        ProgressRing.flag2 = true;

        // Check if up-to-date data is needed. Otherwise, include an end time for query results.
        if (live)
        {
            filter = string.Format("eventprocessedutctime ge '{0}' and deviceid eq '{1}'",
                                   start, ID);
            filter2 = string.Format("eventprocessedutctime ge '{0}'",
                                    start);
        }
        else
        {
            filter = string.Format("eventprocessedutctime ge '{0}' and eventprocessedutctime le '{1}' and deviceid eq '{2}'",
                                   start, end, ID);
            filter2 = string.Format("eventprocessedutctime ge '{0}' and eventprocessedutctime le '{1}'",
                                    start, end);
        }


        foreach (string element in attributes)
        {
            select += element + ", ";
        }

        // This will change based on what the variable for the time element of the telemetry is called
        select += "eventprocessedutctime, prediction";

        // Send queries for both the device and globally. Order the results by the timestamp and the deviceid.
        CustomQuery deviceQuery = new CustomQuery(filter, "eventprocessedutctime, deviceid", 50, deviceSkip, select);

        StartCoroutine(_table.Query <Telemetry>(deviceQuery, DeviceQuery));
        CustomQuery globalQuery = new CustomQuery(filter2, "eventprocessedutctime, deviceid", 50, globalSkip, select);

        StartCoroutine(_table.Query <Telemetry>(globalQuery, GlobalQuery));
    }
    private void GetPageHighscores()
    {
        CustomQuery query = new CustomQuery("", "score desc", _noPageResults, _skip, "id,username,score");

        StartCoroutine(_table.Query <Highscore> (query, OnReadNestedResultsCompleted));
    }