Exemplo n.º 1
0
        public QuestionWindow()
        {
            Grid QuestionWindowGrid = new Grid();
            QuestionWindowGrid.Name = "QuestionWindow";

            MyLabel EndAddingLiquid_lbl = new MyLabel("EndAddingLiqiud_lbl", "Вы действительно хотите отменить добавление новой жидкости?");

            MyButton yesButton = new MyButton("yesButton", 50, 0, 0, 10, 10, "Да");
            yesButton.HorizontalAlignment = HorizontalAlignment.Right;
            yesButton.VerticalAlignment = VerticalAlignment.Bottom;
            yesButton.Height = 23;
            yesButton.Click += yesButton_Click;

            MyButton noButton = new MyButton("noButton", 50, 0, 0, 65, 10, "Нет");
            noButton.HorizontalAlignment = HorizontalAlignment.Right;
            noButton.VerticalAlignment = VerticalAlignment.Bottom;
            noButton.Height = 23;
            noButton.Click += noButton_Click;

            QuestionWindowGrid.Children.Add(EndAddingLiquid_lbl);
            QuestionWindowGrid.Children.Add(yesButton);
            QuestionWindowGrid.Children.Add(noButton);

            Content = QuestionWindowGrid;
            Width = 400;
            Height = 100;
            Title = "Отмена добавления новой жидкости";
        }
Exemplo n.º 2
0
        private void Liquid_Add_Click(object sender, RoutedEventArgs e)
        {
            MyButton OK_Add_Liquid = new MyButton()
                {
                    Name = "OK_Add_Liquid",
                    Width = 100,
                    Height = 30,
                    HorizontalAlignment = HorizontalAlignment.Right,
                    VerticalAlignment = VerticalAlignment.Bottom,
                    Margin = new Thickness(0, 0, 30, 30),
                    Content = "Добавить"
                };
                OK_Add_Liquid.Click += OK_Add_Liquid_Click;

                MyButton Help_Add_Liquid = new MyButton()
                {
                    Name = "Help_Add_Liquid",
                    Width = 100,
                    Height = 30,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Bottom,
                    Margin = new Thickness(30, 0, 0, 30),
                    Content = "Помощь"
                };
                Help_Add_Liquid.Click += Help_Add_Liquid_Click;

                MyButton Cancel_Add_Liquid = new MyButton()
                {
                    Name = "Cancel_Add_Liquid",
                    Width = 100,
                    Height = 30,
                    HorizontalAlignment = HorizontalAlignment.Right,
                    VerticalAlignment = VerticalAlignment.Bottom,
                    Margin = new Thickness(0, 0, 140, 30),
                    Content = "Отменить"
                };
                Cancel_Add_Liquid.Click += Cancel_Add_Liquid_Click;

                MyLabel New_Liquid_Name_lbl = new MyLabel()
                {
                    Width = 160,
                    Height = 28,
                    Name = "New_Liquid_Name_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(30, 130, 0, 0),
                    Content = "Название жидкости:"
                };

                MyTextBox New_Liquid_Name = new MyTextBox()
                {
                    MinWidth = 100,
                    Name = "New_Liquid_Name",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(150, 130, 0, 0)
                };

                MyLabel New_Liquid_Name_Help = new MyLabel()
                {
                    Height = 28,
                    Name = "New_Liquid_Name_Help",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(30, 155, 0, 0),
                    Content = "Пример: 'Ацетон'; 'Азотная кислота, 50%'"
                };

                MyLabel New_Chemical_Formula_lbl = new MyLabel()
                {
                    Width = 170,
                    Height = 28,
                    Name = "New_Chemical_Formula_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(350, 130, 0, 0),
                    Content = "Химическая формула:"
                };

                MyTextBox New_Chemical_Formula = new MyTextBox()
                {
                    Width = 100,
                    Name = "New_Chemical_Formula",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(480, 130, 0, 0)
                };

                MyLabel New_Chemical_Formula_Help = new MyLabel()
                {
                    Height = 28,
                    Name = "New_Chemical_Formula_Help",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(370, 155, 0, 0),
                    Content = "Пример: 'CH3COCH3', 'NH3', 'HNO3'"
                };

                MyLabel New_Molar_Mass_lbl = new MyLabel()
                {
                    Name = "New_Molar_Mass_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(655, 130, 0, 0),
                    Content = "Молярная масса:"
                };

                MyTextBox New_Molar_Mass = new MyTextBox()
                {
                    Width = 100,
                    Name = "New_Molar_Mass",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(760, 130, 0, 0),
                };

                MyLabel New_Molar_Mass_Help = new MyLabel()
                {
                    Height = 28,
                    Name = "New_Molar_Mass_Help",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(700, 155, 0, 0),
                    Content = "Пример: '63,01', '17,03'"
                };

                MyLabel Table_Data_lbl = new MyLabel()
                {
                    Name = "Table_Data_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(430, 190, 0, 0),
                    Content = "Зависимости"
                };

                MyLabel New_Temp_Viscosity_lbl = new MyLabel()
                {
                    Name = "New_Temp_Viscosity_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(70, 210, 0, 0),
                    Content = "Вязкость от температуры"
                };

                MyLabel New_Temp_Density_lbl = new MyLabel()
                {
                    Name = "New_Temp_Density_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(390, 210, 0, 0),
                    Content = "Плотность от температуры"
                };

                MyLabel New_Pressure_BoilingPoint_lbl = new MyLabel()
                {
                    Name = "New_Pressure_BoilingPoint_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(685, 210, 0, 0),
                    Content = "Точка кипения от давления"
                };

                MyLabel First_Temperature_lbl = new MyLabel()
                {
                    Name = "First_Temperature_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(40, 240, 0, 0),
                    Content = "Температура"
                };

                MyTextBox First_Temperature = new MyTextBox()
                {
                    Width = 100,
                    Name = "First_Temperature",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(30, 260, 0, 0)
                };

                MyLabel First_Viscosity_lbl = new MyLabel()
                {
                    Name = "First_Viscosity_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(165, 240, 0, 0),
                    Content = "Вязкость"
                };

                MyTextBox First_Viscosity = new MyTextBox()
                {
                    Width = 100,
                    Name = "First_Viscosity",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(145, 260, 0, 0)
                };

                MyLabel Second_Temperature_lbl = new MyLabel()
                {
                    Name = "Second_Temperature_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(370, 240, 0, 0),
                    Content = "Температура"
                };

                MyTextBox Second_Temperature = new MyTextBox()
                {
                    Width = 100,
                    Name = "Second_Temperature",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(360, 260, 0, 0)
                };

                MyLabel Second_Density_lbl = new MyLabel()
                {
                    Name = "Second_Density_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(490, 240, 0, 0),
                    Content = "Плотность"
                };

                MyTextBox Second_Density = new MyTextBox()
                {
                    Width = 100,
                    Name = "Second_Density",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(475, 260, 0, 0)
                };

                MyLabel Third_Pressure_lbl = new MyLabel()
                {
                    Name = "Third_Pressure_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(675, 240, 0, 0),
                    Content = "Давление"
                };

                MyTextBox Third_Pressure = new MyTextBox()
                {
                    Width = 100,
                    Name = "Third_Pressure",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(655, 260, 0, 0)
                };

                MyLabel Third_Temperature_lbl = new MyLabel()
                {
                    Name = "Third_Temperature_lbl",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(775, 240, 0, 0),
                    Content = "Точка кипения"
                };

                MyTextBox Third_Temperature = new MyTextBox()
                {
                    Width = 100,
                    Name = "Third_Temperature",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(770, 260, 0, 0)
                };

                MyButton Add_Temp_Viscosity = new MyButton()
                {
                    Width = 120,
                    Name = "Add_Temp_Viscosity",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(75, 285, 0, 0),
                    Content = "Добавить точку"
                };
                Add_Temp_Viscosity.Click += Add_Temp_Viscosity_Click;

                MyButton Add_Temp_Density = new MyButton()
                {
                    Width = 120,
                    Name = "Add_Temp_Density",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(405, 285, 0, 0),
                    Content = "Добавить точку"
                };
                Add_Temp_Density.Click += Add_Temp_Density_Click;

                MyButton Add_Pressure_BoilingPoint = new MyButton()
                {
                    Width = 120,
                    Name = "Add_Pressure_BoilingPoint",
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Margin = new Thickness(705, 285, 0, 0),
                    Content = "Добавить точку"
                };
                Add_Pressure_BoilingPoint.Click += Add_Pressure_BoilingPointy_Click;

                Grid Grid_Add_Liquid = new Grid();
                Grid_Add_Liquid.Name = "Grid_Add_Liquid";

                Grid_Add_Liquid.Children.Add(New_Liquid_Name_lbl);
                Grid_Add_Liquid.Children.Add(New_Liquid_Name);
                Grid_Add_Liquid.Children.Add(New_Liquid_Name_Help);
                Grid_Add_Liquid.Children.Add(New_Chemical_Formula_lbl);
                Grid_Add_Liquid.Children.Add(New_Chemical_Formula);
                Grid_Add_Liquid.Children.Add(New_Chemical_Formula_Help);
                Grid_Add_Liquid.Children.Add(New_Molar_Mass_lbl);
                Grid_Add_Liquid.Children.Add(New_Molar_Mass);
                Grid_Add_Liquid.Children.Add(New_Molar_Mass_Help);
                Grid_Add_Liquid.Children.Add(OK_Add_Liquid);
                Grid_Add_Liquid.Children.Add(Cancel_Add_Liquid);
                Grid_Add_Liquid.Children.Add(Help_Add_Liquid);
                Grid_Add_Liquid.Children.Add(Table_Data_lbl);
                Grid_Add_Liquid.Children.Add(New_Temp_Viscosity_lbl);
                Grid_Add_Liquid.Children.Add(New_Temp_Density_lbl);
                Grid_Add_Liquid.Children.Add(New_Pressure_BoilingPoint_lbl);
                Grid_Add_Liquid.Children.Add(First_Temperature_lbl);
                Grid_Add_Liquid.Children.Add(First_Temperature);
                Grid_Add_Liquid.Children.Add(First_Viscosity_lbl);
                Grid_Add_Liquid.Children.Add(First_Viscosity);
                Grid_Add_Liquid.Children.Add(Second_Temperature_lbl);
                Grid_Add_Liquid.Children.Add(Second_Temperature);
                Grid_Add_Liquid.Children.Add(Second_Density_lbl);
                Grid_Add_Liquid.Children.Add(Second_Density);
                Grid_Add_Liquid.Children.Add(Third_Pressure_lbl);
                Grid_Add_Liquid.Children.Add(Third_Pressure);
                Grid_Add_Liquid.Children.Add(Third_Temperature_lbl);
                Grid_Add_Liquid.Children.Add(Third_Temperature);
                Grid_Add_Liquid.Children.Add(Add_Temp_Viscosity);
                Grid_Add_Liquid.Children.Add(Add_Temp_Density);
                Grid_Add_Liquid.Children.Add(Add_Pressure_BoilingPoint);

                Window Window_Add_Liquid = new Window()
                {
                    Name = "Window_Add_Liquid",
                    Content = Grid_Add_Liquid,
                    Width = 900,
                    Height = 500,
                    Title = "Добавление новой жидкости"
                };

                Window_Add_Liquid.Show();
        }
