diff --git a/StgSharp.C/x64/Debug/StgSharp.C.ilk b/StgSharp.C/x64/Debug/StgSharp.C.ilk index 5abde768..2d937e51 100644 Binary files a/StgSharp.C/x64/Debug/StgSharp.C.ilk and b/StgSharp.C/x64/Debug/StgSharp.C.ilk differ diff --git a/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.command.1.tlog b/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.command.1.tlog index 4239242a..fb20d913 100644 Binary files a/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.command.1.tlog and b/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.command.1.tlog differ diff --git a/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.read.1.tlog b/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.read.1.tlog index 70e4cda1..1f9640cd 100644 Binary files a/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.read.1.tlog and b/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.read.1.tlog differ diff --git a/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.13144.write.1.tlog b/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.write.1.tlog similarity index 91% rename from StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.13144.write.1.tlog rename to StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.write.1.tlog index a3e06b10..b74a0232 100644 Binary files a/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.13144.write.1.tlog and b/StgSharp.C/x64/Debug/StgSharp.C.tlog/CL.write.1.tlog differ diff --git a/StgSharp.C/x64/Debug/StgSharp.C.tlog/link.read.1.tlog b/StgSharp.C/x64/Debug/StgSharp.C.tlog/link.read.1.tlog index e095cc74..13964ded 100644 Binary files a/StgSharp.C/x64/Debug/StgSharp.C.tlog/link.read.1.tlog and b/StgSharp.C/x64/Debug/StgSharp.C.tlog/link.read.1.tlog differ diff --git a/StgSharp.C/x64/Debug/StgSharpC.cod b/StgSharp.C/x64/Debug/StgSharpC.cod index 1c2db210..55409a4c 100644 --- a/StgSharp.C/x64/Debug/StgSharpC.cod +++ b/StgSharp.C/x64/Debug/StgSharpC.cod @@ -7,7 +7,6 @@ INCLUDELIB OLDNAMES _DATA SEGMENT COMM infolog:BYTE:0200H -COMM currentContext:QWORD _DATA ENDS msvcjmc SEGMENT __7583A0D2_mmintrin@h DB 01H diff --git a/StgSharp.C/x64/Debug/StgSharpC.log b/StgSharp.C/x64/Debug/StgSharpC.log index 923df6ad..d6ef9e93 100644 --- a/StgSharp.C/x64/Debug/StgSharpC.log +++ b/StgSharp.C/x64/Debug/StgSharpC.log @@ -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 目录。 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(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 diff --git a/StgSharp.C/x64/Debug/StgSharpC.obj b/StgSharp.C/x64/Debug/StgSharpC.obj index 9a374b1e..ffdf9b76 100644 Binary files a/StgSharp.C/x64/Debug/StgSharpC.obj and b/StgSharp.C/x64/Debug/StgSharpC.obj differ diff --git a/StgSharp.C/x64/Debug/StgSharpC.sbr b/StgSharp.C/x64/Debug/StgSharpC.sbr index 81d4436c..837fada2 100644 Binary files a/StgSharp.C/x64/Debug/StgSharpC.sbr and b/StgSharp.C/x64/Debug/StgSharpC.sbr differ diff --git a/StgSharp.C/x64/Debug/vc143.idb b/StgSharp.C/x64/Debug/vc143.idb index 69427a33..c32655b4 100644 Binary files a/StgSharp.C/x64/Debug/vc143.idb and b/StgSharp.C/x64/Debug/vc143.idb differ diff --git a/StgSharp.C/x64/Debug/vc143.pdb b/StgSharp.C/x64/Debug/vc143.pdb index f6a7c48f..d0b70725 100644 Binary files a/StgSharp.C/x64/Debug/vc143.pdb and b/StgSharp.C/x64/Debug/vc143.pdb differ diff --git a/StgSharp.Common/Logic/Blueprint/Blueprint.cs b/StgSharp.Common/Logic/Blueprint/Blueprint.cs index e4540b9c..a46b1946 100644 --- a/StgSharp.Common/Logic/Blueprint/Blueprint.cs +++ b/StgSharp.Common/Logic/Blueprint/Blueprint.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="BlueprintSchedueler.cs" +// file="Blueprint.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,27 +28,19 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp; - using System; using System.Collections.Generic; using System.Linq; -using System.Linq.Expressions; -using System.Reflection; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; using System.Threading; -using System.Threading.Tasks; -using System.Xml.Serialization; namespace StgSharp.Blueprint { /// /// A sets of complex logic designed for running in multi threads environment. Warning: do not - /// run a instance in multi threads more than once. + /// run a instance in multi threads more than once. /// - public partial class BlueprintSchedueler : IConvertableToBlueprintNode + public partial class BlueprintScheduler : IConvertableToBlueprintNode { private BeginningNode beginNode; @@ -64,7 +56,7 @@ namespace StgSharp.Blueprint internal int currentGlobalNodeIndex; internal int currentNativeNodeIndex; - public BlueprintSchedueler() + public BlueprintScheduler() { allNode = new Dictionary(); globalNodeList = new List(); @@ -78,23 +70,24 @@ namespace StgSharp.Blueprint public BlueprintNode EndLayer => endNode; + public BlueprintNodeOperation Operation + { + get => ExecuteMain; + } + public bool IsRunning { get => runningStat.CurrentCount == 0; } - public ReadOnlySpan InputInterfacesName + public IEnumerable InputInterfacesName { - get { return beginNode.OutputInterfaces - .Select( p => p.Key ) - .ToArray(); } + get { return beginNode.OutputInterfaces.Keys; } } - public ReadOnlySpan OutputInterfacesName + public IEnumerable OutputInterfacesName { - get { return beginNode.OutputInterfaces - .Select( p => p.Key ) - .ToArray(); } + get { return beginNode.OutputInterfaces.Keys; } } /**/ @@ -112,7 +105,6 @@ namespace StgSharp.Blueprint allNode.Add( node.Name, node ); } - public void ExecuteMain( in Dictionary input, in Dictionary output ) @@ -120,11 +112,6 @@ namespace StgSharp.Blueprint BlueprintRunner.Run( this ); } - public BlueprintNodeOperation Operation - { - get => ExecuteMain; - } - [MethodImpl( MethodImplOptions.AggressiveInlining )] public (string name, BlueprintPipelineArgs arg)[] GetOutput() { @@ -179,7 +166,7 @@ namespace StgSharp.Blueprint return false; } - ~BlueprintSchedueler() + ~BlueprintScheduler() { runningStat.Dispose(); } diff --git a/StgSharp.Common/Logic/Blueprint/BlueprintNodeCraeater.cs b/StgSharp.Common/Logic/Blueprint/BlueprintNodeCraeater.cs index 0f6826a2..b0a888e4 100644 --- a/StgSharp.Common/Logic/Blueprint/BlueprintNodeCraeater.cs +++ b/StgSharp.Common/Logic/Blueprint/BlueprintNodeCraeater.cs @@ -34,7 +34,7 @@ using System.Text; namespace StgSharp.Blueprint { - public partial class BlueprintSchedueler + public partial class BlueprintScheduler { public BlueprintNode CreateBlueprintNode( diff --git a/StgSharp.Common/Logic/Blueprint/BlueprintRunner.cs b/StgSharp.Common/Logic/Blueprint/BlueprintRunner.cs index e2209255..756f387c 100644 --- a/StgSharp.Common/Logic/Blueprint/BlueprintRunner.cs +++ b/StgSharp.Common/Logic/Blueprint/BlueprintRunner.cs @@ -47,32 +47,28 @@ namespace StgSharp.Blueprint public static class BlueprintRunner { - private static NodeRunner[] allAvailableTask = CreateBlueprintRunnerArray(); - private static CancellationTokenSource cts = new CancellationTokenSource(); - private static ConcurrentStack blueprintInWaiting - = new ConcurrentStack(); + private static NodeRunner[] allAvailableTask = CreateBlueprintRunnerArray( + ); + private static CancellationTokenSource cts = new CancellationTokenSource( + ); + private static ConcurrentStack blueprintInWaiting + = new ConcurrentStack(); private static int _callingThread; private static SemaphoreSlim bpLock = new SemaphoreSlim( 0, 1 ); - private static NodeRunner[] CreateBlueprintRunnerArray() - { - int count = Environment.ProcessorCount; - return new NodeRunner[ count < 2 ? count : count - 2]; - } - /// - /// Only the fallowing occasions of calling are valid: - /// 1. no bp is running or the only bp is quitting. - /// 2. calling from the main thread and the current running bp. + /// Only the fallowing occasions of calling are valid: 1. no bp is running or the only bp is + /// quitting. 2. calling from the main thread and the current running bp. /// internal static bool IsValidCalling { get { if( ( NodeRunner.CurrentBlueprint == null ) || //no bp running at all - ( ( blueprintInWaiting.IsEmpty ) && ( NodeRunner.CurrentBlueprint.IsRunning == false ) ) ) - // a bp is quiting - { + ( ( blueprintInWaiting.IsEmpty ) && ( NodeRunner.CurrentBlueprint.IsRunning == + false ) ) ) + // a bp is quiting + { //in case no bp is running return true; } @@ -91,7 +87,7 @@ namespace StgSharp.Blueprint } } - public static void Run(BlueprintSchedueler blueprint) + public static void Run( BlueprintScheduler blueprint ) { //Console.WriteLine(); if( blueprint == null ) { @@ -104,14 +100,13 @@ namespace StgSharp.Blueprint if( IsValidCalling ) { //Console.WriteLine("valid and run"); if( InterruptAndRunNewBp( blueprint ) ) { - while (InterruptAndRunNewBp( - NodeRunner.CurrentBlueprint )){ }; + while( InterruptAndRunNewBp( NodeRunner.CurrentBlueprint ) ) { } + ; } } else { bpLock.Wait(); if( InterruptAndRunNewBp( blueprint ) ) { - while (InterruptAndRunNewBp( - NodeRunner.CurrentBlueprint)) { } + while( InterruptAndRunNewBp( NodeRunner.CurrentBlueprint ) ) { } } bpLock.Release(); @@ -141,16 +136,17 @@ namespace StgSharp.Blueprint foreach( NodeRunner task in allAvailableTask ) { task.Cts.Cancel(); } - foreach( BlueprintSchedueler bp in blueprintInWaiting ) { + foreach( BlueprintScheduler bp in blueprintInWaiting ) { bp.Terminate(); } blueprintInWaiting.Clear(); } - internal static bool InterruptAndRunNewBp( BlueprintSchedueler newBp ) + internal static bool InterruptAndRunNewBp( BlueprintScheduler newBp ) { Debug.Assert( newBp != null ); - if( ( newBp != NodeRunner.CurrentBlueprint ) && ( NodeRunner.CurrentBlueprint != null ) ) { + if( ( newBp != NodeRunner.CurrentBlueprint ) && ( NodeRunner.CurrentBlueprint != + null ) ) { //if a running bp exists blueprintInWaiting.Push( NodeRunner.CurrentBlueprint ); } @@ -162,7 +158,8 @@ namespace StgSharp.Blueprint //run beginning node to init it first. if( !NodeRunner.CurrentBlueprint.IsRunning ) { - ( NodeRunner.CurrentBlueprint.BeginLayer as BeginningNode )!.Run(); + ( NodeRunner.CurrentBlueprint.BeginLayer as BeginningNode )!.Run( + ); } //refresh all tasks @@ -174,7 +171,7 @@ namespace StgSharp.Blueprint } BlueprintNode node; while( !cts.Token.IsCancellationRequested && NodeRunner.CurrentBlueprint - .RequestNextNativeNode( out node ) ) { + .RequestNextNativeNode( out node ) ) { node.Run(); if( !NodeRunner.CurrentBlueprint.IsRunning ) { break; @@ -184,12 +181,18 @@ namespace StgSharp.Blueprint 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 { - private static BlueprintSchedueler _current; + private static BlueprintScheduler _current; internal NodeRunner() : base() @@ -197,7 +200,7 @@ namespace StgSharp.Blueprint _startup = InternalRun; } - internal static ref BlueprintSchedueler CurrentBlueprint + internal static ref BlueprintScheduler CurrentBlueprint { get => ref _current; } diff --git a/StgSharp.Common/Logic/Blueprint/CrossFrameBlueprintNode.cs b/StgSharp.Common/Logic/Blueprint/CrossFrameBlueprintNode.cs index 56039604..d0df4feb 100644 --- a/StgSharp.Common/Logic/Blueprint/CrossFrameBlueprintNode.cs +++ b/StgSharp.Common/Logic/Blueprint/CrossFrameBlueprintNode.cs @@ -40,16 +40,19 @@ namespace StgSharp.Blueprint { public class CrossFrameOperation : IConvertableToBlueprintNode { + + private static string[] _inputName = ["TaskIn"]; + private static string[] _outputName = ["TaskOut"]; + private Action _mainExecution; private int currentCount; private readonly int cycleCount; - private Action _mainExecution; public CrossFrameOperation( Action startup, int cycleCount ) { MainExecution = startup; this.cycleCount = ( cycleCount > 1 ) ? - cycleCount : throw new ArgumentException( - $"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(BlueprintNode).Name} instead."}" ); + cycleCount : throw new ArgumentException( + $"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(BlueprintNode).Name} instead."}" ); this.cycleCount = cycleCount; currentCount = cycleCount; } @@ -60,17 +63,18 @@ namespace StgSharp.Blueprint private protected set => _mainExecution = value; } - private static string[] _inputName = ["TaskIn"]; - private static string[] _outputName = ["TaskOut"]; - public BlueprintNodeOperation Operation { get => ExecuteMain; } + public IEnumerable InputInterfacesName => _inputName; + + public IEnumerable OutputInterfacesName => _outputName; + public void ExecuteMain( - in Dictionary input, - in Dictionary output ) + in Dictionary input, + in Dictionary output ) { if( currentCount < cycleCount ) { Interlocked.Increment( ref currentCount ); @@ -83,9 +87,5 @@ namespace StgSharp.Blueprint BlueprintPipeline.SkipAll( output ); } - public ReadOnlySpan InputInterfacesName => _inputName; - - public ReadOnlySpan OutputInterfacesName => _outputName; - } } diff --git a/StgSharp.Common/Logic/Blueprint/IConvertableToBlueprintNode.cs b/StgSharp.Common/Logic/Blueprint/IConvertableToBlueprintNode.cs index 0b58561e..4bebf863 100644 --- a/StgSharp.Common/Logic/Blueprint/IConvertableToBlueprintNode.cs +++ b/StgSharp.Common/Logic/Blueprint/IConvertableToBlueprintNode.cs @@ -36,22 +36,26 @@ using System.Text; namespace StgSharp.Blueprint { public delegate void BlueprintNodeOperation( - in Dictionary input, - in Dictionary output ); + in Dictionary input, + in Dictionary output ); public interface IConvertableToBlueprintNode { - public ReadOnlySpan InputInterfacesName + + BlueprintNodeOperation Operation { get; } - public ReadOnlySpan OutputInterfacesName + public IEnumerable InputInterfacesName { get; } - BlueprintNodeOperation Operation { get; } + public IEnumerable OutputInterfacesName + { + get; + } } @@ -63,9 +67,9 @@ namespace StgSharp.Blueprint private BlueprintNodeOperation _execution; public DefaultConvertableToBlueprintNode( - BlueprintNodeOperation execution, - string[] input, - string[] output ) + BlueprintNodeOperation execution, + string[] input, + string[] output ) { _input = input; _output = output; @@ -74,9 +78,9 @@ namespace StgSharp.Blueprint public BlueprintNodeOperation Operation => _execution; - public ReadOnlySpan InputInterfacesName => _input; + public IEnumerable InputInterfacesName => _input; - public ReadOnlySpan OutputInterfacesName => _output; + public IEnumerable OutputInterfacesName => _output; } } diff --git a/StgSharp.Common/Logic/Blueprint/SideNode.cs b/StgSharp.Common/Logic/Blueprint/SideNode.cs index 131716a5..44f5650e 100644 --- a/StgSharp.Common/Logic/Blueprint/SideNode.cs +++ b/StgSharp.Common/Logic/Blueprint/SideNode.cs @@ -42,10 +42,12 @@ namespace StgSharp.Blueprint internal sealed class BeginningNode : BlueprintNode { - private BlueprintSchedueler _bp; + private BlueprintScheduler _bp; - public BeginningNode( BlueprintSchedueler bp ) - : base(DefaultOperation, name: "BeginningNode", true, ["default"], ["default"] ) + public BeginningNode( BlueprintScheduler bp ) + : base( + DefaultOperation, name: "BeginningNode", true, ["default"], + ["default"] ) { _bp = bp; } @@ -70,8 +72,8 @@ namespace StgSharp.Blueprint } public new void SetCertainOutputPort( - string name, - BlueprintPipeline pipeline ) + string name, + BlueprintPipeline pipeline ) { if( _outputInterfaces.ContainsKey( name ) ) { _outputInterfaces[ name ] = pipeline; @@ -84,10 +86,12 @@ namespace StgSharp.Blueprint internal sealed class EndingNode : BlueprintNode { - private BlueprintSchedueler _bp; + private BlueprintScheduler _bp; - public EndingNode( BlueprintSchedueler bp ) - : base(DefaultOperation, name: "EndingNode", true, ["default"], ["default"] ) + public EndingNode( BlueprintScheduler bp ) + : base( + DefaultOperation, name: "EndingNode", true, ["default"], + ["default"] ) { _bp = bp; } @@ -96,7 +100,7 @@ namespace StgSharp.Blueprint { get { return InputInterfaces.Select( key => (key.Key, key.Value.Args) ) - .ToArray(); } + .ToArray(); } } public override void Run() @@ -108,8 +112,8 @@ namespace StgSharp.Blueprint } public new void SetCertainInputPort( - string name, - BlueprintPipeline pipeline ) + string name, + BlueprintPipeline pipeline ) { if( _inputInterfaces.ContainsKey( name ) ) { _inputInterfaces[ name ] = pipeline; diff --git a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs index bf452b96..34f27741 100644 --- a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs +++ b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [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.AssemblyTitleAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json index a48608e3..48222c59 100644 --- a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json +++ b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/83bde12d2227bf32a3b939e94849bbd7273bad21/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}} \ No newline at end of file diff --git a/StgSharp.Model/STEP/FileStructure/StepModel.cs b/StgSharp.Model/STEP/FileStructure/StepModel.cs index d7eabc58..4cf42896 100644 --- a/StgSharp.Model/STEP/FileStructure/StepModel.cs +++ b/StgSharp.Model/STEP/FileStructure/StepModel.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="STEP.cs" +// file="StepModel.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -38,31 +38,27 @@ namespace StgSharp.Modeling.STEP { public class StepModel { + + private BlueprintScheduler _builder; private Dictionary _node - = new Dictionary( ); - private BlueprintSchedueler _builder; + = new Dictionary(); private StepInfo _header; internal StepModel( - StepInfo header, - Dictionary nodeSource) + StepInfo header, + Dictionary nodeSource ) { _header = header; _node = nodeSource; - _builder = new BlueprintSchedueler(); + _builder = new BlueprintScheduler(); } + public void BuildGeometry() { } + public void OrganizeNode() { - foreach (var node in _node) - { - - } + foreach( KeyValuePair node in _node ) { } } - public void BuildGeometry() - { - - } } } diff --git a/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs b/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs index 11fec859..25b83fdf 100644 --- a/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs +++ b/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Model")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [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.AssemblyTitleAttribute("StgSharp.Model")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.sourcelink.json b/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.sourcelink.json index 5cb7415b..48222c59 100644 --- a/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.sourcelink.json +++ b/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/c23b640cae59b9ee7dcfd8f026b8970a084ddbd7/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}} \ No newline at end of file diff --git a/StgSharp.Script/Express/Builtin/ExpBuiltinConstant.cs b/StgSharp.Script/Express/Builtin/ExpBuiltinConstant.cs index 918e6007..6ecab1c7 100644 --- a/StgSharp.Script/Express/Builtin/ExpBuiltinConstant.cs +++ b/StgSharp.Script/Express/Builtin/ExpBuiltinConstant.cs @@ -32,11 +32,20 @@ using System; namespace StgSharp.Script.Express { - public class ExpBuiltinConstant : ExpLiteralGenericNode + internal partial class ExpSchema_Nitload { - internal ExpBuiltinConstant( string name, T value ) - : base( name, null!, value ) { } + public ExpTypeSource IntType + { + get; + private set; + } + + public ExpTypeSource FloatType + { + get; + private set; + } } } \ No newline at end of file diff --git a/StgSharp.Script/Express/Builtin/ExpCollection.cs b/StgSharp.Script/Express/Builtin/ExpCollection.cs index 18a6373f..76f43b2f 100644 --- a/StgSharp.Script/Express/Builtin/ExpCollection.cs +++ b/StgSharp.Script/Express/Builtin/ExpCollection.cs @@ -68,12 +68,6 @@ namespace StgSharp.Script.Express public abstract IEnumerator GetEnumerator(); - public override sealed bool IsConvertable( - ExpInstantiableElement targetType ) - { - return false; - } - IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); diff --git a/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs b/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs index 883ca42d..a363b16b 100644 --- a/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs +++ b/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs @@ -40,8 +40,7 @@ namespace StgSharp.Script.Express protected internal (int min, int max) _range; protected internal ExpElementType _memberType; - protected ExpCollectionInstanceBase( string name, ExpSchema context ) - : base( name ) { } + protected ExpCollectionInstanceBase( string name ) : base( name ) { } public abstract ExpCollectionBase CollectionValue { diff --git a/StgSharp.Script/Express/Builtin/ExpLogic.cs b/StgSharp.Script/Express/Builtin/ExpLogic.cs index 885ee00a..bf45b3d7 100644 --- a/StgSharp.Script/Express/Builtin/ExpLogic.cs +++ b/StgSharp.Script/Express/Builtin/ExpLogic.cs @@ -34,40 +34,84 @@ using System.Text; namespace StgSharp.Script.Express { - public enum ExpLogic + public enum ExpLogicValue { - Unknown = 0, - False = 1, - True = 2, + True, + False, + 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) - { - case ExpLogic.Unknown: - return null; - case ExpLogic.False: - return false; - case ExpLogic.True: - return true; - default: - throw new ArgumentException(); - } + _value = value; } - 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 - { - null => ExpLogic.Unknown, - true => ExpLogic.True, - false => ExpLogic.False, - }; + return a.IsTrue ? False : a.IsFalse ? True : Unknown; } + + // AND & + public static ExpLogic operator &( ExpLogic a, ExpLogic b ) + { + if( a.IsFalse || b.IsFalse ) { + return 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; + } + } } diff --git a/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs b/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs index ed4f005c..89a8ab63 100644 --- a/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs +++ b/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs @@ -33,9 +33,6 @@ using System.Collections; using System.Collections.Frozen; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; using static StgSharp.Script.Express.ExpCompile; @@ -80,7 +77,7 @@ namespace StgSharp.Script.Express string name, out ExpFunctionSource f ) { - throw new NotImplementedException(); + return FunctionDict.TryGetValue( name, out f! ); } public override bool TryGetRule( string name, out ExpRuleSource r ) @@ -131,9 +128,9 @@ namespace StgSharp.Script.Express ConstDict = new Dictionary( Multiplexer ) { - { PoolString( "PI" ), new ExpBuiltinConstant( + { PoolString( "PI" ), new ExpLiteralGenericNode( PoolString( "PI" ), MathF.PI ) }, - { PoolString( "E" ), new ExpBuiltinConstant( + { PoolString( "E" ), new ExpLiteralGenericNode( PoolString( "E" ), MathF.E ) }, }.ToFrozenDictionary(); } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpElementInstanceNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpElementInstanceNode.cs new file mode 100644 index 00000000..2569c7da --- /dev/null +++ b/StgSharp.Script/Express/ExpAstNode/ExpElementInstanceNode.cs @@ -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; + + } +} diff --git a/StgSharp.Script/Express/ExpAstNode/ExpIndexOfNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpIndexOfNode.cs index b20a8890..d239affb 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpIndexOfNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpIndexOfNode.cs @@ -43,10 +43,9 @@ namespace StgSharp.Script.Express private ExpNode _indexExpression; - public ExpIndexOfNode( - ExpSchema context, - ExpCollectionInstanceBase instance, - ExpNode indexExpression ) + private ExpIndexOfNode( + ExpCollectionInstanceBase instance, + ExpNode indexExpression ) : base( ExpCompile.PoolString( "[" ) ) { _collection = instance; @@ -60,5 +59,16 @@ namespace StgSharp.Script.Express 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 ); + } + } } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpLiteralGenericNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpLiteralGenericNode.cs index 6bd275c4..21743b51 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpLiteralGenericNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpLiteralGenericNode.cs @@ -50,7 +50,7 @@ namespace StgSharp.Script.Express private readonly ExpBuiltinType _type; private readonly T _value; - public ExpLiteralGenericNode( string name, ExpSchema context, T value ) + public ExpLiteralGenericNode( string name, T value ) : base( name ) { _value = value; diff --git a/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs index 9e7e449f..d59a1fde 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs @@ -58,7 +58,7 @@ namespace StgSharp.Script.Express public override IExpElementSource EqualityTypeConvert => _operand.EqualityTypeConvert; - public static ExpUnaryOperatorNode UnaryNotNegation( ExpNode operand ) + public static ExpUnaryOperatorNode UnaryNegation( ExpNode operand ) { if( !operand.IsNumber ) { 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}", + }; + } + } } diff --git a/StgSharp.Script/Express/ExpSourceReader.cs b/StgSharp.Script/Express/ExpSourceReader.cs index b6420ce6..0e19aedb 100644 --- a/StgSharp.Script/Express/ExpSourceReader.cs +++ b/StgSharp.Script/Express/ExpSourceReader.cs @@ -77,10 +77,10 @@ namespace StgSharp.Script.Express } /// - /// Read code until end of a line. Lines in multi-line comment will be ignored. Line + /// Read code until end of a line. Lines in multi-line comment will be ignored. Line /// begins with part of multi-line comment will automatically remove the comment part, but - /// beginning with a full multi-line comment will not causing removing. (*Just - /// Like The Comment Here*) Will Not Be Removed + /// beginning with a full multi-line comment will not causing removing. (*Just + /// Like The Comment Here*) Will Not Be Removed /// /// public unsafe ReadOnlySpan ReadLine() @@ -185,7 +185,7 @@ namespace StgSharp.Script.Express return _last; case '-': - // 1. -number + // 1. - number // 2. -- comment // 3. - number type param(UNARY) // 4. param - param(BINARY) diff --git a/StgSharp.Script/Express/NodeGenerator/ExpNodeGenerator.cs b/StgSharp.Script/Express/NodeGenerator/ExpNodeGenerator.cs index f5b37586..182a6641 100644 --- a/StgSharp.Script/Express/NodeGenerator/ExpNodeGenerator.cs +++ b/StgSharp.Script/Express/NodeGenerator/ExpNodeGenerator.cs @@ -95,15 +95,14 @@ namespace StgSharp.Script.Express _operandsNode.Push( node ); } - public AbstractSyntaxTree CloseAndDispose( - ) + public AbstractSyntaxTree CloseAndDispose() { if( _operandsToken.Count != 0 ) { // convert rest to AST } return new AbstractSyntaxTree(); } - + /* public ExpNode GenerateNode( Token t ) { switch( t.Flag ) { @@ -131,10 +130,9 @@ namespace StgSharp.Script.Express break; } } + /**/ - public int GetNextOperandCache( - out Token? token, - out ExpNode? node ) + public int GetNextOperandCache( out Token? token, out ExpNode? node ) { if( _operandsNode.Count != 0 ) { node = _operandsNode.Pop(); diff --git a/StgSharp.Script/Express/NodeGenerator/GenerateUnaryToken.cs b/StgSharp.Script/Express/NodeGenerator/GenerateUnaryToken.cs index 2e5b7ba6..53fc4c48 100644 --- a/StgSharp.Script/Express/NodeGenerator/GenerateUnaryToken.cs +++ b/StgSharp.Script/Express/NodeGenerator/GenerateUnaryToken.cs @@ -38,7 +38,7 @@ namespace StgSharp.Script.Express { public partial class ExpNodeGenerator { - + /* public ExpNode GenerateUnaryToken( Token t ) { switch( t.Value ) { @@ -52,6 +52,7 @@ namespace StgSharp.Script.Express break; } } + /**/ } } diff --git a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs index f833554a..a4bdd447 100644 --- a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs +++ b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [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.AssemblyTitleAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json index 12551908..48222c59 100644 --- a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json +++ b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/ccef0de6f686f94da655b0e7d854d0acaf907d04/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}} \ No newline at end of file diff --git a/StgSharpDebug/Program.cs b/StgSharpDebug/Program.cs index 705056d0..3622bb12 100644 --- a/StgSharpDebug/Program.cs +++ b/StgSharpDebug/Program.cs @@ -59,7 +59,7 @@ namespace StgSharp try { StgSharp.Init(); - + /* ExpCompile.InitCompile(); ExpFileSource reader = new ExpFileSource( testExpPath ); ExpSchemaSource schemaSource = new ExpSchemaSource(); @@ -96,23 +96,24 @@ namespace StgSharp $"{count}\t{str.Flag}\t\t{str.Value.ToString()}" ); } IScriptSourceProvider slice = st.Slice( 5, 2 ); - - /* + /**/ + /**/ StgSharp.InitGL( 4, 6 ); 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(); - var mul = new StringHashMultiplexer(); - IEqualityComparer com = (IEqualityComparer)mul; + StringHashMultiplexer mul = new StringHashMultiplexer(); + IEqualityComparer com = mul; string str = "1234567012345670"; - for (int i = 1; i < 100; i++) - { + for( int i = 1; i < 100; i++ ) { str += $"{(i%8)}"; - int hash = mul.ForceComputeHash(str); - Thread.Sleep(20); + int hash = mul.ForceComputeHash( str ); + Thread.Sleep( 20 ); } ViewModelBase mainModel = new ViewModelMain( vp ); diff --git a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs index 1dce9e6b..f57a0433 100644 --- a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs +++ b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [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.AssemblyTitleAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.csproj.FileListAbsolute.txt b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.csproj.FileListAbsolute.txt index bea8f187..6a1f23d2 100644 --- a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.csproj.FileListAbsolute.txt +++ b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.csproj.FileListAbsolute.txt @@ -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\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.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.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.xml D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharpDebug\bin\x64\Debug\net8.0\StgSharp.Model.pdb diff --git a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.sourcelink.json b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.sourcelink.json index 5cb7415b..48222c59 100644 --- a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.sourcelink.json +++ b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/c23b640cae59b9ee7dcfd8f026b8970a084ddbd7/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/825e68853cd1738287eecc8a4390ee9c78550308/*"}} \ No newline at end of file