Exemplo n.º 1
0
        private void DeSerial()
        {
            try
            {
                Bak.InstCol();
                string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

                ClassSerilization.DeSerialUserSetting100(out set);
                try
                {
                    md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам
                    XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection <Bak>));
                    using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "settingBAAK12-100.xml"))
                    {
                        Bak._DataColecBAAK100 = (ObservableCollection <Bak>)xs.Deserialize(wr);
                    }
                }
                catch (Exception)
                {
                    System.Windows.MessageBox.Show("Ошибка серилизации", "Ошибка");
                }
            }
            catch (Exception)
            {
                System.Windows.MessageBox.Show("Ошибка серилизации", "Ошибка");
            }
        }
Exemplo n.º 2
0
        private void DeSerial()
        {
            try
            {
                ClassTestRan.InstCol();

                ClassSerilization.DeSerialUserSetting100(out set);

                try
                {
                    string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

                    XmlSerializer xs1 = new XmlSerializer(typeof(ObservableCollection <ClassTestRan>));
                    using (StreamReader wr1 = new StreamReader(md + "\\UranSetUp\\" + "ClassTestRanSetting100.xml"))
                    {
                        ClassTestRan._DataColec2 = (ObservableCollection <ClassTestRan>)xs1.Deserialize(wr1);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Ошибка серилизации настроек тестового набора");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ошибка серилизации общих настроик");
            }
        }
Exemplo n.º 3
0
        public async Task DeSerial100()
        {
            ClassSerilization.DeSerialUserSetting100(out set);
            string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

            // using (FileStream fs = new FileStream("setting.dat", FileMode.Open))


            FileStream fs;

            try
            {
                ClassSerilization.DeSerialUserSetting100(out set);
                try
                {
                    XmlSerializer xs2 = new XmlSerializer(typeof(ObservableCollection <Bak>));
                    using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "settingBAAK12-100.xml"))
                    {
                        _DataColecBAAK12100 = (ObservableCollection <Bak>)xs2.Deserialize(wr);
                    }
                }
                catch (Exception ex)
                {
                }

                XmlSerializer xs1 = new XmlSerializer(typeof(ObservableCollection <ClassTestRan>));
                using (StreamReader wr1 = new StreamReader(md + "\\UranSetUp\\" + "ClassTestRanSetting100.xml"))
                {
                    _DataColecClassTestRan = (ObservableCollection <ClassTestRan>)xs1.Deserialize(wr1);
                }
            }

            catch (SerializationException)
            {
                MessageBox.Show("ошибка");
            }
            catch (Exception)
            {
                MessageBox.Show("ошибка");
            }

            finally
            {
                // fs.Close();
            }
        }
Exemplo n.º 4
0
        public PageSetRan100()
        {
            InitializeComponent();
            ClassSerilization.DeSerial(out setP);
            DeSerial();



            porogNO.Text = set.Porog.ToString();


            trgNO.Text = set.Trg.ToString();

            BuFlagMS.Toggled1 = !set.FlagMS;
            if (BuFlagMS.Toggled1 == true)
            {
                set.FlagMS = true;
                //  LabFlagMainR.Content = "Вкл";
                // LabFlagMainR.Foreground = System.Windows.Media.Brushes.Green;
            }
            else
            {
                set.FlagMS = false;
                //  LabFlagMainR.Content = "Выкл";
                //  LabFlagMainR.Foreground = System.Windows.Media.Brushes.Red;
            }
            lenght.Text = set.DataLenght.ToString();

            BuFlagMS.Toggled1 = !set.FlagMS;

            if (BuFlagTestRan.Toggled1 == true)
            {
                // set.FlagMainRezim = true;
                // LabFlagMainR.Content = "Вкл";
                // LabFlagMainR.Foreground = System.Windows.Media.Brushes.Green;
            }
            else
            {
                //  set.FlagMainRezim = false;
                //  LabFlagMainR.Content = "Выкл";
                //  LabFlagMainR.Foreground = System.Windows.Media.Brushes.Red;
            }
            list.ItemsSource = Bak._DataColecBAAK100;
        }
Exemplo n.º 5
0
 private void Serial()
 {
     ClassSerilization.SerialUserSetting100(set);
     UserSetting.Serial();
 }
Exemplo n.º 6
0
 private void Serial()
 {
     ClassSerilization.SerialUserSetting100(set);
     UserSetting.SerialBAA12_100();
     MessageBox.Show("Сохранено" + set.Trg.ToString());
 }
