Skip to content

Commit

Permalink
Chore: 更改为.Net Framework编译
Browse files Browse the repository at this point in the history
  • Loading branch information
CmST0us committed May 4, 2020
1 parent e29b71a commit e03b3b1
Show file tree
Hide file tree
Showing 15 changed files with 217 additions and 114 deletions.
56 changes: 56 additions & 0 deletions FaceXDSDK-Sample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="https://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>{CBF6376F-A230-499C-951F-B5305FCCCE4D}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>FaceXDSDK_Sample</RootNamespace>
<AssemblyName>FaceXDSDK-Sample</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<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.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="Properties\AssemblyInfo.cs" />
<Compile Include="sample\Program.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="FaceXDSDK.csproj">
<Project>{dd849cfa-3276-47cd-900c-71191aea7bcc}</Project>
<Name>FaceXDSDK</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
74 changes: 55 additions & 19 deletions FaceXDSDK.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,63 @@
<Project Sdk="Microsoft.NET.Sdk">

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="https://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
<Authors>FaceXD</Authors>
<Product>FaceXD</Product>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DD849CFA-3276-47CD-900C-71191AEA7BCC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FaceXDSDK</RootNamespace>
<AssemblyName>FaceXDSDK</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>
<Compile Remove="src\vendor\**" />
<EmbeddedResource Remove="src\vendor\**" />
<None Remove="src\vendor\**" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<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>
<None Remove=".gitignore" />
<None Remove=".gitmodules" />
<None Remove="LICENSE" />
<None Remove="README.md" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="src\Api\BaseApiService.cs" />
<Compile Include="src\Api\V1ApiService.cs" />
<Compile Include="src\Client.cs" />
<Compile Include="src\Model\NetworkPack\BaseNetworkPack.cs" />
<Compile Include="src\Model\NetworkPack\RawJson.cs" />
<Compile Include="src\Network\BaseNetworkComponent.cs" />
<Compile Include="src\Network\DotNetWebSocketComponent.cs" />
<Compile Include="src\Network\WebSocketSharpComponent.cs" />
<Compile Include="src\Server.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="src\vendor\websocket-sharp\websocket-sharp\websocket-sharp.csproj" />
<ProjectReference Include="src\vendor\websocket-sharp\websocket-sharp\websocket-sharp.csproj">
<Project>{b357bac7-529e-4d81-a0d2-71041b19c8de}</Project>
<Name>websocket-sharp</Name>
</ProjectReference>
</ItemGroup>

</Project>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
43 changes: 24 additions & 19 deletions FaceXDSDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaceXDSDK", "FaceXDSDK.csproj", "{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "websocket-sharp", "src\vendor\websocket-sharp\websocket-sharp\websocket-sharp.csproj", "{B357BAC7-529E-4D81-A0D2-71041B19C8DE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FaceXDSDKSample", "FaceXDSDKSample.csproj", "{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vendor", "vendor", "{9BA58FD4-AC44-4191-9627-A5EA2A5A8A78}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FaceXDSDK", "FaceXDSDK.csproj", "{DD849CFA-3276-47CD-900C-71191AEA7BCC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FaceXDSDK-Sample", "FaceXDSDK-Sample.csproj", "{CBF6376F-A230-499C-951F-B5305FCCCE4D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -17,14 +19,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C927E9B-0FE2-4BF8-9746-D6176FAC4B09}.Release|Any CPU.Build.0 = Release|Any CPU
{B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug_Ubuntu|Any CPU
{B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Debug_Ubuntu|Any CPU.Build.0 = Debug_Ubuntu|Any CPU
{B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -33,18 +27,29 @@ Global
{B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Release_Ubuntu|Any CPU.Build.0 = Release_Ubuntu|Any CPU
{B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B357BAC7-529E-4D81-A0D2-71041B19C8DE}.Release|Any CPU.Build.0 = Release|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94742DBF-B19C-46B8-8558-BF3F98EA4C5D}.Release|Any CPU.Build.0 = Release|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD849CFA-3276-47CD-900C-71191AEA7BCC}.Release|Any CPU.Build.0 = Release|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Release_Ubuntu|Any CPU.ActiveCfg = Release|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Release_Ubuntu|Any CPU.Build.0 = Release|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CBF6376F-A230-499C-951F-B5305FCCCE4D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B357BAC7-529E-4D81-A0D2-71041B19C8DE} = {9BA58FD4-AC44-4191-9627-A5EA2A5A8A78}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C4D2D9EE-0E0D-4E87-84FD-30A2FED36996}
EndGlobalSection
Expand Down
26 changes: 0 additions & 26 deletions FaceXDSDKSample.csproj

This file was deleted.

35 changes: 35 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FaceXDSDK")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FaceXDSDK")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("dd849cfa-3276-47cd-900c-71191aea7bcc")]

// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
8 changes: 2 additions & 6 deletions sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading;
namespace FaceXDSDKSample
{
class Program
Expand All @@ -27,13 +23,13 @@ static void Main(string[] args)
};

/// Must after register delegate;
server.Run("ws:https://127.0.0.1:12003/");
server.Run("ws:https://0.0.0.0:12003/");
Console.ReadKey();
}

static void HandleCaptureFaceParameter(string guid, FaceXDSDK.Api.BasePack pack)
{
var captureFaceParameter = (FaceXDSDK.Api.v1.CaptureFaceParameterTransaction)pack;
var captureFaceParameter = (FaceXDSDK.Api.v1.CaptureFaceParameterTransaction)pack;
Console.WriteLine("[{0}][CaptureFaceParameter]: headPitch: {1}, headRoll: {2}, headYaw: {3}", guid, captureFaceParameter.HeadPitch, captureFaceParameter.HeadRoll, captureFaceParameter.HeadYaw);
}
}
Expand Down
7 changes: 2 additions & 5 deletions src/Api/BaseApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization.Json;
using System.Text;

namespace FaceXDSDK.Api
{
Expand All @@ -18,14 +15,14 @@ virtual public void DispatchPack(BaseNetworkPack pack, string guid)
}
}

public class BasePack: RawJson
public class BasePack : RawJson
{
public const string TypeSet = "set";
public const string TypeGet = "get";
public const string TypeAction = "action";
public const string TypeTransaction = "transaction";

public BasePack(byte[] data): base(data)
public BasePack(byte[] data) : base(data)
{

}
Expand Down
20 changes: 11 additions & 9 deletions src/Api/V1ApiService.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using FaceXDSDK.Model.NetworkPack;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace FaceXDSDK.Api
{
namespace v1
{
public class ApiService: BaseApiService
public class ApiService : BaseApiService
{

Dictionary<string, Type> packMap;
Expand Down Expand Up @@ -57,23 +55,26 @@ private void DispatchRawJsonPack(RawJson jsonPack, string guid)
}
}

public class CaptureFaceParameterTransaction: BasePack
public class CaptureFaceParameterTransaction : BasePack
{
public CaptureFaceParameterTransaction(byte[] data): base(data)
public CaptureFaceParameterTransaction(byte[] data) : base(data)
{

}
public string EyeROpen {
public string EyeROpen
{
get
{
return (string)this.JsonDictionary["eyeROpen"];
}
set {
set
{
this.JsonDictionary["eyeROpen"] = value;
}
}

public string EyeBrowYL {
public string EyeBrowYL
{
get
{
return (string)this.JsonDictionary["eyeBrowYL"];
Expand All @@ -84,7 +85,8 @@ public string EyeBrowYL {
}
}

public string MouthOpenY {
public string MouthOpenY
{
get
{
return (string)this.JsonDictionary["mouthOpenY"];
Expand Down
2 changes: 1 addition & 1 deletion src/Client.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
using System.Net;
using System.Threading.Tasks;

namespace FaceXDSDK
{
Expand Down
Loading

0 comments on commit e03b3b1

Please sign in to comment.