Exemplo n.º 3
0
        public Window_Add_Liquid()
        {
            Grid Grid_Add_Liquid = new MyGrid();
                Grid_Add_Liquid.Name = "Grid_Add_Liquid";

                MyButton OK_Add_Liquid = new MyButton("OK_Add_Liquid", 150, 0, 0, 20, 7, "Добавить");
                OK_Add_Liquid.Height = 30;
                OK_Add_Liquid.HorizontalAlignment = HorizontalAlignment.Right;
                OK_Add_Liquid.VerticalAlignment = VerticalAlignment.Bottom;
                OK_Add_Liquid.Background = Brushes.DarkGreen;
                OK_Add_Liquid.Click += OK_Add_Liquid_Click;

                MyButton Help_Add_Liquid = new MyButton("Help_Add_Liquid", 70, 18, 0, 0, 7, "Справка");
                Help_Add_Liquid.Height = 30;
                Help_Add_Liquid.VerticalAlignment = VerticalAlignment.Bottom;
                Help_Add_Liquid.Background = Brushes.DarkGreen;
                Help_Add_Liquid.Click += Help_Add_Liquid_Click;
                /*
                MyButton Cancel_Add_Liquid = new MyButton("Cancel_Add_Liquid", 100, 0, 0, 140, 30, "Отменить");
                Cancel_Add_Liquid.Height = 30;
                Cancel_Add_Liquid.HorizontalAlignment = HorizontalAlignment.Right;
                Cancel_Add_Liquid.VerticalAlignment = VerticalAlignment.Bottom;
                Cancel_Add_Liquid.Click += Cancel_Add_Liquid_Click;
                */
                MyLabel New_Liquid_Name_lbl = new MyLabel("New_Liquid_Name_lbl",160, 30, 120, 0, 0, "Название вещества:");
                New_Liquid_Name_lbl.Height = 28;

                MyTextBox New_Liquid_Name = new MyTextBox("New_Liquid_Name", 100, 171, 121, 0, 0);

                MyLabel New_Liquid_Name_Help = new MyLabel("New_Liquid_Name_Help", 30, 145, 0, 0, "Пример: 'Ацетон'; 'Азотная кислота, 50%'", 10);

                MyLabel New_Chemical_Formula_lbl = new MyLabel("New_Chemical_Formula_lbl", 170, 332, 120, 0, 0, "Химическая формула:");

                MyTextBox New_Chemical_Formula = new MyTextBox("New_Chemical_Formula", 100, 483, 121, 0, 0);

                MyLabel New_Chemical_Formula_Help = new MyLabel("New_Chemical_Formula_Help", 332, 145, 0, 0, "Пример: 'CH3COCH3'; 'NH3', 'HNO3'", 10);

                MyLabel New_Molar_Mass_lbl = new MyLabel("New_Molar_Mass_lbl",640, 120, 0, 0,"Молярная масса:");

                MyTextBox New_Molar_Mass = new MyTextBox("New_Molar_Mass", 100, 760, 121, 0, 0);

                MyLabel New_Molar_Mass_Help = new MyLabel("New_Molar_Mass_Help", 640, 145, 0, 0, "Пример: '63.01'; '17.03'", 10);

                MyLabel Table_Data_lbl = new MyLabel("Table_Data_lbl", 397, 178, 0, 0,"Зависимости", 14);

                MyLabel New_Temp_Viscosity_lbl = new MyLabel("New_Temp_Viscosity_lbl",58, 210, 0, 0,"Вязкость от температуры");

                MyLabel New_Temp_Density_lbl = new MyLabel("New_Temp_Density_lbl",360, 210, 0, 0,"Плотность от температуры");

                MyLabel New_Pressure_BoilingPoint_lbl = new MyLabel("New_Pressure_BoilingPoint_lbl", 667, 210, 0, 0, "Точка кипения от давления");

                MyLabel First_Temperature_lbl = new MyLabel("First_Temperature_lbl",35, 240, 0, 0,"Температура");

                MyTextBox First_Temperature = new MyTextBox("First_Temperature_1", 100, 30, 260, 0, 0);

                MyLabel First_Viscosity_lbl = new MyLabel("First_Viscosity_lbl", 163, 240, 0, 0, "Вязкость");

                MyTextBox First_Viscosity = new MyTextBox("First_Viscosity_1", 100, 145, 260, 0, 0);

                MyLabel Second_Temperature_lbl = new MyLabel("Second_Temperature_lbl",343, 240, 0, 0,"Температура");

                MyTextBox Second_Temperature = new MyTextBox("Second_Temperature_1", 100, 337, 260, 0, 0);

                MyLabel Second_Density_lbl = new MyLabel("Second_Density_lbl",465, 240, 0, 0,"Плотность");

                MyTextBox Second_Density = new MyTextBox("Second_Density_1", 100, 452, 260, 0, 0);

                MyLabel Third_Pressure_lbl = new MyLabel("Third_Pressure_lbl", 660, 240, 0, 0,"Давление");

                MyTextBox Third_Pressure = new MyTextBox("Third_Pressure_1", 100, 645, 260, 0, 0);

                MyLabel Third_Temperature_lbl = new MyLabel("Third_Temperature_lbl",758, 240, 0, 0,"Точка кипения");

                MyTextBox Third_Temperature = new MyTextBox("Third_Temperature_1", 100, 760, 260, 0, 0);

                MyButton Add_Temp_Viscosity = new MyButton("Add_Temp_Viscosity", 120, 77, 285, 0, 0, "Добавить точку");
                Add_Temp_Viscosity.Click += Add_Temp_Viscosity_Click;

                MyButton Add_Temp_Density = new MyButton("Add_Temp_Density", 120, 385, 285, 0, 0, "Добавить точку");
                Add_Temp_Density.Click += Add_Temp_Density_Click;

                MyButton Add_Pressure_BoilingPoint = new MyButton("Add_Pressure_BoilingPoint", 120, 695, 285, 0, 0, "Добавить точку");
                Add_Pressure_BoilingPoint.Click += Add_Pressure_BoilingPointy_Click;

                Image Add_Liquid_Img_Top = new Image()
                {
                    Width = 900,
                    Height = 90,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Name = "Add_Liquid_Img_Top",
                    Margin = new Thickness(0, 0, 0, 0)
                };

                BitmapImage Add_Liquid_Img_Top_bi = new BitmapImage();
                Add_Liquid_Img_Top_bi.BeginInit();
                Add_Liquid_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Add_New_Liquid.jpg");
                Add_Liquid_Img_Top_bi.EndInit();
                Add_Liquid_Img_Top.Source = Add_Liquid_Img_Top_bi;

                Image Add_Liquid_Img_Bottom = new Image()
                {
                    Width = 900,
                    Height = 50,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    Name = "Add_Liquid_Img_Bottom",
                    Margin = new Thickness(0, 366, 0, 0)
                };

                BitmapImage Add_Liquid_Img_Bottom_bi = new BitmapImage();
                Add_Liquid_Img_Bottom_bi.BeginInit();
                Add_Liquid_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Bottom_First.jpg");
                Add_Liquid_Img_Bottom_bi.EndInit();
                Add_Liquid_Img_Bottom.Source = Add_Liquid_Img_Bottom_bi;

                Grid_Add_Liquid.Children.Add(Add_Liquid_Img_Top);//0
                Grid_Add_Liquid.Children.Add(New_Liquid_Name);//1
                Grid_Add_Liquid.Children.Add(New_Liquid_Name_Help);//2
                Grid_Add_Liquid.Children.Add(New_Chemical_Formula_lbl);//3
                Grid_Add_Liquid.Children.Add(New_Chemical_Formula);//4
                Grid_Add_Liquid.Children.Add(New_Chemical_Formula_Help);//5
                Grid_Add_Liquid.Children.Add(New_Molar_Mass_lbl);//6
                Grid_Add_Liquid.Children.Add(New_Molar_Mass);//7
                Grid_Add_Liquid.Children.Add(New_Molar_Mass_Help);//8
                Grid_Add_Liquid.Children.Add(Add_Liquid_Img_Bottom);//9
                Grid_Add_Liquid.Children.Add(OK_Add_Liquid);//10
                //Grid_Add_Liquid.Children.Add(Cancel_Add_Liquid);//11
                Grid_Add_Liquid.Children.Add(Help_Add_Liquid);//11
                Grid_Add_Liquid.Children.Add(Table_Data_lbl);//12
                Grid_Add_Liquid.Children.Add(New_Temp_Viscosity_lbl);//13
                Grid_Add_Liquid.Children.Add(New_Temp_Density_lbl);//14
                Grid_Add_Liquid.Children.Add(New_Pressure_BoilingPoint_lbl);//15
                Grid_Add_Liquid.Children.Add(First_Temperature_lbl);//16
                Grid_Add_Liquid.Children.Add(First_Temperature);//17
                Grid_Add_Liquid.Children.Add(First_Viscosity_lbl);//18
                Grid_Add_Liquid.Children.Add(First_Viscosity);//19
                Grid_Add_Liquid.Children.Add(Second_Temperature_lbl);//20
                Grid_Add_Liquid.Children.Add(Second_Temperature);//21
                Grid_Add_Liquid.Children.Add(Second_Density_lbl);//22
                Grid_Add_Liquid.Children.Add(Second_Density);//23
                Grid_Add_Liquid.Children.Add(Third_Pressure_lbl);//24
                Grid_Add_Liquid.Children.Add(Third_Pressure);//25
                Grid_Add_Liquid.Children.Add(Third_Temperature_lbl);//26
                Grid_Add_Liquid.Children.Add(Third_Temperature);//27
                Grid_Add_Liquid.Children.Add(Add_Temp_Viscosity);//28
                Grid_Add_Liquid.Children.Add(Add_Temp_Density);//29
                Grid_Add_Liquid.Children.Add(Add_Pressure_BoilingPoint);//30
                Grid_Add_Liquid.Children.Add(New_Liquid_Name_lbl);//31

                Name = "Window_Add_Liquid";
                Content = Grid_Add_Liquid;
                Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
                this.Icon = BitmapFrame.Create(iconUri);
                this.MinWidth = 908;
                this.MaxWidth = 908;
                this.MinHeight = 450;
                this.MaxHeight = 450;
                Title = "Добавление новой жидкости - EasyPACT";
        }