Exemplo n.º 7
0
        public NastroikiAll()
        {
            InitializeComponent();

            ClassSerilization.DeSerial(out set);


            BuFMR.Toggled1 = !set.FlagMainRezim;
            if (BuFMR.Toggled1 == true)
            {
                _DataColec = new ObservableCollection <Data1>
                {
                    new Data1 {
                        Name = "Установка", Pyti = "", Img = "/ImgSourse/stars18dp.png"
                    },
                    new Data1 {
                        Name = "Набор/Ran", Pyti = "", Img = "/ImgSourse/bike8dp.png"
                    },
                    new Data1 {
                        Name = "Плата BAAK", Pyti = "", Img = "/ImgSourse/board18dp.png"
                    },
                    new Data1 {
                        Name = "Данные", Pyti = "", Img = "/ImgSourse/assess18dp.png"
                    },
                    new Data1 {
                        Name = "Синхронизация", Pyti = "", Img = "/ImgSourse/alarm18dp.png"
                    },
                    new Data1 {
                        Name = "Параметры плат", Pyti = "", Img = "/ImgSourse/list18dp.png"
                    },
                    new Data1 {
                        Name = "Методический набор", Pyti = "", Img = "/ImgSourse/widg18dp.png"
                    },
                    new Data1 {
                        Name = "Метод отбора", Pyti = "", Img = "/ImgSourse/tur18dp.png"
                    },
                    new Data1 {
                        Name = "Визуализация", Pyti = "", Img = "/ImgSourse/tur18dp.png"
                    },
                    new Data1 {
                        Name = "BD_Data", Pyti = "", Img = "/ImgSourse/list18dp.png"
                    },
                    new Data1 {
                        Name = "О программе", Pyti = "",
                    }
                };
                listView1.ItemsSource = _DataColec;
            }
            else
            {
                //  ClassSetUpProgram.FlagMainRezim = false;


                _DataColec = new ObservableCollection <Data1>
                {
                    new Data1 {
                        Name = "Установка", Pyti = "", Img = "/ImgSourse/stars18dp.png"
                    },
                    new Data1 {
                        Name = "Набор/Ran", Pyti = "", Img = "/ImgSourse/bike8dp.png"
                    },
                    new Data1 {
                        Name = "Плата BAAK", Pyti = "", Img = "/ImgSourse/board18dp.png"
                    },
                    new Data1 {
                        Name = "Данные", Pyti = "", Img = "/ImgSourse/assess18dp.png"
                    },
                    new Data1 {
                        Name = "Синхронизация", Pyti = "", Img = "/ImgSourse/alarm18dp.png"
                    },
                    new Data1 {
                        Name = "Параметры плат", Pyti = "", Img = "/ImgSourse/list18dp.png"
                    },
                    new Data1 {
                        Name = "Методический набор", Pyti = "", Img = "/ImgSourse/widg18dp.png"
                    },
                    new Data1 {
                        Name = "О программе", Pyti = "",
                    }
                };
                listView1.ItemsSource = _DataColec;
            }

            //frameName.NavigationService.Navigate(new Uri("PageSetYstan.xaml", UriKind.Relative));
            // SetYstanovka();
        }
