Commit 08298753 authored by 谢旭's avatar 谢旭

增加socket连接代码

parent d4d8cd97
No preview for this file type
......@@ -95,6 +95,7 @@
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll</HintPath>
</Reference>
......
......@@ -8,6 +8,15 @@ namespace CefDemo.Extension
{
class CoordinateTransformation
{
/// <summary>
/// 经纬度转笛卡尔坐标
/// </summary>
/// <param name="B"></param>
/// <param name="L"></param>
/// <param name="H"></param>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
public static double[] TranslateBLHToXYZ(double B, double L, double H, double a = 6378137, double b = 6356752.314245179)
{
double p = 180 / Math.PI;
......@@ -23,6 +32,15 @@ namespace CefDemo.Extension
return new double[] { x, y, z };
}
/// <summary>
/// 笛卡尔坐标转经纬度
/// </summary>
/// <param name="X"></param>
/// <param name="Y"></param>
/// <param name="Z"></param>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
public static double[] TranslateXYZToBLH(double X, double Y, double Z, double a = 6378137, double b = 6356752.314245179)
{
double ee = Math.Pow(Math.Sqrt(a * a - b * b) / a, 2);
......
......@@ -13,11 +13,12 @@
<dxc:ChartControl
Name="chargrid"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="8,8,16,16"
DataSource="{Binding ElementName=grid, Path=SelectedItems}">
DataSource="{Binding Datasource,Mode=TwoWay}"
><!---->
<dxc:ChartControl.Titles>
<dxc:Title HorizontalAlignment="Center">Monthly Revenue</dxc:Title>
</dxc:ChartControl.Titles>
......@@ -39,6 +40,18 @@
</dxc:AxisY2D.Label>
</dxc:AxisY2D>
</dxc:XYDiagram2D.AxisY>
<!--<dxc:BarSideBySideStackedSeries2D DisplayName="(计划)长度(m)" Visible="{Binding PlanVisible}"
DataSource="{Binding PlanLengthList}"
ArgumentDataMember="ProjectName" ArgumentScaleType="Auto"
ValueDataMember="ProjectValue" ValueScaleType="Numerical" />
<dxc:BarSideBySideStackedSeries2D DisplayName="(计划)面积(m2)" Visible="{Binding PlanVisible}"
DataSource="{Binding PlanAreaList}"
ArgumentDataMember="ProjectName" ArgumentScaleType="Auto"
ValueDataMember="ProjectValue" ValueScaleType="Numerical" />-->
</dxc:XYDiagram2D>
<dxc:ChartControl.Legends>
<dxc:Legend HorizontalPosition="Center" VerticalPosition="BottomOutside" Orientation="Horizontal" />
......
......@@ -13,6 +13,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data;
namespace CefDemo.View
{
......@@ -24,6 +25,10 @@ namespace CefDemo.View
public charwindow()
{
InitializeComponent();
this.DataContext = new ViewModel.ChartWindowViewModel();
}
}
}
using System;
using DevExpress.Mvvm;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CefDemo.ViewModel
{
class ChartWindowViewModel
class item
{
public ChartWindowViewModel()
public item(double x,double y)
{
X = x;
Y = y;
}
public double X;
public double Y;
}
class ChartWindowViewModel:ViewModelBase
{
private List<item> datasource;
public List<item> Datasource
{
get => datasource;
set
{
datasource = value;
SetProperty(ref datasource, value, nameof(Datasource), () => RaisePropertiesChanged((nameof(Datasource))));
}
}
public ChartWindowViewModel()
{
List<item> aa = new List<item>();
aa.Add(new item(2.333,4.3333));
aa.Add(new item(2.333, 4.3333));
Datasource = aa;
}
......
3a46415b79e09fc42234f64877fa6e1ba2ac7812
5fd3390d7db76447a32ca383b30b80aef9154350
......@@ -12,8 +12,8 @@ DEBUG;TRACE
C:\Users\captain.eugene\Desktop\CefDemo (2)\CefDemo\App.xaml
4157044738
23317083803
41-736464666
241505346564
42-1124738333
View\charwindow.xaml;View\HardwareState.xaml;View\MainWindow.xaml;View\ConHardware.xaml;
False
......
......@@ -13,7 +13,7 @@ C:\Users\captain.eugene\Desktop\CefDemo (2)\CefDemo\App.xaml
4157044738
28-1810194257
41-736464666
42-1124738333
View\charwindow.xaml;View\HardwareState.xaml;View\MainWindow.xaml;View\ConHardware.xaml;
True
......
#pragma checksum "..\..\..\..\View\charwindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "514BBD4A569B708013646A83F8D82556C536B271"
#pragma checksum "..\..\..\..\View\charwindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "597CB76A8EB4047EB856C66433E8270A527A8D0C"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -48,6 +48,14 @@ namespace CefDemo.View {
/// </summary>
public partial class charwindow : DevExpress.Xpf.Core.ThemedWindow, System.Windows.Markup.IComponentConnector {
#line 16 "..\..\..\..\View\charwindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal DevExpress.Xpf.Charts.ChartControl chargrid;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
......@@ -76,6 +84,12 @@ namespace CefDemo.View {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.chargrid = ((DevExpress.Xpf.Charts.ChartControl)(target));
return;
}
this._contentLoaded = true;
}
}
......
#pragma checksum "..\..\..\..\View\charwindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "460A8AAB79C8B30ACCC5B34221A3724985C32D38"
#pragma checksum "..\..\..\..\View\charwindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "597CB76A8EB4047EB856C66433E8270A527A8D0C"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -48,6 +48,14 @@ namespace CefDemo.View {
/// </summary>
public partial class charwindow : DevExpress.Xpf.Core.ThemedWindow, System.Windows.Markup.IComponentConnector {
#line 16 "..\..\..\..\View\charwindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal DevExpress.Xpf.Charts.ChartControl chargrid;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
......@@ -76,6 +84,12 @@ namespace CefDemo.View {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.chargrid = ((DevExpress.Xpf.Charts.ChartControl)(target));
return;
}
this._contentLoaded = true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment