开始加入登录,功能还没实现,加入工具类
日志窗口可拖动宽度
This commit is contained in:
parent
7fb0bcf60e
commit
6cb44d5401
@ -43,6 +43,9 @@
|
|||||||
<c:MetroWindow.RightWindowCommands>
|
<c:MetroWindow.RightWindowCommands>
|
||||||
<c:WindowCommands>
|
<c:WindowCommands>
|
||||||
|
|
||||||
|
<Button Content="登陆"
|
||||||
|
Command="{Binding LoginCommand}" />
|
||||||
|
|
||||||
<Button Content="{Binding AppEx.ShowModifyTaskView, Converter={StaticResource ShowModifyTaskViewButtonContentConverter}}"
|
<Button Content="{Binding AppEx.ShowModifyTaskView, Converter={StaticResource ShowModifyTaskViewButtonContentConverter}}"
|
||||||
Command="{Binding ShowOrHideModifyTaskViewCommand}" />
|
Command="{Binding ShowOrHideModifyTaskViewCommand}" />
|
||||||
<Button Content="{Binding b2DMapMode, Converter={StaticResource Show2d3dButtonContentConverter}}"
|
<Button Content="{Binding b2DMapMode, Converter={StaticResource Show2d3dButtonContentConverter}}"
|
||||||
@ -131,7 +134,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid Margin="1">
|
<Grid Margin="1" d:IsHidden="True">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="73*" />
|
<ColumnDefinition Width="73*" />
|
||||||
<ColumnDefinition Width="27*" MinWidth="360" />
|
<ColumnDefinition Width="27*" MinWidth="360" />
|
||||||
@ -240,16 +243,37 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
<TextBox Name="logTextBox" Height="700" Width="600" Background="#FF2D2D2D"
|
|
||||||
|
<Grid x:Name="logGrid" Height="900" VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="Hidden" >
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition MinWidth="20" MaxWidth="800" Width="500"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<DockPanel Grid.Row="0" Grid.Column="0">
|
||||||
|
<TextBox x:Name="logTextBox" Height="900" Width="800" Background="#FF2D2D2D"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Visibility="Hidden"
|
|
||||||
Text="{Binding Logs}"
|
Text="{Binding Logs}"
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||||
TextChanged="LogTextChange"
|
TextChanged="LogTextChange"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
ContextMenu="{StaticResource LogMenu}"/>
|
ContextMenu="{StaticResource LogMenu}"/>
|
||||||
|
</DockPanel>
|
||||||
|
<GridSplitter Grid.Row="0" Grid.Column="1" Width="3" Margin="0,0,0,0" Background="MidnightBlue"
|
||||||
|
VerticalAlignment="Stretch" HorizontalAlignment="Center" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</c:MetroWindow>
|
</c:MetroWindow>
|
||||||
|
@ -490,12 +490,14 @@ namespace Plane.FormationCreator
|
|||||||
|
|
||||||
private void LogShowHide(object sender, MouseButtonEventArgs e)
|
private void LogShowHide(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (logTextBox.Visibility == Visibility.Visible)
|
|
||||||
logTextBox.Visibility = Visibility.Hidden;
|
if (logGrid.Visibility == Visibility.Visible)
|
||||||
|
logGrid.Visibility = Visibility.Hidden;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logTextBox.Height= Math.Max( map.ActualHeight, map3D.ActualHeight) - ((TaskBarView) TaskbarControl).TasksControl.ActualHeight;
|
logGrid.Height = Math.Max(map.ActualHeight, map3D.ActualHeight) - ((TaskBarView)TaskbarControl).TasksControl.ActualHeight;
|
||||||
logTextBox.Visibility = Visibility.Visible;
|
logTextBox.Height = logGrid.Height;
|
||||||
|
logGrid.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +187,7 @@
|
|||||||
<Compile Include="ServiceLocatorConfigurer.cs" />
|
<Compile Include="ServiceLocatorConfigurer.cs" />
|
||||||
<Compile Include="Test.cs" />
|
<Compile Include="Test.cs" />
|
||||||
<Compile Include="CalculationLogLatDistance.cs" />
|
<Compile Include="CalculationLogLatDistance.cs" />
|
||||||
|
<Compile Include="Util\AsynDataUtils.cs" />
|
||||||
<Compile Include="Util\CommNTRIP.cs" />
|
<Compile Include="Util\CommNTRIP.cs" />
|
||||||
<Compile Include="Util\CommsSerialPort.cs">
|
<Compile Include="Util\CommsSerialPort.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
|
@ -10,8 +10,8 @@ using System.Windows;
|
|||||||
[assembly: AssemblyTitle("GroupGCSMain")]
|
[assembly: AssemblyTitle("GroupGCSMain")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("北京飞行魔方科技有限公司")]
|
||||||
[assembly: AssemblyProduct("GroupGCS")]
|
[assembly: AssemblyProduct("无人机编队地面控制系统")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:Plane.FormationCreator.Properties">
|
xmlns:local="clr-namespace:Plane.FormationCreator.Properties">
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="/FGCS;component/Styles/Window.xaml"/>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
58
Plane.FormationCreator/Util/AsynDataUtils.cs
Normal file
58
Plane.FormationCreator/Util/AsynDataUtils.cs
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Plane.Util
|
||||||
|
{
|
||||||
|
public class AsynDataUtils
|
||||||
|
{
|
||||||
|
public delegate void DataResultCallBack(string data);
|
||||||
|
DataResultCallBack _callback;
|
||||||
|
public void AsynGetData(string tagUrl, DataResultCallBack callback)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_callback = callback;
|
||||||
|
AsyncGetWithWebRequest(tagUrl, new AsyncCallback(ReadCallback));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReadCallback(IAsyncResult asynchronousResult)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string DefaultUserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
|
||||||
|
var request = (HttpWebRequest)asynchronousResult.AsyncState;
|
||||||
|
request.Timeout = 5000;
|
||||||
|
request.Method = "GET";
|
||||||
|
request.UserAgent = DefaultUserAgent;
|
||||||
|
|
||||||
|
var response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
|
||||||
|
using (var streamReader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default ))
|
||||||
|
{
|
||||||
|
var resultString = streamReader.ReadToEnd();
|
||||||
|
Console.WriteLine(resultString);
|
||||||
|
if (_callback != null)
|
||||||
|
{
|
||||||
|
_callback(resultString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void AsyncGetWithWebRequest(string url, AsyncCallback callback)
|
||||||
|
{
|
||||||
|
var request = (HttpWebRequest)System.Net.WebRequest.Create(new Uri(url));
|
||||||
|
request.BeginGetResponse(callback, request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -160,6 +160,18 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ICommand _LoginCommand;
|
||||||
|
public ICommand LoginCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _LoginCommand ?? (_LoginCommand = new RelayCommand(() =>
|
||||||
|
{
|
||||||
|
// AppEx.Current.ShowModifyTaskView = !AppEx.Current.ShowModifyTaskView;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ICommand _ShowOrHideModifyTaskViewCommand;
|
private ICommand _ShowOrHideModifyTaskViewCommand;
|
||||||
public ICommand ShowOrHideModifyTaskViewCommand
|
public ICommand ShowOrHideModifyTaskViewCommand
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user