Exemple #1
0
        private static IWidget CreateWindow6_3(string path)
        {
            var window = new Window("window6_3", Path.Combine(path, @"generic/bg.raw"));

            window.AddChild(new RawButton("window6_3_home", Path.Combine(path, @"generic/home.raw"), Path.Combine(path, @"generic/home.raw"), 383, 247)
            {
                OnRelease = () => mApplication.SetFocusedWindow("window1")
            });

            window.AddChild(new TextArea("window6_1_title", null, 10, 215, 400)
            {
                Color = { B = 1, G = 1, R = 1 },
                Text  = "Результат измерения потенциала",
                Size  = 16
            });

            const int btnsX     = 350;
            const int btnsYBase = 100;
            const int btnsYStep = 70;

            window.AddChild(new RawButton("window_6_3_graphic", Path.Combine(path, "RawButtons/bt_graphic.raw"), Path.Combine(path, "RawButtons/bt_graphic_pr.raw"), btnsX, ToVgY(btnsYBase))
            {
                OnRelease = () => mMeasureController.ShowSampleGraphic()
            });
            window.AddChild(new RawButton("", Path.Combine(path, "RawButtons/bt_onwards.raw"), Path.Combine(path, "RawButtons/bt_onwards_pr.raw"), btnsX, 5)
            {
                OnRelease = () => mMeasureController.OnEndOfMeasureProcess()
            });


            window.AddChild(new ProgressBarImages("bar", path, 10, 10)
            {
                Percent   = 100,
                Text      = "       Завершено",
                TextColor = { B = 1, R = 1, G = 1 }
            });

            var table = new TextTable("window6_3.table", 15, 115, new[] { 210, 100 }, TextTable.CreateOffset(3, 22), new[] { 4, 4 }, null, 16);

            table.Cells[0, 0].Text = "Значение потенциала";
            table.Cells[0, 1].Text = "Тип активности";
            table.Cells[0, 2].Text = "Стабильность потенциала";
            window.AddChild(table);

            mMeasureController.Window63DataAction = (potential, temperature, activity, stability) =>
            {
                table.Cells[1, 0].Text = potential;
                table.Cells[1, 1].Text = activity;
                table.Cells[1, 2].Text = stability;

                window.Invalidate();
            };


            #region Repeat modal window
            const int popupX = 40;
            const int popupY = 30;

            var repeatPopup = new ModalWindow("", path);
            //                              "xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxx "
            repeatPopup.TextLines[1].Text = "         Вы действительно хотите";
            repeatPopup.TextLines[1].Size = 20;

            repeatPopup.TextLines[2].Text = "         начать измерение заново?";
            repeatPopup.TextLines[2].Size = 20;

            repeatPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_yes.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_yes_pr.raw"), popupX + 280, popupY)
            {
                OnRelease = () =>
                {
                    repeatPopup.IsVisible = false;

                    mMeasureController.Reset();
                    mApplication.SetFocusedWindow("window3");

                    window.Invalidate();
                }
            });
            repeatPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_no.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_no_pr.raw"), popupX + 20, popupY)
            {
                OnRelease = () =>
                {
                    repeatPopup.IsVisible = false;

                    window.Invalidate();
                }
            });


            window.AddPopup(repeatPopup);
            #endregion

            window.AddChild(new RawButton("", Path.Combine(path, "RawButtons/bt_repeat_measurement.raw"), Path.Combine(path, "RawButtons/bt_repeat_measurement_pr.raw"), btnsX, ToVgY(btnsYBase + btnsYStep))
            {
                OnRelease = () =>
                {
                    repeatPopup.IsVisible = true;

                    window.Invalidate();
                }
            });


            #region Popup visibility
            {
                // TODO: set all to false
                //repeatPopup.IsVisible = true;
            }
            #endregion

            return(window);
        }
