-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
MainWindow.xaml
241 lines (229 loc) · 13.1 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<Window x:Class="ESPEDfGK.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:ESPEDfGK"
xmlns:dpsplit="clr-namespace:System.Windows.Controls;assembly=DockPanelSplitter"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
mc:Ignorable="d"
Closing="Window_Closing"
Icon="pack://application:,,,/wicon.ico"
Title="ESP32/ESP8266 Exception Decoder for Generation Klick" Height="450" Width="800">
<Window.Resources>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</Window.Resources>
<Grid>
<Grid.LayoutTransform>
<ScaleTransform x:Name="uiScaler" CenterX="0" CenterY="0" ScaleX="1" ScaleY="1" />
</Grid.LayoutTransform>
<TabControl HorizontalAlignment="Stretch" Margin="0,5,0,0" VerticalAlignment="Stretch" >
<TabItem Header="Decoder">
<DockPanel Grid.Row="0" Grid.Column="0" Background="#FFE5E5E5">
<Label DockPanel.Dock="Top">Elf-File (in IDE use Sketch->Export compiled Binary or ALT+CTRL+S):</Label>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--- -->
<ComboBox Name="TBElffile" IsEditable="True" IsReadOnly="False"
HorizontalContentAlignment="Stretch"
Grid.IsSharedSizeScope="True"
ItemsSource="{Binding}" Margin="10,0,4,0">
<!--
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Margin="0" Text="{Binding FileName}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
-->
<ComboBox.ItemContainerStyle>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid x:Name="cg" TextElement.Foreground="Black">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="FirstColumn"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Padding="5,0,5,2" Grid.Column="0"
Text="{Binding FileName}"/>
<TextBlock Margin="0" Grid.Column="1"
Text="{Binding LastChange, StringFormat='{}{0:yyyy-MM-dd HH:mm}'}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="ComboBoxItem.IsSelected" Value="True">
<Setter TargetName="cg" Property="Background"
Value="Lightgray"></Setter>
<Setter TargetName="cg" Property="TextElement.Foreground"
Value="White"></Setter>
</Trigger>
<Trigger Property="ComboBoxItem.IsMouseOver" Value="True">
<Setter TargetName="cg" Property="Background"
Value="LightBlue"></Setter>
<Setter TargetName="cg" Property="TextElement.Foreground"
Value="White"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>
<!--- -->
<Button Content=" Select... "
Grid.Row="0" Grid.Column="1"
HorizontalAlignment="Right"
Click="BTSelectElffile"
Margin="4,2,4,0" />
<Button Content=" Find... "
Grid.Row="0" Grid.Column="2"
HorizontalAlignment="Right"
Click="BTFindElffile"
Margin="4,2,4,0" />
</Grid>
<Label DockPanel.Dock="Top">Exception-Dump (Copy from Serial Monitor):</Label>
<TextBox DockPanel.Dock="Top" Name="TBStackdump" TextWrapping="Wrap" AcceptsReturn="True"
Margin="10,0,3,0" Height="Auto">
</TextBox>
<dpsplit:DockPanelSplitter Name="DPSsplitter1" DockPanel.Dock="Top"/>
<Grid DockPanel.Dock="Top">
<DockPanel>
<DockPanel>
<Label DockPanel.Dock="Top" Width="Auto"
Margin="10,0,0,0" Padding="0">Stack Trace (Click to show source):</Label>
<Label DockPanel.Dock="Top" Name="LBStyleInfo"
Margin="15,0,0,0" Padding="0">xxxxxvisxxxxxx</Label>
<Label DockPanel.Dock="Top" Name="LBExceptionInfo"
Margin="15,0,0,0" Padding="0" >xxxxxvisxxxxxx</Label>
</DockPanel>
<Button DockPanel.Dock="Right"
Name="BTnCopyToClipboardDone"
IsEnabled="false"
Visibility="Collapsed"
Margin="0,5,3,5"
VerticalAlignment="Top"
Padding="5,0,5,0">Done</Button>
<Button DockPanel.Dock="Right"
Name="BTnCopyToClipboard"
Click="BTCopyToClipboard"
IsEnabled="false"
Margin="0,5,3,5"
VerticalAlignment="Top"
Padding="5,0,5,0">Copy to clipboard</Button>
<Button DockPanel.Dock="Right"
Click="BTAnalyze"
Margin="0,5,3,5"
VerticalAlignment="Top"
Padding="5,0,5,0">Analyze it</Button>
<!-- fill space -->
<Label></Label>
</DockPanel>
</Grid>
<ListView DockPanel.Dock="Top" x:Name="LBExceptionList"
Margin="10,0,3,0">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<EventSetter Event="MouseUp" Handler="SenderDoppelClick" />
</Style>
</ListView.ItemContainerStyle>
<ListView.Resources>
<Style TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Left" />
</Style>
</ListView.Resources>
<ListView.View>
<GridView >
<GridViewColumn Header="Addr"
DisplayMemberBinding="{Binding Addr}"
Width="Auto" />
<GridViewColumn Header="Name"
DisplayMemberBinding="{Binding Name}"
Width="Auto" />
<GridViewColumn Header="File"
DisplayMemberBinding="{Binding SourcecodeFile}"
Width="Auto" />
<GridViewColumn Header="Line" Width="Auto">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding SourcecodeLine}"
TextAlignment="Right" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<dpsplit:DockPanelSplitter Name="DPSsplitter2" DockPanel.Dock="Top"/>
<avalonEdit:TextEditor DockPanel.Dock="Top" Margin="10,0,3,0"
ShowLineNumbers="True"
MinHeight="50px"
SyntaxHighlighting="C++"
Name="TBSourceCodeFilecontent" Cursor="">
</avalonEdit:TextEditor>
</DockPanel>
</TabItem>
<TabItem Header="Settings">
<StackPanel Grid.Row="0" Grid.Column="0" Background="#FFE5E5E5">
<StackPanel.Resources>
<Style TargetType="CheckBox">
<Setter Property="Margin" Value="10,5,0,0"/>
</Style>
<Style TargetType="Separator">
<Setter Property="Margin" Value="5,10,5,0"/>
</Style>
</StackPanel.Resources>
<StackPanel Orientation="Vertical" Margin="5,5,5,0">
<Label Content="xtensa-lx106-elf-addr2line:"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ComboBox Name="tbaddr2line" HorizontalAlignment="Stretch"
IsEditable="True"
Grid.Row="0" Grid.Column="0" Margin="10,0,4,0"/>
<Button Content=" Select... "
Grid.Row="0" Grid.Column="1"
HorizontalAlignment="Right"
Click="BTSelectExecutable"
Margin="4,2,4,0" />
<Button Content=" Find... "
Grid.Row="0" Grid.Column="2"
HorizontalAlignment="Right"
Click="BTFindExecutable"
Margin="4,2,4,0" />
</Grid>
</StackPanel>
<Separator/>
<StackPanel Orientation="Vertical" Margin="5,5,5,0">
<Label Padding="0,0,0,0" Content="Search Space for ELF Files"/>
<CheckBox Name="CBsearchpathSketch" IsChecked="True">Search in SKETCH folder as defined in IDE</CheckBox>
<Label Margin="20,0,0,0" Padding="0,0,0,0">
(Use Sketch->Export compiled Binary or ALT+CTRL+S in IDE to create ELF file)
</Label>
<CheckBox Name="CBsearchpathTEMP" IsChecked="True">Search in Windows %Temp% folder</CheckBox>
<Label Margin="20,0,0,0" Padding="0,0,0,0">
(This can result in a lot of stuff. You might want to clear your %TEMP% folder.)
</Label>
</StackPanel>
<Separator/>
<Label Content="huge empty space"/>
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</Window>