Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            //
            this.FontFamily = new FontFamily("Noto Sans CJK KR Medium");
            this.FontSize   = 16;

            // init. controls
            m_singlePage = new SinglePage();
            m_bothPage   = new BothPage();
            m_compPage   = new CompPage();
            m_progPage   = new ProgPage();

            // TTT
            MeasurementData.Ins.DataDirSelf = "D:/HCT_DATA/20190614/000002/OCT_190614_165757_OD";
            OctDBAccessor.Ins.DBFilePath    = "D:/projects/etc/cpp-csharp-interop/MFCApplication1/MFCApplication1/HCT_DB.db";

            // load data
            // - self
            Utils.LoadJsonTo(MeasurementData.Ins.DataDirSelf, Defs.kAngioGraphyInfoFileName, MeasurementData.Ins.Self);
            // - other side
            var dirForOtherSide = OctDBAccessor.Ins.getOtherSide(MeasurementData.Ins.DataDirSelf, MeasurementData.Ins.Self.ExamInfo.Side);

            if (dirForOtherSide != null)
            {
                Utils.LoadJsonTo(dirForOtherSide, Defs.kAngioGraphyInfoFileName, MeasurementData.Ins.OtherSide);
            }
            // - comparables
            var dirListForComp = OctDBAccessor.Ins.getCompables(MeasurementData.Ins.DataDirSelf, MeasurementData.Ins.Self.ExamInfo.Side);

            if (dirListForComp.Count > 0)
            {
                var compItem = new MeasurementData.Item();
                Utils.LoadJsonTo(dirForOtherSide, Defs.kAngioGraphyInfoFileName, compItem);
                MeasurementData.Ins.CompList.Add(compItem);
            }

            // patient info. bar
            patientInfo.refreshData();
            patientInfo.btnReCalc.Click += BtnReCalc_Click;

            updateData();

            // tab
            tabBar.updateData();
            tabBar.PageButtonClicked += TabBar_PageButtonClicked;

            // default page
            switchPage(m_singlePage);
        }
Ejemplo n.º 2
0
        public static void LoadJsonTo(String dataDir, String fileName, MeasurementData.Item measurementData)
        {
            String filePath = dataDir + "/" + fileName;

            // read file
            var     contents = File.ReadAllText(filePath);
            dynamic array    = JsonConvert.DeserializeObject(contents);

            // angiography list
            var arrAngiography = array["angiography_list"];
            List <MeasurementData.AngiographyItem> angiographyList = new List <MeasurementData.AngiographyItem>();

            foreach (var angiography in arrAngiography)
            {
                var newAngiography = MeasurementData.AngiographyItem.fromJson(angiography, dataDir);
                angiographyList.Add(newAngiography);
            }
            measurementData.AngiographyItemList.Clear();
            measurementData.AngiographyItemList.AddRange(angiographyList);
            // exam info
            measurementData.ExamInfo = MeasurementData.ExamInfo.fromJson(array["exam_info"]);
            // patient info
            measurementData.PatientData = MeasurementData.PatientData.fromJson(array["patient_info"]);
        }