Esempio n. 1
0
 /* constructor */
 public MainFrame(SignalFilter filter)
 {
     InitializeComponent();
     this.filter  = filter;
     stepNrString = stepNr.Text;
     simModeCombo.SelectedIndex    = 0;
     chosenCaseCombo.SelectedIndex = 0;
     weightsCombo.SelectedIndex    = 0;
     netSize                 = 0;
     ready                   = false;
     simInProgress           = false;
     initial                 = true;
     reseted                 = false;
     shifted                 = false;
     dataNoisy               = new ListDataSeries(netSize);
     dataNoisy.LineWidth     = 2f;
     dataNoisy.ForeColor     = Color.DarkGray;
     dataNoisy.AntiAlias     = true;
     dataClean               = new ListDataSeries(netSize);
     dataClean.LineWidth     = 2f;
     dataClean.ForeColor     = Color.Green;
     dataClean.AntiAlias     = true;
     dataProcessed           = new ListDataSeries(netSize);
     dataProcessed.LineWidth = 2f;
     dataProcessed.ForeColor = Color.Blue;
     dataProcessed.AntiAlias = true;
 }
        /*******************************************************************
         * Функция:         InitDataBook
         * назначение:      Визуальное отображение инициализации
         *
         * ********************************************************************/
        private void InitDataBook()
        {
            string tmpFolder;

            _pWindSplash = new Splash();

            _pWindSplash.Show();
            _pWindSplash.titleWrk.Content = "Распаковка файлов";
            //using (var extr = new SevenZipExtractor(Properties.Settings.Default.strFiledataName))
            //    _pWindSplash.pb_Extract2.Maximum = extr.ArchiveFileData.Count;

            //Extract();

            tmpFolder = _currentdirApplication + "\\db\\";
            //серии книг
            _pWindSplash.pb_Extract2.IsIndeterminate = true;
            _pWindSplash.titleWrk.Content            = "Распаковка серии книг";
            System.Windows.Forms.Application.DoEvents();
            _pTableSeries = new ListDataSeries(tmpFolder, Properties.Settings.Default.NameSeries);
            //анонс книг
            _pWindSplash.pb_Extract2.IsIndeterminate = true;
            _pWindSplash.titleWrk.Content            = "Распаковка аннотаций книг";
            System.Windows.Forms.Application.DoEvents();
            _pTableBookAnons = new ListDataBookAnons(tmpFolder, Properties.Settings.Default.ameBookanno);
            //список книг
            _pWindSplash.titleWrk.Content = "Распаковка названий книг";
            System.Windows.Forms.Application.DoEvents();
            _pTableBook = new ListDataBook(tmpFolder, Properties.Settings.Default.NameBook);
            //список авторов
            _pWindSplash.titleWrk.Content = "Распаковка авторов книг";
            System.Windows.Forms.Application.DoEvents();
            _pTableAuthor = new ListDataAuthor(tmpFolder, Properties.Settings.Default.NameAuthor);

            var queruAutorTmp = from autorName in _pTableAuthor.DataAuthorList
                                where autorName.Name.Substring(0, 1).Contains(_strFindCondishion)
                                select(autorName);

            listBox.ItemsSource   = queruAutorTmp;                              //указываем источник данных
            listBox.SelectedValue = listBox.Items[0];                           //выделяем первый элемент коллекции
            //спиок жанров
            _pWindSplash.titleWrk.Content = "Распаковка жанров книг";
            System.Windows.Forms.Application.DoEvents();
            _pTableBookTags = new ListDataBookTags(tmpFolder, Properties.Settings.Default.nameBooktags);

            _pWindSplash.Close();
        }