Exemple #2
0
        private static IWidget CreateWindow7(string path)
        {
            var window = new Window("window7", Path.Combine(path, @"generic/bg.raw"));

            window.AddChild(new RawButton("window7_home", Path.Combine(path, @"generic/home.raw"), Path.Combine(path, @"generic/home.raw"), 383, 247)
            {
                OnRelease = () => mApplication.SetFocusedWindow("window1")
            });

            window.AddChild(new TextArea("", null, 30, 210, 350)
            {
                Text = "Отчёт о проведенном измерении", Size = 16, Color = new Color {
                    R = 1.0f, G = 1.0f, B = 1.0f
                }
            });

            var table = new TextTable("window7.table", 15, 70, new[] { 180, 130 }, TextTable.CreateOffset(5, 22), new[] { 2, 4 }, null, 16);

            table.Cells[0, 0].Text = "Проба:";
            table.Cells[0, 1].Text = "Результат АОА:";
            table.Cells[0, 2].Text = "Результат ОА:";
            table.Cells[0, 3].Text = "Исполнитель:";
            table.Cells[0, 4].Text = "Дата:";
            window.AddChild(table);

            window.AddChild(new RawButton("", Path.Combine(path, "RawButtons/bt_next_measurement.raw"), Path.Combine(path, "RawButtons/bt_next_measurement_pr.raw"), 350, 5)
            {
                OnRelease = () => mApplication.SetFocusedWindow("window2")
            });

            window.AddChild(new RawButton("", Path.Combine(path, "RawButtons/bt_repeat_measurement.raw"), Path.Combine(path, "RawButtons/bt_repeat_measurement_pr.raw"), 350, 165)
            {
                OnRelease = () =>
                {
                    mMeasureController.Reset();
                    mApplication.SetFocusedWindow("window3");
                }
            });

            const int popupX = 40;
            const int popupY = 30;

            var additionalWindow = new ModalWindow("", path)
            {
                HeaderLine = "       Дополнительные сведения:"
            };
            const int offset = 120;

            for (var i = 2; i < 7; i++)
            {
                additionalWindow.Cells[1, i].X     -= offset;
                additionalWindow.Cells[0, i].Width -= offset;
                additionalWindow.Cells[1, i].Width  = offset;
            }

            additionalWindow.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_ok.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_ok_pr.raw"), popupX + 151, popupY)
            {
                OnRelease = () =>
                {
                    additionalWindow.IsVisible = false;
                    window.Invalidate();
                }
            });

            window.AddPopup(additionalWindow);

            window.AddChild(new RawButton("", Path.Combine(path, "RawButtons/bt_additional_info.raw"), Path.Combine(path, "RawButtons/bt_additional_info_pr.raw"), 350, 105)
            {
                OnRelease = () =>
                {
                    additionalWindow.IsVisible = true;
                    window.Invalidate();
                }
            });

            mMeasureController.Window7DataAction = (sample, aoa, oa, executor, date, startTime, endTime, totalTime, stability, Ebase, Esample, Emax, t) =>
            {
                table.Cells[1, 0].Text = sample;
                table.Cells[1, 1].Text = aoa;
                table.Cells[1, 2].Text = oa;
                table.Cells[1, 3].Text = executor;
                table.Cells[1, 4].Text = date;

                additionalWindow.Cells[0, 2].Text = "Затраченное время:";
                additionalWindow.Cells[1, 2].Text = totalTime;

                additionalWindow.Cells[0, 3].Text = "Начальный потенциал:";
                if (Ebase.HasValue)
                {
                    additionalWindow.Cells[1, 3].Text = Ebase.Value.ToString("F2") + " мВ";
                }
                else
                {
                    additionalWindow.Cells[1, 3].Text = "-";
                }


                additionalWindow.Cells[0, 4].Text = "Потенциал пробы:";
                if (Esample.HasValue)
                {
                    additionalWindow.Cells[1, 4].Text = Esample.Value.ToString("F2") + " мВ";
                }
                else
                {
                    additionalWindow.Cells[1, 4].Text = "-";
                }


                additionalWindow.Cells[0, 5].Text = "Макс. потенциал:";
                if (Emax.HasValue)
                {
                    additionalWindow.Cells[1, 5].Text = Emax.Value.ToString("F2") + " мВ";
                }
                else
                {
                    additionalWindow.Cells[1, 5].Text = "-";
                }
            };

            return(window);
        }
