Daily update on 20250304-070522 by Nitload Youmu. Additional Message : None
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,6 @@ INCLUDELIB OLDNAMES
|
|||||||
|
|
||||||
_DATA SEGMENT
|
_DATA SEGMENT
|
||||||
COMM infolog:BYTE:0200H
|
COMM infolog:BYTE:0200H
|
||||||
COMM currentContext:QWORD
|
|
||||||
_DATA ENDS
|
_DATA ENDS
|
||||||
msvcjmc SEGMENT
|
msvcjmc SEGMENT
|
||||||
__7583A0D2_mmintrin@h DB 01H
|
__7583A0D2_mmintrin@h DB 01H
|
||||||
|
|||||||
@@ -1,56 +1,5 @@
|
|||||||
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||||
StgSharpC.c
|
StgSharpC.c
|
||||||
intrinsic.c
|
|
||||||
mat4.c
|
|
||||||
string.c
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\StgSharpC.c(14,30): warning C4244: “函数”: 从“uint64_t”转换到“GLuint”,可能丢失数据
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\StgSharpC.c(14,30): warning C4244: “函数”: 从“uint64_t”转换到“GLuint”,可能丢失数据
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\StgSharpC.c(16,43): warning C4244: “函数”: 从“uint64_t”转换到“GLuint”,可能丢失数据
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\StgSharpC.c(16,43): warning C4244: “函数”: 从“uint64_t”转换到“GLuint”,可能丢失数据
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\string.c(21,54): warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\string.c(36,54): warning C4267: “return”: 从“size_t”转换到“int”,可能丢失数据
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(9,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(9,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(11,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(11,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(20,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(20,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(22,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(22,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(24,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(24,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(26,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(26,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(36,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(36,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(38,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(38,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(40,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(40,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(42,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(42,62): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(51,54): warning C4028: 形参 1 与声明不同
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(51,84): warning C4028: 形参 2 与声明不同
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(53,22): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(54,22): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(55,22): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(56,22): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(59,28): warning C4013: “det_mat3_internal”未定义;假设外部返回 int
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(59,28): warning C4244: “函数”: 从“int”转换到“float”,可能丢失数据
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(59,62): warning C4244: “函数”: 从“int”转换到“float”,可能丢失数据
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(60,28): warning C4244: “函数”: 从“int”转换到“float”,可能丢失数据
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(60,62): warning C4244: “函数”: 从“int”转换到“float”,可能丢失数据
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(61,36): warning C4133: “函数”: 从“const __m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(69,37): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(69,61): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(70,37): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(70,61): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(71,37): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(71,61): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(72,37): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(72,61): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(77,38): warning C4133: “函数”: 从“__m256 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(77,63): warning C4133: “函数”: 从“__m256 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(78,38): warning C4133: “函数”: 从“__m256 *”到“const float *”的类型不兼容
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c(78,63): warning C4133: “函数”: 从“__m256 *”到“const float *”的类型不兼容
|
|
||||||
正在创建库 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.lib 和对象 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.exp
|
|
||||||
LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
|
|
||||||
StgSharpC.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.dll
|
StgSharpC.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.dll
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// file="BlueprintSchedueler.cs"
|
// file="Blueprint.cs"
|
||||||
// Project: StgSharp
|
// Project: StgSharp
|
||||||
// AuthorGroup: Nitload Space
|
// AuthorGroup: Nitload Space
|
||||||
// Copyright (c) Nitload Space. All rights reserved.
|
// Copyright (c) Nitload Space. All rights reserved.
|
||||||
@@ -28,27 +28,19 @@
|
|||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
using StgSharp;
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Serialization;
|
|
||||||
|
|
||||||
namespace StgSharp.Blueprint
|
namespace StgSharp.Blueprint
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A sets of complex logic designed for running in multi threads environment. Warning: do not
|
/// A sets of complex logic designed for running in multi threads environment. Warning: do not
|
||||||
/// run a <see cref="BlueprintSchedueler" /> instance in multi threads more than once.
|
/// run a <see cref="BlueprintScheduler" /> instance in multi threads more than once.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class BlueprintSchedueler : IConvertableToBlueprintNode
|
public partial class BlueprintScheduler : IConvertableToBlueprintNode
|
||||||
{
|
{
|
||||||
|
|
||||||
private BeginningNode beginNode;
|
private BeginningNode beginNode;
|
||||||
@@ -64,7 +56,7 @@ namespace StgSharp.Blueprint
|
|||||||
internal int currentGlobalNodeIndex;
|
internal int currentGlobalNodeIndex;
|
||||||
internal int currentNativeNodeIndex;
|
internal int currentNativeNodeIndex;
|
||||||
|
|
||||||
public BlueprintSchedueler()
|
public BlueprintScheduler()
|
||||||
{
|
{
|
||||||
allNode = new Dictionary<string, BlueprintNode>();
|
allNode = new Dictionary<string, BlueprintNode>();
|
||||||
globalNodeList = new List<BlueprintNode>();
|
globalNodeList = new List<BlueprintNode>();
|
||||||
@@ -78,23 +70,24 @@ namespace StgSharp.Blueprint
|
|||||||
|
|
||||||
public BlueprintNode EndLayer => endNode;
|
public BlueprintNode EndLayer => endNode;
|
||||||
|
|
||||||
|
public BlueprintNodeOperation Operation
|
||||||
|
{
|
||||||
|
get => ExecuteMain;
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsRunning
|
public bool IsRunning
|
||||||
{
|
{
|
||||||
get => runningStat.CurrentCount == 0;
|
get => runningStat.CurrentCount == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<string> InputInterfacesName
|
public IEnumerable<string> InputInterfacesName
|
||||||
{
|
{
|
||||||
get { return beginNode.OutputInterfaces
|
get { return beginNode.OutputInterfaces.Keys; }
|
||||||
.Select( p => p.Key )
|
|
||||||
.ToArray(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<string> OutputInterfacesName
|
public IEnumerable<string> OutputInterfacesName
|
||||||
{
|
{
|
||||||
get { return beginNode.OutputInterfaces
|
get { return beginNode.OutputInterfaces.Keys; }
|
||||||
.Select( p => p.Key )
|
|
||||||
.ToArray(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
@@ -112,7 +105,6 @@ namespace StgSharp.Blueprint
|
|||||||
allNode.Add( node.Name, node );
|
allNode.Add( node.Name, node );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ExecuteMain(
|
public void ExecuteMain(
|
||||||
in Dictionary<string, BlueprintPipeline> input,
|
in Dictionary<string, BlueprintPipeline> input,
|
||||||
in Dictionary<string, BlueprintPipeline> output )
|
in Dictionary<string, BlueprintPipeline> output )
|
||||||
@@ -120,11 +112,6 @@ namespace StgSharp.Blueprint
|
|||||||
BlueprintRunner.Run( this );
|
BlueprintRunner.Run( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlueprintNodeOperation Operation
|
|
||||||
{
|
|
||||||
get => ExecuteMain;
|
|
||||||
}
|
|
||||||
|
|
||||||
[MethodImpl( MethodImplOptions.AggressiveInlining )]
|
[MethodImpl( MethodImplOptions.AggressiveInlining )]
|
||||||
public (string name, BlueprintPipelineArgs arg)[] GetOutput()
|
public (string name, BlueprintPipelineArgs arg)[] GetOutput()
|
||||||
{
|
{
|
||||||
@@ -179,7 +166,7 @@ namespace StgSharp.Blueprint
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
~BlueprintSchedueler()
|
~BlueprintScheduler()
|
||||||
{
|
{
|
||||||
runningStat.Dispose();
|
runningStat.Dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace StgSharp.Blueprint
|
namespace StgSharp.Blueprint
|
||||||
{
|
{
|
||||||
public partial class BlueprintSchedueler
|
public partial class BlueprintScheduler
|
||||||
{
|
{
|
||||||
|
|
||||||
public BlueprintNode CreateBlueprintNode(
|
public BlueprintNode CreateBlueprintNode(
|
||||||
|
|||||||
@@ -47,30 +47,26 @@ namespace StgSharp.Blueprint
|
|||||||
public static class BlueprintRunner
|
public static class BlueprintRunner
|
||||||
{
|
{
|
||||||
|
|
||||||
private static NodeRunner[] allAvailableTask = CreateBlueprintRunnerArray();
|
private static NodeRunner[] allAvailableTask = CreateBlueprintRunnerArray(
|
||||||
private static CancellationTokenSource cts = new CancellationTokenSource();
|
);
|
||||||
private static ConcurrentStack<BlueprintSchedueler> blueprintInWaiting
|
private static CancellationTokenSource cts = new CancellationTokenSource(
|
||||||
= new ConcurrentStack<BlueprintSchedueler>();
|
);
|
||||||
|
private static ConcurrentStack<BlueprintScheduler> blueprintInWaiting
|
||||||
|
= new ConcurrentStack<BlueprintScheduler>();
|
||||||
private static int _callingThread;
|
private static int _callingThread;
|
||||||
private static SemaphoreSlim bpLock = new SemaphoreSlim( 0, 1 );
|
private static SemaphoreSlim bpLock = new SemaphoreSlim( 0, 1 );
|
||||||
|
|
||||||
private static NodeRunner[] CreateBlueprintRunnerArray()
|
|
||||||
{
|
|
||||||
int count = Environment.ProcessorCount;
|
|
||||||
return new NodeRunner[ count < 2 ? count : count - 2];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Only the fallowing occasions of calling are valid:
|
/// Only the fallowing occasions of calling are valid: 1. no bp is running or the only bp is
|
||||||
/// 1. no bp is running or the only bp is quitting.
|
/// quitting. 2. calling from the main thread and the current running bp.
|
||||||
/// 2. calling from the main thread and the current running bp.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static bool IsValidCalling
|
internal static bool IsValidCalling
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if( ( NodeRunner.CurrentBlueprint == null ) || //no bp running at all
|
if( ( NodeRunner.CurrentBlueprint == null ) || //no bp running at all
|
||||||
( ( blueprintInWaiting.IsEmpty ) && ( NodeRunner.CurrentBlueprint.IsRunning == false ) ) )
|
( ( blueprintInWaiting.IsEmpty ) && ( NodeRunner.CurrentBlueprint.IsRunning ==
|
||||||
|
false ) ) )
|
||||||
// a bp is quiting
|
// a bp is quiting
|
||||||
{
|
{
|
||||||
//in case no bp is running
|
//in case no bp is running
|
||||||
@@ -91,7 +87,7 @@ namespace StgSharp.Blueprint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Run(BlueprintSchedueler blueprint)
|
public static void Run( BlueprintScheduler blueprint )
|
||||||
{
|
{
|
||||||
//Console.WriteLine();
|
//Console.WriteLine();
|
||||||
if( blueprint == null ) {
|
if( blueprint == null ) {
|
||||||
@@ -104,14 +100,13 @@ namespace StgSharp.Blueprint
|
|||||||
if( IsValidCalling ) {
|
if( IsValidCalling ) {
|
||||||
//Console.WriteLine("valid and run");
|
//Console.WriteLine("valid and run");
|
||||||
if( InterruptAndRunNewBp( blueprint ) ) {
|
if( InterruptAndRunNewBp( blueprint ) ) {
|
||||||
while (InterruptAndRunNewBp(
|
while( InterruptAndRunNewBp( NodeRunner.CurrentBlueprint ) ) { }
|
||||||
NodeRunner.CurrentBlueprint )){ };
|
;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bpLock.Wait();
|
bpLock.Wait();
|
||||||
if( InterruptAndRunNewBp( blueprint ) ) {
|
if( InterruptAndRunNewBp( blueprint ) ) {
|
||||||
while (InterruptAndRunNewBp(
|
while( InterruptAndRunNewBp( NodeRunner.CurrentBlueprint ) ) { }
|
||||||
NodeRunner.CurrentBlueprint)) { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bpLock.Release();
|
bpLock.Release();
|
||||||
@@ -141,16 +136,17 @@ namespace StgSharp.Blueprint
|
|||||||
foreach( NodeRunner task in allAvailableTask ) {
|
foreach( NodeRunner task in allAvailableTask ) {
|
||||||
task.Cts.Cancel();
|
task.Cts.Cancel();
|
||||||
}
|
}
|
||||||
foreach( BlueprintSchedueler bp in blueprintInWaiting ) {
|
foreach( BlueprintScheduler bp in blueprintInWaiting ) {
|
||||||
bp.Terminate();
|
bp.Terminate();
|
||||||
}
|
}
|
||||||
blueprintInWaiting.Clear();
|
blueprintInWaiting.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool InterruptAndRunNewBp( BlueprintSchedueler newBp )
|
internal static bool InterruptAndRunNewBp( BlueprintScheduler newBp )
|
||||||
{
|
{
|
||||||
Debug.Assert( newBp != null );
|
Debug.Assert( newBp != null );
|
||||||
if( ( newBp != NodeRunner.CurrentBlueprint ) && ( NodeRunner.CurrentBlueprint != null ) ) {
|
if( ( newBp != NodeRunner.CurrentBlueprint ) && ( NodeRunner.CurrentBlueprint !=
|
||||||
|
null ) ) {
|
||||||
//if a running bp exists
|
//if a running bp exists
|
||||||
blueprintInWaiting.Push( NodeRunner.CurrentBlueprint );
|
blueprintInWaiting.Push( NodeRunner.CurrentBlueprint );
|
||||||
}
|
}
|
||||||
@@ -162,7 +158,8 @@ namespace StgSharp.Blueprint
|
|||||||
|
|
||||||
//run beginning node to init it first.
|
//run beginning node to init it first.
|
||||||
if( !NodeRunner.CurrentBlueprint.IsRunning ) {
|
if( !NodeRunner.CurrentBlueprint.IsRunning ) {
|
||||||
( NodeRunner.CurrentBlueprint.BeginLayer as BeginningNode )!.Run();
|
( NodeRunner.CurrentBlueprint.BeginLayer as BeginningNode )!.Run(
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//refresh all tasks
|
//refresh all tasks
|
||||||
@@ -184,12 +181,18 @@ namespace StgSharp.Blueprint
|
|||||||
return blueprintInWaiting.TryPeek( out NodeRunner.CurrentBlueprint );
|
return blueprintInWaiting.TryPeek( out NodeRunner.CurrentBlueprint );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static NodeRunner[] CreateBlueprintRunnerArray()
|
||||||
|
{
|
||||||
|
int count = Environment.ProcessorCount;
|
||||||
|
return new NodeRunner[ count < 2 ? count : count - 2];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class NodeRunner : CancellableTask
|
internal class NodeRunner : CancellableTask
|
||||||
{
|
{
|
||||||
|
|
||||||
private static BlueprintSchedueler _current;
|
private static BlueprintScheduler _current;
|
||||||
|
|
||||||
internal NodeRunner()
|
internal NodeRunner()
|
||||||
: base()
|
: base()
|
||||||
@@ -197,7 +200,7 @@ namespace StgSharp.Blueprint
|
|||||||
_startup = InternalRun;
|
_startup = InternalRun;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ref BlueprintSchedueler CurrentBlueprint
|
internal static ref BlueprintScheduler CurrentBlueprint
|
||||||
{
|
{
|
||||||
get => ref _current;
|
get => ref _current;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,9 +40,12 @@ namespace StgSharp.Blueprint
|
|||||||
{
|
{
|
||||||
public class CrossFrameOperation : IConvertableToBlueprintNode
|
public class CrossFrameOperation : IConvertableToBlueprintNode
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static string[] _inputName = ["TaskIn"];
|
||||||
|
private static string[] _outputName = ["TaskOut"];
|
||||||
|
private Action _mainExecution;
|
||||||
private int currentCount;
|
private int currentCount;
|
||||||
private readonly int cycleCount;
|
private readonly int cycleCount;
|
||||||
private Action _mainExecution;
|
|
||||||
|
|
||||||
public CrossFrameOperation( Action startup, int cycleCount )
|
public CrossFrameOperation( Action startup, int cycleCount )
|
||||||
{
|
{
|
||||||
@@ -60,14 +63,15 @@ namespace StgSharp.Blueprint
|
|||||||
private protected set => _mainExecution = value;
|
private protected set => _mainExecution = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string[] _inputName = ["TaskIn"];
|
|
||||||
private static string[] _outputName = ["TaskOut"];
|
|
||||||
|
|
||||||
public BlueprintNodeOperation Operation
|
public BlueprintNodeOperation Operation
|
||||||
{
|
{
|
||||||
get => ExecuteMain;
|
get => ExecuteMain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<string> InputInterfacesName => _inputName;
|
||||||
|
|
||||||
|
public IEnumerable<string> OutputInterfacesName => _outputName;
|
||||||
|
|
||||||
public void ExecuteMain(
|
public void ExecuteMain(
|
||||||
in Dictionary<string, BlueprintPipeline> input,
|
in Dictionary<string, BlueprintPipeline> input,
|
||||||
in Dictionary<string, BlueprintPipeline> output )
|
in Dictionary<string, BlueprintPipeline> output )
|
||||||
@@ -83,9 +87,5 @@ namespace StgSharp.Blueprint
|
|||||||
BlueprintPipeline.SkipAll( output );
|
BlueprintPipeline.SkipAll( output );
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<string> InputInterfacesName => _inputName;
|
|
||||||
|
|
||||||
public ReadOnlySpan<string> OutputInterfacesName => _outputName;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,17 +41,21 @@ namespace StgSharp.Blueprint
|
|||||||
|
|
||||||
public interface IConvertableToBlueprintNode
|
public interface IConvertableToBlueprintNode
|
||||||
{
|
{
|
||||||
public ReadOnlySpan<string> InputInterfacesName
|
|
||||||
|
BlueprintNodeOperation Operation
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<string> OutputInterfacesName
|
public IEnumerable<string> InputInterfacesName
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlueprintNodeOperation Operation { get; }
|
public IEnumerable<string> OutputInterfacesName
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,9 +78,9 @@ namespace StgSharp.Blueprint
|
|||||||
|
|
||||||
public BlueprintNodeOperation Operation => _execution;
|
public BlueprintNodeOperation Operation => _execution;
|
||||||
|
|
||||||
public ReadOnlySpan<string> InputInterfacesName => _input;
|
public IEnumerable<string> InputInterfacesName => _input;
|
||||||
|
|
||||||
public ReadOnlySpan<string> OutputInterfacesName => _output;
|
public IEnumerable<string> OutputInterfacesName => _output;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,10 +42,12 @@ namespace StgSharp.Blueprint
|
|||||||
internal sealed class BeginningNode : BlueprintNode
|
internal sealed class BeginningNode : BlueprintNode
|
||||||
{
|
{
|
||||||
|
|
||||||
private BlueprintSchedueler _bp;
|
private BlueprintScheduler _bp;
|
||||||
|
|
||||||
public BeginningNode( BlueprintSchedueler bp )
|
public BeginningNode( BlueprintScheduler bp )
|
||||||
: base(DefaultOperation, name: "BeginningNode", true, ["default"], ["default"] )
|
: base(
|
||||||
|
DefaultOperation, name: "BeginningNode", true, ["default"],
|
||||||
|
["default"] )
|
||||||
{
|
{
|
||||||
_bp = bp;
|
_bp = bp;
|
||||||
}
|
}
|
||||||
@@ -84,10 +86,12 @@ namespace StgSharp.Blueprint
|
|||||||
internal sealed class EndingNode : BlueprintNode
|
internal sealed class EndingNode : BlueprintNode
|
||||||
{
|
{
|
||||||
|
|
||||||
private BlueprintSchedueler _bp;
|
private BlueprintScheduler _bp;
|
||||||
|
|
||||||
public EndingNode( BlueprintSchedueler bp )
|
public EndingNode( BlueprintScheduler bp )
|
||||||
: base(DefaultOperation, name: "EndingNode", true, ["default"], ["default"] )
|
: base(
|
||||||
|
DefaultOperation, name: "EndingNode", true, ["default"],
|
||||||
|
["default"] )
|
||||||
{
|
{
|
||||||
_bp = bp;
|
_bp = bp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Common")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Common")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+83bde12d2227bf32a3b939e94849bbd7273bad21")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+825e68853cd1738287eecc8a4390ee9c78550308")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Common")]
|
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Common")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Common")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Common")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/83bde12d2227bf32a3b939e94849bbd7273bad21/*"}}
|
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// file="STEP.cs"
|
// file="StepModel.cs"
|
||||||
// Project: StgSharp
|
// Project: StgSharp
|
||||||
// AuthorGroup: Nitload Space
|
// AuthorGroup: Nitload Space
|
||||||
// Copyright (c) Nitload Space. All rights reserved.
|
// Copyright (c) Nitload Space. All rights reserved.
|
||||||
@@ -38,9 +38,10 @@ namespace StgSharp.Modeling.STEP
|
|||||||
{
|
{
|
||||||
public class StepModel
|
public class StepModel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private BlueprintScheduler _builder;
|
||||||
private Dictionary<int, IStepObject> _node
|
private Dictionary<int, IStepObject> _node
|
||||||
= new Dictionary<int, IStepObject>();
|
= new Dictionary<int, IStepObject>();
|
||||||
private BlueprintSchedueler _builder;
|
|
||||||
private StepInfo _header;
|
private StepInfo _header;
|
||||||
|
|
||||||
internal StepModel(
|
internal StepModel(
|
||||||
@@ -49,20 +50,15 @@ namespace StgSharp.Modeling.STEP
|
|||||||
{
|
{
|
||||||
_header = header;
|
_header = header;
|
||||||
_node = nodeSource;
|
_node = nodeSource;
|
||||||
_builder = new BlueprintSchedueler();
|
_builder = new BlueprintScheduler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void BuildGeometry() { }
|
||||||
|
|
||||||
public void OrganizeNode()
|
public void OrganizeNode()
|
||||||
{
|
{
|
||||||
foreach (var node in _node)
|
foreach( KeyValuePair<int, IStepObject> node in _node ) { }
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildGeometry()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Model")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Model")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c23b640cae59b9ee7dcfd8f026b8970a084ddbd7")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+825e68853cd1738287eecc8a4390ee9c78550308")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Model")]
|
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Model")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Model")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Model")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/c23b640cae59b9ee7dcfd8f026b8970a084ddbd7/*"}}
|
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}}
|
||||||
@@ -32,11 +32,20 @@ using System;
|
|||||||
|
|
||||||
namespace StgSharp.Script.Express
|
namespace StgSharp.Script.Express
|
||||||
{
|
{
|
||||||
public class ExpBuiltinConstant<T> : ExpLiteralGenericNode<T>
|
internal partial class ExpSchema_Nitload
|
||||||
{
|
{
|
||||||
|
|
||||||
internal ExpBuiltinConstant( string name, T value )
|
public ExpTypeSource IntType
|
||||||
: base( name, null!, value ) { }
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExpTypeSource FloatType
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,12 +68,6 @@ namespace StgSharp.Script.Express
|
|||||||
|
|
||||||
public abstract IEnumerator<ExpElementInstanceBase> GetEnumerator();
|
public abstract IEnumerator<ExpElementInstanceBase> GetEnumerator();
|
||||||
|
|
||||||
public override sealed bool IsConvertable(
|
|
||||||
ExpInstantiableElement targetType )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
{
|
{
|
||||||
return GetEnumerator();
|
return GetEnumerator();
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ namespace StgSharp.Script.Express
|
|||||||
protected internal (int min, int max) _range;
|
protected internal (int min, int max) _range;
|
||||||
protected internal ExpElementType _memberType;
|
protected internal ExpElementType _memberType;
|
||||||
|
|
||||||
protected ExpCollectionInstanceBase( string name, ExpSchema context )
|
protected ExpCollectionInstanceBase( string name ) : base( name ) { }
|
||||||
: base( name ) { }
|
|
||||||
|
|
||||||
public abstract ExpCollectionBase CollectionValue
|
public abstract ExpCollectionBase CollectionValue
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,40 +34,84 @@ using System.Text;
|
|||||||
|
|
||||||
namespace StgSharp.Script.Express
|
namespace StgSharp.Script.Express
|
||||||
{
|
{
|
||||||
public enum ExpLogic
|
public enum ExpLogicValue
|
||||||
{
|
{
|
||||||
|
|
||||||
Unknown = 0,
|
True,
|
||||||
False = 1,
|
False,
|
||||||
True = 2,
|
Unknown
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class LogicConverter
|
public struct ExpLogic
|
||||||
{
|
{
|
||||||
public static bool? AsNullableBool(this ExpLogic l)
|
|
||||||
|
public static readonly ExpLogic False = new ExpLogic(
|
||||||
|
ExpLogicValue.False );
|
||||||
|
|
||||||
|
public static readonly ExpLogic True = new ExpLogic(
|
||||||
|
ExpLogicValue.True );
|
||||||
|
public static readonly ExpLogic Unknown = new ExpLogic(
|
||||||
|
ExpLogicValue.Unknown );
|
||||||
|
|
||||||
|
private readonly ExpLogicValue _value;
|
||||||
|
|
||||||
|
public ExpLogic( ExpLogicValue value )
|
||||||
{
|
{
|
||||||
switch (l)
|
_value = value;
|
||||||
{
|
|
||||||
case ExpLogic.Unknown:
|
|
||||||
return null;
|
|
||||||
case ExpLogic.False:
|
|
||||||
return false;
|
|
||||||
case ExpLogic.True:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
throw new ArgumentException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExpLogic AsNullableInt(this bool? b)
|
public bool IsTrue => _value == ExpLogicValue.True;
|
||||||
|
|
||||||
|
public bool IsFalse => _value == ExpLogicValue.False;
|
||||||
|
|
||||||
|
public bool IsUnknown => _value == ExpLogicValue.Unknown;
|
||||||
|
|
||||||
|
public override string ToString() => _value.ToString();
|
||||||
|
|
||||||
|
// NOT !
|
||||||
|
public static ExpLogic operator !( ExpLogic a )
|
||||||
{
|
{
|
||||||
return b switch
|
return a.IsTrue ? False : a.IsFalse ? True : Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
// AND &
|
||||||
|
public static ExpLogic operator &( ExpLogic a, ExpLogic b )
|
||||||
{
|
{
|
||||||
null => ExpLogic.Unknown,
|
if( a.IsFalse || b.IsFalse ) {
|
||||||
true => ExpLogic.True,
|
return False;
|
||||||
false => ExpLogic.False,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( a.IsUnknown || b.IsUnknown ) {
|
||||||
|
return Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
// XOR ^
|
||||||
|
public static ExpLogic operator ^( ExpLogic a, ExpLogic b )
|
||||||
|
{
|
||||||
|
if( a.IsUnknown || b.IsUnknown ) {
|
||||||
|
return Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ( a.IsTrue ^ b.IsTrue ) ? True : False;
|
||||||
|
}
|
||||||
|
|
||||||
|
// OR |
|
||||||
|
public static ExpLogic operator |( ExpLogic a, ExpLogic b )
|
||||||
|
{
|
||||||
|
if( a.IsTrue || b.IsTrue ) {
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( a.IsUnknown || b.IsUnknown ) {
|
||||||
|
return Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ using System.Collections;
|
|||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
using static StgSharp.Script.Express.ExpCompile;
|
using static StgSharp.Script.Express.ExpCompile;
|
||||||
|
|
||||||
@@ -80,7 +77,7 @@ namespace StgSharp.Script.Express
|
|||||||
string name,
|
string name,
|
||||||
out ExpFunctionSource f )
|
out ExpFunctionSource f )
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return FunctionDict.TryGetValue( name, out f! );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool TryGetRule( string name, out ExpRuleSource r )
|
public override bool TryGetRule( string name, out ExpRuleSource r )
|
||||||
@@ -131,9 +128,9 @@ namespace StgSharp.Script.Express
|
|||||||
|
|
||||||
ConstDict = new Dictionary<string, ExpElementInstanceBase>(
|
ConstDict = new Dictionary<string, ExpElementInstanceBase>(
|
||||||
Multiplexer ) {
|
Multiplexer ) {
|
||||||
{ PoolString( "PI" ), new ExpBuiltinConstant<float>(
|
{ PoolString( "PI" ), new ExpLiteralGenericNode<float>(
|
||||||
PoolString( "PI" ), MathF.PI ) },
|
PoolString( "PI" ), MathF.PI ) },
|
||||||
{ PoolString( "E" ), new ExpBuiltinConstant<float>(
|
{ PoolString( "E" ), new ExpLiteralGenericNode<float>(
|
||||||
PoolString( "E" ), MathF.E ) },
|
PoolString( "E" ), MathF.E ) },
|
||||||
}.ToFrozenDictionary();
|
}.ToFrozenDictionary();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// file="ExpElementInstanceNode.cs"
|
||||||
|
// Project: StgSharp
|
||||||
|
// AuthorGroup: Nitload Space
|
||||||
|
// Copyright (c) Nitload Space. All rights reserved.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person
|
||||||
|
// obtaining a copy of this software and associated documentation
|
||||||
|
// files (the “Software”), to deal in the Software without restriction,
|
||||||
|
// including without limitation the rights to use, copy, modify, merge,
|
||||||
|
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
// and to permit persons to whom the Software is furnished to do so,
|
||||||
|
// subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and
|
||||||
|
// this permission notice shall be included in all copies
|
||||||
|
// or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||||
|
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||||
|
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StgSharp.Script.Express
|
||||||
|
{
|
||||||
|
public class ExpElementInstanceNode : ExpNode
|
||||||
|
{
|
||||||
|
|
||||||
|
private ExpInstantiableElement _element;
|
||||||
|
|
||||||
|
public ExpElementInstanceNode(
|
||||||
|
string varName,
|
||||||
|
ExpInstantiableElement element )
|
||||||
|
: base( varName )
|
||||||
|
{
|
||||||
|
_element = element;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override ExpInstantiableElement EqualityTypeConvert => _element;
|
||||||
|
|
||||||
|
public override ExpNode Left => Empty;
|
||||||
|
|
||||||
|
public override ExpNode Right => Empty;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,8 +43,7 @@ namespace StgSharp.Script.Express
|
|||||||
|
|
||||||
private ExpNode _indexExpression;
|
private ExpNode _indexExpression;
|
||||||
|
|
||||||
public ExpIndexOfNode(
|
private ExpIndexOfNode(
|
||||||
ExpSchema context,
|
|
||||||
ExpCollectionInstanceBase instance,
|
ExpCollectionInstanceBase instance,
|
||||||
ExpNode indexExpression )
|
ExpNode indexExpression )
|
||||||
: base( ExpCompile.PoolString( "[" ) )
|
: base( ExpCompile.PoolString( "[" ) )
|
||||||
@@ -60,5 +59,16 @@ namespace StgSharp.Script.Express
|
|||||||
|
|
||||||
public override IExpElementSource EqualityTypeConvert => _collection.EqualityTypeConvert;
|
public override IExpElementSource EqualityTypeConvert => _collection.EqualityTypeConvert;
|
||||||
|
|
||||||
|
public static ExpIndexOfNode Create(
|
||||||
|
ExpCollectionInstanceBase instance,
|
||||||
|
ExpNode indexExpression )
|
||||||
|
{
|
||||||
|
if( !indexExpression.IsNumber ) {
|
||||||
|
throw new ExpInvalidTypeException(
|
||||||
|
"Number", indexExpression.EqualityTypeConvert.Name );
|
||||||
|
}
|
||||||
|
return new ExpIndexOfNode( instance, indexExpression );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ namespace StgSharp.Script.Express
|
|||||||
private readonly ExpBuiltinType _type;
|
private readonly ExpBuiltinType _type;
|
||||||
private readonly T _value;
|
private readonly T _value;
|
||||||
|
|
||||||
public ExpLiteralGenericNode( string name, ExpSchema context, T value )
|
public ExpLiteralGenericNode( string name, T value )
|
||||||
: base( name )
|
: base( name )
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace StgSharp.Script.Express
|
|||||||
|
|
||||||
public override IExpElementSource EqualityTypeConvert => _operand.EqualityTypeConvert;
|
public override IExpElementSource EqualityTypeConvert => _operand.EqualityTypeConvert;
|
||||||
|
|
||||||
public static ExpUnaryOperatorNode UnaryNotNegation( ExpNode operand )
|
public static ExpUnaryOperatorNode UnaryNegation( ExpNode operand )
|
||||||
{
|
{
|
||||||
if( !operand.IsNumber ) {
|
if( !operand.IsNumber ) {
|
||||||
throw new ExpInvalidTypeException(
|
throw new ExpInvalidTypeException(
|
||||||
@@ -73,5 +73,19 @@ namespace StgSharp.Script.Express
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ExpUnaryOperatorNode UnaryNot( ExpNode operand )
|
||||||
|
{
|
||||||
|
if( ( operand._nodeFlag | ( ExpNodeFlag.BuiltinType_Logic | ExpNodeFlag.BuiltinType_Logic ) ) ==
|
||||||
|
0 ) {
|
||||||
|
throw new ExpInvalidTypeException(
|
||||||
|
"Bool or Logic", operand.EqualityTypeConvert.Name );
|
||||||
|
}
|
||||||
|
return new ExpUnaryOperatorNode( ExpCompile.KeyWord.NOT )
|
||||||
|
{
|
||||||
|
_nodeFlag = ExpNodeFlag.Operator_Unary | ExpNodeFlag.BuiltinType_Logic,
|
||||||
|
CodeConvertTemplate = "! {0}",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,15 +95,14 @@ namespace StgSharp.Script.Express
|
|||||||
_operandsNode.Push( node );
|
_operandsNode.Push( node );
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractSyntaxTree<ExpNode, IExpElementSource> CloseAndDispose(
|
public AbstractSyntaxTree<ExpNode, IExpElementSource> CloseAndDispose()
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if( _operandsToken.Count != 0 ) {
|
if( _operandsToken.Count != 0 ) {
|
||||||
// convert rest to AST
|
// convert rest to AST
|
||||||
}
|
}
|
||||||
return new AbstractSyntaxTree<ExpNode, IExpElementSource>();
|
return new AbstractSyntaxTree<ExpNode, IExpElementSource>();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public ExpNode GenerateNode( Token t )
|
public ExpNode GenerateNode( Token t )
|
||||||
{
|
{
|
||||||
switch( t.Flag ) {
|
switch( t.Flag ) {
|
||||||
@@ -131,10 +130,9 @@ namespace StgSharp.Script.Express
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**/
|
||||||
|
|
||||||
public int GetNextOperandCache(
|
public int GetNextOperandCache( out Token? token, out ExpNode? node )
|
||||||
out Token? token,
|
|
||||||
out ExpNode? node )
|
|
||||||
{
|
{
|
||||||
if( _operandsNode.Count != 0 ) {
|
if( _operandsNode.Count != 0 ) {
|
||||||
node = _operandsNode.Pop();
|
node = _operandsNode.Pop();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace StgSharp.Script.Express
|
|||||||
{
|
{
|
||||||
public partial class ExpNodeGenerator
|
public partial class ExpNodeGenerator
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
public ExpNode GenerateUnaryToken( Token t )
|
public ExpNode GenerateUnaryToken( Token t )
|
||||||
{
|
{
|
||||||
switch( t.Value ) {
|
switch( t.Value ) {
|
||||||
@@ -52,6 +52,7 @@ namespace StgSharp.Script.Express
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Script")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Script")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d12bbbd873ec13306fdfa5255965188674ed417c")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+825e68853cd1738287eecc8a4390ee9c78550308")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Script")]
|
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Script")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Script")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Script")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/ccef0de6f686f94da655b0e7d854d0acaf907d04/*"}}
|
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}}
|
||||||
@@ -59,7 +59,7 @@ namespace StgSharp
|
|||||||
try {
|
try {
|
||||||
StgSharp.Init();
|
StgSharp.Init();
|
||||||
|
|
||||||
|
/*
|
||||||
ExpCompile.InitCompile();
|
ExpCompile.InitCompile();
|
||||||
ExpFileSource reader = new ExpFileSource( testExpPath );
|
ExpFileSource reader = new ExpFileSource( testExpPath );
|
||||||
ExpSchemaSource schemaSource = new ExpSchemaSource();
|
ExpSchemaSource schemaSource = new ExpSchemaSource();
|
||||||
@@ -96,20 +96,21 @@ namespace StgSharp
|
|||||||
$"{count}\t{str.Flag}\t\t{str.Value.ToString()}" );
|
$"{count}\t{str.Flag}\t\t{str.Value.ToString()}" );
|
||||||
}
|
}
|
||||||
IScriptSourceProvider slice = st.Slice( 5, 2 );
|
IScriptSourceProvider slice = st.Slice( 5, 2 );
|
||||||
|
/**/
|
||||||
/*
|
/**/
|
||||||
|
|
||||||
StgSharp.InitGL( 4, 6 );
|
StgSharp.InitGL( 4, 6 );
|
||||||
StgSharp.GlobalSetting.VSyncActivated = false;
|
StgSharp.GlobalSetting.VSyncActivated = false;
|
||||||
|
|
||||||
ViewPort vp = new ViewPort(800,600,"Hello StgSharp!",IntPtr.Zero);
|
ViewPort vp = new ViewPort(
|
||||||
|
800, 600, "Hello StgSharp!", IntPtr.Zero );
|
||||||
|
|
||||||
//throw new NotImplementedException();
|
//throw new NotImplementedException();
|
||||||
|
|
||||||
var mul = new StringHashMultiplexer();
|
StringHashMultiplexer mul = new StringHashMultiplexer();
|
||||||
IEqualityComparer<string> com = (IEqualityComparer<string>)mul;
|
IEqualityComparer<string> com = mul;
|
||||||
string str = "1234567012345670";
|
string str = "1234567012345670";
|
||||||
for (int i = 1; i < 100; i++)
|
for( int i = 1; i < 100; i++ ) {
|
||||||
{
|
|
||||||
str += $"{(i%8)}";
|
str += $"{(i%8)}";
|
||||||
int hash = mul.ForceComputeHash( str );
|
int hash = mul.ForceComputeHash( str );
|
||||||
Thread.Sleep( 20 );
|
Thread.Sleep( 20 );
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ccef0de6f686f94da655b0e7d854d0acaf907d04")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+825e68853cd1738287eecc8a4390ee9c78550308")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
|
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\St
|
|||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharpDebug.xml
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharpDebug.xml
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\CommunityToolkit.HighPerformance.dll
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\CommunityToolkit.HighPerformance.dll
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Common.dll
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Common.dll
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Generator.dll
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Model.dll
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Model.dll
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Script.dll
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Script.dll
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Generator.pdb
|
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Common.pdb
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Common.pdb
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Common.xml
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Common.xml
|
||||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Model.pdb
|
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Model.pdb
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/c23b640cae59b9ee7dcfd8f026b8970a084ddbd7/*"}}
|
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}}
|
||||||
Reference in New Issue
Block a user