Esempio n. 3
0
        public Form1()
        {
            InitializeComponent();

            // Initialize the point chart.
            PointDataSeries pds = new PointDataSeries();

            chartPlotter1.DataSeries.Add(pds);
            chartPlotter1.VisibleRectangle = new RectangleF(-0.5f, -0.5f,
                                                            1.0f, 1.0f);

            // Initialize the "precomputed" linear function.
            ListDataSeries ds = new ListDataSeries(100);

            for (int i = 0; i < 100; i++)
            {
                float x = i / 10f - 5f;
                ds.Data.Add(new PointF(x, -x));
            }
            ds.ForeColor = Color.Red;
            chartPlotter2.DataSeries.Add(ds);

            // Initialize the "precomputed" sine function.
            ds           = new ListDataSeries(20);
            ds.LineWidth = 2.0f;
            for (int i = 0; i < 20; i++)
            {
                float x = i / 2.0f;
                ds.Data.Add(new PointF(x, 9 * (float)Math.Sin(x)));
            }
            ds.ForeColor = Color.Blue;
            chartPlotter2.DataSeries.Add(ds);

            // Initialize the linear function.
            ComputedDataSeries ds2 = new ComputedDataSeries();

            ds2.LineWidth = 3.0f;
            ds2.Function  = delegate(double x)
            {
                return(x);
            };
            ds2.ForeColor = Color.Green;
            chartPlotter2.DataSeries.Add(ds2);

            // Initialize the parametrized cosine function.
            ds2 = new ComputedDataSeries();
            ds2.FunctionObject = cosFun;
            ds2.AntiAlias      = true;
            chartPlotter2.DataSeries.Add(ds2);

            // Initialize some plots under the 2D surface.
            ds2          = new ComputedDataSeries();
            ds2.Function = delegate(double arg)
            {
                return(Math.Sin(arg) * 5.0);
            };
            ds2.LineWidth = 2;
            ds2.AntiAlias = true;
            //chartPlotter3.DataSeries.Add(ds2);

            // Initialize the 2D surface.
            Computed2DSeries ds3 = new Computed2DSeries();

            /*ds3.Function = delegate(double x, double y)
             * {
             *  return Color.FromArgb(
             *      (int)((Math.Cos(x / 2.0) + 1.0) * 127.5),
             *      (int)(Math.Abs(Math.Sin(x + y)) * 255.0),
             *      (int)(Math.Abs(Math.Sin(x - y)) * 255.0),
             *      (int)(Math.Abs(Math.Sin(y)) * 255.0));
             * };*/
            ds3.Function = delegate(double x, double y)
            {
                double x0 = x, y0 = y;
                double x2, y2;
                int    i = 255;

                while ((x2 = x * x) + (y2 = y * y) < 100.0 && i > 0)
                {
                    double xnew = x2 - y2 + x0;
                    double ynew = 2 * x * y + y0;
                    x = xnew;
                    y = ynew;
                    i--;
                }

                return(Color.FromArgb(i, i, i));
            };
            chartPlotter3.DataSeries.Add(ds3);
            chartPlotter3.VisibleRectangle = new RectangleF(-2f, -2f, 4f, 4f);

            // Initialize the network response function.
            CreateNetwork();
            ds3 = new Computed2DSeries();
            ds3.FunctionObject   = netFun;
            netFun.OutputOffset  = 0.5;
            netFun.OutputScale   = 0.5;
            netFun.NeuralNetwork = _network;
            chartPlotter4.DataSeries.Add(ds3);
            chartPlotter4.VisibleRectangle = new RectangleF(-1.0f, -1.0f, 2.0f, 2.0f);

            _neuronLines.ForeColor      = Color.White;
            _neuronLines.ContinuousLine = false;

            // Initialize the history plotter.
            chartPlotter5.DataSeries.Add(_historyLines1);
            chartPlotter5.DataSeries.Add(_historyLines2);
            _historyLines1.ForeColor      = Color.Blue;
            _historyLines1.StepLengthMode = HistoryDataSeries.LengthMode.Screen;
            _historyLines1.StepLength     = 2.0f;
            _historyLines2.ForeColor      = Color.Red;
            _historyLines2.StepLength     = 0.5f;
        }