Example #1
0
        public static void SaveAnalysis(EventAnalysis stats, string path)
        {
            Initialize(false);

            string contents = JsonConvert.SerializeObject(stats, Formatting.Indented);

            File.WriteAllText(path, contents);
        }
Example #2
0
        public void LoadCreateAnalysis()
        {
            string analysisPath = EventPath + "\\" + Event.EventName +
                                  ScoutingJson.AnalysisExtension;

            if (File.Exists(analysisPath))
            {
                FrcAnalysis = ScoutingJson.ParseAnalysis(analysisPath);
            }
            else
            {
                FrcAnalysis = new EventAnalysis(Event);
            }
            FrcAnalysis.PostJsonLoading(Event);
        }
Example #3
0
        public static EventAnalysis ParseAnalysis(string fullPathName)
        {
            Initialize(false);

            string        contents = File.ReadAllText(fullPathName);
            EventAnalysis stats    = null;

            try
            {
                stats = JsonConvert.DeserializeObject <EventAnalysis>(contents);
            }
            catch (JsonException)
            {
                Util.DebugLog(LogLevel.Critical, "Could not deserialize file.");
            }

            return(stats);
        }