Esempio n. 1
0
        private void InitInterface()
        {
            // Initiate ICommands for KeyBindings
            icToggleFullscreen = new ActionCommand(() => ToggleFullscreen());
            icPauseDevice      = new ActionCommand(() => TogglePause());
            icCloseDevice      = new ActionCommand(() => this.Close());
            icExitProgram      = new ActionCommand(() => App.Patient_Editor.RequestExit());

            // Populate UI strings per language selection
            wdwDeviceECG.Title          = App.Language.Dictionary ["ECG:WindowTitle"];
            menuDevice.Header           = App.Language.Dictionary ["MENU:MenuDeviceOptions"];
            menuPauseDevice.Header      = App.Language.Dictionary ["MENU:MenuPauseDevice"];
            menuToggleFullscreen.Header = App.Language.Dictionary ["MENU:MenuToggleFullscreen"];
            menuCloseDevice.Header      = App.Language.Dictionary ["MENU:MenuCloseDevice"];
            menuExitProgram.Header      = App.Language.Dictionary ["MENU:MenuExitProgram"];

            /* 12 Lead ECG Interface layout */
            List <Leads.Values> listLeads = new List <Leads.Values> ();

            foreach (Leads.Values v in Enum.GetValues(typeof(Leads.Values)))
            {
                if (v.ToString().StartsWith("ECG"))
                {
                    listLeads.Add(v);
                }
            }

            int amtRows    = 3,
                amtColumns = 4,
                indexLeads = 0;

            // Set grid's row and column definitions
            for (int i = 0; i < amtRows; i++)
            {
                layoutGrid.RowDefinitions.Add(new RowDefinition());
            }
            for (int i = 0; i < amtColumns; i++)
            {
                layoutGrid.ColumnDefinitions.Add(new ColumnDefinition());
            }

            // Populate the grid with tracings for each lead
            for (int iColumns = 0; iColumns < amtColumns; iColumns++)
            {
                for (int iRows = 0; iRows < amtRows && indexLeads < listLeads.Count; iRows++)
                {
                    listTracings.Add(new Controls.ECGTracing(new Strip(3f, listLeads [indexLeads])));
                    listTracings [indexLeads].SetValue(Grid.ColumnProperty, iColumns);
                    listTracings [indexLeads].SetValue(Grid.RowProperty, iRows);
                    layoutGrid.Children.Add(listTracings [indexLeads]);
                    indexLeads++;
                }
            }

            // Add Lead II running along bottom spanning all columns
            Controls.ECGTracing leadII = new Controls.ECGTracing(new Strip(12f, Leads.Values.ECG_II));
            leadII.SetValue(Grid.ColumnProperty, 0);
            leadII.SetValue(Grid.RowProperty, 4);
            leadII.SetValue(Grid.ColumnSpanProperty, 4);
            listTracings.Add(leadII);
            layoutGrid.RowDefinitions.Add(new RowDefinition());
            layoutGrid.Children.Add(listTracings [indexLeads]);
        }
Esempio n. 2
0
        private void InitInterface()
        {
            /* Initiate ICommands for KeyBindings */
            icToggleFullscreen = new ActionCommand(() => ToggleFullscreen());
            icPauseDevice      = new ActionCommand(() => TogglePause());
            icCloseDevice      = new ActionCommand(() => Close());
            icExitProgram      = new ActionCommand(() => App.Patient_Editor.Exit());
            icSaveScreen       = new ActionCommand(() => SaveScreen());
            icPrintScreen      = new ActionCommand(() => PrintScreen());

            /* Populate UI strings per language selection */
            wdwDeviceECG.Title          = App.Language.Localize("ECG:WindowTitle");
            menuDevice.Header           = App.Language.Localize("MENU:MenuDeviceOptions");
            menuPauseDevice.Header      = App.Language.Localize("MENU:MenuPauseDevice");
            menuShowGrid.Header         = App.Language.Localize("MENU:MenuShowGrid");
            menuToggleFullscreen.Header = App.Language.Localize("MENU:MenuToggleFullscreen");
            menuSaveScreen.Header       = App.Language.Localize("MENU:MenuSaveScreen");
            menuPrintScreen.Header      = App.Language.Localize("MENU:MenuPrintScreen");
            menuCloseDevice.Header      = App.Language.Localize("MENU:MenuCloseDevice");
            menuExitProgram.Header      = App.Language.Localize("MENU:MenuExitProgram");
            menuColor.Header            = App.Language.Localize("MENU:MenuColorScheme");
            menuColorLight.Header       = App.Language.Localize("MENU:MenuColorSchemeLight");
            menuColorDark.Header        = App.Language.Localize("MENU:MenuColorSchemeDark");

            /* Set background image for grid lines */
            gridBackground = new ImageBrush(new BitmapImage(
                                                new Uri("pack://application:,,,/Resources/12L ECG Grid.png")));

            /* 12 Lead ECG Interface layout */
            List <Lead.Values> listLeads = new List <Lead.Values> ();

            foreach (Lead.Values v in Enum.GetValues(typeof(Lead.Values)))
            {
                if (v.ToString().StartsWith("ECG"))
                {
                    listLeads.Add(v);
                }
            }

            int amtRows    = 3,
                amtColumns = 4,
                indexLeads = 0;

            // Set grid's row and column definitions
            for (int i = 0; i < amtRows; i++)
            {
                layoutGrid.RowDefinitions.Add(new RowDefinition());
            }
            for (int i = 0; i < amtColumns; i++)
            {
                layoutGrid.ColumnDefinitions.Add(new ColumnDefinition());
            }

            // Populate the grid with tracings for each lead
            for (int iColumns = 0; iColumns < amtColumns; iColumns++)
            {
                for (int iRows = 0; iRows < amtRows && indexLeads < listLeads.Count; iRows++)
                {
                    listTracings.Add(new Controls.ECGTracing(new Strip(listLeads [indexLeads], (4 - iColumns) * 2.5f, 2.5f)));
                    listTracings [indexLeads].SetValue(Grid.ColumnProperty, iColumns);
                    listTracings [indexLeads].SetValue(Grid.RowProperty, iRows);
                    layoutGrid.Children.Add(listTracings [indexLeads]);
                    indexLeads++;
                }
            }

            // Add Lead II running along bottom spanning all columns
            Controls.ECGTracing leadII = new Controls.ECGTracing(new Strip(Lead.Values.ECG_II, 10f));
            leadII.SetValue(Grid.ColumnProperty, 0);
            leadII.SetValue(Grid.RowProperty, 4);
            leadII.SetValue(Grid.ColumnSpanProperty, 4);
            listTracings.Add(leadII);
            layoutGrid.RowDefinitions.Add(new RowDefinition());
            layoutGrid.Children.Add(listTracings [indexLeads]);
        }