Exemple #3
0
        private static IWidget CreateWindow6_1(string path)
        {
            var window = new Window("window6_1", Path.Combine(path, @"generic/bg.raw"));

            // {Description = {Text = "Измерение потенциала системы с пробой"}};

            window.AddChild(new TextArea("window6_1_title", null, 10, 215, 400)
            {
                Color = { B = 1, G = 1, R = 1 },
                Text  = "Идет измерение потенциала",
                Size  = 16
            });

            var progressArea = new ProgressBarImages("bar", path, 10, 10)
            {
                Percent = 100, Text = "", TextColor = { B = 1, R = 1, G = 1 }
            };

            window.AddChild(progressArea);


            const int btnsX     = 350;
            const int btnsYBase = 100;
            const int btnsYStep = 70;

            window.AddChild(new RawButton("window_6_1_graphic", Path.Combine(path, "RawButtons/bt_graphic.raw"), Path.Combine(path, "RawButtons/bt_graphic_pr.raw"), btnsX, ToVgY(btnsYBase))
            {
                OnRelease = () => mMeasureController.ShowSampleGraphic()
            });

            var table = new TextTable("window6_1.table", 15, 60, new[] { 210, 100 }, TextTable.CreateOffset(5, 22), new[] { 4, 4 }, null, 16);

            table.Cells[0, 0].Text = "Потенциал";
            table.Cells[0, 1].Text = "Тип активности";
            table.Cells[0, 2].Text = "Стабильность потенциала";
            table.Cells[0, 3].Text = "Времени затрачено";
            table.Cells[0, 4].Text = "Времени осталось";

            window.AddChild(table);

            mMeasureController.Window61DataAction = (percent, status, potential, temperature, activity, stability, time, left) =>
            {
                progressArea.Percent = percent;
                progressArea.Text    = status;

                table.Cells[1, 0].Text = potential;
                table.Cells[1, 1].Text = activity;
                table.Cells[1, 2].Text = stability;
                table.Cells[1, 3].Text = time;
                table.Cells[1, 4].Text = left;

                window.Invalidate();
            };


            const int popupX = 40;
            const int popupY = 30;

            #region acceptPopup
            var acceptPopup = new ModalWindow("", path);
            acceptPopup.TextLines[1].Text = "    Принять текущее значение потенциала?";
            acceptPopup.TextLines[1].Size = 16;

            acceptPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_yes.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_yes_pr.raw"), popupX + 280, popupY)
            {
                OnRelease = () =>
                {
                    mMeasureController.StopSampleMeasure();
                    acceptPopup.IsVisible = false;

                    window.Invalidate();
                }
            });
            acceptPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_no.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_no_pr.raw"), popupX + 20, popupY)
            {
                OnRelease = () =>
                {
                    acceptPopup.IsVisible = false;

                    window.Invalidate();
                }
            });

            window.AddPopup(acceptPopup);
            #endregion

            window.AddChild(new RawButton("window_6_1_accept", Path.Combine(path, "RawButtons/bt_accept.raw"), Path.Combine(path, "RawButtons/bt_accept_pr.raw"), btnsX, 5)
            {
                OnRelease = () =>
                {
                    acceptPopup.IsVisible = true;
                    window.Invalidate();
                }
            });


            #region stopPopup
            var stopPopup = new ModalWindow("", path);
            stopPopup.TextLines[1].Text = "       Вы действительно хотите остановить";
            stopPopup.TextLines[1].Size = 16;
            stopPopup.TextLines[2].Text = "                       исследование?";
            stopPopup.TextLines[2].Size = 16;

            stopPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_yes.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_yes_pr.raw"), popupX + 280, popupY)
            {
                OnRelease = () =>
                {
                    mMeasureController.OnStopSampleMeasure();

                    stopPopup.IsVisible = false;

                    window.Invalidate();
                }
            });
            stopPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_no.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_no_pr.raw"), popupX + 20, popupY)
            {
                OnRelease = () =>
                {
                    stopPopup.IsVisible = false;

                    window.Invalidate();
                }
            });

            window.AddPopup(stopPopup);
            #endregion

            window.AddChild(new RawButton("window_6_1_stop", Path.Combine(path, "RawButtons/bt_stop.raw"), Path.Combine(path, "RawButtons/bt_stop_pr.raw"), btnsX, ToVgY(btnsYBase + btnsYStep))
            {
                OnRelease = () =>
                {
                    stopPopup.IsVisible = true;
                    window.Invalidate();
                }
            });

            window.OnShow = () =>
            {
                acceptPopup.IsVisible = false;
                stopPopup.IsVisible   = false;
            };

            return(window);
        }