Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ntminer committed Jan 8, 2021
1 parent 9dc196d commit c4c62d4
Show file tree
Hide file tree
Showing 44 changed files with 1,069 additions and 1,182 deletions.
15 changes: 0 additions & 15 deletions NTMiner.sln
Expand Up @@ -110,8 +110,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WsServer", "src\WsServer\Ws
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{E0B0D173-418C-49D0-9018-99BC6C526CF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinerGpu", "src\MinerGpu\MinerGpu.csproj", "{AB085388-E970-491F-ABFC-27D556C27332}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -434,18 +432,6 @@ Global
{637E9AD8-6410-419B-8FEE-2528130F871A}.Release|x64.Build.0 = Release|Any CPU
{637E9AD8-6410-419B-8FEE-2528130F871A}.Release|x86.ActiveCfg = Release|Any CPU
{637E9AD8-6410-419B-8FEE-2528130F871A}.Release|x86.Build.0 = Release|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Debug|x64.ActiveCfg = Debug|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Debug|x64.Build.0 = Debug|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Debug|x86.ActiveCfg = Debug|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Debug|x86.Build.0 = Debug|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Release|Any CPU.Build.0 = Release|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Release|x64.ActiveCfg = Release|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Release|x64.Build.0 = Release|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Release|x86.ActiveCfg = Release|Any CPU
{AB085388-E970-491F-ABFC-27D556C27332}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -479,7 +465,6 @@ Global
{E7B88637-7704-4701-98E0-7875BB6E8C98} = {2C8C5FC2-8B81-4228-8EBD-6B491216FBC1}
{637E9AD8-6410-419B-8FEE-2528130F871A} = {2C8C5FC2-8B81-4228-8EBD-6B491216FBC1}
{E0B0D173-418C-49D0-9018-99BC6C526CF5} = {B8FD9576-411F-4634-89D9-806FFD21DBA3}
{AB085388-E970-491F-ABFC-27D556C27332} = {B8FD9576-411F-4634-89D9-806FFD21DBA3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A5D14B0A-73FF-46E8-87F3-7E83FFC1DBDD}
Expand Down
4 changes: 2 additions & 2 deletions src/AppModels/AppStatic.cs
Expand Up @@ -233,12 +233,12 @@ public static class AppStatic {
}
}