Exemplo n.º 4
0
        public Credits()
        {
            Image Credits_Img_Top = new Image()
            {
                Width = 450,
                Height = 45,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Credits_Img_Top",
                Margin = new Thickness(0, 0, 0, 0)
            };

            BitmapImage Credits_Img_Top_bi = new BitmapImage();
            Credits_Img_Top_bi.BeginInit();
            Credits_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Credits_Top.jpg");
            Credits_Img_Top_bi.EndInit();
            Credits_Img_Top.Source = Credits_Img_Top_bi;

            MyLabel University = new MyLabel("University", 20, 50, 0, 0, "Российский Химико-Технологический Университет", 15);

            MyLabel University_Name = new MyLabel("University_Name", 125, 70, 0, 0, "имени Д. И. Менделеева", 14);

            MyLabel Faculty = new MyLabel("Faculty", 30, 100, 0, 0, "Факультет Информационных Технологий и Управления", 13);

            MyLabel Work_Name = new MyLabel("Work_Name", 3, 137, 0, 0, "Курсовой проект по объектно-ориентированному программированию");

            MyLabel Students = new MyLabel("Students", 30, 170, 0, 0, "Выполнили студенты группы К-31");

            MyLabel Dima = new MyLabel("Dima", 95, 205, 0, 0, "Вильшанский Дмитрий Владимирович", 14);
            Dima.FontWeight = FontWeights.Bold;

            MyLabel Dima_Info = new MyLabel("Dima_Info", 95, 225, 0, 0, "Разработка расчетной части программы", 10);

            MyLabel Nikita = new MyLabel("Nikita", 95, 270, 0, 0, "Шорыгин Никита Валерьевич", 14);
            Nikita.FontWeight = FontWeights.Bold;

            MyLabel Nikita_Info = new MyLabel("Nikita_Info", 95, 290, 0, 0, "Разработка пользовательского интерфейса", 10);

            Image Dima_Photo = new Image()
            {
                Width = 60,
                Height = 60,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Dima_Photo",
                Margin = new Thickness(30, 198, 0, 0)
            };

            BitmapImage Dima_Photo_bi = new BitmapImage();
            Dima_Photo_bi.BeginInit();
            Dima_Photo_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Dima.png");
            Dima_Photo_bi.EndInit();
            Dima_Photo.Source = Dima_Photo_bi;

            Image Nikita_Photo = new Image()
            {
                Width = 60,
                Height = 60,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Nikita_Photo",
                Margin = new Thickness(30, 263, 0, 0)
            };

            BitmapImage Nikita_Photo_bi = new BitmapImage();
            Nikita_Photo_bi.BeginInit();
            Nikita_Photo_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Nikita.png");
            Nikita_Photo_bi.EndInit();
            Nikita_Photo.Source = Nikita_Photo_bi;

            MyLabel Supervisor = new MyLabel("Supervisor", 3, 335, 0, 0, "Руководитель проекта: Иванов Святослав Игоревич", 12);

            MyLabel Dean = new MyLabel("Dean", 3, 360, 0, 0, "Декан факультета: д.т.н., проф. Меньшутина Наталья Васильевна", 12);

            MyLabel Copyright = new MyLabel("Copyright", 3, 0, 0, -2, "Copyright 2012", 8);
            Copyright.VerticalAlignment = VerticalAlignment.Bottom;

            MyLabel AllRightsReserved = new MyLabel("", 3, 0, 0, -12, "Все права защищены", 8);
            AllRightsReserved.VerticalAlignment = VerticalAlignment.Bottom;

            MyButton Close_Credits = new MyButton("", 90, 0, 0, 5, 2, "З а к р ы т ь");
            Close_Credits.Height = 16;
            Close_Credits.FontSize = 7;
            Close_Credits.Background = Brushes.DarkGreen;
            Close_Credits.Foreground = Brushes.LightGray;
            Close_Credits.HorizontalAlignment = HorizontalAlignment.Right;
            Close_Credits.VerticalAlignment = VerticalAlignment.Bottom;
            Close_Credits.Click += Close_Credits_Click;

            Image Credits_Img_Bottom = new Image()
            {
                Width = 450,
                Height = 25,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Bottom,
                Name = "Credits_Img_Bottom",
                Margin = new Thickness(0, 0, 0, 0)
            };

            BitmapImage Credits_Img_Bottom_bi = new BitmapImage();
            Credits_Img_Bottom_bi.BeginInit();
            Credits_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Credits_Bottom.jpg");
            Credits_Img_Bottom_bi.EndInit();
            Credits_Img_Bottom.Source = Credits_Img_Bottom_bi;

            Grid container_Credits = new Grid();
            container_Credits.Name = "container_Credits";
            container_Credits.Children.Add(Credits_Img_Top);//0
            container_Credits.Children.Add(University);//1
            container_Credits.Children.Add(University_Name);//2
            container_Credits.Children.Add(Faculty);//3
            container_Credits.Children.Add(Work_Name);//4
            container_Credits.Children.Add(Students);//5
            container_Credits.Children.Add(Dima);//6
            container_Credits.Children.Add(Nikita);//7
            container_Credits.Children.Add(Dima_Photo);//8
            container_Credits.Children.Add(Dima_Info);//9
            container_Credits.Children.Add(Nikita_Photo);//10
            container_Credits.Children.Add(Nikita_Info);//11
            container_Credits.Children.Add(Supervisor);//12
            container_Credits.Children.Add(Credits_Img_Bottom);//13
            container_Credits.Children.Add(Dean);//14
            container_Credits.Children.Add(Copyright);//15
            container_Credits.Children.Add(AllRightsReserved);//16
            container_Credits.Children.Add(Close_Credits);//17

            this.MinWidth = 458;
            this.MinHeight = 460;
            this.MaxWidth = 458;
            this.MaxHeight = 460;
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);

            this.Content = container_Credits;
            this.Title = "Информация о разработчиках - EasyPACT";
        }
Exemplo n.º 5
0
        public ResistanceOut(EasyPACT.LiquidInPipeline lip_In, EasyPACT.LiquidInPipeline lip_Out, double Temperature_Out, double NK_dou, double VP)
        {
            this.lip_In = lip_In;
            this.lip_Out = lip_Out;
            this.Temperature_Out = Temperature_Out;
            this.NK_dou = NK_dou;
            this.VP = VP;

            Grid Grid_Add_Resistance = new MyGrid();
            Grid_Add_Resistance.Name = "Grid_Add_Resistance";

            MyLabel Pipe_Resist_In = new MyLabel("Pipe_Resist_In", 30, 100, 0, 0, "Нагнетательный трубопровод", 14);
            Pipe_Resist_In.FontWeight = FontWeights.Bold;

            MyLabel Local_Resistance_In_lbl = new MyLabel("Local_Resistance_In_lbl", 30, 140, 0, 0, "Местное сопротивление:");

            MyComboBox Local_Resistance_In = new MyComboBox("Local_Resistance_In_1", 200, 200, 142, 0, 0);
            Local_Resistance_In.Items.Add("Выберите сопротивление");
            Local_Resistance_In.Items.Add("Вход в трубу");
            Local_Resistance_In.Items.Add("Выход и трубы");
            Local_Resistance_In.Items.Add("Диафрагма");
            Local_Resistance_In.Items.Add("Отвод");
            Local_Resistance_In.Items.Add("Колено");
            Local_Resistance_In.Items.Add("Вентиль нормальный");
            //Local_Resistance_In.Items.Add("Вентиль прямоточный");
            //Local_Resistance_In.Items.Add("Кран пробочный");
            //Local_Resistance_In.Items.Add("Задвижка");
            Local_Resistance_In.SelectedIndex = 0;
            Local_Resistance_In.SelectionChanged += Local_Resistance_In_SelectionChanged;

            // Комбобоксы для сопротивлений

            MyComboBox First = new MyComboBox("First_1", 200, 410, 142, 0, 0);
            First.Visibility = Visibility.Hidden;

            MyComboBox Second = new MyComboBox("Second_1", 200, 620, 142, 0, 0);
            Second.Visibility = Visibility.Hidden;

            MyTextBox Third = new MyTextBox("Third_1", 200, 410, 142, 0, 0);
            Third.Visibility = Visibility.Hidden;
            /*
            MyLabel Number_Local_Resistance_In_lbl = new MyLabel("Number_Local_Resistance_In_lbl", 334, 100, 0, 0, "Количество:");

            MyTextBox Number_Local_Resistance_In = new MyTextBox("Number_Local_Resistance_In", 60, 425, 100, 0, 0);

            MyLabel Shtyk = new MyLabel("Shtyk", 489, 100, 0, 0, "штук.");

            MyLabel Size = new MyLabel("Size_1", 556, 100, 0, 0, "Размеры");

            MyComboBox Size_Choose = new MyComboBox("", 100, 620, 102, 0, 0);
            */
            MyButton Add_New_Local_Resistance = new MyButton("Add_New_Local_Resistance", 100, 100, 170, 0, 0, "Добавить");
            Add_New_Local_Resistance.Click += Add_New_Local_Resistance_Click;

            ScrollBar hSBar = new ScrollBar();
            hSBar.Orientation = Orientation.Vertical;
            hSBar.HorizontalAlignment = HorizontalAlignment.Right;
            hSBar.Width = 10;
            hSBar.Height = 200;
            hSBar.Minimum = 0;
            hSBar.Value = 0;
            hSBar.Scroll += scroll;
            hSBar.Visibility = Visibility.Hidden;

            MyButton Next_3 = new MyButton("Next_3", 150, 0, 0, 20, 7, "Далее");
            Next_3.HorizontalAlignment = HorizontalAlignment.Right;
            Next_3.VerticalAlignment = VerticalAlignment.Bottom;
            Next_3.Background = Brushes.DarkGreen;
            Next_3.FontSize = 12;
            Next_3.Foreground = Brushes.LightGray;
            Next_3.Click += Next_3_Click;

            MyButton Help_Add_Resistance = new MyButton("Help_Add_Resistance", 70, 18, 0, 0, 7, "Справка");
            Help_Add_Resistance.VerticalAlignment = VerticalAlignment.Bottom;
            Help_Add_Resistance.Background = Brushes.DarkGreen;
            Help_Add_Resistance.FontSize = 12;
            Help_Add_Resistance.Foreground = Brushes.LightGray;
            Help_Add_Resistance.Click += Help_Add_Resistance_Click;

            Image Resistance_Img_Top = new Image()
            {
                Width = 900,
                Height = 90,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Resistance_Img_Top",
                Margin = new Thickness(0, 0, 0, 0)
            };

            var Resistance_Img_Top_bi = new BitmapImage();
            Resistance_Img_Top_bi.BeginInit();
            Resistance_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Resists.jpg");

            Resistance_Img_Top_bi.EndInit();
            Resistance_Img_Top.Source = Resistance_Img_Top_bi;

            Image Resistance_Img_Bottom = new Image()
            {
                Width = 900,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Resistance_Img_Bottom",
                Margin = new Thickness(0, 366, 0, 0)
            };

            BitmapImage Resistance_Img_Bottom_bi = new BitmapImage();
            Resistance_Img_Bottom_bi.BeginInit();
            Resistance_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Bottom_First.jpg");
            Resistance_Img_Bottom_bi.EndInit();
            Resistance_Img_Bottom.Source = Resistance_Img_Bottom_bi;

            Grid_Add_Resistance.Children.Add(Local_Resistance_In_lbl);//0
            Grid_Add_Resistance.Children.Add(Local_Resistance_In);//1
            Grid_Add_Resistance.Children.Add(Add_New_Local_Resistance);//2
            Grid_Add_Resistance.Children.Add(hSBar);//3
            Grid_Add_Resistance.Children.Add(First);//4
            Grid_Add_Resistance.Children.Add(Second);//5
            Grid_Add_Resistance.Children.Add(Third);//6
            Grid_Add_Resistance.Children.Add(Resistance_Img_Bottom);//7
            Grid_Add_Resistance.Children.Add(Next_3);//8
            Grid_Add_Resistance.Children.Add(Help_Add_Resistance);//9
            Grid_Add_Resistance.Children.Add(Resistance_Img_Top);//10
            Grid_Add_Resistance.Children.Add(Pipe_Resist_In);//11

            this.Content = Grid_Add_Resistance;
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);
            this.MinHeight = 450;
            this.MinWidth = 900;
            this.MaxHeight = 450;
            this.MaxWidth = 900;
            this.Title = "Местные сопротивления - Нагнетательный трубопровод - EasyPACT";
        }
