1
0
ntminer 5 жил өмнө
parent
commit
b5d454da4c
47 өөрчлөгдсөн 124 нэмэгдсэн , 111 устгасан
  1. 1 2
      src/AppModels/MinerStudio/Vms/GpuSpeedDataViewModel.cs
  2. 2 2
      src/AppModels/MinerStudio/Vms/NTMinerUpdaterConfigViewModel.cs
  3. 1 1
      src/AppModels/Properties/AssemblyInfo.cs
  4. 1 1
      src/AppModels/Vms/GpuViewModel.cs
  5. 1 1
      src/AppViews0/Properties/AssemblyInfo.cs
  6. 4 0
      src/BlankWindow/BlankWindow.csproj
  7. 1 1
      src/BlankWindow/Properties/AssemblyInfo.cs
  8. 1 1
      src/CalcConfigUpdater/Properties/AssemblyInfo.cs
  9. 4 0
      src/DevConsole/DevConsole.csproj
  10. 1 1
      src/DevConsole/Properties/AssemblyInfo.cs
  11. 4 4
      src/MinerClient/Properties/AssemblyInfo.cs
  12. 1 1
      src/MinerClientSelfHost/Properties/AssemblyInfo.cs
  13. 4 4
      src/MinerStudio/Properties/AssemblyInfo.cs
  14. 1 1
      src/MinerStudioSelfHost/Properties/AssemblyInfo.cs
  15. 1 1
      src/NTMinerClient/Core/Gpus/Impl/AMDGpuSet.cs
  16. 1 1
      src/NTMinerClient/Properties/AssemblyInfo.cs
  17. 1 1
      src/NTMinerClient/TempPath.cs
  18. 4 4
      src/NTMinerClient/TempPath.partials.Upgrade.cs
  19. 0 3
      src/NTMinerDaemon/NTMinerDaemon.csproj
  20. 3 3
      src/NTMinerDaemon/Properties/AssemblyInfo.cs
  21. 5 7
      src/NTMinerDaemon/SpecialPath.cs
  22. 1 2
      src/NTMinerDataSchemas/Core/Gpus/GpuName.cs
  23. 24 5
      src/NTMinerDataSchemas/NTKeyword.cs
  24. 1 0
      src/NTMinerDataSchemas/NTMinerDataSchemas.csproj
  25. 4 0
      src/NTMinerGpus/NTMinerGpus.csproj
  26. 1 1
      src/NTMinerGpus/Properties/AssemblyInfo.cs
  27. 4 0
      src/NTMinerHub/NTMinerHub.csproj
  28. 1 1
      src/NTMinerHub/Properties/AssemblyInfo.cs
  29. 0 8
      src/NTMinerLogging/EntryAssemblyInfo.cs
  30. 16 27
      src/NTMinerLogging/HomePath.cs
  31. 1 1
      src/NTMinerLogging/Impl/Log4NetLoggingService.cs
  32. 6 0
      src/NTMinerLogging/NTMinerLogging.csproj
  33. 1 1
      src/NTMinerLogging/Properties/AssemblyInfo.cs
  34. 3 3
      src/NTMinerNoDevFee/NTMinerNoDevFee.csproj
  35. 1 1
      src/NTMinerNoDevFee/Properties/AssemblyInfo.cs
  36. 1 1
      src/NTMinerRpcClient/Properties/AssemblyInfo.cs
  37. 4 4
      src/NTMinerUpdater/Properties/AssemblyInfo.cs
  38. 1 2
      src/NTMinerWpf/Converters/ByteToGbConverter.cs
  39. 1 1
      src/NTMinerWpf/Properties/AssemblyInfo.cs
  40. 0 1
      src/NTMinerlib/NTMinerlib.csproj
  41. 1 1
      src/NTMinerlib/Properties/AssemblyInfo.cs
  42. 2 2
      src/NTMinerlib/VirtualRoot.partials.DriveSet.cs
  43. 1 1
      src/UnitTests/Properties/AssemblyInfo.cs
  44. 4 5
      src/UnitTests/UnitTest1.cs
  45. 1 1
      src/WebApiServer/Controllers/FileUrlController.cs
  46. 1 1
      src/WebApiServer/Properties/AssemblyInfo.cs
  47. 1 1
      src/WsServer/Properties/AssemblyInfo.cs

+ 1 - 2
src/AppModels/MinerStudio/Vms/GpuSpeedDataViewModel.cs

@@ -43,10 +43,9 @@ namespace NTMiner.MinerStudio.Vms {
             }
         }
 
