コード例 #1
0
ファイル: SoftwarePanel.cs プロジェクト: TimmyNoobi/DRBE
        public async void Read_scenario_bt_Click(object sender, RoutedEventArgs e)
        {
            DRBE_Scenario = new DRBEScenario(ParentGrid);
            await DRBE_Scenario.Parse_Scenario("Scenario1.txt");

            Create_Platform(DRBE_Scenario.platform);
            Create_Transmitter(DRBE_Scenario.transmitter);
            Create_Receiver(DRBE_Scenario.receiver);
        }
コード例 #2
0
        private async void MainPage_loaded(object sender, RoutedEventArgs e)
        {
            MainPageTestSv = new ScrollViewer()
            {
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Background          = Default_back_black_color_brush
            };
            //MainGrid.Children.Add(MainPageTestSv);
            MainPageTestSv.SetValue(Grid.ColumnProperty, 0);
            MainPageTestSv.SetValue(Grid.ColumnSpanProperty, 50);
            MainPageTestSv.SetValue(Grid.RowProperty, 0);
            MainPageTestSv.SetValue(Grid.RowSpanProperty, 100);
            Canvas.SetZIndex(MainPageTestSv, 20);

            MainPageTestTb = new TextBlock()
            {
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Foreground          = white_button_brush,
                FontSize            = 12
            };

            //MainGrid.Children.Add(MainPageTestTb);
            //MainPageTestTb.SetValue(Grid.ColumnProperty, 0);
            //MainPageTestTb.SetValue(Grid.ColumnSpanProperty, 50);
            //MainPageTestTb.SetValue(Grid.RowProperty, 0);
            //MainPageTestTb.SetValue(Grid.RowSpanProperty, 100);
            //Canvas.SetZIndex(MainPageTestTb,20);

            MainPageTestSv.Content = MainPageTestTb;

            MainPageTestBd = new Border()
            {
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Background          = Default_back_black_color_brush
            };
            //MainGrid.Children.Add(MainPageTestBd);
            MainPageTestBd.SetValue(Grid.ColumnProperty, 0);
            MainPageTestBd.SetValue(Grid.ColumnSpanProperty, 50);
            MainPageTestBd.SetValue(Grid.RowProperty, 0);
            MainPageTestBd.SetValue(Grid.RowSpanProperty, 100);
            Canvas.SetZIndex(MainPageTestBd, 19);
            StorageFolder storageFolder = ApplicationData.Current.LocalFolder;
            string        path          = storageFolder.Path;

            await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();

            await Task.Delay(1000);

            DRBE_frontPage = new FrontPage(MainGrid, this);
            //DRBE_frontPage.Show();

            DRBE_softwarePage           = new SoftwarePanel(MainGrid, UWbinarywriter);
            Communication_Protocol_Page = new Communication_Protocol_Page(MainGrid);
            DRBE_ap        = new DRBE_AP(MainGrid, UWbinarywriter);
            DRBE_mainpage1 = new DRBE_MainPage1(MainGrid, this);
            DRBE_sv1       = new Simulator_V1(MainGrid, this);

            //DRBE_SUT_Page = new DRBE_SUT(MainGrid);
            //DRBE_Debug_tb = new TextBlock() {
            //    HorizontalAlignment = HorizontalAlignment.Stretch,
            //    VerticalAlignment = VerticalAlignment.Stretch,
            //    FontSize = 12,
            //    Foreground = white_button_brush,
            //    Text = "DRBE_Debug_tb\r\n"
            //};
            //DRBE_Debug_tb.SetValue(Grid.ColumnProperty, 5);
            //DRBE_Debug_tb.SetValue(Grid.ColumnSpanProperty, 100);
            //DRBE_Debug_tb.SetValue(Grid.RowProperty, 5);
            //DRBE_Debug_tb.SetValue(Grid.RowSpanProperty, 100);
            //MainGrid.Children.Add(DRBE_Debug_tb);



            DRBE_frontPage.Statues_tb.Text += storageFolder.Path;

            DRBE_Scenario = new DRBEScenario(MainGrid);
            await DRBE_Scenario.Parse_Scenario("DS1.txt");

            //DRBE_lv = new DRBE_Link_Viewer_s(MainGrid, this);
            //DRBE_SG = new DRBE_Scenario_Generator(MainGrid);

            DRBE_mainpage1.Show();
            //DRBE_sv1.show();


            //TM_Test = new Template_Make(MainGrid, this);


            //DRBE_ap.Show();
            //DRBE_lv.Setup(DRBE_Scenario.D_Trans, DRBE_Scenario.D_Rec, DRBE_Scenario.D_Ref);

            StartClient();

            //DRBE_softwarePage.Show();
            //DRBE_ap.Show();
            //DRBE_lv.hide();

            ConnectToSerialPort();
            AdvReadByte(ReadCancellationTokenSource.Token);

            DRBE_frontPage.Send_Seq_1.Click += Send_Seq_1_Click;

            S_B("A1");


            ScrollViewer svtest = new ScrollViewer()
            {
            };
            StackPanel sptest = new StackPanel()
            {
            };



            #region Slides
            Button ssbt = new Button()
            {
                VerticalAlignment   = VerticalAlignment.Stretch,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Content             = "1",
                Foreground          = white_button_brush,
                FontSize            = 18
            };
            MainGrid.Children.Add(ssbt);
            ssbt.SetValue(Grid.ColumnProperty, 185);
            ssbt.SetValue(Grid.ColumnSpanProperty, 5);
            ssbt.SetValue(Grid.RowProperty, 145);
            ssbt.SetValue(Grid.RowSpanProperty, 5);
            ssbt.Click += Ssbt1_Click;

            Canvas.SetZIndex(ssbt, 20);

            //Button ssbt2 = new Button()
            //{
            //    VerticalAlignment = VerticalAlignment.Stretch,
            //    HorizontalAlignment = HorizontalAlignment.Stretch,
            //    Content = "2",
            //    Foreground = white_button_brush,
            //    FontSize = 18

            //};
            //MainGrid.Children.Add(ssbt2);
            //ssbt2.SetValue(Grid.ColumnProperty, 190);
            //ssbt2.SetValue(Grid.ColumnSpanProperty, 5);
            //ssbt2.SetValue(Grid.RowProperty, 145);
            //ssbt2.SetValue(Grid.RowSpanProperty, 5);
            //ssbt2.Click += Ssbt2_Click;

            //Button ssbt3 = new Button()
            //{
            //    VerticalAlignment = VerticalAlignment.Stretch,
            //    HorizontalAlignment = HorizontalAlignment.Stretch,
            //    Content = "3",
            //    Foreground = white_button_brush,
            //    FontSize = 18

            //};
            //MainGrid.Children.Add(ssbt3);
            //ssbt3.SetValue(Grid.ColumnProperty, 195);
            //ssbt3.SetValue(Grid.ColumnSpanProperty, 5);
            //ssbt3.SetValue(Grid.RowProperty, 145);
            //ssbt3.SetValue(Grid.RowSpanProperty, 5);
            //ssbt3.Click += Ssbt3_Click;
            #endregion
            pp = new Pic_Player(MainGrid);


            All_Received_byte_list = new List <byte>();

            //executeCommand();

            DRBE_SG = new DRBE_Scenario_Generator(MainGrid, this);
            //DRBE_SG.show();
            Link_Viewer = new DRBE_LinkViewer(MainGrid, this);
        }