Exemplo n.º 6
0
        private void Add_New_Local_Resistance_Click(object sender, RoutedEventArgs e)
        {
            resistance_Count++;
            a_r += 30;
            var Grid_Add_Resistance = this.Content as MyGrid;
            var Add_New_Local_Resistance = Grid_Add_Resistance.Children[2] as MyButton;
            var hSBar = Grid_Add_Resistance.Children[3] as ScrollBar;

            Add_New_Local_Resistance.Margin = new Thickness(100, a_r, 0, 0);
            Add_New_Local_Resistance.but_top = a_r;
            a_r -= 30;

            MyLabel Local_Resistance_In_lbl = new MyLabel("Local_Resistance_In_lbl", 30, a_r, 0, 0, "Местные сопротивления:");

            MyComboBox Local_Resistance_In = new MyComboBox("Local_Resistance_In_" + resistance_Count.ToString(), 200, 200, a_r, 0, 0);
            Local_Resistance_In.Items.Add("Выберите сопротивление");
            Local_Resistance_In.Items.Add("Вход в трубу");
            Local_Resistance_In.Items.Add("Выход из трубы");
            Local_Resistance_In.Items.Add("Диафрагма");
            Local_Resistance_In.Items.Add("Отвод");
            Local_Resistance_In.Items.Add("Колено");
            Local_Resistance_In.Items.Add("Вентиль нормальный");
            //Local_Resistance_In.Items.Add("Вентиль прямоточный");
            //Local_Resistance_In.Items.Add("Кран пробочный");
            //Local_Resistance_In.Items.Add("Задвижка");
            Local_Resistance_In.SelectedIndex = 0;
            Local_Resistance_In.SelectionChanged += Local_Resistance_In_SelectionChanged;

            MyComboBox First = new MyComboBox("First_" + resistance_Count.ToString(), 200, 410, a_r, 0, 0);
            First.Visibility = Visibility.Hidden;

            MyComboBox Second = new MyComboBox("Second_" + resistance_Count.ToString(), 200, 620, a_r, 0, 0);
            Second.Visibility = Visibility.Hidden;

            MyTextBox Third = new MyTextBox("Third_" + resistance_Count.ToString(), 200, 410, a_r, 0, 0);
            Third.Visibility = Visibility.Hidden;
            /*
            MyLabel Number_Local_Resistance_In_lbl = new MyLabel("Number_Local_Resistance_In_lbl", 334, a_r, 0, 0, "Количество:");

            MyTextBox Number_Local_Resistance_In = new MyTextBox("Number_Local_Resistance_In", 60, 425, a_r, 0, 0);

            MyLabel Shtyk = new MyLabel("Shtyk", 489, a_r, 0, 0, "штук.");
            */
            Grid_Add_Resistance.Children.Add(Local_Resistance_In_lbl);
            Grid_Add_Resistance.Children.Add(Local_Resistance_In);
            Grid_Add_Resistance.Children.Add(First);
            Grid_Add_Resistance.Children.Add(Second);
            Grid_Add_Resistance.Children.Add(Third);

            //Grid_Add_Resistance.Children.Add(Number_Local_Resistance_In_lbl);
            //Grid_Add_Resistance.Children.Add(Number_Local_Resistance_In);
            //Grid_Add_Resistance.Children.Add(Shtyk);
            a_r += 30;
            /*
            if (a_r > 300)
            {
                hSBar.Visibility = Visibility.Visible;
                hSBar.Maximum = a_r - 300;
            }
            */
            if (resistance_Count == 7)
            {
                Add_New_Local_Resistance.Visibility = Visibility.Hidden;
                MessageBox.Show("Купите монитор побольше!");
            }
        }
Exemplo n.º 7
0
        public Window_Add_Solution()
        {
            Grid Grid_Add_Solution = new MyGrid();
            Grid_Add_Solution.Name = "Grid_Add_Solution";

            MyLabel Add_New_Solution_lbl = new MyLabel("Add_New_Solution_lbl", 30, 110, 0, 0, "Выберите компоненты, образующие смесь:");

            MyComboBox First_Compound = new MyComboBox("", 200, 30, 140, 0, 0);
            First_Compound.Items.Add("Выберите компонент");
            foreach (var a in Database.Query("select name from liquid_list")[0])
            {
                First_Compound.Items.Add(a);
            }
            First_Compound.Items.Add("Добавить жидкость...");
            First_Compound.SelectedIndex = 0;
            First_Compound.SelectionChanged += First_Compound_Selection_Changed;

            MyComboBox Second_Compound = new MyComboBox("", 200, 240, 140, 0, 0);
            Second_Compound.Items.Add("Выберите компонент");
            foreach (var a in Database.Query("select name from liquid_list")[0])
            {
                Second_Compound.Items.Add(a);
            }
            Second_Compound.SelectedIndex = 0;
            Second_Compound.SelectionChanged += Second_Compound_Selection_Changed;

            MyButton Add_New_Compound = new MyButton("Liquid_Add", 200, 30, 180, 0, 0, "Добавление новой жидкости");
            Add_New_Compound.Height = 30;
            Add_New_Compound.Background = Brushes.DarkGreen;
            Add_New_Compound.Foreground = Brushes.LightGray;
            Add_New_Compound.Visibility = Visibility.Hidden;
            Add_New_Compound.Click += Add_New_Compound_Click;

            MyButton Help = new MyButton("Help", 70, 18, 0, 0, 7, "Справка");
            Help.Height = 30;
            Help.HorizontalAlignment = HorizontalAlignment.Left;
            Help.VerticalAlignment = VerticalAlignment.Bottom;
            Help.Background = Brushes.DarkGreen;
            Help.Click += Help_Click;

            MyButton Solution_Add = new MyButton("Add_New_Compound", 150, 0, 0, 20, 7, "Добавить смесь");
            Solution_Add.Height = 30;
            Solution_Add.HorizontalAlignment = HorizontalAlignment.Right;
            Solution_Add.VerticalAlignment = VerticalAlignment.Bottom;
            Solution_Add.Background = Brushes.DarkGreen;
            Solution_Add.Click += Solution_Add_Click;
            /*
            MyButton Cancel_Solution_Add = new MyButton("Cancel_Solution_Add", 100, 0, 0, 140, 30, "Отменить");
            Cancel_Solution_Add.Height = 30;
            Cancel_Solution_Add.HorizontalAlignment = HorizontalAlignment.Right;
            Cancel_Solution_Add.VerticalAlignment = VerticalAlignment.Bottom;
            Cancel_Solution_Add.Click += Cancel_Solution_Add_Click;
            */

            Image Add_Solution_Img_Top = new Image()
            {
                Width = 650,
                Height = 90,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Add_Solution_Img_Top",
                Margin = new Thickness(0, 0, 0, 0)
            };

            BitmapImage Add_Solution_Img_Top_bi = new BitmapImage();
            Add_Solution_Img_Top_bi.BeginInit();
            Add_Solution_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_New_Solution_Top.jpg");
            Add_Solution_Img_Top_bi.EndInit();
            Add_Solution_Img_Top.Source = Add_Solution_Img_Top_bi;

            Image Add_Solution_Img_Bottom = new Image()
            {
                Width = 900,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Add_Solution_Img_Bottom",
                Margin = new Thickness(0, 366, 0, 0)
            };

            BitmapImage Add_Solution_Img_Bottom_bi = new BitmapImage();
            Add_Solution_Img_Bottom_bi.BeginInit();
            Add_Solution_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_New_Solution_Bottom.jpg");
            Add_Solution_Img_Bottom_bi.EndInit();
            Add_Solution_Img_Bottom.Source = Add_Solution_Img_Bottom_bi;

            Grid container_Solution = new Grid();
            container_Solution.Name = "container_Solution";

            container_Solution.Children.Add(Add_Solution_Img_Top);//0
            container_Solution.Children.Add(First_Compound);//1
            container_Solution.Children.Add(Second_Compound);//2
            container_Solution.Children.Add(Add_New_Compound);//3
            container_Solution.Children.Add(Add_New_Solution_lbl);//4
            container_Solution.Children.Add(Add_Solution_Img_Bottom);//5
            container_Solution.Children.Add(Help);//6
            container_Solution.Children.Add(Solution_Add);//7
            //container_Solution.Children.Add(Cancel_Solution_Add);//6

            this.Content = container_Solution;
            this.Title = "Добавление новой смеси - EasyPACT";
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);
            this.Width = 658;
            this.Height = 450;
            this.MinWidth = 658;
            this.MaxWidth = 658;
            this.MinHeight = 450;
            this.MaxHeight = 450;
        }