public static bool IsAmdGpu {
public static bool IsHasATIGpu {
get {
if (WpfUtil.IsInDesignMode) {
return true;
}
return NTMinerContext.Instance.GpuSet.GpuType == GpuType.AMD;
return AdlHelper.IsHasATIGpu;
}
}
#endregion
Expand Down
43 changes: 15 additions & 28 deletions src/AppModels/MinerStudio/Vms/WebApiServerStateViewModel.cs
Expand Up @@ -11,9 +11,8 @@ public class WebApiServerStateViewModel : ViewModelBase, IWebApiServerState {
private ulong _totalPhysicalMemory;
private string _address;
private double _cpuPerformance;
private double _processPerformance;
private ulong _availablePhysicalMemory;
private ulong _workingSet;
private double _processMemoryMb;
private CpuData _cpu;
private CpuDataViewModel _cpuVm;
private List<WsServerNodeState> _wsServerNodes;
Expand All @@ -25,9 +24,8 @@ public class WebApiServerStateViewModel : ViewModelBase, IWebApiServerState {
_totalPhysicalMemory = data.TotalPhysicalMemory;
_address = data.Address;
_cpuPerformance = data.CpuPerformance;
_processPerformance = data.ProcessPerformance;
_availablePhysicalMemory = data.AvailablePhysicalMemory;
_workingSet = data.WorkingSet;
_processMemoryMb = data.ProcessMemoryMb;
_cpu = data.Cpu;
_cpuVm = new CpuDataViewModel(data.Cpu);
_wsServerNodes = data.WsServerNodes;
Expand All @@ -40,9 +38,8 @@ public class WebApiServerStateViewModel : ViewModelBase, IWebApiServerState {
this.TotalPhysicalMemory = data.TotalPhysicalMemory;
this.Address = data.Address;
this.CpuPerformance = data.CpuPerformance;
this.ProcessPerformance = data.ProcessPerformance;
this.AvailablePhysicalMemory = data.AvailablePhysicalMemory;
this.WorkingSet = data.WorkingSet;
this.ProcessMemoryMb = data.ProcessMemoryMb;
this.Cpu = data.Cpu;
this.WsServerNodes = data.WsServerNodes;
}
Expand Down Expand Up @@ -162,23 +159,6 @@ public class WebApiServerStateViewModel : ViewModelBase, IWebApiServerState {
}
}

public double ProcessPerformance {
get => _processPerformance;
set {
if (_processPerformance != value) {
_processPerformance = value;
OnPropertyChanged(nameof(ProcessPerformance));
OnPropertyChanged(nameof(ProcessPerformanceText));
}
}
}

public string ProcessPerformanceText {
get {
return this.ProcessPerformance.ToString("f1") + " %";
}
}

public ulong AvailablePhysicalMemory {
get => _availablePhysicalMemory;
set {
Expand All @@ -189,14 +169,21 @@ public class WebApiServerStateViewModel : ViewModelBase, IWebApiServerState {
}
}

public ulong WorkingSet {
get => _workingSet;
public double ProcessMemoryMb {
get => _processMemoryMb;
set {
if (_workingSet != value) {
_workingSet = value;
OnPropertyChanged(nameof(WorkingSet));
if (_processMemoryMb != value) {
_processMemoryMb = value;
OnPropertyChanged(nameof(ProcessMemoryMb));
OnPropertyChanged(nameof(ProcessMemoryMbText));
}
}
}

public string ProcessMemoryMbText {
get {
return this.ProcessMemoryMb.ToString("f1") + " Mb";
}
}
}
}
43 changes: 15 additions & 28 deletions src/AppModels/MinerStudio/Vms/WsServerNodeStateViewModel.cs
Expand Up @@ -13,9 +13,8 @@ public class WsServerNodeStateViewModel : ViewModelBase, IWsServerNode {
private string _osInfo;
private ulong _totalPhysicalMemory;
private double _cpuPerformance;
private double _processPerformance;
private ulong _availablePhysicalMemory;
private ulong _workingSet;
private double _processMemoryMb;
private CpuData _cpu;
private CpuDataViewModel _cpuVm;

Expand All @@ -37,8 +36,7 @@ public class WsServerNodeStateViewModel : ViewModelBase, IWsServerNode {
_totalPhysicalMemory = data.TotalPhysicalMemory;
_availablePhysicalMemory = data.AvailablePhysicalMemory;
_cpuPerformance = data.CpuPerformance;
_processPerformance = data.ProcessPerformance;
_workingSet = data.WorkingSet;
_processMemoryMb = data.ProcessMemoryMb;
_cpu = data.Cpu;
_cpuVm = new CpuDataViewModel(data.Cpu);
}
Expand All @@ -52,9 +50,8 @@ public class WsServerNodeStateViewModel : ViewModelBase, IWsServerNode {
this.MinerClientSessionCount = data.MinerClientSessionCount;
this.MinerStudioSessionCount = data.MinerStudioSessionCount;
this.CpuPerformance = data.CpuPerformance;
this.ProcessPerformance = data.ProcessPerformance;
this.AvailablePhysicalMemory = data.AvailablePhysicalMemory;
this.WorkingSet = data.WorkingSet;
this.ProcessMemoryMb = data.ProcessMemoryMb;
}

public string Address {
Expand Down Expand Up @@ -176,23 +173,6 @@ public class WsServerNodeStateViewModel : ViewModelBase, IWsServerNode {
}
}

public double ProcessPerformance {
get => _processPerformance;
set {
if (_processPerformance != value) {
_processPerformance = value;
OnPropertyChanged(nameof(ProcessPerformance));
OnPropertyChanged(nameof(ProcessPerformanceText));
}
}
}

public string ProcessPerformanceText {
get {
return this.ProcessPerformance.ToString("f1") + " %";
}
}

public ulong AvailablePhysicalMemory {
get => _availablePhysicalMemory;
set {
Expand All @@ -203,14 +183,21 @@ public class WsServerNodeStateViewModel : ViewModelBase, IWsServerNode {
}
}

public ulong WorkingSet {
get => _workingSet;
public double ProcessMemoryMb {
get => _processMemoryMb;
set {
if (_workingSet != value) {
_workingSet = value;
OnPropertyChanged(nameof(WorkingSet));
if (_processMemoryMb != value) {
_processMemoryMb = value;
OnPropertyChanged(nameof(ProcessMemoryMb));
OnPropertyChanged(nameof(ProcessMemoryMbText));
}
}
}

public string ProcessMemoryMbText {
get {
return this.ProcessMemoryMb.ToString("f1") + " Mb";
}
}
}
}
5 changes: 1 addition & 4 deletions src/AppModels/Vms/KernelOutputViewModel.cs
Expand Up @@ -297,10 +297,7 @@ public class KernelOutputViewModel : ViewModelBase, IKernelOutput, IEditableView

public bool IsRejectOneGpuShare {
get {
if (string.IsNullOrEmpty(RejectOneShare)) {
return false;
}
return RejectOneShare.Contains("?<gpu>");
return !string.IsNullOrEmpty(RejectOneShare);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/AppViews0/MinerStudio/Views/Ucs/WsServerNodePage.xaml
Expand Up @@ -32,6 +32,8 @@
<WrapPanel>
<TextBlock Style="{StaticResource LblTb}">节点地址</TextBlock>
<TextBlock Style="{StaticResource TextBlock}" Text="{Binding WebApiServerStateVm.Address}"></TextBlock>
<TextBlock Style="{StaticResource LblTb}">进程内存</TextBlock>
<TextBlock Style="{StaticResource TextBlock}" Text="{Binding WebApiServerStateVm.ProcessMemoryMbText}"></TextBlock>
<TextBlock Style="{StaticResource LblTb}">总内存</TextBlock>
<TextBlock Style="{StaticResource TextBlock}" Text="{Binding WebApiServerStateVm.TotalPhysicalMemory,Converter={StaticResource ByteToGbConverter}}"></TextBlock>
<TextBlock Style="{StaticResource LblTb}">剩余内存</TextBlock>
Expand Down Expand Up @@ -74,6 +76,8 @@
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Width="106" Header="群控客户端会话数" Binding="{Binding MinerStudioSessionCount}">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Width="90" Header="进程内存" Binding="{Binding ProcessMemoryMbText}">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Width="90" Header="总内存" Binding="{Binding TotalPhysicalMemory,Converter={StaticResource ByteToGbConverter}}">
</DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Width="90" Header="剩余内存" Binding="{Binding AvailablePhysicalMemory,Converter={StaticResource ByteToGbConverter}}">
Expand Down
4 changes: 2 additions & 2 deletions src/AppViews0/Views/Ucs/Toolbox.xaml
Expand Up @@ -29,7 +29,7 @@
Width="{StaticResource ItemWidth}"
Margin="4"
KbButtonHoverBackground="{StaticResource KbButtonHoverBackground}"
IsEnabled="{x:Static app:AppStatic.IsAmdGpu}"
IsEnabled="{x:Static app:AppStatic.IsHasATIGpu}"
Command="{Binding SwitchRadeonGpu}"
Cursor="Hand"
Background="Transparent">
Expand All @@ -51,7 +51,7 @@
Width="{StaticResource ItemWidth}"
Margin="4"
KbButtonHoverBackground="{StaticResource KbButtonHoverBackground}"
IsEnabled="{x:Static app:AppStatic.IsAmdGpu}"
IsEnabled="{x:Static app:AppStatic.IsHasATIGpu}"
Command="{Binding AtikmdagPatcher}"
Cursor="Hand"
Background="Transparent">
Expand Down
4 changes: 2 additions & 2 deletions src/MinerClient/App.xaml.cs
Expand Up @@ -277,14 +277,14 @@ public partial class App : Application {
#endregion
#region 处理开启A卡计算模式
VirtualRoot.BuildCmdPath<SwitchRadeonGpuCommand>(path: message => {
if (NTMinerContext.Instance.GpuSet.GpuType == GpuType.AMD) {
if (AdlHelper.IsHasATIGpu) {
AppRoot.SwitchRadeonGpu(message.On);
}
}, location: this.GetType());
#endregion
#region 处理A卡驱动签名
VirtualRoot.BuildCmdPath<AtikmdagPatcherCommand>(path: message => {
if (NTMinerContext.Instance.GpuSet.GpuType == GpuType.AMD) {
if (AdlHelper.IsHasATIGpu) {
AppRoot.OpenAtikmdagPatcher();
}
}, location: this.GetType());
Expand Down
11 changes: 0 additions & 11 deletions src/MinerClient/Daemon/NTMinerDaemon.exe.config

This file was deleted.

61 changes: 0 additions & 61 deletions src/MinerGpu/MinerGpu.csproj

This file was deleted.

21 changes: 0 additions & 21 deletions src/MinerGpu/Program.cs

This file was deleted.

0 comments on commit c4c62d4

Please sign in to comment.