-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
92 lines (67 loc) · 4.49 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<Window x:Class="csma_cd.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:csma_cd"
mc:Ignorable="d"
Title="MainWindow" Height="600" Width="925">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="620"></ColumnDefinition>
<ColumnDefinition Width="280"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0" FontSize="30" Text="CSMA-Collision Detection Protocol"></TextBlock>
<Canvas Name="mycanvas" Grid.Row="1" Grid.Column="0" Height="500" Width="600" Background="MediumAquamarine">
<TextBlock Width="50" Height="30" Text="Packet1" Canvas.Left="0" Name="text1" Canvas.Top="225" Background="BlueViolet" ></TextBlock>
<TextBlock Width="50" Height="30" Text="Packet2" Canvas.Left="315" Name="text2" Canvas.Top="10" Background="BlueViolet" ></TextBlock>
<TextBlock Width="50" Height="30" Canvas.Left="300" Name="center_text" Canvas.Top="225" ></TextBlock>
<TextBlock Width="50" Height="30" Text="Packet3" Canvas.Left="315" Name="text3" Canvas.Top="410" Background="BlueViolet" ></TextBlock>
<Image Name="comp1" Canvas.Left="0" Canvas.Top="210" Source="C:\Users\IamRoot\Documents\Visual Studio 2015\Projects\aloha\aloha\bin\Debug\images\c.ico" Width="80" Height="80" MouseLeftButtonUp="c1_left_btn_up"/>
<Image Name="comp2" Canvas.Left="300" Canvas.Top="0" Source="C:\Users\IamRoot\Documents\Visual Studio 2015\Projects\aloha\aloha\bin\Debug\images\c.ico" Width="80" Height="80" MouseLeftButtonUp="c2_left_btn_up"></Image>
<Image Name="comp3" Canvas.Left="300" Canvas.Top="400" Source="C:\Users\IamRoot\Documents\Visual Studio 2015\Projects\aloha\aloha\bin\Debug\images\c.ico" Width="80" Height="80" MouseLeftButtonUp="c3_left_btn_up"></Image>
<Image Name="router_img" Source="C:\Users\IamRoot\Documents\Visual Studio 2015\Projects\aloha\aloha\bin\Debug\images\r.png" Width="80" Height="80" Canvas.Left="489" Canvas.Top="210"></Image>
</Canvas>
<StackPanel Grid.Row="1" Grid.Column="1" >
<TextBlock HorizontalAlignment="Center" FontSize="20" VerticalAlignment="Center" Text="Log:-"></TextBlock>
<ListView Name="log" Height="300">
</ListView>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
<Button Name="start_btn" Click="start_btn_Click" >start</Button>
<Separator Opacity="0" Height="20" Width="50"/>
<Button Name="stop_btn" Click="stop_btn_Click">Stop</Button>
<Separator Opacity="0" Height="20" Width="50"/>
<Button Name="reset_btn" Click="reset_btn_Click">Reset</Button>
</StackPanel>
<TextBlock><LineBreak></LineBreak></TextBlock>
<StackPanel Orientation="Horizontal">
<Label>packet1 speed</Label>
<Separator Opacity="0" Height="20" Width="50"/>
<TextBox Width="50" Name="p1_speed_text_block"></TextBox>
<Label>(Default 1.5)</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label>packet1 speed</Label>
<Separator Opacity="0" Height="20" Width="50"/>
<TextBox Width="50" Name="p2_speed_text_block"></TextBox>
<Label>(Default 0.5)</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label>packet1 speed</Label>
<Separator Opacity="0" Height="20" Width="50"/>
<TextBox Width="50" Name="p3_speed_text_block"></TextBox>
<Label>(Default 1.0)</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label>max attempt</Label>
<Separator Opacity="0" Height="20" Width="60"/>
<TextBox Name="max_try_box" Width="50"></TextBox>
<Label>Default(3)</Label>
</StackPanel>
</StackPanel>
</Grid>
</Window>