Exemplo n.º 8
0
        public MainWindow()
        {
            InitializeComponent();

            var inf = new CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
            System.Threading.Thread.CurrentThread.CurrentCulture = inf;
            inf.NumberFormat.NumberDecimalSeparator = ".";

            MyLabel Welcome = new MyLabel("Welcome", 30, 130, 0, 0, "Добро пожаловать в EasyPACT!", 16);

            MyLabel Task_lbl = new MyLabel("Task_lbl", 30, 175, 0, 0, "Задача, которую решает программа:", 13);

            MyLabel Task1 = new MyLabel("Task1", 50, 205, 0, 0, "Расчет теплообменного аппарата и насоса", 14);
            Task1.FontWeight = FontWeights.Bold;

            MyLabel Task2 = new MyLabel("Task2", 50, 230, 0, 0, "по заданным арматуре и состояниям жидкости на входе и на выходе из системы", 14);
            Task2.FontWeight = FontWeights.Bold;

            MyButton Next_0 = new MyButton("Next_0", 150, 0, 0, 20, 7, "Продолжить");
            Next_0.HorizontalAlignment = HorizontalAlignment.Right;
            Next_0.VerticalAlignment = VerticalAlignment.Bottom;
            Next_0.Background = Brushes.DarkGreen;
            Next_0.FontSize = 12;
            Next_0.Foreground = Brushes.LightGray;
            Next_0.Click += Next_0_Click;

            MyButton Help_Choose_Task = new MyButton("Help_Choose_Task", 80, 18, 0, 0, 7, "Разработчики");
            Help_Choose_Task.Foreground = Brushes.LightGray;
            Help_Choose_Task.VerticalAlignment = VerticalAlignment.Bottom;
            Help_Choose_Task.Background = Brushes.DarkGreen;
            Help_Choose_Task.FontSize = 10;
            Help_Choose_Task.Click += OpenCredits_Click;

            Image First_Img_Top = new Image()
            {
                Width = 900,
                Height = 90,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "First_Img_Top",
                Margin = new Thickness(0, 0, 0, 0)
            };

            BitmapImage First_Img_Top_bi = new BitmapImage();
            First_Img_Top_bi.BeginInit();
            First_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_First.jpg");
            First_Img_Top_bi.EndInit();
            First_Img_Top.Source = First_Img_Top_bi;

            Image First_Img_Bottom = new Image()
            {
                Width = 900,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "First_Img_Bottom",
                Margin = new Thickness(0, 366, 0, 0)
            };

            BitmapImage First_Img_Bottom_bi = new BitmapImage();
            First_Img_Bottom_bi.BeginInit();
            First_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Bottom_First.jpg");
            First_Img_Bottom_bi.EndInit();
            First_Img_Bottom.Source = First_Img_Bottom_bi;

            Grid Hello_Window = new Grid();
            Hello_Window.Name = "Hello_Window";
            Hello_Window.Children.Add(Welcome);
            Hello_Window.Children.Add(Task_lbl);
            Hello_Window.Children.Add(Task1);
            Hello_Window.Children.Add(Task2);
            Hello_Window.Children.Add(First_Img_Top);
            Hello_Window.Children.Add(First_Img_Bottom);
            Hello_Window.Children.Add(Next_0);
            Hello_Window.Children.Add(Help_Choose_Task);
            this.Content = Hello_Window;
            this.Title = "Выбор решаемой задачи - EasyPACT";
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);
            this.Width = 908;
            this.Height = 450;
            this.MinWidth = 908;
            this.MaxWidth = 908;
            this.MinHeight = 450;
            this.MaxHeight = 450;
        }
Exemplo n.º 9
0
        public Window_Add_Pipeline(EasyPACT.Liquid liq, double Temperature_Out, double NK_dou, double VP)
        {
            Grid Grid_Add_Pipeline = new MyGrid();
            Grid_Add_Pipeline.Name = "Grid_Add_Pipeline";

            this.liq = liq;
            this.Temperature_Out = Temperature_Out;
            this.NK_dou = NK_dou;
            this.VP = VP;

            MyButton Next_2 = new MyButton("Next_2", 150, 0, 0, 20, 7, "Продолжить");
            Next_2.Height = 30;
            Next_2.FontSize = 12;
            Next_2.Foreground = Brushes.LightGray;
            Next_2.HorizontalAlignment = HorizontalAlignment.Right;
            Next_2.VerticalAlignment = VerticalAlignment.Bottom;
            Next_2.Background = Brushes.DarkGreen;
            Next_2.Click += Next_2_Click;

            MyButton Help_Add_Pipeline = new MyButton("Help_Add_Liquid", 70, 18, 0, 0, 7, "Справка");
            Help_Add_Pipeline.Height = 30;
            Help_Add_Pipeline.Foreground = Brushes.LightGray;
            Help_Add_Pipeline.FontSize = 12;
            Help_Add_Pipeline.VerticalAlignment = VerticalAlignment.Bottom;
            Help_Add_Pipeline.Background = Brushes.DarkGreen;
            Help_Add_Pipeline.Click += Help_Add_Pipeline_Click;
            /*
            MyButton Cancel_Add_Pipeline = new MyButton("Cancel_Add_Pipeline", 100, 0, 0, 140, 30, "Отменить");
            Cancel_Add_Pipeline.Height = 30;
            Cancel_Add_Pipeline.HorizontalAlignment = HorizontalAlignment.Right;
            Cancel_Add_Pipeline.VerticalAlignment = VerticalAlignment.Bottom;
            //Cancel_Add_Liquid.Click += Cancel_Add_Liquid_Click;
            */
            //MyLabel Add_New_Pipeline_lbl = new MyLabel("Add_New_Pipeline_lbl", 30, 110, 0, 0, "Всасывающий трубопровод.", 14);

            MyLabel Pipeline_In_lbl = new MyLabel("Pipeline_In_lbl", 30, 100, 0, 0, "Всасывающий трубопровод", 16);
            Pipeline_In_lbl.FontWeight = FontWeights.Bold;

            MyLabel Pipeline_Type_lbl = new MyLabel("Pipeline_Type_lbl_1", 30, 140, 0, 0, "Тип трубопровода:");

            MyComboBox Pipeline_Type = new MyComboBox("Pipeline_Type_1", 460, 163, 142, 0, 0);
            foreach (var a in Database.Query("select name from XII")[0])
            {
                Pipeline_Type.Items.Add(a);
            }
            Pipeline_Type.SelectedIndex = 0;

            MyLabel Material_In_lbl = new MyLabel("Material_In_lbl_1", 633, 140, 0, 0, "Материал:");

            MyComboBox Material_In = new MyComboBox("Material_In_1", 150, 713, 142, 0, 0);
            foreach (var a in Database.Query("select name from XXVIII")[0])
            {
                Material_In.Items.Add(a);
            }
            Material_In.SelectedIndex = 32;

            MyLabel Length_In_lbl = new MyLabel("Length_In_lbl_1", 30, 170, 0, 0, "Длина:");

            MyTextBox Length_In = new MyTextBox("Length_In_1", 60, 88, 172, 0, 0);

            MyComboBox Length_In_Measure_Choose = new MyComboBox("Length_In_Measure_Choose_1", 120, 153, 172, 0, 0);
            Length_In_Measure_Choose.SelectedIndex = 0;
            Length_In_Measure_Choose.Items.Add("м");
            Length_In_Measure_Choose.Items.Add("см");
            Length_In_Measure_Choose.Items.Add("мм");
            Length_In_Measure_Choose.SelectedIndex = 0;
            //Length_In_Measure_Choose.SelectionChanged += Length_In_Measure_Choose_SelectionChanged;

            MyLabel Length_In_Help = new MyLabel("Length_In_Help", 82, 197, 0, 0, "Пример: '20'; '33.1'; '10.83'", 10);

            MyLabel Diameter_In_lbl = new MyLabel("Diameter_lbl_1", 283, 170, 0, 0, "Диаметр:");

            MyTextBox Diameter_In = new MyTextBox("Diameter_In_1", 60, 360, 172, 0, 0);

            MyComboBox Diameter_In_Measure_Choose = new MyComboBox("Diameter_In_Measure_Choose_1", 120, 425, 172, 0, 0);
            Diameter_In_Measure_Choose.SelectedIndex = 0;
            Diameter_In_Measure_Choose.Items.Add("м");
            Diameter_In_Measure_Choose.Items.Add("см");
            Diameter_In_Measure_Choose.Items.Add("мм");
            Diameter_In_Measure_Choose.SelectedIndex = 0;
            //Diameter_In_Measure_Choose.SelectionChanged += Diameter_In_Measure_Choose_SelectionChanged;

            MyLabel Diameter_In_Help = new MyLabel("Diameter_In_Help", 354, 197, 0, 0, "Пример: '12'; '23.1'; '65.34'", 10);

            MyLabel Wall_Width_In_lbl = new MyLabel("Wall_Width_In_lbl_1", 556, 170, 0, 0, "Толщина стенки:");

            MyTextBox Wall_Width_In = new MyTextBox("Wall_Width_In_1", 60, 678, 172, 0, 0);

            MyComboBox Wall_Width_In_Measure_Choose = new MyComboBox("Wall_Width_In_Measure_Choose_1", 120, 743, 172, 0, 0);
            Wall_Width_In_Measure_Choose.SelectedIndex = 0;
            Wall_Width_In_Measure_Choose.Items.Add("м");
            Wall_Width_In_Measure_Choose.Items.Add("см");
            Wall_Width_In_Measure_Choose.Items.Add("мм");
            Wall_Width_In_Measure_Choose.SelectedIndex = 0;
            //Wall_Width_In_Measure_Choose.SelectionChanged += Wall_Width_In_Measure_Choose_SelectionChanged;

            MyLabel Wall_Width_In_Help = new MyLabel("", 672, 197, 0, 0, "Пример: '2'; '3.4'; '12.15'", 10);

            // Нагнетающий

            MyLabel Pipeline_Out_lbl = new MyLabel("Pipeline_Out_lbl", 30, 230, 0, 0, "Нагнетательный трубопровод", 16);
            Pipeline_Out_lbl.FontWeight = FontWeights.Bold;

            MyLabel Pipeline_Out_Type_lbl = new MyLabel("Pipeline_Out_Type_lbl_1", 30, 270, 0, 0, "Тип трубопровода:");

            MyComboBox Pipeline_Out_Type = new MyComboBox("Pipeline_Out_Type_1", 460, 163, 272, 0, 0);
            foreach (var a in Database.Query("select name from XII")[0])
            {
                Pipeline_Out_Type.Items.Add(a);
            }
            Pipeline_Out_Type.SelectedIndex = 0;

            MyLabel Material_Out_lbl = new MyLabel("Material_Out_lbl_1", 633, 270, 0, 0, "Материал:");

            MyComboBox Material_Out = new MyComboBox("Material_Out_1", 150, 713, 272, 0, 0);
            foreach (var a in Database.Query("select name from XXVIII")[0])
            {
                Material_Out.Items.Add(a);
            }
            Material_Out.SelectedIndex = 32;

            MyLabel Length_Out_lbl = new MyLabel("Length_In_lbl_1", 30, 300, 0, 0, "Длина:");

            MyTextBox Length_Out = new MyTextBox("Length_Out_1", 60, 88, 302, 0, 0);

            MyComboBox Length_Out_Measure_Choose = new MyComboBox("Length_Out_Measure_Choose_1", 120, 153, 302, 0, 0);
            Length_Out_Measure_Choose.SelectedIndex = 0;
            Length_Out_Measure_Choose.Items.Add("м");
            Length_Out_Measure_Choose.Items.Add("см");
            Length_Out_Measure_Choose.Items.Add("мм");
            Length_Out_Measure_Choose.SelectedIndex = 0;
            //Length_In_Measure_Choose.SelectionChanged += Length_In_Measure_Choose_SelectionChanged;

            MyLabel Length_Out_Help = new MyLabel("Length_Out_Help", 82, 327, 0, 0, "Пример: '20'; '33.1'; '10.83'", 10);

            MyLabel Diameter_Out_lbl = new MyLabel("Diameter_Out_lbl_1", 283, 300, 0, 0, "Диаметр:");

            MyTextBox Diameter_Out = new MyTextBox("Diameter_Out_1", 60, 360, 302, 0, 0);

            MyComboBox Diameter_Out_Measure_Choose = new MyComboBox("Diameter_Out_Measure_Choose_1", 120, 425, 302, 0, 0);
            Diameter_Out_Measure_Choose.SelectedIndex = 0;
            Diameter_Out_Measure_Choose.Items.Add("м");
            Diameter_Out_Measure_Choose.Items.Add("см");
            Diameter_Out_Measure_Choose.Items.Add("мм");
            Diameter_Out_Measure_Choose.SelectedIndex = 0;
            //Diameter_Out_Measure_Choose.SelectionChanged += Diameter_Out_Measure_Choose_SelectionChanged;

            MyLabel Diameter_Out_Help = new MyLabel("Diameter_Out_Help", 354, 327, 0, 0, "Пример: '12'; '23.1'; '65.34'", 10);

            MyLabel Wall_Width_Out_lbl = new MyLabel("Wall_Width_Out_lbl_1", 556, 300, 0, 0, "Толщина стенки:");

            MyTextBox Wall_Width_Out = new MyTextBox("Wall_Width_Out_1", 60, 678, 302, 0, 0);

            MyComboBox Wall_Width_Out_Measure_Choose = new MyComboBox("Wall_Width_Out_Measure_Choose_1", 120, 743, 302, 0, 0);
            Wall_Width_Out_Measure_Choose.SelectedIndex = 0;
            Wall_Width_Out_Measure_Choose.Items.Add("м");
            Wall_Width_Out_Measure_Choose.Items.Add("cм");
            Wall_Width_Out_Measure_Choose.Items.Add("мм");
            Wall_Width_Out_Measure_Choose.SelectedIndex = 0;
            //Wall_Width_Out_Measure_Choose.SelectionChanged += Wall_Width_Out_Measure_Choose_SelectionChanged;

            MyLabel Wall_Width_Out_Help = new MyLabel("", 672, 327, 0, 0, "Пример: '2'; '3.4'; '12.15'", 10);
            /*
            MyLabel Pipeline_Out_Type_lbl = new MyLabel("Pipeline_Out_Type_lbl_1", 30, 110, 0, 0, "Тип трубопровода:");

            MyComboBox Pipeline_Out_Type = new MyComboBox("Pipeline_Out_Type_1", 460, 163, 112, 0, 0);
            foreach (var a in Database.Query("select name from XII")[0])
            {
                Pipeline_Type.Items.Add(a);
            }
            Pipeline_Type.SelectedIndex = 0;
            */

            /*
            MyButton Add_New_Pipe = new MyButton("Add_New_Pipe", 250, 30, 202, 0, 0, "Добавить новую трубу");
            Add_New_Pipe.Click += Add_New_Pipe_Click;
            */
            Image Add_Pipeline_Img_Top = new Image()
            {
                Width = 900,
                Height = 90,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Add_Pipeline_Img_Top",
                Margin = new Thickness(0, 0, 0, 0)
            };

            BitmapImage Add_Pipeline_Img_Top_bi = new BitmapImage();
            Add_Pipeline_Img_Top_bi.BeginInit();
            Add_Pipeline_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Pipe_Params.jpg");
            Add_Pipeline_Img_Top_bi.EndInit();
            Add_Pipeline_Img_Top.Source = Add_Pipeline_Img_Top_bi;

            Image Add_Pipeline_Img_Bottom = new Image()
            {
                Width = 900,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Add_Pipeline_Img_Bottom",
                Margin = new Thickness(0, 366, 0, 0)
            };

            BitmapImage Add_Pipeline_Img_Bottom_bi = new BitmapImage();
            Add_Pipeline_Img_Bottom_bi.BeginInit();
            Add_Pipeline_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Bottom_First.jpg");
            Add_Pipeline_Img_Bottom_bi.EndInit();
            Add_Pipeline_Img_Bottom.Source = Add_Pipeline_Img_Bottom_bi;

            /*
            var scrbr = new ScrollBar();
            scrbr.Orientation = Orientation.Vertical;
            scrbr.HorizontalAlignment = HorizontalAlignment.Right;
            scrbr.Width = 20;
            scrbr.Height = 100;
            scrbr.Scroll += scrbr_Scroll;
            */

            /*
            MyLabel Local_Resistance_In_lbl = new MyLabel("Local_Resistance_In_lbl", 30, 200, 0, 0, "Местные сопротивления:");

            MyComboBox Local_Resistance_In = new MyComboBox("Local_Resistance_In", 124, 200, 202, 0, 0);
            Local_Resistance_In.Items.Add("Всякая фигня");
            Local_Resistance_In.SelectedIndex = 0;

            MyLabel Number_Local_Resistance_In_lbl = new MyLabel("Number_Local_Resistance_In_lbl", 334, 200, 0, 0, "Количество:");

            MyTextBox Number_Local_Resistance_In = new MyTextBox("Number_Local_Resistance_In", 60, 425, 202, 0, 0);

            MyLabel Shtyk = new MyLabel("Shtyk", 489, 200, 0, 0, "штук.");

            MyLabel Size = new MyLabel("Size_1", 556, 200, 0, 0, "Размеры");

            MyComboBox Size_Choose = new MyComboBox("", 100, 620, 202, 0, 0);

            */

            Grid_Add_Pipeline.Children.Add(Add_Pipeline_Img_Top);//0
            Grid_Add_Pipeline.Children.Add(Add_Pipeline_Img_Bottom);//1
            Grid_Add_Pipeline.Children.Add(Next_2);//2
            Grid_Add_Pipeline.Children.Add(Help_Add_Pipeline);//3
            Grid_Add_Pipeline.Children.Add(Pipeline_Type);//4
            Grid_Add_Pipeline.Children.Add(Material_In_lbl);//5
            Grid_Add_Pipeline.Children.Add(Material_In);//6
            Grid_Add_Pipeline.Children.Add(Length_In_lbl);//7
            Grid_Add_Pipeline.Children.Add(Length_In);//8
            Grid_Add_Pipeline.Children.Add(Length_In_Measure_Choose);//9
            Grid_Add_Pipeline.Children.Add(Length_In_Help);//10
            Grid_Add_Pipeline.Children.Add(Diameter_In_lbl);//11
            Grid_Add_Pipeline.Children.Add(Diameter_In);//12
            Grid_Add_Pipeline.Children.Add(Diameter_In_Measure_Choose);//13
            Grid_Add_Pipeline.Children.Add(Diameter_In_Help);//14
            Grid_Add_Pipeline.Children.Add(Wall_Width_In_lbl);//15
            Grid_Add_Pipeline.Children.Add(Wall_Width_In);//16
            Grid_Add_Pipeline.Children.Add(Wall_Width_In_Measure_Choose);//17
            Grid_Add_Pipeline.Children.Add(Wall_Width_In_Help);//18
            Grid_Add_Pipeline.Children.Add(Pipeline_Type_lbl);//19

            // Нагнетающий
            Grid_Add_Pipeline.Children.Add(Pipeline_Out_Type_lbl);//20
            Grid_Add_Pipeline.Children.Add(Pipeline_Out_Type);//21
            Grid_Add_Pipeline.Children.Add(Material_Out_lbl);//22
            Grid_Add_Pipeline.Children.Add(Material_Out);//23
            Grid_Add_Pipeline.Children.Add(Length_Out_lbl);//24
            Grid_Add_Pipeline.Children.Add(Length_Out);//25
            Grid_Add_Pipeline.Children.Add(Length_Out_Measure_Choose);//26
            Grid_Add_Pipeline.Children.Add(Length_Out_Help);//27
            Grid_Add_Pipeline.Children.Add(Diameter_Out_lbl);//28
            Grid_Add_Pipeline.Children.Add(Diameter_Out);//29
            Grid_Add_Pipeline.Children.Add(Diameter_Out_Measure_Choose);//30
            Grid_Add_Pipeline.Children.Add(Diameter_Out_Help);//31
            Grid_Add_Pipeline.Children.Add(Wall_Width_Out_lbl);//32
            Grid_Add_Pipeline.Children.Add(Wall_Width_Out);//33
            Grid_Add_Pipeline.Children.Add(Wall_Width_Out_Measure_Choose);//34
            Grid_Add_Pipeline.Children.Add(Wall_Width_Out_Help);//35

            Grid_Add_Pipeline.Children.Add(Pipeline_In_lbl);//36
            Grid_Add_Pipeline.Children.Add(Pipeline_Out_lbl);//37

            Content = Grid_Add_Pipeline;
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);
            this.MinWidth = 908;
            this.MaxWidth = 908;
            this.MinHeight = 450;
            this.MaxHeight = 450;
            Title = "Добавление нового трубопровода - EasyPACT";
        }