-        private const double g = 1024 * 1024 * 1024;
         public string TotalMemoryGbText {
             get {
-                return Math.Round(this.TotalMemory / g, 1) + "Gb";
+                return Math.Round(this.TotalMemory / NTKeyword.DoubleG, 1) + "Gb";
             }
         }
 

+ 2 - 2
src/AppModels/MinerStudio/Vms/NTMinerUpdaterConfigViewModel.cs

@@ -16,7 +16,7 @@ namespace NTMiner.MinerStudio.Vms {
             this.Save = new DelegateCommand(() => {
                 try {
                     if (string.IsNullOrEmpty(this.FileName)) {
-                        this.FileName = HomePath.NTMinerUpdaterFileName;
+                        this.FileName = NTKeyword.NTMinerUpdaterFileName;
                     }
                     RpcRoot.OfficialServer.AppSettingService.SetAppSettingAsync(new AppSettingData {
                         Key = NTKeyword.NTMinerUpdaterFileNameAppSettingKey,
@@ -40,7 +40,7 @@ namespace NTMiner.MinerStudio.Vms {
                     FileName = Path.GetFileName(uri.LocalPath);
                 }
                 else {
-                    FileName = HomePath.NTMinerUpdaterFileName;
+                    FileName = NTKeyword.NTMinerUpdaterFileName;
                 }
             });
         }

+ 1 - 1
src/AppModels/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("AppModels")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
src/AppModels/Vms/GpuViewModel.cs

@@ -186,7 +186,7 @@ namespace NTMiner.Vms {
 
         public string TotalMemoryGbText {
             get {
-                return Math.Round((this.TotalMemory / (double)(1024 * 1024 * 1024)), 1) + "G";
+                return Math.Round((this.TotalMemory / NTKeyword.DoubleG), 1) + "G";
             }
         }
 

+ 1 - 1
src/AppViews0/Properties/AssemblyInfo.cs

@@ -22,7 +22,7 @@ using System.Windows;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("AppViews0")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 //下载于mycodes.net

+ 4 - 0
src/BlankWindow/BlankWindow.csproj

@@ -125,6 +125,10 @@
     <AppDesigner Include="Properties\" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\NTMinerDataSchemas\NTMinerDataSchemas.csproj">
+      <Project>{defc7387-f9fa-4651-a281-6612efb7fbb6}</Project>
+      <Name>NTMinerDataSchemas</Name>
+    </ProjectReference>
     <ProjectReference Include="..\NTMinerLogging\NTMinerLogging.csproj">
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>

+ 1 - 1
src/BlankWindow/Properties/AssemblyInfo.cs

@@ -8,7 +8,7 @@ using System.Windows.Markup;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMiner")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
src/CalcConfigUpdater/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("CalcConfigUpdater")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 4 - 0
src/DevConsole/DevConsole.csproj

@@ -59,6 +59,10 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\NTMinerDataSchemas\NTMinerDataSchemas.csproj">
+      <Project>{defc7387-f9fa-4651-a281-6612efb7fbb6}</Project>
+      <Name>NTMinerDataSchemas</Name>
+    </ProjectReference>
     <ProjectReference Include="..\NTMinerLogging\NTMinerLogging.csproj">
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>

+ 1 - 1
src/DevConsole/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("DevConsole")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 4 - 4
src/MinerClient/Properties/AssemblyInfo.cs

@@ -17,13 +17,13 @@ using System.Windows;
 // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
 // 方法是按如下所示使用“*”:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion(EntryAssemblyInfo.VersionBuild)]
-[assembly: AssemblyDescription(EntryAssemblyInfo.ManJiTag)]
-[assembly: AssemblyFileVersion(EntryAssemblyInfo.Version)]
+[assembly: AssemblyVersion(NTKeyword.VersionBuild)]
+[assembly: AssemblyDescription(NTKeyword.ManJiTag)]
+[assembly: AssemblyFileVersion(NTKeyword.Version)]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMiner")]
-[assembly: AssemblyCopyright(EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 //下载于mycodes.net

+ 1 - 1
src/MinerClientSelfHost/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("MinerClientSelfHost")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 4 - 4
src/MinerStudio/Properties/AssemblyInfo.cs

@@ -17,13 +17,13 @@ using System.Windows;
 // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
 // 方法是按如下所示使用“*”:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion(EntryAssemblyInfo.VersionBuild)]
-[assembly: AssemblyDescription(EntryAssemblyInfo.ManXiaoManTag)]
-[assembly: AssemblyFileVersion(EntryAssemblyInfo.Version)]
+[assembly: AssemblyVersion(NTKeyword.VersionBuild)]
+[assembly: AssemblyDescription(NTKeyword.ManXiaoManTag)]
+[assembly: AssemblyFileVersion(NTKeyword.Version)]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("MinerStudio")]
-[assembly: AssemblyCopyright(EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 //下载于mycodes.net

+ 1 - 1
src/MinerStudioSelfHost/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("MinerStudioSelfHost")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
src/NTMinerClient/Core/Gpus/Impl/AMDGpuSet.cs

@@ -43,7 +43,7 @@ namespace NTMiner.Core.Gpus.Impl {
             if (deviceCount > 0) {
                 this.DriverVersion = adlHelper.GetDriverVersion();
                 this.Properties.Add(new GpuSetProperty(GpuSetProperty.DRIVER_VERSION, "驱动版本", DriverVersion));
-                const ulong minG = (ulong)5 * 1024 * 1024 * 1024;
+                const ulong minG = 5 * NTKeyword.ULongG;
                 bool has470 = _gpus.Any(a => a.Key != NTMinerContext.GpuAllId && a.Value.TotalMemory < minG);
                 if (has470) {
                     Dictionary<string, string> kvs = new Dictionary<string, string> {

+ 1 - 1
src/NTMinerClient/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerClient")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
src/NTMinerClient/TempPath.cs

@@ -79,7 +79,7 @@ namespace NTMiner {
         private static bool _sIsFirstCallTempLogsDirFullName = true;
         public static string TempLogsDirFullName {
             get {
-                string dirFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, EntryAssemblyInfo.LogsDirName);
+                string dirFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, NTKeyword.LogsDirName);
                 if (_sIsFirstCallTempLogsDirFullName) {
                     if (!Directory.Exists(dirFullName)) {
                         Directory.CreateDirectory(dirFullName);

+ 4 - 4
src/NTMinerClient/TempPath.partials.Upgrade.cs

@@ -5,7 +5,7 @@ namespace NTMiner {
         private static void Upgrade() {
             if (ClientAppType.IsMinerClient && HomePath.IsLocalHome && !File.Exists(HomePath.RootLockFileFullName)) {
                 #region 迁移
-                string sharePackagesDir = Path.Combine(EntryAssemblyInfo.TempDirFullName, HomePath.PackagesDirName);
+                string sharePackagesDir = Path.Combine(EntryAssemblyInfo.TempDirFullName, NTKeyword.PackagesDirName);
                 if (Directory.Exists(sharePackagesDir)) {
                     foreach (var fileFullName in Directory.GetFiles(sharePackagesDir)) {
                         string destFileName = Path.Combine(HomePath.PackagesDirFullName, Path.GetFileName(fileFullName));
@@ -20,7 +20,7 @@ namespace NTMiner {
                         File.Copy(shareServerDbFileFullName, HomePath.ServerDbFileFullName);
                     }
                 }
-                string shareServerJsonFileFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, HomePath.ServerJsonFileName);
+                string shareServerJsonFileFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, NTKeyword.ServerJsonFileName);
                 if (File.Exists(shareServerJsonFileFullName) && !File.Exists(HomePath.ServerJsonFileFullName)) {
                     File.Copy(shareServerJsonFileFullName, HomePath.ServerJsonFileFullName);
                 }
@@ -28,11 +28,11 @@ namespace NTMiner {
                 if (File.Exists(shareLocalDbFileFullName) && !File.Exists(HomePath.LocalDbFileFullName)) {
                     File.Copy(shareLocalDbFileFullName, HomePath.LocalDbFileFullName);
                 }
-                string shareGpuProfilesJsonFileFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, HomePath.GpuProfilesFileName);
+                string shareGpuProfilesJsonFileFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, NTKeyword.GpuProfilesFileName);
                 if (File.Exists(shareGpuProfilesJsonFileFullName) && !File.Exists(HomePath.GpuProfilesJsonFileFullName)) {
                     File.Copy(shareGpuProfilesJsonFileFullName, HomePath.GpuProfilesJsonFileFullName);
                 }
-                string shareUpdaterFileFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, HomePath.UpdaterDirName, HomePath.NTMinerUpdaterFileName);
+                string shareUpdaterFileFullName = Path.Combine(EntryAssemblyInfo.TempDirFullName, NTKeyword.UpdaterDirName, NTKeyword.NTMinerUpdaterFileName);
                 if (File.Exists(shareUpdaterFileFullName) && !File.Exists(HomePath.UpdaterFileFullName)) {
                     File.Copy(shareUpdaterFileFullName, HomePath.UpdaterFileFullName);
                 }

+ 0 - 3
src/NTMinerDaemon/NTMinerDaemon.csproj

@@ -112,9 +112,6 @@
     <Compile Include="..\NTMinerlib\GZipUtil.cs">
       <Link>GZipUtil.cs</Link>
     </Compile>
-    <Compile Include="..\NTMinerlib\NTKeyword.cs">
-      <Link>NTKeyword.cs</Link>
-    </Compile>
     <Compile Include="..\NTMinerlib\NTMinerRegistry.cs">
       <Link>NTMinerRegistry.cs</Link>
     </Compile>

+ 3 - 3
src/NTMinerDaemon/Properties/AssemblyInfo.cs

@@ -5,14 +5,14 @@ using System.Runtime.InteropServices;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyVersion(EntryAssemblyInfo.VersionBuild)]
-[assembly: AssemblyFileVersion(EntryAssemblyInfo.Version)]
+[assembly: AssemblyVersion(NTKeyword.VersionBuild)]
+[assembly: AssemblyFileVersion(NTKeyword.Version)]
 [assembly: AssemblyTitle("NTMinerDaemon")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerDaemon")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 5 - 7
src/NTMinerDaemon/SpecialPath.cs

@@ -4,7 +4,6 @@ using System.Text;
 
 namespace NTMiner {
     public static class SpecialPath {
-        private static readonly string _serverJsonFileFullName;
         private static readonly string _mineWorkLocalJsonFileFullName;
         private static readonly string _mineWorkServerJsonFileFullName;
         private static readonly string _selfWorkLocalJsonFileFullName;
@@ -39,12 +38,11 @@ namespace NTMiner {
             if (!Directory.Exists(mineWorkDirFullName)) {
                 Directory.CreateDirectory(mineWorkDirFullName);
             }
-            _serverJsonFileFullName = Path.Combine(homeDirFullName, HomePath.ServerJsonFileName);
-            _mineWorkServerJsonFileFullName = Path.Combine(mineWorkDirFullName, HomePath.ServerJsonFileName);
-            _mineWorkLocalJsonFileFullName = Path.Combine(mineWorkDirFullName, HomePath.LocalJsonFileName);
-            _selfWorkServerJsonFileFullName = Path.Combine(selfWorkDirFullName, HomePath.ServerJsonFileName);
-            _selfWorkLocalJsonFileFullName = Path.Combine(selfWorkDirFullName, HomePath.LocalJsonFileName);
-            _gpuProfilesJsonFileFullName = Path.Combine(homeDirFullName, HomePath.GpuProfilesFileName);
+            _mineWorkServerJsonFileFullName = Path.Combine(mineWorkDirFullName, NTKeyword.ServerJsonFileName);
+            _mineWorkLocalJsonFileFullName = Path.Combine(mineWorkDirFullName, NTKeyword.LocalJsonFileName);
+            _selfWorkServerJsonFileFullName = Path.Combine(selfWorkDirFullName, NTKeyword.ServerJsonFileName);
+            _selfWorkLocalJsonFileFullName = Path.Combine(selfWorkDirFullName, NTKeyword.LocalJsonFileName);
+            _gpuProfilesJsonFileFullName = Path.Combine(homeDirFullName, NTKeyword.GpuProfilesFileName);
         }
 
         public static string ReadMineWorkLocalJsonFile() {

+ 1 - 2
src/NTMinerDataSchemas/Core/Gpus/GpuName.cs

@@ -11,8 +11,7 @@
         }
 
         public override string ToString() {
-            const ulong gb = 1024 * 1024 * 1024;
-            ulong totalMemoryGb = (this.TotalMemory + gb - 1) / gb;
+            ulong totalMemoryGb = (this.TotalMemory + NTKeyword.ULongG - 1) / NTKeyword.ULongG;
             return $"{this.Name}///{totalMemoryGb.ToString()}";
         }
     }

+ 24 - 5
src/NTMinerlib/NTKeyword.cs → src/NTMinerDataSchemas/NTKeyword.cs

@@ -1,9 +1,30 @@
-using System;
-
-namespace NTMiner {
+namespace NTMiner {
     public static class NTKeyword {
         public const double DoubleK = 1024;
         public const double DoubleM = 1024 * 1024;
+        public const double DoubleG = 1024 * 1024 * 1024;
+        public const ulong ULongG = 1024 * 1024 * 1024;
+        public const long LongG = 1024 * 1024 * 1024;
+
+        public const string Version = "2.8.1";
+        private const string _build = "1";
+        public const string VersionBuild = Version + "." + _build;
+        public const string ManJiTag = "蛮吉";
+        public const string ManXiaoManTag = "蛮小满";
+        public const string Copyright = "Copyright ©  NTMiner";
+
+        public const string LogsDirName = "Logs";
+        public const string ServerJsonFileName = "server.json";
+        public const string LocalJsonFileName = "local.json";
+        public const string GpuProfilesFileName = "gpuProfiles.json";
+        public const string PackagesDirName = "Packages";
+        public const string UpdaterDirName = "Updater";
+        public const string SelfWorkDirName = "SelfWork";
+        public const string MineWorkDirName = "MineWork";
+        public const string NTMinerUpdaterFileName = "NTMinerUpdater.exe";
+        public const string ServerDbFileName = "server.litedb";
+        public const string LocalDbFileName = "local.litedb";
+
 
         public const string WpfDesignOnly = "这是供WPF设计时使用的构造,不应在业务代码中被调用";
 
@@ -28,8 +49,6 @@ namespace NTMiner {
         public const string DNSServer0 = "119.29.29.29";
         public const string DNSServer1 = "223.5.5.5";
         public const string MinerClientFinderFileName = "MinerClientFinder.exe";
-        public const string LocalDbFileName = HomePath.LocalDbFileName;
-        public const string ServerDbFileName = HomePath.ServerDbFileName;
         public const string DevConsoleFileName = "DevConsole.exe";
         public const string NTMinerDaemonFileName = "NTMinerDaemon.exe";
         public const string NTMinerNoDevFeeFileName = "NTMinerNoDevFee.exe";

+ 1 - 0
src/NTMinerDataSchemas/NTMinerDataSchemas.csproj

@@ -59,6 +59,7 @@
     <Compile Include="Core\MinerServer\MinerSign.cs" />
     <Compile Include="Core\Profile\IProfile.cs" />
     <Compile Include="DataSchemaIdAttribute.cs" />
+    <Compile Include="NTKeyword.cs" />
     <Compile Include="Report\ISpeedData.cs" />
     <Compile Include="Report\SpeedData.cs" />
     <Compile Include="ServerNode\CpuData.cs" />

+ 4 - 0
src/NTMinerGpus/NTMinerGpus.csproj

@@ -49,6 +49,10 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\NTMinerDataSchemas\NTMinerDataSchemas.csproj">
+      <Project>{defc7387-f9fa-4651-a281-6612efb7fbb6}</Project>
+      <Name>NTMinerDataSchemas</Name>
+    </ProjectReference>
     <ProjectReference Include="..\NTMinerLogging\NTMinerLogging.csproj">
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>

+ 1 - 1
src/NTMinerGpus/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerGpus")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 4 - 0
src/NTMinerHub/NTMinerHub.csproj

@@ -55,6 +55,10 @@
     <Compile Include="Timing\ITimingEventProducer.cs" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\NTMinerDataSchemas\NTMinerDataSchemas.csproj">
+      <Project>{defc7387-f9fa-4651-a281-6612efb7fbb6}</Project>
+      <Name>NTMinerDataSchemas</Name>
+    </ProjectReference>
     <ProjectReference Include="..\NTMinerLogging\NTMinerLogging.csproj">
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>

+ 1 - 1
src/NTMinerHub/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerHub")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 0 - 8
src/NTMinerLogging/EntryAssemblyInfo.cs

@@ -5,14 +5,6 @@ using System.Reflection;
 
 namespace NTMiner {
     public static class EntryAssemblyInfo {
-        public const string Version = "2.8.1";
-        private const string _build = "1";
-        public const string VersionBuild = Version + "." + _build;
-        public const string ManJiTag = "蛮吉";
-        public const string ManXiaoManTag = "蛮小满";
-        public const string Copyright = "Copyright ©  NTMiner";
-        public const string LogsDirName = "Logs";
-
         public static readonly Version CurrentVersion;
         public static readonly string CurrentVersionStr;
         public static readonly string CurrentVersionTag = string.Empty;

+ 16 - 27
src/NTMinerLogging/HomePath.cs

@@ -3,17 +3,6 @@ using System.IO;
 
 namespace NTMiner {
     public static class HomePath {
-        public const string ServerJsonFileName = "server.json";
-        public const string LocalJsonFileName = "local.json";
-        public const string GpuProfilesFileName = "gpuProfiles.json";
-        public const string PackagesDirName = "Packages";
-        public const string UpdaterDirName = "Updater";
-        public const string SelfWorkDirName = "SelfWork";
-        public const string MineWorkDirName = "MineWork";
-        public const string NTMinerUpdaterFileName = "NTMinerUpdater.exe";
-        public const string ServerDbFileName = "server.litedb";
-        public const string LocalDbFileName = "local.litedb";
-
         public static readonly string RootLockFileFullName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "home.lock");
         public static readonly string RootConfigFileFullName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "home.config");
         public static string HomeDirFullName { get; private set; } = EntryAssemblyInfo.TempDirFullName;
@@ -34,12 +23,12 @@ namespace NTMiner {
                 homeDirFullName = AppDomain.CurrentDomain.BaseDirectory;
             }
             SetHomeDirFullName(homeDirFullName);
-            ServerJsonFileFullName = Path.Combine(HomeDirFullName, ServerJsonFileName);
-            SelfWorkServerJsonFileFullName = Path.Combine(SelfWorkDirFullName, ServerJsonFileName);
-            MineWorkServerJsonFileFullName = Path.Combine(MineWorkDirFullName, ServerJsonFileName);
-            SelfWorkLocalJsonFileFullName = Path.Combine(SelfWorkDirFullName, LocalJsonFileName);
-            MineWorkLocalJsonFileFullName = Path.Combine(MineWorkDirFullName, LocalJsonFileName);
-            GpuProfilesJsonFileFullName = Path.Combine(HomeDirFullName, GpuProfilesFileName);
+            ServerJsonFileFullName = Path.Combine(HomeDirFullName, NTKeyword.ServerJsonFileName);
+            SelfWorkServerJsonFileFullName = Path.Combine(SelfWorkDirFullName, NTKeyword.ServerJsonFileName);
+            MineWorkServerJsonFileFullName = Path.Combine(MineWorkDirFullName, NTKeyword.ServerJsonFileName);
+            SelfWorkLocalJsonFileFullName = Path.Combine(SelfWorkDirFullName, NTKeyword.LocalJsonFileName);
+            MineWorkLocalJsonFileFullName = Path.Combine(MineWorkDirFullName, NTKeyword.LocalJsonFileName);
+            GpuProfilesJsonFileFullName = Path.Combine(HomeDirFullName, NTKeyword.GpuProfilesFileName);
         }
 
         public static string ExportServerJsonFileName {
@@ -67,14 +56,14 @@ namespace NTMiner {
             }
         }
 
-        private static string _localDbFileFullName = Path.Combine(HomeDirFullName, LocalDbFileName);
+        private static string _localDbFileFullName = Path.Combine(HomeDirFullName, NTKeyword.LocalDbFileName);
         public static string LocalDbFileFullName {
             get {
                 return _localDbFileFullName;
             }
         }
 
-        private static string _serverDbFileFullName = Path.Combine(HomeDirFullName, ServerDbFileName);
+        private static string _serverDbFileFullName = Path.Combine(HomeDirFullName, NTKeyword.ServerDbFileName);
         public static string ServerDbFileFullName {
             get {
                 return _serverDbFileFullName;
@@ -89,14 +78,14 @@ namespace NTMiner {
             if (!Directory.Exists(dirFullName)) {
                 Directory.CreateDirectory(dirFullName);
             }
-            _localDbFileFullName = Path.Combine(HomeDirFullName, LocalDbFileName);
-            _serverDbFileFullName = Path.Combine(HomeDirFullName, ServerDbFileName);
+            _localDbFileFullName = Path.Combine(HomeDirFullName, NTKeyword.LocalDbFileName);
+            _serverDbFileFullName = Path.Combine(HomeDirFullName, NTKeyword.ServerDbFileName);
         }
         
         private static bool _sIsFirstCallPackageDirFullName = true;
         public static string PackagesDirFullName {
             get {
-                string dirFullName = Path.Combine(HomeDirFullName, PackagesDirName);
+                string dirFullName = Path.Combine(HomeDirFullName, NTKeyword.PackagesDirName);
                 if (_sIsFirstCallPackageDirFullName) {
                     if (!Directory.Exists(dirFullName)) {
                         Directory.CreateDirectory(dirFullName);
@@ -111,7 +100,7 @@ namespace NTMiner {
         private static bool _sIsFirstCallHomeLogsDirFullName = true;
         public static string HomeLogsDirFullName {
             get {
-                string dirFullName = Path.Combine(HomeDirFullName, EntryAssemblyInfo.LogsDirName);
+                string dirFullName = Path.Combine(HomeDirFullName, NTKeyword.LogsDirName);
                 if (_sIsFirstCallHomeLogsDirFullName) {
                     if (!Directory.Exists(dirFullName)) {
                         Directory.CreateDirectory(dirFullName);
@@ -129,7 +118,7 @@ namespace NTMiner {
         /// </summary>
         public static string UpdaterDirFullName {
             get {
-                string dirFullName = Path.Combine(HomeDirFullName, UpdaterDirName);
+                string dirFullName = Path.Combine(HomeDirFullName, NTKeyword.UpdaterDirName);
                 if (_sIsFirstCallUpdaterDirFullName) {
                     if (!Directory.Exists(dirFullName)) {
                         Directory.CreateDirectory(dirFullName);
@@ -144,7 +133,7 @@ namespace NTMiner {
         private static bool _sIsFirstCallSelfWorkDirFullName = true;
         public static string SelfWorkDirFullName {
             get {
-                string dirFullName = Path.Combine(HomeDirFullName, SelfWorkDirName);
+                string dirFullName = Path.Combine(HomeDirFullName, NTKeyword.SelfWorkDirName);
                 if (_sIsFirstCallSelfWorkDirFullName) {
                     if (!Directory.Exists(dirFullName)) {
                         Directory.CreateDirectory(dirFullName);
@@ -159,7 +148,7 @@ namespace NTMiner {
         private static bool _sIsFirstCallMineWorkDirFullName = true;
         public static string MineWorkDirFullName {
             get {
-                string dirFullName = Path.Combine(HomeDirFullName, MineWorkDirName);
+                string dirFullName = Path.Combine(HomeDirFullName, NTKeyword.MineWorkDirName);
                 if (_sIsFirstCallMineWorkDirFullName) {
                     if (!Directory.Exists(dirFullName)) {
                         Directory.CreateDirectory(dirFullName);
@@ -173,7 +162,7 @@ namespace NTMiner {
 
         public static string UpdaterFileFullName {
             get {
-                return Path.Combine(UpdaterDirFullName, NTMinerUpdaterFileName);
+                return Path.Combine(UpdaterDirFullName, NTKeyword.NTMinerUpdaterFileName);
             }
         }
 

+ 1 - 1
src/NTMinerLogging/Impl/Log4NetLoggingService.cs

@@ -8,7 +8,7 @@ namespace NTMiner.Impl {
         private readonly ILog _log;
 
         public Log4NetLoggingService() {
-            string logFileName = $"root{EntryAssemblyInfo.VersionBuild}.log";
+            string logFileName = $"root{NTKeyword.VersionBuild}.log";
             string logFile = $"logs\\{logFileName}";
             if (!string.IsNullOrEmpty(Logger.Dir)) {
                 logFile = Path.Combine(Logger.Dir, logFileName);

+ 6 - 0
src/NTMinerLogging/NTMinerLogging.csproj

@@ -61,5 +61,11 @@
   <ItemGroup>
     <None Include="packages.config" />
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\NTMinerDataSchemas\NTMinerDataSchemas.csproj">
+      <Project>{defc7387-f9fa-4651-a281-6612efb7fbb6}</Project>
+      <Name>NTMinerDataSchemas</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 1 - 1
src/NTMinerLogging/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerLogging")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 3 - 3
src/NTMinerNoDevFee/NTMinerNoDevFee.csproj

@@ -106,6 +106,9 @@
     <Compile Include="..\NTMinerDataSchemas\ISignableData.cs">
       <Link>ISignableData.cs</Link>
     </Compile>
+    <Compile Include="..\NTMinerDataSchemas\NTKeyword.cs">
+      <Link>NTKeyword.cs</Link>
+    </Compile>
     <Compile Include="..\NTMinerDataSchemas\NTMinerAppType.cs">
       <Link>NTMinerAppType.cs</Link>
     </Compile>
@@ -118,9 +121,6 @@
     <Compile Include="..\NTMinerDataSchemas\Timestamp.cs">
       <Link>Timestamp.cs</Link>
     </Compile>
-    <Compile Include="..\NTMinerlib\NTKeyword.cs">
-      <Link>NTKeyword.cs</Link>
-    </Compile>
     <Compile Include="..\NTMinerlib\NTMinerRegistry.cs">
       <Link>NTMinerRegistry.cs</Link>
     </Compile>

+ 1 - 1
src/NTMinerNoDevFee/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerNoDevFee")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
src/NTMinerRpcClient/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerRpcClient")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 4 - 4
src/NTMinerUpdater/Properties/AssemblyInfo.cs

@@ -17,13 +17,13 @@ using System.Windows;
 // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
 // 方法是按如下所示使用“*”:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion(EntryAssemblyInfo.VersionBuild)]
-[assembly: AssemblyDescription(EntryAssemblyInfo.ManJiTag)]
-[assembly: AssemblyFileVersion(EntryAssemblyInfo.Version)]
+[assembly: AssemblyVersion(NTKeyword.VersionBuild)]
+[assembly: AssemblyDescription(NTKeyword.ManJiTag)]
+[assembly: AssemblyFileVersion(NTKeyword.Version)]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerUpdater")]
-[assembly: AssemblyCopyright(EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 2
src/NTMinerWpf/Converters/ByteToGbConverter.cs

@@ -7,8 +7,7 @@ namespace NTMiner.Converters {
     public class ByteToGbConverter : IValueConverter {
         public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
             double d = System.Convert.ToDouble(value);
-            const long g = 1024 * 1024 * 1024;
-            return (d / g).ToString("f1") + " GB";
+            return (d / NTKeyword.LongG).ToString("f1") + " GB";
         }
 
         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {

+ 1 - 1
src/NTMinerWpf/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerWpf")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 0 - 1
src/NTMinerlib/NTMinerlib.csproj

@@ -50,7 +50,6 @@
     <Compile Include="Cryptography\RSAKey.cs" />
     <Compile Include="GZipUtil.cs" />
     <Compile Include="Net\Hosts.cs" />
-    <Compile Include="NTKeyword.cs" />
     <Compile Include="NTMinerRegistry.partials.cs" />
     <Compile Include="Net\IpUtil.cs" />
     <Compile Include="Repositories\JsonReadOnlyRepository`1.cs" />

+ 1 - 1
src/NTMinerlib/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("NTMinerlib")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 2 - 2
src/NTMinerlib/VirtualRoot.partials.DriveSet.cs

@@ -81,7 +81,7 @@ namespace NTMiner {
                         sb.Append(";");
                     }
                     // item.Name like C:\
-                    sb.Append(item.Name).Append((item.AvailableFreeSpace / (double)(1024 * 1024 * 1024)).ToString("f1")).Append(" Gb");
+                    sb.Append(item.Name).Append((item.AvailableFreeSpace / NTKeyword.DoubleG).ToString("f1")).Append(" Gb");
                 }
                 return sb.ToString();
             }
@@ -93,7 +93,7 @@ namespace NTMiner {
                 if (virtualMemories.TryGetValue("Auto", out int virtualMemoryMb)) {
                     long virtualMemoryB = virtualMemoryMb * 1024 * 1024;
                     // 系统盘留出1Gb
-                    long systemReserveB = 1024 * 1024 * 1024;
+                    long systemReserveB = NTKeyword.LongG;
                     // 非系统盘留出100Mb
                     long reserveB = 100 * 1024 * 1024;
                     if (_drives.Sum(a => a.AvailableFreeSpace) - systemReserveB - (_drives.Count - 1) * reserveB < virtualMemoryMb) {

+ 1 - 1
src/UnitTests/Properties/AssemblyInfo.cs

@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("UnitTestProject1")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 4 - 5
src/UnitTests/UnitTest1.cs

@@ -18,12 +18,11 @@ namespace NTMiner {
     public class UnitTest1 {
         [TestMethod]
         public void CeilingTest() {
-            const ulong gb = 1024 * 1024 * 1024;
-            ulong totalMemory = (ulong)(3.9 * gb);
-            ulong totalMemoryGb = (totalMemory + gb - 1) / gb;
+            ulong totalMemory = (ulong)(3.9 * NTKeyword.ULongG);
+            ulong totalMemoryGb = (totalMemory + NTKeyword.ULongG - 1) / NTKeyword.ULongG;
             Assert.IsTrue(4 == totalMemoryGb);
-            totalMemory = (ulong)(3.1 * gb);
-            totalMemoryGb = (totalMemory + gb) / gb;
+            totalMemory = (ulong)(3.1 * NTKeyword.ULongG);
+            totalMemoryGb = (totalMemory + NTKeyword.ULongG) / NTKeyword.ULongG;
             Assert.IsTrue(4 == totalMemoryGb);
         }
 

+ 1 - 1
src/WebApiServer/Controllers/FileUrlController.cs

@@ -62,7 +62,7 @@ namespace NTMiner.Controllers {
             try {
                 string fileName;
                 if (!VirtualRoot.LocalAppSettingSet.TryGetAppSetting(NTKeyword.NTMinerUpdaterFileNameAppSettingKey, out IAppSetting setting)) {
-                    fileName = HomePath.NTMinerUpdaterFileName;
+                    fileName = NTKeyword.NTMinerUpdaterFileName;
                 }
                 else {
                     fileName = (string)setting.Value;

+ 1 - 1
src/WebApiServer/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("WebApiServer")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 

+ 1 - 1
src/WsServer/Properties/AssemblyInfo.cs

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("WsServer")]
-[assembly: AssemblyCopyright(NTMiner.EntryAssemblyInfo.Copyright)]
+[assembly: AssemblyCopyright(NTMiner.NTKeyword.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]