Exemple #1
0
        private void BtnTest_Click(object sender, RoutedEventArgs e)
        {
            updaterWindow       = new UpdaterWindow();
            updaterWindow.Owner = this;
            updaterWindow.Show();
            if ((updaterWindow.IsLoaded) && (updaterWindow.IsInitialized))
            {
                updaterWindow.RunWorker();
            }
            unsafe
            {
                Point point = new Point();
                bufer = new ByteBufer();

                bufer.testByte[0] = 0xA5;
                bufer.testByte[1] = 0xA6;

                bufer.testByte[2] = 0x00;
                bufer.testByte[3] = 0x10;
                bufer.testByte[4] = 0x20;
                bufer.testByte[5] = 0x30;
                SetFidName("Присоединение №1");

                point.X = 5;
                point.Y = 10;

                MemoryStream    streamBuffer = new MemoryStream();
                MemoryStream    streamStruct = new MemoryStream();
                BinaryFormatter formatter    = new BinaryFormatter();

                try
                {
                    //  formatter.Serialize(streamBuffer, bufer);
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.ToString());
                    // throw;
                }


                // streamBuffer.Write(testByte, 0, testByte.Length);

                // point.X =  stream.ReadByte();
                // point.Y = stream.ReadByte();

                streamBuffer.Close();
                streamStruct.Close();

                // MessageBox.Show(point.X.ToString() + " " + point.Y.ToString());
            }

            updaterWindow.StopWorker();
            updaterWindow.Close();
        }
Exemple #2
0
        private void btn_NewForm_Click(object sender, RoutedEventArgs e)
        {
            //modifying any series values will also animate and update the chart
            // secondForm = new WindowForm();
            // secondForm.Show();

            updaterWindow = new UpdaterWindow();
            // updaterWindow.Owner = this;
            updaterWindow.Show();
            updaterWindow.RunWorker();
            SeriesCollection.Add(new LineSeries
            {
                Values         = new ChartValues <double>(signal_input.ToArray()),
                LineSmoothness = 1     //straight lines, 1 really smooth lines
            });

            updaterWindow.StopWorker();
        }