Exemplo n.º 10
0
        public ResultWindow(double Temperature_Out, double NK_dou, double VP)
        {
            this.Temperature_Out = Temperature_Out;
            this.NK_dou = NK_dou;
            this.VP = VP;

            MyLabel proizv = new MyLabel("proizv", 270, 330, 0, 0, "Введите производительность насоса, кг/с:");

            MyTextBox proizv_txt = new MyTextBox("proizv_txt", 60, 560, 332, 0, 0);

            MyButton proizv_but = new MyButton("", 100, 630, 330, 0, 0, "Получить ответ");
            proizv_but.Background = Brushes.DarkGreen;
            proizv_but.Foreground = Brushes.LightGray;
            proizv_but.Height = 23;
            proizv_but.Visibility = Visibility.Visible;
            proizv_but.Click += proizv_but_Click;

            MyLabel Machine = new MyLabel("Machine", 270, 130, 0, 0, "Требуемый насос", 15);
            Machine.FontWeight = FontWeights.Bold;

            MyLabel MachineRes = new MyLabel("MachineRes", 270, 160, 0, 0, "");

            MyLabel TO = new MyLabel("TO", 270, 200, 0, 0, "Требуемый теплообменный аппарат", 15);
            TO.FontWeight = FontWeights.Bold;

            MyLabel TORes = new MyLabel("TORes", 270, 230, 0, 0, "");

            Image Result_Img_Top = new Image()
            {
                Width = 900,
                Height = 90,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Result_Img_Top",
                Margin = new Thickness(0, 0, 0, 0)
            };

            BitmapImage Result_Img_Top_bi = new BitmapImage();
            Result_Img_Top_bi.BeginInit();
            Result_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Results.jpg");
            Result_Img_Top_bi.EndInit();
            Result_Img_Top.Source = Result_Img_Top_bi;

            Image Result_Img_Bottom = new Image()
            {
                Width = 900,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "Result_Img_Bottom",
                Margin = new Thickness(0, 366, 0, 0)
            };

            BitmapImage Result_Img_Bottom_bi = new BitmapImage();
            Result_Img_Bottom_bi.BeginInit();
            Result_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Bottom_First.jpg");
            Result_Img_Bottom_bi.EndInit();
            Result_Img_Bottom.Source = Result_Img_Bottom_bi;

            Image Animation = new Image()
            {
                Width = 200,
                Height = 270,
                HorizontalAlignment = HorizontalAlignment.Left,
                Name = "Animation",
                Margin = new Thickness(10, 40, 0, 0)
            };

            BitmapImage Animation_bi = new BitmapImage();
            Animation_bi.BeginInit();
            Animation_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\Animation.png");
            Animation_bi.EndInit();
            Animation.Source = Animation_bi;

            MyButton Next_last = new MyButton("Next_last", 150, 0, 0, 20, 7, "Закрыть");
            Next_last.HorizontalAlignment = HorizontalAlignment.Right;
            Next_last.VerticalAlignment = VerticalAlignment.Bottom;
            Next_last.Background = Brushes.DarkGreen;
            Next_last.FontSize = 12;
            Next_last.Foreground = Brushes.LightGray;
            Next_last.Click += Next_last_Click;

            MyButton Cred = new MyButton("Cred", 80, 18, 0, 0, 7, "Разработчики");
            Cred.Foreground = Brushes.LightGray;
            Cred.VerticalAlignment = VerticalAlignment.Bottom;
            Cred.Background = Brushes.DarkGreen;
            Cred.FontSize = 10;
            Cred.Click += OpenCredits_Click;

            Grid ResultWindow = new MyGrid();
            ResultWindow.Name = "ResultWindow";
            ResultWindow.Children.Add(Result_Img_Top);//0
            ResultWindow.Children.Add(Result_Img_Bottom);//1
            ResultWindow.Children.Add(Animation);//2
            ResultWindow.Children.Add(Machine);//3
            ResultWindow.Children.Add(MachineRes);//4
            ResultWindow.Children.Add(TO);//5
            ResultWindow.Children.Add(TORes);//6
            ResultWindow.Children.Add(Next_last);//7
            ResultWindow.Children.Add(Cred);//8
            ResultWindow.Children.Add(proizv);//9
            ResultWindow.Children.Add(proizv_txt);//10
            ResultWindow.Children.Add(proizv_but);//11

            this.Content = ResultWindow;
            this.Title = "Вывод результатов - EasyPACT";
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);
            this.MinWidth = 908;
            this.MaxWidth = 908;
            this.MinHeight = 450;
            this.MaxHeight = 450;
        }
Exemplo n.º 11
0
        private void proizv_but_Click(object sender, RoutedEventArgs e)
        {
            var ResultWindow = this.Content as MyGrid;
            var proizv_txt = ResultWindow.Children[10] as MyTextBox;
            var MachineRes = ResultWindow.Children[4] as MyLabel;
            var TORes = ResultWindow.Children[6] as MyLabel;
            var proizv_but = ResultWindow.Children[11] as MyButton;

            double result = 0;
            if (double.TryParse(proizv_txt.Text, out result))
            {
                Network.Get().SetProductivity(result);
                if ((Network.Get().HeatExchanger == null) & (Network.Get().Pump == null))
                {
                    MyLabel SpeedIn = new MyLabel("SpeedIn", 10, 180, 0, 0, "", 10);

                    MyLabel SpeedOut = new MyLabel("SpeedOut", 100, 100, 0, 0, "", 10);

                    proizv_but.Visibility = Visibility.Hidden;
                    proizv_txt.IsEnabled = false;
                    try
                    {
                        Network.Get().ChooseHeatExchanger(Temperature_Out, Temperature_Out + 20);
                        TORes.Content = Network.Get().HeatExchanger.ToString();
                    }
                    catch
                    {
                        MessageBox.Show("Невозможно подобрать теплообменный аппарат");
                    }
                    try
                    {
                        Network.Get().ChooseCentrifugalPump(VP);
                        ResultWindow.Children.Add(new MyLabel("PumpFr", 42, 234, 0, 0, String.Format("{0:f2} об/с", Network.Get().Pump.FrequencyOfRotation), 10));//15
                        ResultWindow.Children.Add(new MyLabel("PumpPr", 44, 248, 0, 0, String.Format("{0:f2} кВт", Network.Get().Pump.Capacity), 10));
                        MachineRes.Content = Network.Get().Pump.ToString();
                    }
                    catch
                    {
                        MessageBox.Show("Невозможно подобрать насос");
                    }
                    ResultWindow.Children.Add(new MyLabel("SpeedIn", 10, 202, 0, 0, String.Format("{0:f2} м/с", Network.Get().VacuumLine.Speed), 10));//12
                    ResultWindow.Children.Add(new MyLabel("SpeedOut", 93, 93, 0, 0, String.Format("{0:f2} м/с", Network.Get().ForcingLine.Speed), 10));//13
                    ResultWindow.Children.Add(new MyLabel("TempIn", 30, 320, 0, 0, String.Format("{0:f2} C", Network.Get().VacuumLine.Liquid.Temperature), 10));//14
                    ResultWindow.Children.Add(new MyLabel("TempOut", 150, 140, 0, 0, String.Format("{0:f2} C", Temperature_Out), 10));
                }
            }
            else
            {
                MessageBox.Show("Введите числовое значение производительности в кг/с");
            }
        }
