Пример #1
0
        public Tuple <string[], int[], int[], string, double[], double[], string[]> ReadEyeInfo(Patient pat, DateTime date, bool isLeft)
        {
            var    pats        = ReadPatientsList();
            string patientPath = null;

            for (int i = 0; i < pats[0].Length; i++)
            {
                if (pats[0][i] != pat.Name)
                {
                    continue;
                }
                patientPath = pats[1][i];
                break;
            }

            string path = _root + '\\' + patientPath + "\\" + date.ToShortDateString() + "\\" +
                          (isLeft ? "Левый глаз\\info.json" : "Правый глаз\\info.json");

            if (!File.Exists(path))
            {
                return(null);
            }

            EyeJson ej = JsonConvert.DeserializeObject <EyeJson>(ReadData(path));

            return(Tuple.Create(ej.Params, ej.ParamsValues, ej.Diags, ej.Path, ej.Xses, ej.Yses, ej.Texts));
        }
Пример #2
0
        public void WriteEyeInfo(Tuple <string[], int[], int[], string, double[], double[], string[]> args)
        {
            EyeJson ej = new EyeJson
            {
                Params       = args.Item1,
                ParamsValues = args.Item2,
                Diags        = args.Item3,
                Path         = args.Item4,
                Xses         = args.Item5,
                Yses         = args.Item6,
                Texts        = args.Item7
            };
            var temp = args.Item4.Split('\\');

            temp[temp.Length - 1] = "info.json";
            var str = String.Join("\\", temp);

            Serialize(ej, str);
        }