Exemplo n.º 1
0
        ////// MARKERS UI
        public void CreateManualMarker(string defaultText, MarkerLabel markerLabel = MarkerLabel.CUSTOM_MARKER)
        {
            EoM_Events.Send_OnStringReceived(DataType.ManualMarkers, ExciteOMeterManager.GetTimestamp(), defaultText);
            LogMessageUI.instance.WriteConsoleText("New custom marker at " + ExciteOMeterManager.GetTimestampString(2) + " with message " + defaultText);
            GameObject           go     = Instantiate(instanceMarkerPrefab, markersParent);
            CustomMarkerScriptUI script = go.GetComponent <CustomMarkerScriptUI>();

            script.Setup(ExciteOMeterManager.GetTimestamp(), defaultText, markerLabel);
            // sessionMarkers.Add(script); // Used to keep record of existing session markers
            LoggerController.instance.SaveScreenshot();
        }
Exemplo n.º 2
0
        void ReleaseDesignerOutlets()
        {
            if (CaloriesLabel != null)
            {
                CaloriesLabel.Dispose();
                CaloriesLabel = null;
            }

            if (DistanceLabel != null)
            {
                DistanceLabel.Dispose();
                DistanceLabel = null;
            }

            if (DurationLabel != null)
            {
                DurationLabel.Dispose();
                DurationLabel = null;
            }

            if (MarkerButton != null)
            {
                MarkerButton.Dispose();
                MarkerButton = null;
            }

            if (MarkerLabel != null)
            {
                MarkerLabel.Dispose();
                MarkerLabel = null;
            }

            if (PauseResumeButton != null)
            {
                PauseResumeButton.Dispose();
                PauseResumeButton = null;
            }
        }
        public void Setup(float timestamp, string text, MarkerLabel markerLabel)
        {
            this.timestamp     = timestamp;
            timestampText.text = timestamp.ToString("F2");
            messageText.text   = text;

            if (markerImageColor != null)
            {
                Color markerColor = colorDefault;
                // Show the color of the marker based on label
                switch (markerLabel)
                {
                case MarkerLabel.CUSTOM_MARKER:
                    markerColor = colorCustomMarker;
                    break;

                case MarkerLabel.QUICK_MARKER:
                    markerColor = colorQuickMarker;
                    break;
                }
                markerImageColor.color = markerColor;
            }
        }
Exemplo n.º 4
0
 public static void Send_OnStringReceived(ExciteOMeter.DataType type, float timestamp, string message, MarkerLabel label = MarkerLabel.CUSTOM_MARKER)
 {
     if (OnStringReceived != null)
     {
         OnStringReceived(type, timestamp, message, label);
     }
 }
        private void ExciteOMeterMarkerReceived(DataType type, float timestamp, string message, MarkerLabel label)
        {
            // Only process data when a file is configured
            if (!isConfigured)
            {
                return;
            }

            Values.timeseries[type].timestamp.Add(timestamp);
            Values.timeseries[type].text.Add(message);
        }
 public InstantMarker(float _timeStamp, MarkerLabel _label, string _msg)
 {
     timestamp = _timeStamp;
     label     = _label;
     message   = _msg;
 }
Exemplo n.º 7
0
 void Awake()
 {
     _markerLabel = Instantiate(markerLabelPrefab, transform);
     _markerLabel.gameObject.SetActive(false);
 }
Exemplo n.º 8
0
        void ProcessStringLog(ExciteOMeter.DataType type, float timestamp, string message, MarkerLabel label)
        {
            bool written = LoggerController.instance.WriteLine(LogName.EventsAndMarkers,
                                                               ExciteOMeterManager.ConvertFloatToString(timestamp) + "," +
                                                               type.ToString() + "," +
                                                               message + "," +
                                                               label.ToString());

            if (!written)
            {
                Debug.LogWarning("The Logger Controller has not been setup to store strings. Please setup a file with LogID EventsAndMarkers.");
            }
        }