Exemplo n.º 12
0
        public Begin_Parameters()
        {
            //InitializeComponent();
            /*
            var inf = new CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
            System.Threading.Thread.CurrentThread.CurrentCulture = inf;
            inf.NumberFormat.NumberDecimalSeparator = ".";
            */
            MyLabel Liquid_type_lbl = new MyLabel("Liquid_type_lbl", 180, 211, 115, 0, 0, "Выберите тип жидкости:");

            MyComboBox Liquid_type = new MyComboBox("Liquid_type", 140, 380, 116, 12, 0);
            Liquid_type.Items.Add("Чистая жидкость");
            Liquid_type.Items.Add("Бинарная смесь");
            Liquid_type.SelectedIndex = 0;
            Liquid_type.SelectionChanged += Liquid_type_SelectionChanged;

            MyLabel Liquid_lbl = new MyLabel("Liquid_lbl", 527, 115, 0, 0, "Выберите жидкость:");

            MyComboBox Liquid = new MyComboBox("Liquid", 180, 670, 116, 0, 0);

            var a = Database.Query("select name,id from liquid_list");
            for (int i = 0; i < a[0].Count; i++)
            {
                Liquid.Items.Add(a[0][i]);
                id_str.Add(a[1][i]);
            }

            Liquid.Items.Add("Добавить жидкость...");
            Liquid.SelectedIndex = 0;

            Liquid.SelectionChanged += Liquid_SelectionChanged;

            MyLabel Liquid_parameters_lbl = new MyLabel("Liquid_parameters_lbl", 291, 157, 0, 0, "Параметры жидкости на входе", 14);

            MyLabel Pressure_lbl = new MyLabel("Pressure_lbl", 144, 590, 160, 0, 0, "Давление:");

            MyTextBox Pressure_Input = new MyTextBox("Pressure_Input", 88, 670, 160, 0, 0);

            MyComboBox Pressure_Measure_Choose = new MyComboBox("Pressure_Measure_Choose", 90, 760, 160, 0, 0);
            Pressure_Measure_Choose.SelectedIndex = 0;
            Pressure_Measure_Choose.Items.Add("мм рт.ст.");
            Pressure_Measure_Choose.Items.Add("МПа");
            Pressure_Measure_Choose.Items.Add("бар");
            //Pressure_Measure_Choose.SelectionChanged += Pressure_Measure_Choose_SelectionChanged;

            MyLabel Pressure_Input_Help = new MyLabel("Pressure_Input_Help", 665, 181, 0, 0, "Пример: '20'; '12.7'", 10);

            MyLabel Temperature_lbl = new MyLabel("Temperature_lbl", 574, 207, 0, 0, "Температура:");

            MyTextBox Temperature_Input = new MyTextBox("Temperature_Input", 88, 670, 207, 0, 0);

            MyComboBox Temperature_Measure_Choose = new MyComboBox("Temperature_Measure_Choose", 90, 760, 207, 0, 0);
            Temperature_Measure_Choose.SelectedIndex = 0;
            Temperature_Measure_Choose.Items.Add("Цельсий");
            Temperature_Measure_Choose.Items.Add("Кельвин"); ;
            //Temperature_Measure_Choose.SelectionChanged += Temperature_Measure_Choose_SelectionChanged;

            MyLabel Temperature_Input_Help = new MyLabel("Temperature_Input_Help", 665, 227, 0, 0, "Пример: '25'; '293.15'", 10);

            MyLabel Liquid_parameters_Out_lbl = new MyLabel("Liquid_parameters_Out_lbl", 281, 257, 0, 0, "Параметры жидкости на выходе", 14);
            /*
            MyLabel Pressure_Out_lbl = new MyLabel("Pressure_Out_lbl", 144, 590, 260, 0, 0, "Давление:");

            MyTextBox Pressure_Out_Input = new MyTextBox("Pressure_Out_Input", 88, 670, 260, 0, 0);

            MyComboBox Pressure_Out_Measure_Choose = new MyComboBox("Pressure_Out_Measure_Choose", 90, 760, 260, 0, 0);
            Pressure_Out_Measure_Choose.SelectedIndex = 0;
            Pressure_Out_Measure_Choose.Items.Add("МПа");
            Pressure_Out_Measure_Choose.Items.Add("мм.рт.ст.");
            Pressure_Out_Measure_Choose.Items.Add("бар");
            //Pressure_Out_Measure_Choose.SelectionChanged += Pressure_Out_Measure_Choose_SelectionChanged;
            */
            //MyLabel Pressure_Out_Input_Help = new MyLabel("Pressure_Out_Input_Help", 665, 281, 0, 0, "Пример: '20'; '12.7'", 10);

            MyLabel Temperature_Out_lbl = new MyLabel("Temperature_Out_lbl", 574, 260, 0, 0, "Температура:");

            MyTextBox Temperature_Out_Input = new MyTextBox("Temperature_Out_Input", 88, 670, 261, 0, 0);

            MyComboBox Temperature_Out_Measure_Choose = new MyComboBox("Temperature_Out_Measure_Choose", 90, 760, 261, 0, 0);
            Temperature_Out_Measure_Choose.SelectedIndex = 0;
            Temperature_Out_Measure_Choose.Items.Add("Цельсий");
            Temperature_Out_Measure_Choose.Items.Add("Кельвин"); ;
            //Temperature_Out_Measure_Choose.SelectionChanged += Temperature_Out_Measure_Choose_SelectionChanged;

            MyLabel NK_lbl = new MyLabel("NK_lbl", 601, 320, 0, 0, "Доля НК:");
            NK_lbl.Visibility = Visibility.Hidden;

            MyTextBox NK = new MyTextBox("NK", 88, 670, 321, 0, 0);
            NK.Visibility = Visibility.Hidden;

            MyLabel VysPod_lbl = new MyLabel("VysPod_lbl", 561, 290, 0, 0, "Высота подачи:");

            MyTextBox VysPod = new MyTextBox("VysPod", 88, 670, 291, 0, 0);

            MyLabel VysPod_Measure_lbl = new MyLabel("VysPod_Measure_lbl", 755, 290, 0, 0, "метров");

            //MyLabel Temperature_Out_Input_Help = new MyLabel("Temperature_Out_Input_Help", 665, 327, 0, 0, "Пример: '25'; '293.15'", 10);

            MyButton Next_1 = new MyButton("Next_1", 150, 0, 0, 20, 7, "Продолжить");
            Next_1.Height = 30;
            Next_1.Background = Brushes.DarkGreen;
            Next_1.Foreground = Brushes.LightGray;
            Next_1.FontSize = 12;
            Next_1.HorizontalAlignment = HorizontalAlignment.Right;
            Next_1.VerticalAlignment = VerticalAlignment.Bottom;
            Next_1.Click += Next_1_Click;

            MyButton Help = new MyButton("Help", 70, 18, 0, 0, 7, "Справка");
            Help.Height = 30;
            Help.Background = Brushes.DarkGreen;
            Help.HorizontalAlignment = HorizontalAlignment.Left;
            Help.VerticalAlignment = VerticalAlignment.Bottom;
            Help.Foreground = Brushes.LightGray;

            Help.Click += Help_Click;

            MyButton Liquid_Add = new MyButton("Liquid_Add", 180, 340, 0, 0, 60, "Добавление новой жидкости");
            Liquid_Add.Height = 30;
            Liquid_Add.Background = Brushes.DarkGreen;
            Liquid_Add.Foreground = Brushes.LightGray;
            Liquid_Add.VerticalAlignment = VerticalAlignment.Bottom;
            Liquid_Add.Visibility = Visibility.Hidden;
            Liquid_Add.Click += Liquid_Add_Click;

            MyButton Liquid_Solution_Add = new MyButton("Liquid_Add", 180, 340, 0, 0, 74, "Добавление новой смеси");
            Liquid_Solution_Add.Height = 30;
            Liquid_Solution_Add.Background = Brushes.DarkGreen;
            Liquid_Solution_Add.Foreground = Brushes.LightGray;
            Liquid_Solution_Add.VerticalAlignment = VerticalAlignment.Bottom;
            Liquid_Solution_Add.Visibility = Visibility.Hidden;
            Liquid_Solution_Add.Click += Liquid_Solution_Add_Click;

            Image Begin_Parameters_Img_Top = new Image()
            {
                Width = 900,
                Height = 90,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "First_Img_Top",
                Margin = new Thickness(0, 0, 0, 0),
                //Source = new BitmapSource(C:\EasyPACT\EasyPACT_Graphic\Images\favicon.gif)
            };

            BitmapImage Begin_Parameters_Img_Top_bi = new BitmapImage();
            Begin_Parameters_Img_Top_bi.BeginInit();
            Begin_Parameters_Img_Top_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Begin_Parameters_Top.jpg");
            Begin_Parameters_Img_Top_bi.EndInit();
            Begin_Parameters_Img_Top.Source = Begin_Parameters_Img_Top_bi;

            Image First_Img_Bottom = new Image()
            {
                Width = 900,
                Height = 50,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Top,
                Name = "First_Img_Bottom",
                Margin = new Thickness(0, 366, 0, 0),
                //Source = new BitmapSource(C:\EasyPACT\EasyPACT_Graphic\Images\favicon.gif)
            };

            BitmapImage First_Img_Bottom_bi = new BitmapImage();
            First_Img_Bottom_bi.BeginInit();
            First_Img_Bottom_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\EasyPACT_Bottom_First.jpg");
            First_Img_Bottom_bi.EndInit();
            First_Img_Bottom.Source = First_Img_Bottom_bi;

            Image Animation = new Image()
            {
                Width = 200,
                Height = 270,
                HorizontalAlignment = HorizontalAlignment.Left,
                Name = "Animation",
                Margin = new Thickness(10, 40, 0, 0)
            };

            BitmapImage Animation_bi = new BitmapImage();
            Animation_bi.BeginInit();
            Animation_bi.UriSource = new Uri(@"C:\EasyPACT\EasyPACT_Graphic\Animation.png");
            Animation_bi.EndInit();
            Animation.Source = Animation_bi;

            Grid container_1 = new Grid();
            container_1.Name = "container_1";
            container_1.Children.Add(First_Img_Bottom);//0
            container_1.Children.Add(Liquid_type);//1
            container_1.Children.Add(Liquid_lbl);//2
            container_1.Children.Add(Liquid);//3
            container_1.Children.Add(Liquid_parameters_lbl);//4
            container_1.Children.Add(Pressure_lbl);//5
            container_1.Children.Add(Pressure_Input);//6
            container_1.Children.Add(Pressure_Measure_Choose);//7
            container_1.Children.Add(Temperature_lbl);//8
            container_1.Children.Add(Temperature_Input);//9
            container_1.Children.Add(Temperature_Measure_Choose);//10
            container_1.Children.Add(Next_1);//11
            container_1.Children.Add(Liquid_type_lbl);//12
            //container_1.Children.Add(Help);//12!!!!!
            container_1.Children.Add(Liquid_Add);//13
            container_1.Children.Add(Liquid_Solution_Add);//14
            container_1.Children.Add(Pressure_Input_Help);//15
            container_1.Children.Add(Temperature_Input_Help);//16
            container_1.Children.Add(Begin_Parameters_Img_Top);//17
            container_1.Children.Add(Help);//18
            container_1.Children.Add(Liquid_parameters_Out_lbl);//19
            container_1.Children.Add(Temperature_Out_lbl);//20
            container_1.Children.Add(Temperature_Out_Input);//21
            container_1.Children.Add(Temperature_Out_Measure_Choose);//22
            container_1.Children.Add(Animation);//23
            container_1.Children.Add(NK_lbl);//24
            container_1.Children.Add(NK);//25
            container_1.Children.Add(VysPod_lbl);//26
            container_1.Children.Add(VysPod);//27
            container_1.Children.Add(VysPod_Measure_lbl);//28

            this.Content = container_1;

            this.Title = "Параметры жидкости - EasyPACT";
            Uri iconUri = new Uri("C://EasyPACT/EasyPACT_Graphic/EasyPACT_Icon.jpg", UriKind.RelativeOrAbsolute);
            this.Icon = BitmapFrame.Create(iconUri);
            this.Width = 908;
            this.Height = 450;
            this.MinWidth = 908;
            this.MaxWidth = 908;
            this.MinHeight = 450;
            this.MaxHeight = 450;
        }