更新
This commit is contained in:
parent
2b8d2f91be
commit
194b12335e
@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using FlyBase;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FlieOperate
|
||||
@ -13,6 +14,204 @@ namespace FlieOperate
|
||||
/// </summary>
|
||||
public class FileBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 逐行读取 文档
|
||||
/// </summary>
|
||||
/// <param name="path">文件路径</param>
|
||||
/// <returns></returns>
|
||||
private static string[] ReadFile(string path)
|
||||
{
|
||||
StreamReader sr = new StreamReader(path, Encoding.Default);
|
||||
String line;
|
||||
ArrayList arrlist = new ArrayList();
|
||||
while ((line = sr.ReadLine()) != null)
|
||||
{
|
||||
arrlist.Add(line);
|
||||
}
|
||||
if (arrlist.Count == 1)//判断 svg的文件内容 是否写在一行里面
|
||||
{
|
||||
string temp = (string)arrlist[0];
|
||||
string[] strArray = Regex.Split(temp, "/>");
|
||||
return strArray;
|
||||
}
|
||||
string[] arr = new string[arrlist.Count];
|
||||
int key = 0;
|
||||
foreach (var item in arrlist)
|
||||
{
|
||||
arr[key] = (string)item;
|
||||
key++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
/// <summary>
|
||||
/// svg航点坐标文档 转坐标集合 PS:灯光映射 支持格式
|
||||
/// </summary>
|
||||
/// <param name="path">文件路径</param>
|
||||
/// <returns></returns>
|
||||
public static Vector3[] SvgToPosForLight(string path)
|
||||
{
|
||||
//读取文档内容
|
||||
string[] arr;
|
||||
arr = ReadFile(path);
|
||||
//获取飞机x轴 z轴 坐标
|
||||
ArrayList tempVec = new ArrayList();//记录飞机坐标
|
||||
string cx = @"cx=""(?<mark>\-{0,1}\d*\.{0,1}\d*)""";
|
||||
string cy = @"cy=""(?<mark>\-{0,1}\d*\.{0,1}\d*)""";
|
||||
string r = @"r=""(?<mark>\d*\.{0,1}\d*)""";
|
||||
foreach (string item in arr)
|
||||
{
|
||||
if (item.IndexOf("<circle") >= 0)//找到svg里面<circle>标签
|
||||
{
|
||||
Regex reg = new Regex(cx);
|
||||
string strX = reg.Match(item).Groups["mark"].ToString();//正则匹配获取x轴
|
||||
reg = new Regex(cy);
|
||||
string strZ = reg.Match(item).Groups["mark"].ToString();//正则匹配获取y轴 在三维里面用作z轴
|
||||
double x = Convert.ToDouble(strX);
|
||||
double z = Convert.ToDouble(strZ);
|
||||
tempVec.Add(new Vector3(x, 0, z));
|
||||
}
|
||||
}
|
||||
Vector3[] vec = FlyVecFun.ArrToVec(tempVec);//把arrlist转换成坐标集合
|
||||
return vec;//返回坐标集合
|
||||
}
|
||||
/// <summary>
|
||||
/// txt航点坐标文档 转坐标集合 PS:目前是C4D坐标文档
|
||||
/// </summary>
|
||||
/// <param name="path">文件路径</param>
|
||||
/// <param name="flightPointNames">参数形式返回航点名称集合</param>
|
||||
/// <returns>航点集合</returns>
|
||||
public static List<Vector3[]> TxtToPos(string path, out string[] flightPointNames)
|
||||
{
|
||||
//读取文档内容
|
||||
string[] arr;
|
||||
arr = ReadFile(path);
|
||||
//处理文档内容
|
||||
int group = 0;//获取有几组坐标
|
||||
foreach (string item in arr)
|
||||
{
|
||||
if (item.IndexOf(" ") <= 0)//找到航点名称
|
||||
{
|
||||
group++;
|
||||
}
|
||||
}
|
||||
int planesCou = (arr.Length - group) / group;//获取飞机总数
|
||||
flightPointNames = new string[group];//记录航点名称
|
||||
int gKey = 0;//航点名称数组下标
|
||||
int pKey = 0;//所有坐标序号
|
||||
Vector3[] pos = new Vector3[planesCou];//临时记录飞机坐标
|
||||
List<Vector3[]> re = new List<Vector3[]>();//返回值
|
||||
for (int i = 0; i < arr.Length; i++)
|
||||
{
|
||||
if (i % (planesCou + 1) == 0)//分析是否是航点名称 行
|
||||
{
|
||||
flightPointNames[gKey] = arr[i];//记录航点名称
|
||||
gKey++;
|
||||
}
|
||||
else//否则 当坐标行处理
|
||||
{
|
||||
string[] tempArr = arr[i].Split(' ');//每行坐标分割
|
||||
pos[pKey % planesCou] = new Vector3(Convert.ToDouble(tempArr[1]), Convert.ToDouble(tempArr[2]), Convert.ToDouble(tempArr[3]));
|
||||
if (pKey % planesCou == planesCou - 1)//当一组组标循环完成 之后记录到返回组
|
||||
{
|
||||
re.Add(pos);
|
||||
pos = new Vector3[planesCou];//重新new一下 更新内存地址
|
||||
}
|
||||
pKey++;
|
||||
}
|
||||
}
|
||||
return re;//out flightPointNames 输出航点名称,re返回值 返回航点集合
|
||||
}
|
||||
/// <summary>
|
||||
/// svg航点坐标文档 转坐标集合
|
||||
/// </summary>
|
||||
/// <param name="path">文件路径</param>
|
||||
/// <returns>坐标集合</returns>
|
||||
public static Vector3[] SvgToPos(string path)
|
||||
{
|
||||
//读取文档内容
|
||||
string[] arr;
|
||||
arr = ReadFile(path);
|
||||
//获取飞机x轴 z轴 坐标
|
||||
ArrayList tempVec = new ArrayList();//记录飞机坐标
|
||||
string cx = @"cx=""(?<mark>\-{0,1}\d*\.{0,1}\d*)""";
|
||||
string cy = @"cy=""(?<mark>\-{0,1}\d*\.{0,1}\d*)""";
|
||||
string r = @"r=""(?<mark>\d*\.{0,1}\d*)""";
|
||||
foreach (string item in arr)
|
||||
{
|
||||
if (item.IndexOf("<circle") >= 0)//找到svg里面<circle>标签
|
||||
{
|
||||
Regex reg = new Regex(cx);
|
||||
string strX = reg.Match(item).Groups["mark"].ToString();//正则匹配获取x轴
|
||||
reg = new Regex(cy);
|
||||
string strZ = reg.Match(item).Groups["mark"].ToString();//正则匹配获取y轴 在三维里面用作z轴
|
||||
reg = new Regex(r);
|
||||
string radius = reg.Match(item).Groups["mark"].ToString();//正则匹配获取球半径
|
||||
//按比例缩放(半径为100公分) 获取世界坐标
|
||||
double Rate = 100 / Convert.ToDouble(radius);
|
||||
double x = Rate * Convert.ToDouble(strX);
|
||||
double z = Rate * Convert.ToDouble(strZ) * -1;
|
||||
tempVec.Add(new Vector3(x, 0, z));
|
||||
}
|
||||
}
|
||||
//坐标集原点相对位置 移到坐标集质心
|
||||
Vector3[] vec = FlyVecFun.ArrToVec(tempVec);//把arrlist转换成坐标集合
|
||||
Vector3 centerPos = FlyVecFun.GetPosCenter(vec);//获取中心点
|
||||
int key = 0;
|
||||
foreach (Vector3 item in vec)
|
||||
{
|
||||
item.SetZero(centerPos);
|
||||
vec[key] = item;
|
||||
key++;
|
||||
}
|
||||
return vec;//返回坐标集合
|
||||
}
|
||||
/// <summary>
|
||||
/// obj航点坐标文档 转坐标集合
|
||||
/// </summary>
|
||||
/// <param name="path">文件路径</param>
|
||||
/// <returns>坐标集合</returns>
|
||||
public static Vector3[] ObjToPos(string path)
|
||||
{
|
||||
//读取文档内容
|
||||
string[] arr;
|
||||
arr =ReadFile(path);
|
||||
//获取飞机x轴 z轴 坐标
|
||||
string pCou = @"#\s+(?<mark>\d*)\s+vertices";//匹配obj里面标记点的数量
|
||||
string pPos = @"v\s+(?<markX>\-{0,1}\d*\.{0,1}\d*)\s+(?<markY>\-{0,1}\d*\.{0,1}\d*)\s+(?<markZ>\-{0,1}\d*\.{0,1}\d*)";
|
||||
int linage = 0;//行数
|
||||
string tempPos;//临时记录一下 xyz坐标
|
||||
ArrayList tempVec = new ArrayList();//记录飞机坐标
|
||||
foreach (string item in arr)
|
||||
{
|
||||
Regex reg = new Regex(pCou);
|
||||
string cou = reg.Match(item).Groups["mark"].ToString();//正则匹配获取x轴
|
||||
if (cou != "")
|
||||
{
|
||||
for (int i = Convert.ToInt32(cou); i > 0; i--)
|
||||
{
|
||||
tempPos = arr[linage - i];
|
||||
reg = new Regex(pPos);
|
||||
string strX = reg.Match(tempPos).Groups["markX"].ToString();
|
||||
string strY = reg.Match(tempPos).Groups["markY"].ToString();
|
||||
string strZ = reg.Match(tempPos).Groups["markZ"].ToString();
|
||||
tempVec.Add(new Vector3(Convert.ToDouble(strX), Convert.ToDouble(strY), Convert.ToDouble(strZ)));
|
||||
}
|
||||
}
|
||||
linage++;
|
||||
}
|
||||
//坐标集原点相对位置 移到坐标集质心
|
||||
Vector3[] vec = FlyVecFun.ArrToVec(tempVec);//把arrlist转换成坐标集合
|
||||
//重新定义中心点为原点
|
||||
//Vector3 centerPos = getPosCenter(vec);//获取中心点
|
||||
//int key = 0;
|
||||
//foreach (Vector3 item in vec)
|
||||
//{
|
||||
// item.setZero(centerPos);
|
||||
// vec[key] = item;
|
||||
// key++;
|
||||
//}
|
||||
return vec;//返回坐标集合
|
||||
}
|
||||
/// <summary>
|
||||
/// 资源管理器 文件类型 中文说明 和扩展名是 成对关系 数组长度要一致
|
||||
/// </summary>
|
||||
|
@ -31,6 +31,9 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FlyBase">
|
||||
<HintPath>..\FlyCube\bin\Release\FlyBase.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\FlyCube\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
|
36
FlieOperate/Properties/AssemblyInfo.cs
Normal file
36
FlieOperate/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("FlieOperate")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FlieOperate")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("c354fd6b-5863-4246-bb48-6df14a85c161")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
4
FlieOperate/packages.config
Normal file
4
FlieOperate/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
||||
</packages>
|
1680
FlyBase/FlyBase.cs
1680
FlyBase/FlyBase.cs
File diff suppressed because it is too large
Load Diff
49
FlyBase/FlyBase.csproj
Normal file
49
FlyBase/FlyBase.csproj
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{626A9BFA-07DE-4063-A178-360EB7057ED6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FlyBase</RootNamespace>
|
||||
<AssemblyName>FlyBase</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FlyBase.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
36
FlyBase/Properties/AssemblyInfo.cs
Normal file
36
FlyBase/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("FlyBase")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FlyBase")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("626a9bfa-07de-4063-a178-360eb7057ed6")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
154
FlyBase/Vector3.cs
Normal file
154
FlyBase/Vector3.cs
Normal file
@ -0,0 +1,154 @@
|
||||
using System;
|
||||
|
||||
namespace FlyBase
|
||||
{
|
||||
public struct Vector3
|
||||
{
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
public double Z { get; set; }
|
||||
/// <summary>
|
||||
/// 构造 初始化
|
||||
/// </summary>
|
||||
/// <param name="x">x坐标</param>
|
||||
/// <param name="y">y坐标</param>
|
||||
/// <param name="z">z坐标</param>
|
||||
public Vector3(double x, double y, double z)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Z = z;
|
||||
}
|
||||
//重载二元坐标加法+
|
||||
public static Vector3 operator +(Vector3 v1, Vector3 v2)
|
||||
{
|
||||
return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z);
|
||||
}
|
||||
//重载一元坐标加法+
|
||||
public static Vector3 operator +(Vector3 v1, double i)
|
||||
{
|
||||
return new Vector3(v1.X + i, v1.Y + i, v1.Z + i);
|
||||
}
|
||||
//重载一元坐标加法+
|
||||
public static Vector3 operator +(Vector3 v1, int i)
|
||||
{
|
||||
return new Vector3(v1.X + (double)i, v1.Y + (double)i, v1.Z + (double)i);
|
||||
}
|
||||
//重载二元坐标减法-
|
||||
public static Vector3 operator -(Vector3 v1, Vector3 v2)
|
||||
{
|
||||
return new Vector3(v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z);
|
||||
}
|
||||
//重载一元坐标加法-
|
||||
public static Vector3 operator -(Vector3 v1, double i)
|
||||
{
|
||||
return new Vector3(v1.X - i, v1.Y - i, v1.Z - i);
|
||||
}
|
||||
//重载一元坐标加法-
|
||||
public static Vector3 operator -(Vector3 v1, int i)
|
||||
{
|
||||
return new Vector3(v1.X - (double)i, v1.Y - (double)i, v1.Z - (double)i);
|
||||
}
|
||||
//重载一元坐标乘法*
|
||||
public static Vector3 operator *(Vector3 v1, double i)
|
||||
{
|
||||
return new Vector3(v1.X * i, v1.Y * i, v1.Z * i);
|
||||
}
|
||||
//重载一元坐标乘法*
|
||||
public static Vector3 operator *(Vector3 v1, int i)
|
||||
{
|
||||
return new Vector3(v1.X * (double)i, v1.Y * (double)i, v1.Z * (double)i);
|
||||
}
|
||||
//重载一元坐标除法/
|
||||
public static Vector3 operator /(Vector3 v1, double i)
|
||||
{
|
||||
return new Vector3(v1.X / i, v1.Y / i, v1.Z / i);
|
||||
}
|
||||
//重载一元坐标除法/
|
||||
public static Vector3 operator /(Vector3 v1, int i)
|
||||
{
|
||||
return new Vector3(v1.X / (double)i, v1.Y / (double)i, v1.Z / (double)i);
|
||||
}
|
||||
//重载==
|
||||
public static bool operator ==(Vector3 v1, Vector3 v2)
|
||||
{
|
||||
if (v1.X == v2.X && v1.Y == v2.Y && v1.Z == v2.Z) return true;
|
||||
return false;
|
||||
}
|
||||
//重载!=
|
||||
public static bool operator !=(Vector3 v1, Vector3 v2)
|
||||
{
|
||||
if (v1.X != v2.X || v1.Y != v2.Y || v1.Z != v2.Z) return true;
|
||||
return false;
|
||||
}
|
||||
//模长
|
||||
public double GetMag()
|
||||
{
|
||||
return Math.Sqrt(Math.Pow(this.X, 2) + Math.Pow(this.Y, 2) + Math.Pow(this.Z, 2));
|
||||
}
|
||||
/// <summary>
|
||||
/// 标准化坐标
|
||||
/// </summary>
|
||||
/// <param name="multiple">标准化单位</param>
|
||||
public void Normalize(double multiple = 1.0)
|
||||
{
|
||||
double magSq = Math.Pow(this.X, 2) + Math.Pow(this.Y, 2) + Math.Pow(this.Z, 2);
|
||||
if (magSq > 0)
|
||||
{
|
||||
double oneOverMag = multiple / Math.Sqrt(magSq);
|
||||
this.X *= oneOverMag;
|
||||
this.Y *= oneOverMag;
|
||||
this.Z *= oneOverMag;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 标准化 返回一个标准化之后的值 不改变自身
|
||||
/// </summary>
|
||||
/// <param name="multiple">标准化单位</param>
|
||||
/// <returns>标准化之后的值</returns>
|
||||
public Vector3 NormalizEd(double multiple = 1.0)
|
||||
{
|
||||
Vector3 re = new Vector3();
|
||||
double magSq = Math.Pow(this.X, 2) + Math.Pow(this.Y, 2) + Math.Pow(this.Z, 2);
|
||||
if (magSq > 0)
|
||||
{
|
||||
double oneOverMag = multiple / Math.Sqrt(magSq);
|
||||
re.X = this.X * oneOverMag;
|
||||
re.Y = this.Y * oneOverMag;
|
||||
re.Z = this.Z * oneOverMag;
|
||||
}
|
||||
return re;
|
||||
}
|
||||
//归零 改变自身数值 一般配合归位使用
|
||||
public void SetZero(Vector3 v2)
|
||||
{
|
||||
this.X -= v2.X;
|
||||
this.Y -= v2.Y;
|
||||
this.Z -= v2.Z;
|
||||
}
|
||||
//归零 返回一个归零值 不改变自身
|
||||
public Vector3 SetZeroEd(Vector3 v2)
|
||||
{
|
||||
Vector3 re = new Vector3(this.X - v2.X, this.Y - v2.Y, this.Z - v2.Z);
|
||||
return re;
|
||||
}
|
||||
//归位
|
||||
public void SetFormerly(Vector3 v2)
|
||||
{
|
||||
this.X += v2.X;
|
||||
this.Y += v2.Y;
|
||||
this.Z += v2.Z;
|
||||
}
|
||||
/// <summary>
|
||||
/// 打印坐标
|
||||
/// </summary>
|
||||
/// <returns>坐标字符串</returns>
|
||||
public string PosToString()
|
||||
{
|
||||
string x = Convert.ToString(this.X);
|
||||
string y = Convert.ToString(this.Y);
|
||||
string z = Convert.ToString(this.Z);
|
||||
return string.Format($"X轴:{x} Y轴:{y} Z轴:{z}");
|
||||
}
|
||||
}
|
||||
}
|
6
FlyCube/App.config
Normal file
6
FlyCube/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
9
FlyCube/App.xaml
Normal file
9
FlyCube/App.xaml
Normal file
@ -0,0 +1,9 @@
|
||||
<Application x:Class="FlyCube.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:FlyCube"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
17
FlyCube/App.xaml.cs
Normal file
17
FlyCube/App.xaml.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace FlyCube
|
||||
{
|
||||
/// <summary>
|
||||
/// App.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
122
FlyCube/FlyCube.csproj
Normal file
122
FlyCube/FlyCube.csproj
Normal file
@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B36F850B-75B9-42C9-9C48-88141AB6D4B1}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>FlyCube</RootNamespace>
|
||||
<AssemblyName>FlyCube</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="WpfAnimatedGif, Version=2.0.0.0, Culture=neutral, PublicKeyToken=9e7cd3b544a090dc, processorArchitecture=MSIL">
|
||||
<HintPath>packages\WpfAnimatedGif.2.0.2\lib\net40\WpfAnimatedGif.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="ControlLibrary\AxisControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ControlLibrary\AxisControl.xaml.cs">
|
||||
<DependentUpon>AxisControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Models\ImageUtility.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FlieOperate\FlieOperate.csproj">
|
||||
<Project>{c354fd6b-5863-4246-bb48-6df14a85c161}</Project>
|
||||
<Name>FlieOperate</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\FlyBase\FlyBase.csproj">
|
||||
<Project>{626a9bfa-07de-4063-a178-360eb7057ed6}</Project>
|
||||
<Name>FlyBase</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
40
FlyCube/FlyCube.sln
Normal file
40
FlyCube/FlyCube.sln
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.7.34018.315
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlyCube", "FlyCube.csproj", "{B36F850B-75B9-42C9-9C48-88141AB6D4B1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlyBase", "..\FlyBase\FlyBase.csproj", "{626A9BFA-07DE-4063-A178-360EB7057ED6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlieOperate", "..\FlieOperate\FlieOperate.csproj", "{C354FD6B-5863-4246-BB48-6DF14A85C161}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{626A9BFA-07DE-4063-A178-360EB7057ED6} = {626A9BFA-07DE-4063-A178-360EB7057ED6}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B36F850B-75B9-42C9-9C48-88141AB6D4B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B36F850B-75B9-42C9-9C48-88141AB6D4B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B36F850B-75B9-42C9-9C48-88141AB6D4B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B36F850B-75B9-42C9-9C48-88141AB6D4B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{626A9BFA-07DE-4063-A178-360EB7057ED6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{626A9BFA-07DE-4063-A178-360EB7057ED6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{626A9BFA-07DE-4063-A178-360EB7057ED6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{626A9BFA-07DE-4063-A178-360EB7057ED6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C354FD6B-5863-4246-BB48-6DF14A85C161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C354FD6B-5863-4246-BB48-6DF14A85C161}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C354FD6B-5863-4246-BB48-6DF14A85C161}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C354FD6B-5863-4246-BB48-6DF14A85C161}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {AEC8BEB7-E150-46F0-829B-4B0984B4B59B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -21,6 +21,7 @@
|
||||
<Button Content="导入映射图" HorizontalAlignment="Left" VerticalAlignment="Top" Width="220" Height="49" Margin="0,54,0,0" Click="ImportImg_Click"/>
|
||||
<Button Content="保存航点" HorizontalAlignment="Left" VerticalAlignment="Top" Width="220" Height="49" Margin="0,108,0,0" Click="ExportFcgm_Click"/>
|
||||
<Button Content="渲染" HorizontalAlignment="Left" VerticalAlignment="Top" Width="220" Height="49" Margin="0,162,0,0" Click="Render_Click"/>
|
||||
<Button Content="测试" HorizontalAlignment="Left" VerticalAlignment="Top" Width="220" Height="49" Margin="0,220,0,0" Click="Del_Click"/>
|
||||
</Grid>
|
||||
</WrapPanel>
|
||||
</Window>
|
@ -19,12 +19,84 @@ using static FlieOperate.FcgmJsonModel.Tasks.SingleCopterInfos;
|
||||
using FlyCube.Models;
|
||||
using ControlLibrary;
|
||||
using WpfAnimatedGif;//播放GIF
|
||||
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace FlyCube
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
/// <summary>
|
||||
/// 入口函数
|
||||
/// </summary>
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
//创建一个 主画布对象
|
||||
TopCanvas = new MainCanvas(this.LayerPlane);
|
||||
}
|
||||
private void Del_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Vector3 a1 = new Vector3(0, 50, 220);
|
||||
Vector3 a2 = new Vector3(0, 0, 0);
|
||||
Vector3 a3 = new Vector3(0, 1000, 1000);
|
||||
Vector3 a4 = new Vector3(1020, 0, 1000);
|
||||
Vector3 a5 = new Vector3(1020, 0, 2240);
|
||||
Vector3 a6 = new Vector3(1400, 2000, 4500);
|
||||
|
||||
Vector3 b1 = new Vector3(420, 0, 330);
|
||||
Vector3 b2 = new Vector3(310, 0, 1400);
|
||||
Vector3 b3 = new Vector3(120, 0, 4200);
|
||||
Vector3 b4 = new Vector3(2330, 0, 7300);
|
||||
Vector3 b5 = new Vector3(110, 0, 1400);
|
||||
Vector3 b6 = new Vector3(1200, 0, 5200);
|
||||
Vector3[] aa = new Vector3[] { a1, a2, a3, a4, a5, a6 };
|
||||
Vector3[] bb = new Vector3[] { b1, b2, b3, b4, b5, b6 };
|
||||
|
||||
//FlyVecFun.GetRingVec(a1, a6, 0.5);
|
||||
//return;
|
||||
List<Vector3> a = FlyVecFun.GetRingVec(a1, a6, 0.5);
|
||||
//foreach (int[] v in cc)
|
||||
//{
|
||||
// MessageBox.Show($"{ v[0].ToString()}----{v[1].ToString()}");
|
||||
//}
|
||||
|
||||
//Vector3[] cc = FlyVecFun.ContactABOut(aa,bb);
|
||||
//foreach (var item in a)
|
||||
//{
|
||||
// MessageBox.Show(item.PosToString());
|
||||
//}
|
||||
//MessageBox.Show($"{a[0].ToString()}---{a[1].ToString()}---{a[2].ToString()}---{a[3].ToString()}");
|
||||
string str = "";
|
||||
int id = 1;
|
||||
foreach (Vector3 item in a)
|
||||
{
|
||||
str += id + " 0" + " " + item.X + " " + item.Y + " " + item.Z + "\r\n";
|
||||
id++;
|
||||
}
|
||||
//for (int i = 0; i < 4; i++)
|
||||
//{
|
||||
// str += i + " 0" + " " + a[i].X + " " + a[i].Y + " " + a[i].Z + "\r\n";
|
||||
//}
|
||||
SaveFile("C:/Users/szdot/Desktop/del.txt", str);
|
||||
}
|
||||
//保存输出文本
|
||||
private static void SaveFile(string filePath, string txtCon)
|
||||
{
|
||||
txtCon = txtCon.TrimEnd((char[])"\n\r".ToCharArray());//去除最后的回车符
|
||||
Console.WriteLine(txtCon);
|
||||
string stream = null;
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
StreamReader reader = new StreamReader(filePath);
|
||||
stream = reader.ReadToEnd();
|
||||
reader.Close();
|
||||
}
|
||||
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
|
||||
StreamWriter sw = new StreamWriter(fs);
|
||||
sw.Write(txtCon);
|
||||
sw.Close();
|
||||
fs.Close();
|
||||
}
|
||||
/// <summary>
|
||||
/// 航点文件 模型对象
|
||||
/// </summary>
|
||||
@ -41,13 +113,6 @@ namespace FlyCube
|
||||
/// 导入的gif路径
|
||||
/// </summary>
|
||||
public string ImagePath { get; set; }
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
//创建一个 主画布对象
|
||||
TopCanvas = new MainCanvas(this.LayerPlane);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 导入航点
|
||||
/// </summary>
|
||||
@ -97,7 +162,6 @@ namespace FlyCube
|
||||
PlaneVecOnCanvas[planeId] = v;
|
||||
planeId++;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 输出航点
|
||||
@ -132,8 +196,11 @@ namespace FlyCube
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 渲染输出航点
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Render_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ImageUtility img = new ImageUtility(this.ImagePath);
|
||||
@ -141,7 +208,7 @@ namespace FlyCube
|
||||
foreach (Vector3 item in PlaneVecOnCanvas)
|
||||
{
|
||||
List<LedInfos> ledInfos = new List<LedInfos>();
|
||||
Color[] colors = img.GetColorsForGifPos((int)item.X, (int)item.Y);
|
||||
Color[] colors = img.GetColorsForGifPos((int)item.X, (int)item.Z);
|
||||
string c = "";
|
||||
foreach (var color in colors)
|
||||
{
|
||||
@ -150,20 +217,20 @@ namespace FlyCube
|
||||
//添加灯光信息
|
||||
LedInfos led = new LedInfos();
|
||||
led.Delay = 0.1;
|
||||
led.LEDMode = 0;
|
||||
led.LEDMode = (int)LightClass.常亮;
|
||||
led.LEDInterval = 0.0;
|
||||
led.LEDRate = 0;
|
||||
led.LEDTimes = 0;
|
||||
led.LEDRGB = color.ToString().Remove(0, 3);
|
||||
ledInfos.Add(led);
|
||||
//记录这一帧颜色 用于下次循环和 这一帧进行对比
|
||||
//记录这一帧颜色 用于下次循环时和 这一帧进行对比
|
||||
c = color.ToString().Remove(0, 3);
|
||||
}
|
||||
else//如果和上一帧颜色一样 则不进行Add 并把上一帧的 灯光延时自加0.1秒
|
||||
{
|
||||
ledInfos[ledInfos.Count-1].Delay += 0.1;
|
||||
ledInfos[ledInfos.Count - 1].Delay += 0.1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.FcgmInfo.tasks[2].singleCopterInfos[id].ledInfos = ledInfos;
|
||||
id++;
|
||||
@ -171,7 +238,7 @@ namespace FlyCube
|
||||
|
||||
MessageBox.Show("成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 灯光 组
|
||||
|
55
FlyCube/Properties/AssemblyInfo.cs
Normal file
55
FlyCube/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("FlyCube")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FlyCube")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//若要开始生成可本地化的应用程序,请设置
|
||||
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
|
||||
//例如,如果您在源文件中使用的是美国英语,
|
||||
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
|
||||
//对以下 NeutralResourceLanguage 特性的注释。 更新
|
||||
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//或应用程序资源字典中找到时使用)
|
||||
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//、应用程序或任何主题专用资源字典中找到时使用)
|
||||
)]
|
||||
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
70
FlyCube/Properties/Resources.Designer.cs
generated
Normal file
70
FlyCube/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace FlyCube.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// 强类型资源类,用于查找本地化字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FlyCube.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
FlyCube/Properties/Resources.resx
Normal file
117
FlyCube/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
29
FlyCube/Properties/Settings.Designer.cs
generated
Normal file
29
FlyCube/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace FlyCube.Properties
|
||||
{
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
FlyCube/Properties/Settings.settings
Normal file
7
FlyCube/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
4
FlyCube/packages.config
Normal file
4
FlyCube/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="WpfAnimatedGif" version="2.0.2" targetFramework="net472" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user