Exemplo n.º 9
0
        // Update is called once per frame
        void Update()
        {
            //// OLD INPUT SYSTEM

            if (kb[Key.U].wasPressedThisFrame)
            {
                // Update values and whole timeline
                Debug.Log("Updating Timeline");

                EoM_Events.Send_TimelineRedraw();
            }

            if (kb[Key.C].wasPressedThisFrame)
            {
                // Update values and whole timeline
                Debug.Log("Custom range");

                EoM_Events.Send_SetTimelineRange(10, 90);
            }


            if (kb[Key.J].wasPressedThisFrame)
            {
                // Update values and whole timeline
                float value = 3f;
                Debug.Log("Value:" + value);
                int intvalue = Convert.ToInt32(value);
                Debug.Log("Int Value:" + intvalue);
                MarkerLabel mlabel = (MarkerLabel)intvalue;
                Debug.Log("label:" + mlabel);
                Color labelC = ExciteOMeter.Vizualisation.VisualStyle.InstantMarkersColorTable[mlabel];
                Debug.Log("Color: " + labelC);
            }



            if (kb[Key.S].wasPressedThisFrame)
            {
                // Update values and whole timeline
                Debug.Log("Set range");

                EoM_Events.Send_SetTimelineRange(0, 300);
            }

            if (kb[Key.T].wasPressedThisFrame)
            {
                // Update values and whole timeline
                // float newTimestamp = UnityEngine.Random.Range(0f,200f);
                float newTimestamp = 60f;

                Debug.Log("newTimestamp:" + newTimestamp + " = " + TimeLineHelpers.GetTimeFormat(newTimestamp, true));
                EoM_Events.Send_SetTimeMarker(newTimestamp);
            }

            if (kb[Key.D].wasPressedThisFrame)
            {
                OfflineAnalysisManager.instance.GenerateDataTypeListMenu();
            }

            if (kb[Key.G].wasPressedThisFrame)
            {
                int findindex = ExciteOMeter.Vizualisation.OfflineAnalysisManager.instance.sessions.FindLastIndex(x => x.isLoaded == true);
                ExciteOMeter.Vizualisation.Timeline.instance.AddLineGraph(ExciteOMeter.Vizualisation.OfflineAnalysisManager.instance.sessions[findindex], DataType.HeartRate);
            }

            if (kb[Key.A].wasPressedThisFrame)
            {
                int findindex = ExciteOMeter.Vizualisation.OfflineAnalysisManager.instance.sessions.FindLastIndex(x => x.isLoaded == true);
                ExciteOMeter.Vizualisation.Timeline.instance.AddMarkerGraph(ExciteOMeter.Vizualisation.OfflineAnalysisManager.instance.sessions[findindex], DataType.AutomaticMarkers);
            }
        }
Exemplo n.º 10
0
    /// <summary>
    /// Make request url string
    /// for Google Static Maps
    /// </summary>
    /// <param name="coo"></param>
    /// <param name="size"></param>
    /// <param name="zoom"></param>
    /// <param name="type"></param>
    /// <returns>string url</returns>
    private string MakeUrlRequest(Vector2 coo,
                                  Vector2 size,
                                  int zoom,
                                  MapType type,
                                  ArrayList markers)
    {
        //Check coordinates
        int maxLat = 6 * zoom;

        if (coo[1] > maxLat || coo[1] < -maxLat)
        {
            //Wrong latitude
            Debug.LogWarning("Latitude wrong");
            if (coo[1] < 0)
            {
                coo[1] = -maxLat;
            }
            else
            {
                coo[1] = maxLat;
            }
        }

        string ret = urlBase                                                    // request base string adress
                     + "center=" + coo[0].ToString() + "," + coo[1].ToString()  // + position
                     + "&zoom=" + zoom.ToString()                               // + zoom
                     + "&size=" + size[0].ToString() + "x" + size[1].ToString() // + size
                     + "&maptype=" + type.ToString();                           // + maptype

        // + "&markers=size:mid%7Ccolor:0xff0000%7Clabel:1%7C" + coo[0].ToString() + "," + coo[1].ToString() // + marker example
        // + "&markers=size:mid%7Ccolor:0xff0000%7Clabel:1%7C" + coo[1].ToString() + "," + coo[1].ToString();// + marker example

        GameObject[] gos = GameObject.FindGameObjectsWithTag("MarkerLabel");
        foreach (GameObject go in gos)
        {
            DestroyObject(go);
        }


        int count = 35;

        if (markers != null)
        {
            //add markers to request
            foreach (Vector2 marker in markers)
            {
                if (count-- == 0)
                {
                    break;
                }
                ret += "&markers=size:mid%7Ccolor:0xff0000%7Clabel:1%7C" + marker[0].ToString() + "," + marker[1].ToString();
                //   ret += "&markers=size:mid%7Ccolor:0xff0000%7Clabel:1%7C" + marker[0].ToString() + "," + marker[1].ToString();
                GameObject  mlObj = Instantiate <GameObject>(markerLabelPrefab);
                MarkerLabel ml    = mlObj.GetComponent <MarkerLabel>();
                ml.coordinates = marker;
                ml.zoom        = zoom;
            }
        }
        //add custom markers to request
        if (markersList != null)
        {
            foreach (Vector2 marker in markersList /* gui property */)
            {
                if (count-- <= 0)
                {
                    break;
                }
                ret += "&markers=%7Clabel:1%7C" + marker[0].ToString() + "," + marker[1].ToString();
                GameObject  mlObj = Instantiate <GameObject>(markerLabelPrefab);
                MarkerLabel ml    = mlObj.GetComponent <MarkerLabel>();
                ml.coordinates = marker;
                ml.zoom        = zoom;
            }
        }
        /* google static map api key */
        ret += "&key=AIzaSyDb-yIJTeihCDkU_GAVK67i878h88zfYIk";
        //set gui propery
        url = ret;
        return(ret);
    }