Exemplo n.º 8
0
        private void Bu_MouseLeftButtonDownFMR(object sender, MouseButtonEventArgs e)
        {
            if (BuFMR.Toggled1 == true)
            {
                set.FlagMainRezim = true;

                _DataColec = new ObservableCollection <Data1>
                {
                    new Data1 {
                        Name = "Установка", Pyti = "", Img = "/ImgSourse/stars18dp.png"
                    },
                    new Data1 {
                        Name = "Набор/Ran", Pyti = "", Img = "/ImgSourse/bike8dp.png"
                    },
                    new Data1 {
                        Name = "Плата BAAK", Pyti = "", Img = "/ImgSourse/board18dp.png"
                    },
                    new Data1 {
                        Name = "Данные", Pyti = "", Img = "/ImgSourse/assess18dp.png"
                    },
                    new Data1 {
                        Name = "Синхронизация", Pyti = "", Img = "/ImgSourse/alarm18dp.png"
                    },
                    new Data1 {
                        Name = "Параметры плат", Pyti = "", Img = "/ImgSourse/list18dp.png"
                    },
                    new Data1 {
                        Name = "Методический набор", Pyti = "", Img = "/ImgSourse/widg18dp.png"
                    },
                    new Data1 {
                        Name = "Метод отбора", Pyti = "", Img = "/ImgSourse/tur18dp.png"
                    },
                    new Data1 {
                        Name = "Визуализация", Pyti = "", Img = "/ImgSourse/tur18dp.png"
                    },
                    new Data1 {
                        Name = "О программе", Pyti = "",
                    }
                };
                listView1.ItemsSource = _DataColec;
            }
            else
            {
                set.FlagMainRezim = false;

                _DataColec = new ObservableCollection <Data1>
                {
                    new Data1 {
                        Name = "Установка", Pyti = "", Img = "/ImgSourse/stars18dp.png"
                    },
                    new Data1 {
                        Name = "Набор/Ran", Pyti = "", Img = "/ImgSourse/bike8dp.png"
                    },
                    new Data1 {
                        Name = "Плата BAAK", Pyti = "", Img = "/ImgSourse/board18dp.png"
                    },
                    new Data1 {
                        Name = "Данные", Pyti = "", Img = "/ImgSourse/assess18dp.png"
                    },
                    new Data1 {
                        Name = "Синхронизация", Pyti = "", Img = "/ImgSourse/alarm18dp.png"
                    },
                    new Data1 {
                        Name = "Параметры плат", Pyti = "", Img = "/ImgSourse/list18dp.png"
                    },
                    new Data1 {
                        Name = "Методический набор", Pyti = "", Img = "/ImgSourse/widg18dp.png"
                    },
                    new Data1 {
                        Name = "О программе", Pyti = "",
                    }
                };
                listView1.ItemsSource = _DataColec;
            }
            ClassSerilization.SerialProg(set);
            ListView1_SelectionChanged(null, null);
        }
Exemplo n.º 9
0
 private void Serial()
 {
     ClassSerilization.SerialUserSetting100(set);
     // UserSetting.Serial();
     ClassTestRan.Serial100();//сохраняем настройки методического набора и коллекцию
 }
Exemplo n.º 10
0
 private void DeSerial()
 {
     ClassSerilization.DeSerialUserSetting200(out set);
 }
Exemplo n.º 11
0
 private void Serial()
 {
     ClassSerilization.SerialUserSetting200(set);
     UserSetting.Serial();
     System.Windows.MessageBox.Show("Настройки удачно сохранены", "Сохранение");
 }
Exemplo n.º 12
0
        public async Task DeSerial200()
        {
            string md = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

            // using (FileStream fs = new FileStream("setting.dat", FileMode.Open))


            FileStream fs;

            try
            {
                ClassSerilization.DeSerialUserSetting200(out set);

                XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection <Bak>));
                using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "setting1.xml"))
                {
                    _DataColec1 = (ObservableCollection <Bak>)xs.Deserialize(wr);
                }
                try
                {
                    XmlSerializer xs2 = new XmlSerializer(typeof(ObservableCollection <Bak>));
                    using (StreamReader wr = new StreamReader(md + "\\UranSetUp\\" + "settingBAAK12-100.xml"))
                    {
                        _DataColecBAAK12100 = (ObservableCollection <Bak>)xs2.Deserialize(wr);
                    }
                }
                catch (Exception ex)
                {
                }
                XmlSerializer xs1 = new XmlSerializer(typeof(ObservableCollection <ClassTestRan>));
                using (StreamReader wr1 = new StreamReader(md + "\\UranSetUp\\" + "ClassTestRanSetting1.xml"))
                {
                    _DataColecClassTestRan = (ObservableCollection <ClassTestRan>)xs1.Deserialize(wr1);
                }
            }

            catch (SerializationException)
            {
                MessageBox.Show("ошибка");
            }
            catch (Exception)
            {
                MessageBox.Show("ошибка");
            }

            finally
            {
                // fs.Close();
            }

            try
            {
                string md1 = Environment.GetFolderPath(Environment.SpecialFolder.Personal);//путь к Документам

                FileStream fs1 = new FileStream(md1 + "\\UranSetUp\\" + "ClassOtborNeutron.dat", FileMode.Open);
                try
                {
                    BinaryFormatter bf = new BinaryFormatter();
                    otbN = (ClassOtborNeutron)bf.Deserialize(fs1);
                }
                catch (SerializationException)
                {
                    System.Windows.MessageBox.Show("ошибка");
                }
                finally
                {
                    fs1.Close();
                }
            }
            catch (Exception)
            {
                System.Windows.MessageBox.Show("Ошибка серилизации");
            }
        }