예제 #1
0
 public void Init(SessionData _sessionData)
 {
     sessionData = _sessionData;
     SetupPanel();
 }
예제 #2
0
 public void Init(SessionData _sessionData)
 {
     sessionData = _sessionData;
     bar.color   = sessionData.sessionColor;
     screenShotTexture.texture = defaultTexture;
 }
예제 #3
0
 public void AddExciteOgraph(SessionData _sessionData)
 {
     EOMGraph.AddSubLineGraph(_sessionData, DataType.EOM);
 }
예제 #4
0
 public void Init(SessionData _sessionData)
 {
     sessionData = _sessionData;
     SetupButtonUI();
 }
예제 #5
0
        // ====================================================================================================
        #region Sessions Disk & Menu

        void GetSessionDataFromDisk()
        {
            mainLogFolder   = SettingsManager.Values.logSettings.mainLogFolder;
            sessionFilename = SettingsManager.Values.logSettings.sessionJsonFilename;
            // Folders with available sessions
            string[] dirs = Directory.GetDirectories(mainLogFolder);

            // Temp variables for string processing
            int    rootLength = mainLogFolder.Length;
            string dirName    = ""; // Variable to store the dirname without full path.

            string[] dirNameParts;  // Separate between date and sessionId
            string[] sessionFiles;

            // Copy predefined sessioncolor options
            sessionColors.AddRange(VisualStyle.SessionsColorTable);
            int sessionCounter = -1;

            foreach (string dir in dirs)
            {
                // Extract folder name without whole path
                dirName = dir.Substring(rootLength);

                // Check if the folder has a valid file with a sessionFilename
                sessionFiles = Directory.GetFiles(dir, sessionFilename, SearchOption.TopDirectoryOnly);

                if (sessionFiles.Length == 1) // There should be only one session file per folder
                {
                    // Process the folder
                    dirNameParts = dirName.Split('_');

                    // Every session data gets a unique key
                    sessionCounter++;

                    // Make a session and define a color for it
                    int         sessionColorIndex = UnityEngine.Random.Range(0, sessionColors.Count);
                    SessionData newSession        = new SessionData(sessionColors[sessionColorIndex], sessionCounter);
                    sessionColors.RemoveAt(sessionColorIndex);
                    if (sessionColors.Count == 0)
                    {
                        sessionColors.AddRange(VisualStyle.SessionsColorTable);
                    }

                    // Add folder info
                    SessionFolder newSessionFolder = new SessionFolder();
                    newSessionFolder.sessionFilepath = sessionFiles[0];         // Full path to json file
                    newSessionFolder.folderPath      = dir;                     // Full path to session folder
                    newSessionFolder.datetime        = DateTime.ParseExact(dirNameParts[0], "yyyyMMdd-HHmmss", System.Globalization.CultureInfo.InvariantCulture);
                    newSessionFolder.sessionId       = dirName.Substring(dirNameParts[0].Length + 1);
                    newSession.sessionFolder         = newSessionFolder;

                    // Add to list of sessions
                    sessions.Add(newSession);
                }
                else
                {
                    // Move to the next folder and avoid processing this folder
                    Debug.Log("Skipping folder " + dirName + " because session filename " + sessionFilename + " was not found.");
                }
            }
        }