├── icone.ico
├── logo.png
├── Resources
├── icone.ico
├── logo.png
├── LICENSEs-other.md
├── iconeTaskbar2.ico
└── LICENSE.md
├── True Mining Desktop - Screenshot.webp
├── True Mining Desktop - Dashboard Screenshot.webp
├── App.xaml.cs
├── Properties
└── launchSettings.json
├── Janelas
├── Settings.xaml.cs
├── Pages.cs
├── SubMenuSettings
│ ├── SettingsCPU.xaml.cs
│ ├── SettingsCUDA.xaml.cs
│ ├── SettingsOPENCL.xaml.cs
│ ├── SettingsCPU.xaml
│ ├── SettingsOPENCL.xaml
│ └── SettingsCUDA.xaml
├── Other.xaml.cs
├── CheckerPopup.xaml
├── DeviceInfo.cs
├── Settings.xaml
├── Home.xaml.cs
├── Dashboard.xaml.cs
├── Popups
│ ├── ExhangeRates.xaml.cs
│ ├── Calculator.xaml
│ └── Calculator.xaml.cs
├── Dashboard.xaml
├── Home.xaml
└── Other.xaml
├── ViewModel
├── SubItem.cs
├── ItemMenu.cs
├── UserControlItemMenu.xaml.cs
├── UserControlItemMenu.xaml
├── OverviewDeviceSimplified.xaml.cs
├── PageCreateWallet.xaml.cs
├── OverviewDeviceSimplified.xaml
├── DashboardChart.cs
└── PageCreateWallet.xaml
├── AssemblyInfo.cs
├── Server
├── ExternalApi
│ ├── MarketData.cs
│ ├── CoinGecko.cs
│ └── NanopoolData.cs
└── SoftwareParameters.cs
├── Core
├── hashrate_timer.cs
├── NextStart.cs
├── Device.cs
└── Miners
│ └── TRex
│ └── ApiSummary.cs
├── App.xaml
├── True Mining Desktop.sln
├── README.md
├── Docs
└── Nota de Atualização.md
├── True Mining Desktop.csproj
├── MainWindow.xaml
└── .gitignore
/icone.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/icone.ico
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/logo.png
--------------------------------------------------------------------------------
/Resources/icone.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/Resources/icone.ico
--------------------------------------------------------------------------------
/Resources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/Resources/logo.png
--------------------------------------------------------------------------------
/Resources/LICENSEs-other.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/Resources/LICENSEs-other.md
--------------------------------------------------------------------------------
/Resources/iconeTaskbar2.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/Resources/iconeTaskbar2.ico
--------------------------------------------------------------------------------
/True Mining Desktop - Screenshot.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/True Mining Desktop - Screenshot.webp
--------------------------------------------------------------------------------
/True Mining Desktop - Dashboard Screenshot.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/True-Mining/TrueMiningDesktop/HEAD/True Mining Desktop - Dashboard Screenshot.webp
--------------------------------------------------------------------------------
/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace TrueMiningDesktop
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | }
11 | }
--------------------------------------------------------------------------------
/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "True Mining Desktop": {
4 | "commandName": "Project",
5 | "sqlDebugging": false,
6 | "nativeDebugging": true,
7 | "jsWebView2Debugging": false
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/Janelas/Settings.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace TrueMiningDesktop.Janelas
4 | {
5 | ///
6 | /// Interação lógica para Settings.xam
7 | ///
8 | public partial class Settings : UserControl
9 | {
10 | public Settings()
11 | {
12 | InitializeComponent();
13 | DataContext = User.Settings.User;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/ViewModel/SubItem.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace TrueMiningDesktop.ViewModel
4 | {
5 | public class SubItem
6 | {
7 | public SubItem(string name, UserControl screen = null)
8 | {
9 | Name = name;
10 | Screen = screen;
11 | }
12 |
13 | public string Name { get; private set; }
14 | public UserControl Screen { get; private set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/Janelas/Pages.cs:
--------------------------------------------------------------------------------
1 | namespace TrueMiningDesktop.Janelas
2 | {
3 | public static class Pages
4 | {
5 | public static Home Home = new();
6 | public static Settings Settings = new();
7 | public static Dashboard Dashboard = new();
8 |
9 | public static SubMenuSettings.SettingsCPU SettingsCPU = new();
10 | public static SubMenuSettings.SettingsOPENCL SettingsOPENCL = new();
11 | public static SubMenuSettings.SettingsCUDA SettingsCUDA = new();
12 | }
13 | }
--------------------------------------------------------------------------------
/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
--------------------------------------------------------------------------------
/ViewModel/ItemMenu.cs:
--------------------------------------------------------------------------------
1 | using MaterialDesignThemes.Wpf;
2 | using System.Collections.Generic;
3 | using System.Windows.Controls;
4 |
5 | namespace TrueMiningDesktop.ViewModel
6 | {
7 | public class ItemMenu
8 | {
9 | public ItemMenu(string header, List subItems, PackIconKind icon)
10 | {
11 | Header = header;
12 | Expanded = false;
13 | SubItems = subItems;
14 | Icon = icon;
15 | }
16 |
17 | public ItemMenu(string header, UserControl screen, PackIconKind icon)
18 | {
19 | Header = header;
20 | Screen = screen;
21 | Icon = icon;
22 | }
23 |
24 | public string Header { get; private set; }
25 | public bool Expanded { get; set; }
26 | public PackIconKind Icon { get; private set; }
27 | public List SubItems { get; private set; }
28 | public UserControl Screen { get; private set; }
29 | }
30 | }
--------------------------------------------------------------------------------
/Server/ExternalApi/MarketData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace TrueMiningDesktop.ExternalApi
4 | {
5 | public class ExchangeOrderbooks
6 | {
7 | public static Orderbook XMRBTC = new Orderbook();
8 | public static Orderbook RVNBTC = new Orderbook();
9 | public static Orderbook ETCBTC = new Orderbook();
10 | public static Orderbook PaymentCoinBTC = new Orderbook();
11 | }
12 |
13 | public class Orderbook
14 | {
15 | public List buyLevels { get; set; }
16 | public List sellLevels { get; set; }
17 | }
18 |
19 | public class BuyLevel
20 | {
21 | public decimal price { get; set; }
22 | public decimal volume { get; set; }
23 | }
24 |
25 | public class SellLevel
26 | {
27 | public decimal price { get; set; }
28 | public decimal volume { get; set; }
29 | }
30 |
31 | public class BitcoinPrice
32 | {
33 | public static decimal BTCUSD { get; set; }
34 | }
35 | }
--------------------------------------------------------------------------------
/Server/ExternalApi/CoinGecko.cs:
--------------------------------------------------------------------------------
1 | namespace TrueMiningDesktop.ExternalApi
2 | {
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Converters;
5 | using System.Globalization;
6 |
7 | public partial class CoinData
8 | {
9 | [JsonProperty("btc", NullValueHandling = NullValueHandling.Ignore)]
10 | public decimal Btc { get; set; }
11 |
12 | [JsonProperty("btc_24h_change", NullValueHandling = NullValueHandling.Ignore)]
13 | public decimal? Btc24HChange { get; set; }
14 |
15 | [JsonProperty("last_updated_at", NullValueHandling = NullValueHandling.Ignore)]
16 | public long LastUpdatedAt { get; set; }
17 | }
18 |
19 | internal static class Converter
20 | {
21 | public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
22 | {
23 | MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
24 | DateParseHandling = DateParseHandling.None,
25 | Converters =
26 | {
27 | new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
28 | },
29 | };
30 | }
31 | }
--------------------------------------------------------------------------------
/Core/hashrate_timer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using TrueMiningDesktop.Janelas;
3 |
4 | namespace TrueMiningDesktop.Core
5 | {
6 | internal class Hashrate_timer
7 | {
8 | private readonly DeviceInfo DeviceInfo;
9 | private readonly System.Timers.Timer Timer = new(5000);
10 |
11 | public event EventHandler HashrateUpdated;
12 |
13 | private decimal hashrate;
14 |
15 | public decimal Hashrate
16 | { get { return hashrate; } set { hashrate = value; OnNewHashrate(); } }
17 |
18 | public Hashrate_timer(DeviceInfo _parent)
19 | {
20 | DeviceInfo = _parent;
21 | Timer.Stop();
22 | Timer.Elapsed += Timer_Elapsed;
23 | }
24 |
25 | private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
26 | {
27 | Hashrate = Miner.GetHashrate(DeviceInfo.BackendName);
28 | }
29 |
30 | protected virtual void OnNewHashrate()
31 | {
32 | HashrateUpdated?.Invoke(this, null);
33 | }
34 |
35 | public void Start()
36 | {
37 | Timer.Start();
38 | }
39 |
40 | public void Stop()
41 | {
42 | Timer.Stop(); Hashrate = -1;
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/True Mining Desktop.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31612.314
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "True Mining Desktop", "True Mining Desktop.csproj", "{B8F0FC8A-8A79-40E2-B16E-A703E04560D1}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {B8F0FC8A-8A79-40E2-B16E-A703E04560D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {B8F0FC8A-8A79-40E2-B16E-A703E04560D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {B8F0FC8A-8A79-40E2-B16E-A703E04560D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {B8F0FC8A-8A79-40E2-B16E-A703E04560D1}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {2F66D7AF-1686-4307-9182-792806695B21}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Janelas/SubMenuSettings/SettingsCPU.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace TrueMiningDesktop.Janelas.SubMenuSettings
5 | {
6 | ///
7 | /// Interação lógica para SettingsCPU.xam
8 | ///
9 | public partial class SettingsCPU : UserControl
10 | {
11 | public SettingsCPU()
12 | {
13 | InitializeComponent();
14 | DataContext = User.Settings.Device.cpu;
15 | }
16 |
17 | private void CheckBox_Checked(object sender, RoutedEventArgs e)
18 | {
19 | WrapPanel_ManualConfig.IsEnabled = false;
20 | }
21 |
22 | private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
23 | {
24 | WrapPanel_ManualConfig.IsEnabled = true;
25 | }
26 |
27 | private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
28 | {
29 | MainWindow.Clicado = false;
30 | }
31 |
32 | private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
33 | {
34 | try
35 | {
36 | if (!User.Settings.Device.cpu.Autoconfig && User.Settings.Device.cpu.Threads > 0)
37 | {
38 | PanelMaxUsageHint.IsEnabled = false;
39 | }
40 | else
41 | {
42 | PanelMaxUsageHint.IsEnabled = true;
43 | }
44 | }
45 | catch
46 | {
47 | PanelMaxUsageHint.IsEnabled = true;
48 | }
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/ViewModel/UserControlItemMenu.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace TrueMiningDesktop.ViewModel
5 | {
6 | ///
7 | /// Interação lógica para UserControlItemMenu.xam
8 | ///
9 | public partial class UserControlItemMenu : UserControl
10 | {
11 | private readonly MainWindow _context;
12 |
13 | public UserControlItemMenu(ItemMenu itemMenu, MainWindow context)
14 | {
15 | InitializeComponent();
16 |
17 | _context = context;
18 |
19 | ExpanderMenu.Visibility = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible;
20 | ListViewItemMenu.Visibility = itemMenu.SubItems == null ? Visibility.Visible : Visibility.Collapsed;
21 |
22 | DataContext = itemMenu;
23 |
24 | Screen = itemMenu.Screen;
25 | }
26 |
27 | private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
28 | {
29 | _context.SwitchScreen(((SubItem)((ListView)sender).SelectedItem).Screen);
30 | _context.MenuMenu.ScrollIntoView(_context.MenuMenu.Items[0]); //scroll to top
31 | }
32 |
33 | public UserControl Screen { get; private set; }
34 |
35 | private void UserControl_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
36 | {
37 | if (ListViewMenu.SelectedIndex >= 0)
38 | _context.SwitchScreen(((SubItem)((ListView)ListViewMenu).SelectedItem).Screen);
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/Core/NextStart.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Text.Json;
3 | using System.Threading;
4 |
5 | namespace TrueMiningDesktop.Core.NextStart
6 | {
7 | internal class Instructions
8 | {
9 | public bool useThisInstructions { get; set; } = false;
10 |
11 | public bool startMining { get; set; } = false;
12 | public bool ignoreUpdates { get; set; } = true;
13 | public bool startHiden { get; set; } = false;
14 | }
15 |
16 | internal class Actions
17 | {
18 | public static void Save(Instructions instructions)
19 | {
20 | string text = JsonSerializer.Serialize(instructions);
21 |
22 | while (Tools.IsFileLocked(new FileInfo("NextStartInstructions.json"))) { Thread.Sleep(500); }
23 | File.WriteAllText("NextStartInstructions.json", text);
24 | }
25 |
26 | public static Instructions loadedNextStartInstructions = new Instructions();
27 |
28 | public static void Load()
29 | {
30 | if (File.Exists("NextStartInstructions.json"))
31 | {
32 | while (Tools.IsFileLocked(new FileInfo("NextStartInstructions.json"))) { Thread.Sleep(500); }
33 | loadedNextStartInstructions = JsonSerializer.Deserialize(File.ReadAllText("NextStartInstructions.json"));
34 |
35 | DeleteInstructions();
36 | }
37 | }
38 |
39 | public static void DeleteInstructions()
40 | {
41 | while (Tools.IsFileLocked(new FileInfo("NextStartInstructions.json"))) { Thread.Sleep(500); }
42 | File.Delete("NextStartInstructions.json");
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/Core/Device.cs:
--------------------------------------------------------------------------------
1 | using MaterialDesignThemes.Wpf;
2 | using System;
3 | using TrueMiningDesktop.Janelas;
4 |
5 | namespace TrueMiningDesktop.Core
6 | {
7 | public class Device
8 | {
9 | public static DeviceInfo Cpu = new DeviceInfo("cpu", "x64 CPU(s)", User.Settings.Device.cpu.Algorithm, (bool)User.Settings.Device.cpu.MiningSelected, -1, PackIconKind.Cpu64Bit);
10 | public static DeviceInfo Opencl = new DeviceInfo("opencl", "AMD GPU(s)", User.Settings.Device.opencl.Algorithm, (bool)User.Settings.Device.opencl.MiningSelected, -1, PackIconKind.Gpu);
11 | public static DeviceInfo Cuda = new DeviceInfo("cuda", "NVIDIA GPU(s)", User.Settings.Device.cuda.Algorithm, (bool)User.Settings.Device.cuda.MiningSelected, -1, PackIconKind.Gpu);
12 |
13 | public Device()
14 | {
15 | Cpu.PropertieChanged += new EventHandler(cpuChanged);
16 | Cuda.PropertieChanged += new EventHandler(cudaChanged);
17 | Opencl.PropertieChanged += new EventHandler(openclChanged);
18 | }
19 |
20 | public static System.Collections.Generic.List DevicesList = new System.Collections.Generic.List() { Cpu, Opencl, Cuda };
21 |
22 | private void openclChanged(object sender, EventArgs e)
23 | {
24 | User.Settings.Device.opencl.MiningSelected = Opencl.IsSelected;
25 | }
26 |
27 | private void cudaChanged(object sender, EventArgs e)
28 | {
29 | User.Settings.Device.cuda.MiningSelected = Cuda.IsSelected;
30 | }
31 |
32 | private void cpuChanged(object sender, EventArgs e)
33 | {
34 | User.Settings.Device.cpu.MiningSelected = Cpu.IsSelected;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/ViewModel/UserControlItemMenu.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Resources/LICENSE.md:
--------------------------------------------------------------------------------
1 | # TRUE MINING LICENSE
2 |
3 | > Version 1.3, Janeiro de 2022
4 |
5 | > Copyright (C) 2019-2022 True Mining
6 |
7 | Todos têm permissão para copiar e distribuir este documento de licença como original ou modificado.
8 |
9 | > TRUE MINING LICENSE
10 | > TERMOS E CONDIÇÕES PARA CÓPIA, DISTRIBUIÇÃO E MODIFICAÇÃO
11 |
12 | 1. O software é de propriedade integral da True Mining. Você pode apenas fazer o que a licença clarifica:
13 |
14 | 1a. Baixar e usar o software da forma que o software propõe, dentro das limitações de uso que a interface gráfica lhe proporciona.
15 | 1b. Visualizar, verificar, sugerir alterações e compilar o código fonte deste projeto em sua máquina.
16 | 1c. Fotografar, gravar vídeos e produzir/compartilhar material midiático e publicitário deste projeto.
17 |
18 | 2. Não é permitido distribuir ou redistribuir cópias modificadas do projeto.
19 |
20 | 3. Não é permitido uso de má-fé do nome ou marca da empresa ou do projeto. Jamais será tolerado atribuir ou relacionar nome ou marca da empresa ou projeto a golpes, fraudes ou qualquer forma de prejudicar outrem.
21 |
22 | 4. Não há garantias quanto ao funcionamento ou mal funcionamento do software. Não somos responsáveis por danos de qualquer natureza a pessoas, hardware nem nada. Não garantimos que haja suporte nem disponibilidade de nada.
23 |
24 | 5. O software poderá baixar arquivos compilados de softwares de terceiros. Não há como verificarmos a integridade desses arquivos. Não temos qualquer tipo de responsabilidade sobre isso e o usuário concorda com os termos de uso e licença desses softwares e arquivos de terceiros automaticamente assim que forem executados em sua máquina por processos automáticos ou manuais, deixando nosso projeto de fora disso.
25 |
26 | 6. Não somos responsáveis pelo uso ou mal uso do software nem a qualquer implicação que isso cause.
27 |
28 | 7. Não infrinja as leis do seu país ou jurisdição. O cumprimento das leis e as consequências do descumprimento delas são de total responsabilidade do usuário.
29 |
30 | 8. A licença pode ser alterada a qualquer momento sem aviso prévio. A aceitação dos novos termos é automática.
31 |
32 | 9. Entre em contato com o desenvolvedor se quiser negociar algo ou tiver dúvidas sobre a licença. Esse software pode ser cedida para outras pessoas e/ou empresas, com autorização prévia, para que possam fazer uso comercial do software, limitado às condições acordadas entre partes.
33 |
34 | 10. Usando o software ou fazendo qualquer coisa especificada neste documento de licença você concorda com os termos dispostos acima.
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # True Mining Desktop
2 |
3 | [](https://github.com/True-Mining/TrueMiningDesktop/releases/latest/download/TrueMiningDesktop.zip)
4 | [](https://github.com/True-Mining/TrueMiningDesktop/releases)
5 | [](https://github.com/True-Mining/TrueMiningDesktop/releases/latest)
6 | [](https://truemining.online)
7 | 
8 | [](https://github.com/True-Mining/TrueMiningDesktop/stargazers)
9 | [](https://github.com/True-Mining/TrueMiningDesktop/network)
10 |
11 | >True Mining Desktop is a software integrated with the True Mining and True Payment Platform.
12 |
13 | True Mining Desktop comes to facilitate the CPU and GPU mining of the end user, providing an simple and easy-to-use graphical interface.
14 |
15 | Currently supported payment currencies:
16 | - Dogecoin (DOGE)
17 | - Digibyte (DGB)
18 | - Ravencoin (RVN)
19 |
20 | Website: https://truemining.online
21 |
22 | #### Screenshot:
23 | 
24 |
25 |
26 | #### Features:
27 | - Selection of device types;
28 | - Automatic configuration;
29 | - Easy graphical interface;
30 | - Can mine on almost any 64-bit windows computer;
31 | - Allows you to mine even while using it for something else without disturbing your activities;
32 | - Automatic download of miners;
33 | - Dashboard: displays the user's accumulated balance and estimated time for payment;
34 | - Allows the software to avoid Windows auto-suspend;
35 | - Allows automatic startup along with user login;
36 | - Configuration to start with windows;
37 | - Setting to start mining when opening the miner;
38 | - Setting to start hidden;
39 | - Show/hide mining console;
40 | - Custom configuration for device mining;
41 | - Setting to start Tor + Privoxy in mining to avoid firewalls;
42 | - Automatic software updates;
43 | - Human support in our groups;
44 |
45 |
46 | [](https://github.com/True-Mining/TrueMiningDesktop/releases/latest/download/TrueMiningDesktop.zip)
47 |
--------------------------------------------------------------------------------
/ViewModel/OverviewDeviceSimplified.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Windows;
4 | using System.Windows.Media;
5 | using TrueMiningDesktop.Core;
6 | using TrueMiningDesktop.Janelas;
7 |
8 | namespace TrueMiningDesktop.ViewModel
9 | {
10 | ///
11 | /// Interação lógica para OverviewDeviceSimplified.xam
12 | ///
13 | public partial class OverviewDeviceSimplified
14 | {
15 | public event EventHandler PropertieChanged;
16 |
17 | protected virtual void OnChanged(EventArgs e)
18 | {
19 | PropertieChanged?.Invoke(this, e);
20 | }
21 |
22 | public OverviewDeviceSimplified()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 | public void RefreshDataContext(DeviceInfo data)
28 | {
29 | ovIcon.Kind = data.IconKind;
30 | ovDeviceName.Content = data.DeviceName;
31 | ovMiningAlgo.Content = data.MiningAlgo;
32 | ovDeviceIsSelected.IsChecked = data.IsSelected;
33 |
34 | if ((bool)ovDeviceIsSelected.IsChecked)
35 | {
36 | if (data.HashrateValue_raw > 0)
37 | {
38 | ovHashrate.FontSize = 18;
39 | ovHashrate.Content = data.HashrateString;
40 | }
41 | else
42 | {
43 | if (Miner.IsMining)
44 | {
45 | if (Miner.StartedSince > DateTime.UtcNow.AddMinutes(-2))
46 | {
47 | ovHashrate.FontSize = 17;
48 | ovHashrate.Content = "starting";
49 | }
50 | else
51 | {
52 | ovHashrate.FontSize = 17;
53 | ovHashrate.Content = "error";
54 | }
55 | }
56 | else
57 | {
58 | ovHashrate.FontSize = 18;
59 | ovHashrate.Content = "-";
60 | }
61 | }
62 | }
63 | else
64 | {
65 | ovHashrate.Content = "-";
66 | }
67 | }
68 |
69 | private void DeviceIsSelected_Checked(object sender, RoutedEventArgs e)
70 | {
71 | OnChanged(null);
72 |
73 | ovIcon.Foreground = Brushes.Black;
74 | new System.Threading.Tasks.Task(() =>
75 | {
76 | if (Miner.IsMining || Miner.IsTryingStartMining)
77 | {
78 | while (Miner.IsStoppingMining || Miner.IsTryingStartMining) { Thread.Sleep(100); }
79 |
80 | Miner.StopMiners();
81 |
82 | Miner.StartMiners();
83 | }
84 | })
85 | .Start();
86 | }
87 |
88 | private void DeviceIsSelected_Unchecked(object sender, RoutedEventArgs e)
89 | {
90 | OnChanged(null);
91 |
92 | ovIcon.Foreground = Brushes.Gray;
93 |
94 | new System.Threading.Tasks.Task(() =>
95 | {
96 | if (Miner.IsMining || Miner.IsTryingStartMining)
97 | {
98 | while (Miner.IsStoppingMining || Miner.IsTryingStartMining) { Thread.Sleep(100); }
99 |
100 | Miner.StopMiners();
101 |
102 | Miner.StartMiners();
103 | }
104 | })
105 | .Start();
106 | }
107 | }
108 | }
--------------------------------------------------------------------------------
/ViewModel/PageCreateWallet.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using TrueMiningDesktop.Core;
4 |
5 | namespace TrueMiningDesktop.ViewModel
6 | {
7 | ///
8 | /// Interação lógica para PageCreateWallet.xam
9 | ///
10 | public partial class PageCreateWallet : Window
11 | {
12 | public PageCreateWallet()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void button_click(object sender, RoutedEventArgs e)
18 | {
19 | string content = null;
20 | if (sender != null)
21 | {
22 | try
23 | {
24 | content = (sender as Button).Name;
25 | }
26 | catch { }
27 | }
28 |
29 | switch (content)
30 | {
31 | case "RVN_binance":
32 | {
33 | Tools.OpenLinkInBrowser("https://www.binance.com/pt-BR/register?ref=15277911");
34 | }
35 | break;
36 |
37 | case "RVN_github_core":
38 | {
39 | Tools.OpenLinkInBrowser("https://github.com/RavenProject/Ravencoin/releases");
40 | }
41 | break;
42 |
43 | case "RVN_github_electrum":
44 | {
45 | Tools.OpenLinkInBrowser("https://github.com/Electrum-RVN-SIG/Electrum-Ravencoin/releases");
46 | }
47 | break;
48 |
49 | case "RVN_dot_org_site":
50 | {
51 | Tools.OpenLinkInBrowser("https://ravencoin.org/wallet/");
52 | }
53 | break;
54 |
55 | case "DOGE_github":
56 | {
57 | Tools.OpenLinkInBrowser("https://github.com/dogecoin/dogecoin/releases");
58 | }
59 | break;
60 |
61 | case "DOGE_binance":
62 | {
63 | Tools.OpenLinkInBrowser("https://www.binance.com/pt-BR/register?ref=15277911");
64 | }
65 | break;
66 |
67 | case "DOGE_okex":
68 | {
69 | Tools.OpenLinkInBrowser("https://www.okex.com/join/9619437");
70 | }
71 | break;
72 |
73 | case "DOGE_dogechain":
74 | {
75 | Tools.OpenLinkInBrowser("https://my.dogechain.info");
76 | }
77 | break;
78 |
79 | case "DOGE_crex24":
80 | {
81 | Tools.OpenLinkInBrowser("https://crex24.com/?refid=ves323roqu7eousuh5wm");
82 | }
83 | break;
84 |
85 | case "DGB_github":
86 | {
87 | Tools.OpenLinkInBrowser("https://github.com/DigiByte-Core/digibyte/releases");
88 | }
89 | break;
90 |
91 | case "DGB_binance":
92 | {
93 | Tools.OpenLinkInBrowser("https://www.binance.com/pt-BR/register?ref=15277911");
94 | }
95 | break;
96 |
97 | case "DGB_okex":
98 | {
99 | Tools.OpenLinkInBrowser("https://www.okex.com/join/9619437");
100 | }
101 | break;
102 |
103 | case "DGB_crex24":
104 | {
105 | Tools.OpenLinkInBrowser("https://crex24.com/?refid=ves323roqu7eousuh5wm");
106 | }
107 | break;
108 |
109 | default: MessageBox.Show("Something went wrong"); break;
110 | }
111 | }
112 | }
113 | }
--------------------------------------------------------------------------------
/Janelas/Other.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using TrueMiningDesktop.Core;
4 |
5 | namespace TrueMiningDesktop.Janelas
6 | {
7 | public partial class Other : UserControl
8 | {
9 | public Other()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void Button_website_Click(object sender, RoutedEventArgs e)
15 | {
16 | Tools.OpenLinkInBrowser("https://truemining.online/");
17 | }
18 |
19 | private void Button_github_Click(object sender, RoutedEventArgs e)
20 | {
21 | Tools.OpenLinkInBrowser("https://github.com/True-Mining");
22 | }
23 |
24 | private void Button_YtTutorial_Click(object sender, RoutedEventArgs e)
25 | {
26 | Tools.OpenLinkInBrowser("https://www.youtube.com/watch?v=3VbH1y4o7Ak");
27 | }
28 |
29 | private void Button_telegramGroup_Click(object sender, RoutedEventArgs e)
30 | {
31 | MessageBox.Show("You will be redirected to an interactive group. Do not send subjects not related to True Mining. You can be banned without notice.");
32 | Tools.OpenLinkInBrowser("https://t.me/true_mining");
33 | }
34 |
35 | private void Button_telegramLOGChannel_Click(object sender, RoutedEventArgs e)
36 | {
37 | Tools.OpenLinkInBrowser("https://t.me/joinchat/AAAAAFTI4DfIEWk8MM-YLQ");
38 | }
39 |
40 | private void Button_whatsapp_Click(object sender, RoutedEventArgs e)
41 | {
42 | MessageBox.Show("You will be redirected to an support group. Only True Mining support, request help or help a friend.");
43 | Tools.OpenLinkInBrowser("https://chat.whatsapp.com/GmZheo5aQmoFbWXP6ZXQh2");
44 | }
45 |
46 | private void Button_whatsapp_offtopic_Click(object sender, RoutedEventArgs e)
47 | {
48 | MessageBox.Show("You will be redirected to an offtopic interactive group. Be respectfull and don't scam your friends.");
49 | Tools.OpenLinkInBrowser("https://chat.whatsapp.com/HlMg3voD3MkKXHvklNc2N9");
50 | }
51 |
52 | private void Button_telegram_offtopic_Click(object sender, RoutedEventArgs e)
53 | {
54 | MessageBox.Show("You will be redirected to an offtopic interactive group. Be respectfull and don't scam your friends.");
55 | Tools.OpenLinkInBrowser("https://t.me/joinchat/RIJqDSeKxc81ODk5");
56 | }
57 |
58 | private void Button_telegramBot_Click(object sender, RoutedEventArgs e)
59 | {
60 | Tools.OpenLinkInBrowser("https://t.me/TrueMiningBot");
61 | }
62 |
63 | private void Button_discord_Click(object sender, RoutedEventArgs e)
64 | {
65 | MessageBox.Show("You will be redirected to discord server. Be respectfull and don't scam your friends.");
66 | Tools.OpenLinkInBrowser("https://discord.gg/3RYv2QQWTC");
67 | }
68 |
69 | private void Button_sponsor_Click(object sender, RoutedEventArgs e)
70 | {
71 | MessageBox.Show("You will be redirected to our sponsor link. We only select who we trust, but we are not responsible for anything");
72 | Tools.OpenLinkInBrowser(Server.SoftwareParameters.ServerConfig.SponsorClickLink);
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/Docs/Nota de Atualização.md:
--------------------------------------------------------------------------------
1 | # True Mining Desktop
2 |
3 | > Estamos lançando o True Mining Desktop, o software escrito do zero que irá substituiro antigo True Mining.
4 | #### Neste post vamos esclarecer todas as dúvidas e como foi e será o decorrer desta atualização.
5 |
6 | #### Agenda:
7 | * Desde final de 2019 estamos planejando e programando o novo software.
8 | * Dia 27/09/2020 iniciamos a fase beta, criamos nossa licença, publicamos nosso código no github e permitimos aos usuários que baixassem a versão beta, ouvindo o feedback e melhorando os pontos que os usuários apontaram para melhorar e fazendo diversas melhorias extras.
9 | * Dia 10/10/2020 foi lançada a versão oficial e rolling release, após várias melhorias e termos observado que o software estava estável
10 | * Dia 11/10/2020 alteramos o software antigo (True Mining) para que exibisse uma mensagem avisando que a versão nova estava disponível para download, que deve ser baixada e instalada manualmente.
11 | * Dia 12/10/2020 oficialmente desligamos o suporte a versão mais antiga. O usuário ainda pode usar o software, mas não vamos mais oferecer suporte nem garantir disponibilidade.
12 | * Dia 30/10/2020 a versão antiga será completamente desligada e não irá mais funcionar para minerar.
13 | * Agora e no futuro planejamos continuar com as atualizações, trazendo diversas melhorias.
14 |
15 | #### Por que essa nova versão é importante?
16 | A versão anterior tinha seu código muito mal escrito e se tornava custoso demais oferecer suporte, realizar melhorias e novas implementações. Além disso nossa interface tinha um visual ultrapassado e oferecia travamentos.
17 | Essa atualização irá nos fornecer maior segurança jurídica.
18 | Com o novo software, será muito mais fácil e barato adicionar novos recursos e resolver bugs com mais agilidade.
19 |
20 | #### O que muda?
21 | Atualmente, o principio de funcionamento é basicamente o mesmo, porém TODO O CÓDIGO FOI REESCRITO DO ZERO.
22 | Temos agora uma interface mais intuitiva, software mais estável e responsivo, técnicas de programação mais eficiente e mais segurança.
23 | Agora todo nosso código está publicado no nosso [Repositório do Github](https://github.com/True-Mining/TrueMiningDesktop). Vide licença.
24 |
25 | #### Como migrar do software antigo para o novo software?
26 | Ao abrir o True Mining (software antigo) você irá observar na tela inicial um botão com algumas informações sobre esta atualização. Ao clicar nesse botão você será redirecionado para nosso site e um download iniciará automaticamente. Mas atenção: você precisa manualmente descompactar a pasta contida dentro do arquivo 'TrueMiningDesktop.zip' baixado. Após descompactar a pasta para o local de sua preferência, abra o arquivo executável 'True Mining Desktop.exe' contido dentro da pasta. Após a aceitação da licença o software irá abrir. Configure o software como você preferir e inicie a mineração. Pronto. Você pode deletar o software antigo se quiser.
27 |
28 | #### Suporte
29 | Caso tenha dúvidas, entre em nossos grupos para buscar mais informações
30 | [Telegram](t.me/true_mining)
31 | [WhatsApp](https://chat.whatsapp.com/BxV5ZsSHWoD2zzE5kDTQay)
32 |
--------------------------------------------------------------------------------
/ViewModel/OverviewDeviceSimplified.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Janelas/CheckerPopup.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/Janelas/DeviceInfo.cs:
--------------------------------------------------------------------------------
1 | using MaterialDesignThemes.Wpf;
2 | using System;
3 | using System.Linq;
4 | using TrueMiningDesktop.Core;
5 | using TrueMiningDesktop.ViewModel;
6 |
7 | namespace TrueMiningDesktop.Janelas
8 | {
9 | public class DeviceInfo : OverviewDeviceSimplified
10 | {
11 | public OverviewDeviceSimplified OverviewDeviceSimplified = new();
12 |
13 | public event EventHandler PropertieChangedDevInfo;
14 |
15 | private readonly Hashrate_timer hashrate_timer;
16 |
17 | public DeviceInfo(string backendName, string name, string miningAlgo = null, bool isSelected = false, decimal hashrate = -1, PackIconKind iconKind = PackIconKind.Cpu64Bit)
18 | {
19 | BackendName = backendName;
20 | DeviceName = name;
21 | MiningAlgo = miningAlgo;
22 | HashrateValue_raw = hashrate;
23 | IsSelected = isSelected;
24 | IconKind = iconKind;
25 |
26 | Janelas.Pages.Home.listDevicesOverview.Children.Add(OverviewDeviceSimplified);
27 |
28 | OverviewDeviceSimplified.PropertieChanged += new EventHandler(OVchanged);
29 |
30 | OverviewDeviceSimplified.RefreshDataContext(this);
31 |
32 | hashrate_timer = new Hashrate_timer(this);
33 | hashrate_timer.HashrateUpdated += HashrateUpdated;
34 | }
35 |
36 | private void HashrateUpdated(object sender, EventArgs e)
37 | {
38 | HashrateValue_raw = hashrate_timer.Hashrate;
39 | }
40 |
41 | protected virtual void OnChangedDevInfo(EventArgs e)
42 | {
43 | PropertieChangedDevInfo?.Invoke(this, e);
44 | }
45 |
46 | private void OVchanged(object sender, EventArgs e)
47 | {
48 | IsSelected = (bool)OverviewDeviceSimplified.ovDeviceIsSelected.IsChecked;
49 | }
50 |
51 | public void what()
52 | {
53 | // bixo sei lá, só sei que deixa desse jeito pra funcionar
54 | }
55 |
56 | public string BackendName { get; private set; }
57 | public string DeviceName { get; private set; }
58 | public string miningAlgo;
59 |
60 | public string MiningAlgo
61 | {
62 | get => miningAlgo;
63 | set
64 | {
65 | miningAlgo = value;
66 | _ = Dispatcher.BeginInvoke((Action)(() => { OverviewDeviceSimplified.RefreshDataContext(this); }));
67 | }
68 | }
69 |
70 | private decimal hashrateValue_raw = -1;
71 |
72 | public decimal HashrateValue_raw
73 | {
74 | get => hashrateValue_raw;
75 | set
76 | {
77 | hashrateValue_raw = value;
78 | if (Server.SoftwareParameters.ServerConfig != null && Server.SoftwareParameters.ServerConfig.MiningCoins.Any(coin => coin.Algorithm.Equals(MiningAlgo, StringComparison.OrdinalIgnoreCase)))
79 | {
80 | Server.MiningCoin miningCoin = Server.SoftwareParameters.ServerConfig.MiningCoins.First(coin => coin.Algorithm.Equals(MiningAlgo, StringComparison.OrdinalIgnoreCase));
81 |
82 | HashrateValue = value / miningCoin.DefaultHashMuCoef;
83 | HashrateString = Math.Round(value / miningCoin.DefaultHashMuCoef, 2) + " " + miningCoin.DefaultHashMuString;
84 | }
85 |
86 | _ = Dispatcher.BeginInvoke((Action)(() => { OverviewDeviceSimplified.RefreshDataContext(this); }));
87 | }
88 | }
89 |
90 | private decimal hashrateValue = -1;
91 |
92 | public decimal HashrateValue
93 | { get => hashrateValue; set { hashrateValue = value; Dispatcher.BeginInvoke((Action)(() => { OverviewDeviceSimplified.RefreshDataContext(this); })); } }
94 |
95 | private string hashrateString = "0 H/s";
96 |
97 | public string HashrateString
98 | { get => hashrateString; set { hashrateString = value; Dispatcher.BeginInvoke((Action)(() => { OverviewDeviceSimplified.RefreshDataContext(this); })); } }
99 |
100 | private bool isSelected = true;
101 |
102 | public bool IsSelected
103 | { get => isSelected; set { isSelected = value; OnChanged(null); } }
104 |
105 | private bool isMining = true;
106 |
107 | public bool IsMining
108 | { get => isMining; set { isMining = value; if (isMining) { hashrate_timer.Start(); } else { hashrate_timer.Stop(); } } }
109 |
110 | public PackIconKind IconKind { get; set; }
111 | }
112 | }
--------------------------------------------------------------------------------
/Janelas/Settings.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Janelas/Home.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text.RegularExpressions;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using TrueMiningDesktop.Core;
10 | using TrueMiningDesktop.Server;
11 |
12 | namespace TrueMiningDesktop.Janelas
13 | {
14 | ///
15 | /// Interação lógica para Home.xam
16 | ///
17 | public partial class Home : UserControl
18 | {
19 | public bool PaymentInfoWasChanged { get; set; } = false;
20 |
21 | public Home()
22 | {
23 | InitializeComponent();
24 | }
25 |
26 | public void StartStopMining_Click(object sender, RoutedEventArgs e)
27 | {
28 | if (Miner.IsMining && !Miner.IsStoppingMining)
29 | {
30 | new Task(() => Miner.StopMiners()).Start();
31 | }
32 | else if (!Miner.IsMining && !Miner.IsTryingStartMining && !Miner.IsStoppingMining)
33 | {
34 | new Task(() => Miner.StartMiners()).Start();
35 | }
36 | }
37 |
38 | private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
39 | {
40 | try
41 | {
42 | TextBox_PaymentAddress.Text = Regex.Replace(TextBox_PaymentAddress.Text, @"[^\w]", "");
43 |
44 | if (!string.IsNullOrEmpty(TextBox_PaymentAddress.Text) && SoftwareParameters.ServerConfig != null && SoftwareParameters.ServerConfig.PaymentCoins != null)
45 | {
46 | List possibleCoinsByCurrentAddress = SoftwareParameters.ServerConfig.PaymentCoins.Where(x => x.AddressPatterns.Any(x => Regex.IsMatch(TextBox_PaymentAddress.Text, x))).ToList();
47 |
48 | if (possibleCoinsByCurrentAddress.Count > 0)
49 | {
50 | Button_CreateWallet.Visibility = Visibility.Hidden;
51 | }
52 | else
53 | {
54 | Button_CreateWallet.Visibility = Visibility.Visible;
55 | }
56 |
57 | if (possibleCoinsByCurrentAddress.Count == 1)
58 | {
59 | ComboBox_PaymentCoin.SelectedItem = possibleCoinsByCurrentAddress.First().CoinTicker + " - " + possibleCoinsByCurrentAddress.First().CoinName;
60 | }
61 | else if (User.Settings.User.Payment_Wallet == TextBox_PaymentAddress.Text)
62 | {
63 | ComboBox_PaymentCoin.SelectedItem = User.Settings.User.PayCoin.CoinTicker + " - " + User.Settings.User.PayCoin.CoinName;
64 | }
65 | else
66 | {
67 | ComboBox_PaymentCoin.SelectedItem = null;
68 | }
69 |
70 | PaymentInfoWasChanged = true;
71 | Pages.Dashboard.xWalletAddress.Content = TextBox_PaymentAddress.Text;
72 | }
73 | else
74 | {
75 | if (User.Settings.User.PayCoin != null && User.Settings.User.PayCoin.AddressPatterns.Any(x => Regex.IsMatch(TextBox_PaymentAddress.Text, x)))
76 | {
77 | Button_CreateWallet.Visibility = Visibility.Hidden;
78 | }
79 | else
80 | {
81 | Button_CreateWallet.Visibility = Visibility.Visible;
82 | }
83 | }
84 | }
85 | catch { }
86 | }
87 |
88 | private void Button_CreateWallet_Click(object sender, RoutedEventArgs e)
89 | {
90 | new ViewModel.PageCreateWallet().ShowDialog();
91 | }
92 |
93 | private void RestartAsAdministrator_Click(object sender, RoutedEventArgs e)
94 | {
95 | Tools.RestartApp(true);
96 | }
97 |
98 | private void UninstallWarsawDiebold_Click(object sender, RoutedEventArgs e)
99 | {
100 | new System.Threading.Tasks.Task(() =>
101 | {
102 | if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Diebold\Warsaw\unins000.exe"))
103 | {
104 | MessageBox.Show("True Mining Desktop will open uninstaller for you. Uninstall it");
105 |
106 | System.Diagnostics.Process removeDiebold;
107 | removeDiebold = new System.Diagnostics.Process() { StartInfo = new System.Diagnostics.ProcessStartInfo(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Diebold\Warsaw\unins000.exe") };
108 |
109 | removeDiebold.Start();
110 | removeDiebold.WaitForExit();
111 | }
112 |
113 | int count = 20;
114 |
115 | while (count > 0)
116 | {
117 | count--;
118 | Application.Current.Dispatcher.Invoke((Action)delegate
119 | {
120 | Janelas.Pages.Home.WarningsTextBlock.Text = Janelas.Pages.Home.WarningsTextBlock.Text.Replace("\nWarsaw Diebold found on your system. It is highly recommended to uninstall this agent. Click \"Remove Warsaw\"", "");
121 |
122 | if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Diebold\Warsaw\unins000.exe")) { Janelas.Pages.Home.UninstallWarsawDiebold.Visibility = Visibility.Visible; Janelas.Pages.Home.WarningsTextBlock.Text += "\nWarsaw Diebold found on your system. It is highly recommended to uninstall this agent. Click \"Remove Warsaw\""; } else { Janelas.Pages.Home.UninstallWarsawDiebold.Visibility = Visibility.Collapsed; }
123 | });
124 | System.Threading.Thread.Sleep(5000);
125 | }
126 | }).Start();
127 | }
128 | }
129 | }
--------------------------------------------------------------------------------
/True Mining Desktop.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net6.0-windows
5 | TrueMiningDesktop
6 | true
7 | true
8 | icone.ico
9 | 4.20.2
10 | 4.20.2
11 | 4.20.2
12 | TrueMiningDesktop.App
13 | True Mining Desktop
14 | True Mining
15 | Matheus Bach
16 | True Mining Desktop
17 | Copyright (C) 2019-2023 True Mining
18 | logo.png
19 | True Mining Desktop Mining Software
20 | https://github.com/True-Mining/TrueMiningDesktop
21 | https://truemining.online
22 | true
23 | TrueMiningDesktop
24 | embedded
25 | false
26 | true
27 | false
28 | false
29 | Release
30 | true
31 | win-x64
32 | enable
33 | False
34 | README.md
35 | git
36 |
37 |
38 | none
39 |
40 |
41 | none
42 |
43 |
44 |
45 |
46 | True
47 |
48 |
49 |
50 |
51 | True
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | Code
71 |
72 |
73 |
74 |
75 | Always
76 |
77 |
78 | True
79 | \
80 |
81 |
82 | Always
83 |
84 |
85 | Always
86 |
87 |
88 |
89 |
90 | Always
91 | True
92 |
93 |
94 | Always
95 |
96 |
97 |
98 |
99 | Designer
100 |
101 |
102 |
103 |
104 | False
105 |
106 | ../Resources/libraries/dotnet6
107 | ./Resources/libraries/dotnet6
108 |
109 |
110 |
111 |
112 |
113 | False
114 |
115 | True
116 |
117 | False
118 |
119 |
120 |
121 | True
122 |
123 |
124 | Info
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/Janelas/Dashboard.xaml.cs:
--------------------------------------------------------------------------------
1 | using OxyPlot;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Linq;
6 | using System.Runtime.CompilerServices;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using TrueMiningDesktop.ExternalApi;
10 | using TrueMiningDesktop.Janelas.Popups;
11 |
12 | namespace TrueMiningDesktop.Janelas
13 | {
14 | ///
15 | /// Interação lógica para Dashboard.xam
16 | ///
17 | public partial class Dashboard : INotifyPropertyChanged
18 | {
19 | public Dashboard()
20 | {
21 | InitializeComponent();
22 | DataContext = this;
23 | }
24 |
25 | public event PropertyChangedEventHandler PropertyChanged;
26 |
27 | private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
28 | {
29 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
30 | }
31 |
32 | private string labelNextPayout;
33 | private string labelAccumulatedBalance;
34 | private List dashboardWarnings = new();
35 | public Visibility warningWrapVisibility = Visibility.Visible;
36 |
37 | public string LabelNextPayout
38 | { get { return labelNextPayout; } set { labelNextPayout = value; xLabelNextPayout.Content = value; } }
39 |
40 | public string LabelAccumulatedBalance
41 | { get { return labelAccumulatedBalance; } set { labelAccumulatedBalance = value; xLabelAccumulatedBalance.Content = value; } }
42 |
43 | public List DashboardWarnings
44 | { get { return dashboardWarnings; } set { dashboardWarnings = value; NotifyPropertyChanged(); } }
45 |
46 | public Visibility WarningWrapVisibility
47 | { get { return warningWrapVisibility; } set { warningWrapVisibility = value; NotifyPropertyChanged(); } }
48 |
49 | public static string WalletAddress
50 | { get { return User.Settings.User.Payment_Wallet; } set { } }
51 |
52 | private bool firstTimeLoad = false;
53 |
54 | private Server.Saldo saldo;
55 |
56 | private PlotModel chartModel;
57 | private OxyPlot.Series.ColumnSeries columnChartSeries;
58 | private PlotController chartControler;
59 | private Visibility chartVisibility = Visibility.Hidden;
60 |
61 | public PlotModel ChartModel
62 | { get { return chartModel; } set { chartModel = value; NotifyPropertyChanged(); } }
63 |
64 | public OxyPlot.Series.ColumnSeries ColumnChartSeries
65 | { get { return columnChartSeries; } set { columnChartSeries = value; NotifyPropertyChanged(); } }
66 |
67 | public PlotController ChartController
68 | { get { return chartControler; } set { chartControler = value; NotifyPropertyChanged(); } }
69 |
70 | public Visibility ChartVisibility
71 | { get { return chartVisibility; } set { chartVisibility = value; NotifyPropertyChanged(); } }
72 |
73 | private void UserControl_Loaded(object sender, RoutedEventArgs e)
74 | {
75 | if (!firstTimeLoad)
76 | {
77 | saldo = new Server.Saldo();
78 | firstTimeLoad = true;
79 | }
80 | }
81 |
82 | private void Button_Calculator_Popup(object sender, RoutedEventArgs e)
83 | {
84 | try
85 | {
86 | foreach (Window window in Application.Current.Windows)
87 | {
88 | if (window.Title == "Calculator") { window.Close(); }
89 | }
90 |
91 | new Calculator() { Title = "Calculator" }.Show();
92 | }
93 | catch { }
94 | }
95 |
96 | private void Button_ExchangeRates_Popup(object sender, RoutedEventArgs e)
97 | {
98 | try
99 | {
100 | foreach (Window window in Application.Current.Windows)
101 | {
102 | if (window.Title == "Exchange Rates") { window.Close(); }
103 | }
104 |
105 | new ExchangeRates(saldo.exchangeRatePontosXmrToMiningCoin, saldo.exchangeRatePontosRvnToMiningCoin, saldo.exchangeRatePontosEtcToMiningCoin) { Title = "Exchange Rates" }.Show();
106 | }
107 | catch { }
108 | }
109 |
110 | public void ChangeChartZoom(object sender, RoutedEventArgs e)
111 | {
112 | string content = null;
113 | if (sender != null)
114 | {
115 | try
116 | {
117 | content = (sender as Button).Content.ToString();
118 | }
119 | catch { }
120 | }
121 |
122 | switch (content)
123 | {
124 | case "12h":
125 | {
126 | chart_zoom_interval = new TimeSpan(0, 12, 0, 0);
127 | }
128 | break;
129 |
130 | case "1d":
131 | {
132 | chart_zoom_interval = new TimeSpan(1, 0, 0, 0);
133 | }
134 | break;
135 |
136 | case "5d":
137 | {
138 | chart_zoom_interval = new TimeSpan(5, 0, 0, 0);
139 | }
140 | break;
141 |
142 | default:
143 | {
144 | //deixa como está, só atualiza o gráfico
145 | }
146 | break;
147 | }
148 |
149 | ViewModel.DashboardChart.UpdateAxes(new[] { NanopoolData.XMR_nanopool.pointsHistory_user, NanopoolData.RVN_nanopool.pointsHistory_user, NanopoolData.ETC_nanopool.pointsHistory_user }.SelectMany(d => d).GroupBy(kvp => kvp.Key, (key, kvps) => new { Key = key, Value = kvps.Sum(kvp => kvp.Value) }).ToDictionary(x => x.Key, x => x.Value), (int)Pages.Dashboard.chart_zoom_interval.TotalSeconds);
150 | }
151 |
152 | public TimeSpan chart_zoom_interval { get; set; } = new TimeSpan(0, 24, 0, 0);
153 |
154 | private void PackIcon_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
155 | {
156 | saldo.UpdateBalances();
157 | }
158 |
159 | private void ShowWarnings(object sender, RoutedEventArgs e)
160 | {
161 | foreach (string warning in DashboardWarnings)
162 | {
163 | MessageBox.Show(warning);
164 | }
165 | }
166 |
167 | private void HelpButton_Click(object sender, RoutedEventArgs e)
168 | {
169 | Core.Tools.OpenLinkInBrowser("https://gist.github.com/matheusbach/462558744709625db1149b7a1e5d384e");
170 | }
171 | }
172 | }
--------------------------------------------------------------------------------
/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Janelas/Popups/ExhangeRates.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using System.Windows.Input;
4 |
5 | namespace TrueMiningDesktop.Janelas.Popups
6 | {
7 | ///
8 | /// Lógica interna para Calculator.xaml
9 | ///
10 | public partial class ExchangeRates : Window
11 | {
12 | public ExchangeRates(decimal exchangeRatePontosRandomXToMiningCoin, decimal exchangeRatePontosKawPowToMiningCoin, decimal exchangeRatePontosEtchashToMiningCoin)
13 | {
14 | InitializeComponent();
15 | new System.Threading.Tasks.Task(() =>
16 | {
17 | Application.Current.Dispatcher.Invoke((Action)delegate
18 | {
19 | loadingVisualElement.Visibility = Visibility.Visible;
20 | AllContent.Visibility = Visibility.Hidden;
21 |
22 | if (Janelas.Pages.Dashboard.loadingVisualElement.Visibility == Visibility.Visible)
23 | {
24 | Close();
25 |
26 | MessageBox.Show("Wait for Dashboard load first"); return;
27 | }
28 | else
29 | {
30 | CoinName = User.Settings.User.PayCoin != null ? User.Settings.User.PayCoin.CoinName : "Coins";
31 |
32 | BTCToCoinRate = decimal.Round(BTCToBTCRate / (ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price) / 2);
33 | BTCToBTCRate = 1;
34 | BTCToUSDRate = decimal.Round(ExternalApi.BitcoinPrice.BTCUSD, 2);
35 |
36 | PointRandomXToCoinRate = decimal.Round(exchangeRatePontosRandomXToMiningCoin * (ExternalApi.ExchangeOrderbooks.XMRBTC.sellLevels[0].price / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price), 6);
37 | PointRandomXToBTCRate = decimal.Round((ExternalApi.ExchangeOrderbooks.XMRBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.XMRBTC.sellLevels[0].price) / 2 * exchangeRatePontosRandomXToMiningCoin / BTCToBTCRate, 8);
38 | PointRandomXToUSDRate = decimal.Round((ExternalApi.ExchangeOrderbooks.XMRBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.XMRBTC.sellLevels[0].price) / 2 * exchangeRatePontosRandomXToMiningCoin / BTCToBTCRate * BTCToUSDRate, 6);
39 |
40 | PointKawPowToCoinRate = decimal.Round(exchangeRatePontosKawPowToMiningCoin * (ExternalApi.ExchangeOrderbooks.RVNBTC.sellLevels[0].price / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price), 6);
41 | PointKawPowToBTCRate = decimal.Round((ExternalApi.ExchangeOrderbooks.RVNBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.RVNBTC.sellLevels[0].price) / 2 * exchangeRatePontosKawPowToMiningCoin / BTCToBTCRate, 8);
42 | PointKawPowToUSDRate = decimal.Round((ExternalApi.ExchangeOrderbooks.RVNBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.RVNBTC.sellLevels[0].price) / 2 * exchangeRatePontosKawPowToMiningCoin / BTCToBTCRate * BTCToUSDRate, 6);
43 |
44 | PointEtchashToCoinRate = decimal.Round(exchangeRatePontosEtchashToMiningCoin * (ExternalApi.ExchangeOrderbooks.ETCBTC.sellLevels[0].price / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price), 6);
45 | PointEtchashToBTCRate = decimal.Round((ExternalApi.ExchangeOrderbooks.ETCBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.ETCBTC.sellLevels[0].price) / 2 * exchangeRatePontosEtchashToMiningCoin / BTCToBTCRate, 8);
46 | PointEtchashToUSDRate = decimal.Round((ExternalApi.ExchangeOrderbooks.ETCBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.ETCBTC.sellLevels[0].price) / 2 * exchangeRatePontosEtchashToMiningCoin / BTCToBTCRate * BTCToUSDRate, 6);
47 |
48 | CoinToCoinRate = 1;
49 | CoinToPointRandomXRate = decimal.Round(CoinToCoinRate / PointRandomXToCoinRate, 2);
50 | CoinToPointKawPowRate = decimal.Round(CoinToCoinRate / PointKawPowToCoinRate, 2);
51 | CoinToPointEtchashRate = decimal.Round(CoinToCoinRate / PointEtchashToCoinRate, 2);
52 | CoinToBTCRate = decimal.Round((ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price) / 2 / BTCToBTCRate, 8);
53 | CoinToUSDRate = decimal.Round((ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price + ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price) / 2 / BTCToBTCRate * BTCToUSDRate, 6);
54 |
55 | loadingVisualElement.Visibility = Visibility.Hidden;
56 | AllContent.Visibility = Visibility.Visible;
57 |
58 | DataContext = null;
59 | DataContext = this;
60 | }
61 | });
62 | }).Start();
63 | }
64 |
65 | public string CoinName { get; set; }
66 |
67 | public decimal PointRandomXToCoinRate { get; set; } = 1;
68 | public decimal PointRandomXToBTCRate { get; set; } = 1;
69 | public decimal PointRandomXToUSDRate { get; set; } = 1;
70 |
71 | public decimal PointKawPowToCoinRate { get; set; } = 1;
72 | public decimal PointKawPowToBTCRate { get; set; } = 1;
73 | public decimal PointKawPowToUSDRate { get; set; } = 1;
74 |
75 | public decimal PointEtchashToCoinRate { get; set; } = 1;
76 | public decimal PointEtchashToBTCRate { get; set; } = 1;
77 | public decimal PointEtchashToUSDRate { get; set; } = 1;
78 |
79 | public decimal CoinToCoinRate { get; set; } = 1;
80 | public decimal CoinToPointRandomXRate { get; set; } = 1;
81 | public decimal CoinToPointKawPowRate { get; set; } = 1;
82 | public decimal CoinToPointEtchashRate { get; set; } = 1;
83 | public decimal CoinToBTCRate { get; set; } = 1;
84 | public decimal CoinToUSDRate { get; set; } = 1;
85 |
86 | public decimal BTCToCoinRate { get; set; } = 1;
87 | public decimal BTCToBTCRate { get; set; } = 1;
88 | public decimal BTCToUSDRate { get; set; } = 1;
89 |
90 | private void CloseButton_click(object sender, MouseButtonEventArgs e)
91 | {
92 | Close();
93 | }
94 |
95 | private static bool clicado;
96 | private Point lm;
97 |
98 | public void Down(object sender, MouseButtonEventArgs e)
99 | {
100 | clicado = true;
101 |
102 | lm.X = System.Windows.Forms.Control.MousePosition.X;
103 | lm.Y = System.Windows.Forms.Control.MousePosition.Y;
104 | lm.X = Convert.ToInt16(Left) - lm.X;
105 | lm.Y = Convert.ToInt16(Top) - lm.Y;
106 | }
107 |
108 | public void Move(object sender, MouseEventArgs e)
109 | {
110 | if (clicado && e.LeftButton == MouseButtonState.Pressed)
111 | {
112 | Left = System.Windows.Forms.Control.MousePosition.X + lm.X;
113 | Top = System.Windows.Forms.Control.MousePosition.Y + lm.Y;
114 | }
115 | else { clicado = false; }
116 | }
117 |
118 | public void Up(object sender, MouseButtonEventArgs e)
119 | {
120 | clicado = false;
121 | }
122 | }
123 | }
--------------------------------------------------------------------------------
/Janelas/SubMenuSettings/SettingsCUDA.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace TrueMiningDesktop.Janelas.SubMenuSettings
5 | {
6 | ///
7 | /// Interação lógica para SettingsCUDA.xam
8 | ///
9 | public partial class SettingsCUDA : UserControl
10 | {
11 | public SettingsCUDA()
12 | {
13 | InitializeComponent();
14 | DataContext = User.Settings.Device.cuda;
15 | AlgorithmComboBox.SelectedValue = User.Settings.Device.cuda.Algorithm;
16 | DisableTempControlCheckBox.IsChecked = User.Settings.Device.cuda.DisableTempControl;
17 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.cuda.ChipFansFullspeedTemp > 0 ? User.Settings.Device.cuda.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
18 | MemFansFullspeedTempTxt.Text = User.Settings.Device.cuda.MemFansFullspeedTemp > 0 ? User.Settings.Device.cuda.MemFansFullspeedTemp.ToString() + " °C" : "auto";
19 | ChipPauseMiningTempTxt.Text = User.Settings.Device.cuda.ChipPauseMiningTemp > 0 ? User.Settings.Device.cuda.ChipPauseMiningTemp.ToString() + " °C" : "auto";
20 | MemPauseMiningTempTxt.Text = User.Settings.Device.cuda.MemPauseMiningTemp > 0 ? User.Settings.Device.cuda.MemPauseMiningTemp.ToString() + " °C" : "auto";
21 | }
22 |
23 | private void CheckBox_Checked(object sender, RoutedEventArgs e)
24 | {
25 | WrapPanel_ManualConfig.IsEnabled = false;
26 | User.CudaSettings defaultSettings = new User.CudaSettings();
27 | User.Settings.Device.cuda.Algorithm = defaultSettings.Algorithm;
28 | User.Settings.Device.cuda.ChipFansFullspeedTemp = defaultSettings.ChipFansFullspeedTemp;
29 | User.Settings.Device.cuda.MemFansFullspeedTemp = defaultSettings.MemFansFullspeedTemp;
30 | User.Settings.Device.cuda.ChipPauseMiningTemp = defaultSettings.ChipPauseMiningTemp;
31 | User.Settings.Device.cuda.MemPauseMiningTemp = defaultSettings.MemPauseMiningTemp;
32 |
33 | AlgorithmComboBox.SelectedValue = User.Settings.Device.cuda.Algorithm;
34 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.cuda.ChipFansFullspeedTemp > 0 ? User.Settings.Device.cuda.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
35 | MemFansFullspeedTempTxt.Text = User.Settings.Device.cuda.MemFansFullspeedTemp > 0 ? User.Settings.Device.cuda.MemFansFullspeedTemp.ToString() + " °C" : "auto";
36 | ChipPauseMiningTempTxt.Text = User.Settings.Device.cuda.ChipPauseMiningTemp > 0 ? User.Settings.Device.cuda.ChipPauseMiningTemp.ToString() + " °C" : "auto";
37 | MemPauseMiningTempTxt.Text = User.Settings.Device.cuda.MemPauseMiningTemp > 0 ? User.Settings.Device.cuda.MemPauseMiningTemp.ToString() + " °C" : "auto";
38 | }
39 |
40 | private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
41 | {
42 | WrapPanel_ManualConfig.IsEnabled = true;
43 | }
44 |
45 | private void CheckBoxDisableTempControl_Checked(object sender, RoutedEventArgs e)
46 | {
47 | User.Settings.Device.cuda.DisableTempControl = true;
48 | }
49 |
50 | private void CheckBoxDisableTempControl_Unchecked(object sender, RoutedEventArgs e)
51 | {
52 | User.Settings.Device.cuda.DisableTempControl = false;
53 | }
54 |
55 | private void ChipFansFullspeedTempPlusNumber_Click(object sender, RoutedEventArgs e)
56 | {
57 | User.Settings.Device.cuda.ChipFansFullspeedTemp++;
58 |
59 | if (User.Settings.Device.cuda.ChipFansFullspeedTemp > 100) { User.Settings.Device.cuda.ChipFansFullspeedTemp = 100; }
60 |
61 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.cuda.ChipFansFullspeedTemp > 0 ? User.Settings.Device.cuda.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
62 | }
63 |
64 | private void ChipFansFullspeedTempMinusNumber_Click(object sender, RoutedEventArgs e)
65 | {
66 | User.Settings.Device.cuda.ChipFansFullspeedTemp--;
67 |
68 | if (User.Settings.Device.cuda.ChipFansFullspeedTemp < 0) { User.Settings.Device.cuda.ChipFansFullspeedTemp = 0; }
69 |
70 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.cuda.ChipFansFullspeedTemp > 0 ? User.Settings.Device.cuda.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
71 | }
72 |
73 | private void MemFansFullspeedTempPlusNumber_Click(object sender, RoutedEventArgs e)
74 | {
75 | User.Settings.Device.cuda.MemFansFullspeedTemp++;
76 |
77 | if (User.Settings.Device.cuda.MemFansFullspeedTemp > 100) { User.Settings.Device.cuda.MemFansFullspeedTemp = 100; }
78 |
79 | MemFansFullspeedTempTxt.Text = User.Settings.Device.cuda.MemFansFullspeedTemp > 0 ? User.Settings.Device.cuda.MemFansFullspeedTemp.ToString() + " °C" : "auto";
80 | }
81 |
82 | private void MemFansFullspeedTempMinusNumber_Click(object sender, RoutedEventArgs e)
83 | {
84 | User.Settings.Device.cuda.MemFansFullspeedTemp--;
85 |
86 | if (User.Settings.Device.cuda.MemFansFullspeedTemp < 0) { User.Settings.Device.cuda.MemFansFullspeedTemp = 0; }
87 |
88 | MemFansFullspeedTempTxt.Text = User.Settings.Device.cuda.MemFansFullspeedTemp > 0 ? User.Settings.Device.cuda.MemFansFullspeedTemp.ToString() + " °C" : "auto";
89 | }
90 |
91 | private void ChipPauseMiningTempPlusNumber_Click(object sender, RoutedEventArgs e)
92 | {
93 | User.Settings.Device.cuda.ChipPauseMiningTemp++;
94 |
95 | if (User.Settings.Device.cuda.ChipPauseMiningTemp > 100) { User.Settings.Device.cuda.ChipPauseMiningTemp = 100; }
96 |
97 | ChipPauseMiningTempTxt.Text = User.Settings.Device.cuda.ChipPauseMiningTemp > 0 ? User.Settings.Device.cuda.ChipPauseMiningTemp.ToString() + " °C" : "auto";
98 | }
99 |
100 | private void ChipPauseMiningTempMinusNumber_Click(object sender, RoutedEventArgs e)
101 | {
102 | User.Settings.Device.cuda.ChipPauseMiningTemp--;
103 |
104 | if (User.Settings.Device.cuda.ChipPauseMiningTemp < 0) { User.Settings.Device.cuda.ChipPauseMiningTemp = 0; }
105 |
106 | ChipPauseMiningTempTxt.Text = User.Settings.Device.cuda.ChipPauseMiningTemp > 0 ? User.Settings.Device.cuda.ChipPauseMiningTemp.ToString() + " °C" : "auto";
107 | }
108 |
109 | private void MemPauseMiningTempPlusNumber_Click(object sender, RoutedEventArgs e)
110 | {
111 | User.Settings.Device.cuda.MemPauseMiningTemp++;
112 |
113 | if (User.Settings.Device.cuda.MemPauseMiningTemp > 100) { User.Settings.Device.cuda.MemPauseMiningTemp = 100; }
114 |
115 | MemPauseMiningTempTxt.Text = User.Settings.Device.cuda.MemPauseMiningTemp > 0 ? User.Settings.Device.cuda.MemPauseMiningTemp.ToString() + " °C" : "auto";
116 | }
117 |
118 | private void MemPauseMiningTempMinusNumber_Click(object sender, RoutedEventArgs e)
119 | {
120 | User.Settings.Device.cuda.MemPauseMiningTemp--;
121 |
122 | if (User.Settings.Device.cuda.MemPauseMiningTemp < 0) { User.Settings.Device.cuda.MemPauseMiningTemp = 0; }
123 |
124 | MemPauseMiningTempTxt.Text = User.Settings.Device.cuda.MemPauseMiningTemp > 0 ? User.Settings.Device.cuda.MemPauseMiningTemp.ToString() + " °C" : "auto";
125 | }
126 | }
127 | }
--------------------------------------------------------------------------------
/Janelas/SubMenuSettings/SettingsOPENCL.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace TrueMiningDesktop.Janelas.SubMenuSettings
5 | {
6 | ///
7 | /// Interação lógica para SettingsOPENCL.xam
8 | ///
9 | public partial class SettingsOPENCL : UserControl
10 | {
11 | public SettingsOPENCL()
12 | {
13 | InitializeComponent();
14 | DataContext = User.Settings.Device.opencl;
15 | AlgorithmComboBox.SelectedValue = User.Settings.Device.opencl.Algorithm;
16 | DisableTempControlCheckBox.IsChecked = User.Settings.Device.opencl.DisableTempControl;
17 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.opencl.ChipFansFullspeedTemp > 0 ? User.Settings.Device.opencl.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
18 | MemFansFullspeedTempTxt.Text = User.Settings.Device.opencl.MemFansFullspeedTemp > 0 ? User.Settings.Device.opencl.MemFansFullspeedTemp.ToString() + " °C" : "auto";
19 | ChipPauseMiningTempTxt.Text = User.Settings.Device.opencl.ChipPauseMiningTemp > 0 ? User.Settings.Device.opencl.ChipPauseMiningTemp.ToString() + " °C" : "auto";
20 | MemPauseMiningTempTxt.Text = User.Settings.Device.opencl.MemPauseMiningTemp > 0 ? User.Settings.Device.opencl.MemPauseMiningTemp.ToString() + " °C" : "auto";
21 | }
22 |
23 | private void CheckBox_Checked(object sender, RoutedEventArgs e)
24 | {
25 | WrapPanel_ManualConfig.IsEnabled = false;
26 | User.OpenClSettings defaultSettings = new User.OpenClSettings();
27 | User.Settings.Device.opencl.Algorithm = defaultSettings.Algorithm;
28 | User.Settings.Device.opencl.ChipFansFullspeedTemp = defaultSettings.ChipFansFullspeedTemp;
29 | User.Settings.Device.opencl.MemFansFullspeedTemp = defaultSettings.MemFansFullspeedTemp;
30 | User.Settings.Device.opencl.ChipPauseMiningTemp = defaultSettings.ChipPauseMiningTemp;
31 | User.Settings.Device.opencl.MemPauseMiningTemp = defaultSettings.MemPauseMiningTemp;
32 |
33 | AlgorithmComboBox.SelectedValue = User.Settings.Device.opencl.Algorithm;
34 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.opencl.ChipFansFullspeedTemp > 0 ? User.Settings.Device.opencl.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
35 | MemFansFullspeedTempTxt.Text = User.Settings.Device.opencl.MemFansFullspeedTemp > 0 ? User.Settings.Device.opencl.MemFansFullspeedTemp.ToString() + " °C" : "auto";
36 | ChipPauseMiningTempTxt.Text = User.Settings.Device.opencl.ChipPauseMiningTemp > 0 ? User.Settings.Device.opencl.ChipPauseMiningTemp.ToString() + " °C" : "auto";
37 | MemPauseMiningTempTxt.Text = User.Settings.Device.opencl.MemPauseMiningTemp > 0 ? User.Settings.Device.opencl.MemPauseMiningTemp.ToString() + " °C" : "auto";
38 | }
39 |
40 | private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
41 | {
42 | WrapPanel_ManualConfig.IsEnabled = true;
43 | }
44 |
45 | private void CheckBoxDisableTempControl_Checked(object sender, RoutedEventArgs e)
46 | {
47 | User.Settings.Device.opencl.DisableTempControl = true;
48 | }
49 |
50 | private void CheckBoxDisableTempControl_Unchecked(object sender, RoutedEventArgs e)
51 | {
52 | User.Settings.Device.opencl.DisableTempControl = false;
53 | }
54 |
55 | private void ChipFansFullspeedTempPlusNumber_Click(object sender, RoutedEventArgs e)
56 | {
57 | User.Settings.Device.opencl.ChipFansFullspeedTemp++;
58 |
59 | if (User.Settings.Device.opencl.ChipFansFullspeedTemp > 100) { User.Settings.Device.opencl.ChipFansFullspeedTemp = 100; }
60 |
61 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.opencl.ChipFansFullspeedTemp > 0 ? User.Settings.Device.opencl.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
62 | }
63 |
64 | private void ChipFansFullspeedTempMinusNumber_Click(object sender, RoutedEventArgs e)
65 | {
66 | User.Settings.Device.opencl.ChipFansFullspeedTemp--;
67 |
68 | if (User.Settings.Device.opencl.ChipFansFullspeedTemp < 0) { User.Settings.Device.opencl.ChipFansFullspeedTemp = 0; }
69 |
70 | ChipFansFullspeedTempTxt.Text = User.Settings.Device.opencl.ChipFansFullspeedTemp > 0 ? User.Settings.Device.opencl.ChipFansFullspeedTemp.ToString() + " °C" : "auto";
71 | }
72 |
73 | private void MemFansFullspeedTempPlusNumber_Click(object sender, RoutedEventArgs e)
74 | {
75 | User.Settings.Device.opencl.MemFansFullspeedTemp++;
76 |
77 | if (User.Settings.Device.opencl.MemFansFullspeedTemp > 100) { User.Settings.Device.opencl.MemFansFullspeedTemp = 100; }
78 |
79 | MemFansFullspeedTempTxt.Text = User.Settings.Device.opencl.MemFansFullspeedTemp > 0 ? User.Settings.Device.opencl.MemFansFullspeedTemp.ToString() + " °C" : "auto";
80 | }
81 |
82 | private void MemFansFullspeedTempMinusNumber_Click(object sender, RoutedEventArgs e)
83 | {
84 | User.Settings.Device.opencl.MemFansFullspeedTemp--;
85 |
86 | if (User.Settings.Device.opencl.MemFansFullspeedTemp < 0) { User.Settings.Device.opencl.MemFansFullspeedTemp = 0; }
87 |
88 | MemFansFullspeedTempTxt.Text = User.Settings.Device.opencl.MemFansFullspeedTemp > 0 ? User.Settings.Device.opencl.MemFansFullspeedTemp.ToString() + " °C" : "auto";
89 | }
90 |
91 | private void ChipPauseMiningTempPlusNumber_Click(object sender, RoutedEventArgs e)
92 | {
93 | User.Settings.Device.opencl.ChipPauseMiningTemp++;
94 |
95 | if (User.Settings.Device.opencl.ChipPauseMiningTemp > 100) { User.Settings.Device.opencl.ChipPauseMiningTemp = 100; }
96 |
97 | ChipPauseMiningTempTxt.Text = User.Settings.Device.opencl.ChipPauseMiningTemp > 0 ? User.Settings.Device.opencl.ChipPauseMiningTemp.ToString() + " °C" : "auto";
98 | }
99 |
100 | private void ChipPauseMiningTempMinusNumber_Click(object sender, RoutedEventArgs e)
101 | {
102 | User.Settings.Device.opencl.ChipPauseMiningTemp--;
103 |
104 | if (User.Settings.Device.opencl.ChipPauseMiningTemp < 0) { User.Settings.Device.opencl.ChipPauseMiningTemp = 0; }
105 |
106 | ChipPauseMiningTempTxt.Text = User.Settings.Device.opencl.ChipPauseMiningTemp > 0 ? User.Settings.Device.opencl.ChipPauseMiningTemp.ToString() + " °C" : "auto";
107 | }
108 |
109 | private void MemPauseMiningTempPlusNumber_Click(object sender, RoutedEventArgs e)
110 | {
111 | User.Settings.Device.opencl.MemPauseMiningTemp++;
112 |
113 | if (User.Settings.Device.opencl.MemPauseMiningTemp > 100) { User.Settings.Device.opencl.MemPauseMiningTemp = 100; }
114 |
115 | MemPauseMiningTempTxt.Text = User.Settings.Device.opencl.MemPauseMiningTemp > 0 ? User.Settings.Device.opencl.MemPauseMiningTemp.ToString() + " °C" : "auto";
116 | }
117 |
118 | private void MemPauseMiningTempMinusNumber_Click(object sender, RoutedEventArgs e)
119 | {
120 | User.Settings.Device.opencl.MemPauseMiningTemp--;
121 |
122 | if (User.Settings.Device.opencl.MemPauseMiningTemp < 0) { User.Settings.Device.opencl.MemPauseMiningTemp = 0; }
123 |
124 | MemPauseMiningTempTxt.Text = User.Settings.Device.opencl.MemPauseMiningTemp > 0 ? User.Settings.Device.opencl.MemPauseMiningTemp.ToString() + " °C" : "auto";
125 | }
126 | }
127 | }
--------------------------------------------------------------------------------
/Server/ExternalApi/NanopoolData.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using TrueMiningDesktop.Core;
5 |
6 | namespace TrueMiningDesktop.ExternalApi
7 | {
8 | internal class NanopoolData
9 | {
10 | internal static HashrateHistory GetHashrateHystory(string coin, string truemining_address, string user_address = null)
11 | {
12 | return JsonConvert.DeserializeObject(Tools.HttpGet("http://api.nanopool.org/v1/" + coin + "/history/" + truemining_address + "/" + user_address), new JsonSerializerSettings() { Culture = CultureInfo.InvariantCulture });
13 | }
14 |
15 | public class XMR_nanopool
16 | {
17 | public static Dictionary hashrateHistory_user = new Dictionary();
18 | public static Dictionary hashrateHistory_tm = new Dictionary();
19 | public static approximated_earnings approximated_earnings = new approximated_earnings();
20 | public static share_coefficient sharecoef = new share_coefficient();
21 | public static Dictionary pointsHistory_user = new Dictionary();
22 | }
23 |
24 | public class RVN_nanopool
25 | {
26 | public static Dictionary hashrateHistory_user = new Dictionary();
27 | public static Dictionary hashrateHistory_tm = new Dictionary();
28 | public static approximated_earnings approximated_earnings = new approximated_earnings();
29 | public static share_coefficient sharecoef = new share_coefficient();
30 | public static Dictionary pointsHistory_user = new Dictionary();
31 | }
32 |
33 | public class ETC_nanopool
34 | {
35 | public static Dictionary hashrateHistory_user = new Dictionary();
36 | public static Dictionary hashrateHistory_tm = new Dictionary();
37 | public static approximated_earnings approximated_earnings = new approximated_earnings();
38 | public static share_coefficient sharecoef = new share_coefficient();
39 | public static Dictionary pointsHistory_user = new Dictionary();
40 | }
41 | }
42 |
43 | public class Minute
44 | {
45 | public decimal coins { get; set; } = 0;
46 | public decimal dollars { get; set; } = 0;
47 | public decimal yuan { get; set; } = 0;
48 | public decimal euros { get; set; } = 0;
49 | public decimal rubles { get; set; } = 0;
50 | public decimal bitcoins { get; set; } = 0;
51 | public decimal pounds { get; set; } = 0;
52 | }
53 |
54 | public class Hour
55 | {
56 | public decimal coins { get; set; } = 0;
57 | public decimal dollars { get; set; } = 0;
58 | public decimal yuan { get; set; } = 0;
59 | public decimal euros { get; set; } = 0;
60 | public decimal rubles { get; set; } = 0;
61 | public decimal bitcoins { get; set; } = 0;
62 | public decimal pounds { get; set; } = 0;
63 | }
64 |
65 | public class Day
66 | {
67 | public decimal coins { get; set; } = 0;
68 | public decimal dollars { get; set; } = 0;
69 | public decimal yuan { get; set; } = 0;
70 | public decimal euros { get; set; } = 0;
71 | public decimal rubles { get; set; } = 0;
72 | public decimal bitcoins { get; set; } = 0;
73 | public decimal pounds { get; set; } = 0;
74 | }
75 |
76 | public class Week
77 | {
78 | public decimal coins { get; set; } = 0;
79 | public decimal dollars { get; set; } = 0;
80 | public decimal yuan { get; set; } = 0;
81 | public decimal euros { get; set; } = 0;
82 | public decimal rubles { get; set; } = 0;
83 | public decimal bitcoins { get; set; } = 0;
84 | public decimal pounds { get; set; } = 0;
85 | }
86 |
87 | public class Month
88 | {
89 | public decimal coins { get; set; } = 0;
90 | public decimal dollars { get; set; } = 0;
91 | public decimal yuan { get; set; } = 0;
92 | public decimal euros { get; set; } = 0;
93 | public decimal rubles { get; set; } = 0;
94 | public decimal bitcoins { get; set; } = 0;
95 | public decimal pounds { get; set; } = 0;
96 | }
97 |
98 | public class Prices
99 | {
100 | public decimal price_btc { get; set; } = 0;
101 | public decimal price_usd { get; set; } = 0;
102 | public decimal price_eur { get; set; } = 0;
103 | public decimal price_rur { get; set; } = 0;
104 | public decimal price_cny { get; set; } = 0;
105 | public decimal price_gbp { get; set; } = 0;
106 | }
107 |
108 | public class data_approximated_earnings
109 | {
110 | public Minute minute = new Minute();
111 | public Hour hour = new Hour();
112 | public Day day = new Day();
113 | public Week week = new Week();
114 | public Month month = new Month();
115 | public Prices prices = new Prices();
116 | }
117 |
118 | public class approximated_earnings
119 | {
120 | public bool status { get; set; } = true;
121 | public data_approximated_earnings data = new();
122 | }
123 |
124 | public class share_coefficient
125 | {
126 | public bool status { get; set; } = true;
127 | public decimal data { get; set; } = (decimal)52.5;
128 | }
129 |
130 | public partial class HashrateHistory
131 | {
132 | [JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
133 | public bool? Status { get; set; }
134 |
135 | [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)]
136 | public List Data { get; set; }
137 | }
138 |
139 | public partial class Datum
140 | {
141 | [JsonProperty("date", NullValueHandling = NullValueHandling.Ignore)]
142 | public long Date { get; set; }
143 |
144 | [JsonProperty("hashrate", NullValueHandling = NullValueHandling.Ignore)]
145 | public decimal Hashrate { get; set; }
146 | }
147 |
148 | public class GeneralInfo
149 | {
150 | public bool status { get; set; }
151 | public DataGeneralInfo data { get; set; }
152 | }
153 |
154 | public class DataGeneralInfo
155 | {
156 | public string account { get; set; }
157 | public decimal unconfirmed_balance { get; set; }
158 | public decimal balance { get; set; }
159 | public decimal hashrate { get; set; }
160 | public Avghashrate avgHashrate { get; set; }
161 | public Worker[] workers { get; set; }
162 | }
163 |
164 | public class Avghashrate
165 | {
166 | public decimal h1 { get; set; }
167 | public decimal h3 { get; set; }
168 | public decimal h6 { get; set; }
169 | public decimal h12 { get; set; }
170 | public decimal h24 { get; set; }
171 | }
172 |
173 | public class Worker
174 | {
175 | public string id { get; set; }
176 | public int uid { get; set; }
177 | public decimal hashrate { get; set; }
178 | public int lastshare { get; set; }
179 | public int rating { get; set; }
180 | public decimal h1 { get; set; }
181 | public decimal h3 { get; set; }
182 | public decimal h6 { get; set; }
183 | public decimal h12 { get; set; }
184 | public decimal h24 { get; set; }
185 | }
186 |
187 | public class AccountBalance
188 | {
189 | public bool status { get; set; }
190 | public decimal data { get; set; }
191 | }
192 | }
--------------------------------------------------------------------------------
/Janelas/Dashboard.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
51 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/Janelas/Home.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
39 |
40 |
46 |
47 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/ViewModel/DashboardChart.cs:
--------------------------------------------------------------------------------
1 | using OxyPlot;
2 | using OxyPlot.Axes;
3 | using OxyPlot.Series;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Windows;
8 | using TrueMiningDesktop.Janelas;
9 |
10 | namespace TrueMiningDesktop.ViewModel
11 | {
12 | internal class DashboardChart
13 | {
14 | public static void UpdateAxes(Dictionary dados, int zoomInterval)
15 | {
16 | PlotModel plotModel = new()
17 | {
18 | Title = "Mined Points History",
19 | TitleColor = OxyColor.FromRgb(64, 64, 64),
20 | TitleFontSize = 15,
21 | TitleHorizontalAlignment = TitleHorizontalAlignment.CenteredWithinView,
22 | PlotAreaBorderThickness = new OxyThickness(0, 0, 0, 0),
23 | };
24 |
25 | Dictionary dataToShow = new();
26 |
27 | Dictionary dataToShow_formated = new();
28 |
29 | List listaLegendaX = new();
30 |
31 | int botonAxisAngle = 0;
32 |
33 | if (zoomInterval <= TimeSpan.FromDays(1).TotalSeconds) //grafico H1
34 | {
35 | zoomInterval = (int)new TimeSpan((int)Math.Floor(TimeSpan.FromSeconds(zoomInterval).TotalHours) - 1, DateTime.UtcNow.Minute, DateTime.UtcNow.Second).TotalSeconds;
36 |
37 | dataToShow = dados.Where((KeyValuePair value) =>
38 | value.Key >= ((DateTimeOffset)DateTime.UtcNow).ToUnixTimeSeconds() - zoomInterval)
39 | .Select((KeyValuePair value) => new KeyValuePair(value.Key, value.Value))
40 | .OrderBy((KeyValuePair value) => value.Key)
41 | .ToDictionary(x => x.Key, x => x.Value);
42 |
43 | for (int i = 0; zoomInterval / 60 / 60 >= i; i++)
44 | {
45 | DateTime dateTime = DateTime.UtcNow.ToLocalTime().AddSeconds(-zoomInterval).AddHours(i);
46 | string labelToAdd = dateTime.Hour.ToString().PadLeft(2, '0') + ":00";
47 | listaLegendaX.Add(labelToAdd);
48 | }
49 |
50 | foreach (KeyValuePair pair in dataToShow)
51 | {
52 | DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc).AddSeconds(pair.Key).ToLocalTime();
53 | string labelToAdd = dateTime.Hour.ToString().PadLeft(2, '0') + ":00";
54 |
55 | if (dataToShow_formated.ContainsKey(labelToAdd))
56 | {
57 | dataToShow_formated[labelToAdd] = dataToShow_formated[labelToAdd] + pair.Value;
58 | }
59 | else
60 | {
61 | dataToShow_formated.TryAdd(labelToAdd, pair.Value);
62 | }
63 | }
64 | botonAxisAngle = 90;
65 | }
66 | else if (zoomInterval > TimeSpan.FromDays(1).TotalSeconds) //grafico D1
67 | {
68 | zoomInterval = (int)new TimeSpan((int)Math.Floor(TimeSpan.FromSeconds(zoomInterval).TotalDays) - 1, DateTime.UtcNow.Hour, DateTime.UtcNow.Minute, DateTime.UtcNow.Second).TotalSeconds;
69 |
70 | dataToShow = dados.Where((KeyValuePair value) =>
71 | value.Key >= ((DateTimeOffset)DateTime.UtcNow).ToUnixTimeSeconds() - zoomInterval)
72 | .Select((KeyValuePair value) => new KeyValuePair(value.Key, value.Value))
73 | .OrderBy((KeyValuePair value) => value.Key)
74 | .ToDictionary(x => x.Key, x => x.Value);
75 |
76 | for (int i = 0; zoomInterval / 60 / 60 / 24 >= i; i++)
77 | {
78 | DateTime dateTime = DateTime.UtcNow.AddSeconds(-zoomInterval).AddDays(i);
79 | string labelToAdd = dateTime.ToShortDateString() + " (UTC)";
80 | listaLegendaX.Add(labelToAdd);
81 | }
82 |
83 | foreach (KeyValuePair pair in dataToShow)
84 | {
85 | DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc).AddSeconds(pair.Key);
86 | string labelToAdd = dateTime.ToShortDateString() + " (UTC)";
87 |
88 | if (dataToShow_formated.ContainsKey(labelToAdd))
89 | {
90 | dataToShow_formated[labelToAdd] = dataToShow_formated[labelToAdd] + pair.Value;
91 | }
92 | else
93 | {
94 | dataToShow_formated.TryAdd(labelToAdd, pair.Value);
95 | }
96 |
97 | if (!listaLegendaX.Contains(labelToAdd))
98 | {
99 | // listaLegendaX.Add(labelToAdd);
100 | }
101 | }
102 | botonAxisAngle = 00;
103 | }
104 |
105 | plotModel.Axes.Clear();
106 |
107 | CategoryAxis categoryAxis = new()
108 | {
109 | Position = AxisPosition.Bottom,
110 | AxisTickToLabelDistance = 0,
111 | MinorGridlineStyle = LineStyle.None,
112 | MajorGridlineStyle = LineStyle.None,
113 | MinorStep = 1,
114 | Angle = botonAxisAngle,
115 | AxislineStyle = LineStyle.Solid,
116 | AxislineThickness = 1,
117 | IsZoomEnabled = false,
118 | Selectable = false,
119 | IsPanEnabled = true,
120 | TickStyle = TickStyle.Crossing,
121 | };
122 |
123 | foreach (string label in listaLegendaX)
124 | { categoryAxis.ActualLabels.Add(label); }
125 |
126 | plotModel.Axes.Add(categoryAxis);
127 |
128 | /////////////////////////////////
129 |
130 | Pages.Dashboard.ColumnChartSeries = new OxyPlot.Series.ColumnSeries()
131 | {
132 | TrackerFormatString = "{2} points",
133 | Selectable = false,
134 | StrokeThickness = 1,
135 | };
136 |
137 | foreach (KeyValuePair keyValuePair in dataToShow_formated)
138 | {
139 | Pages.Dashboard.ColumnChartSeries.Items.Add(new ColumnItem((double)Math.Round(keyValuePair.Value, 8), listaLegendaX.IndexOf(keyValuePair.Key)));
140 | }
141 | if (Pages.Dashboard.ColumnChartSeries.Items.Count == 0) Pages.Dashboard.ColumnChartSeries.Items.Add(new ColumnItem(0));
142 |
143 | plotModel.Series.Add(Pages.Dashboard.ColumnChartSeries);
144 |
145 | ////////////////////////////////
146 | int chart_max_value = dataToShow_formated.Count > 0 ? (int)Math.Ceiling(d: (decimal)dataToShow_formated.Max((KeyValuePair value) => value.Value)) : 10;
147 | int chart_max_range = (int)((int)Math.Ceiling(chart_max_value / Math.Pow(10, chart_max_value.ToString().Length - 1)) * Math.Pow(10, (chart_max_value.ToString().Length - 1)));
148 | int chart_Yaxis_major_step = (int)Math.Ceiling((decimal)(chart_max_range / 5));
149 |
150 | plotModel.Axes.Add(new OxyPlot.Axes.CategoryAxis()
151 | {
152 | MajorStep = chart_Yaxis_major_step < 2 ? 2 : chart_Yaxis_major_step,
153 | Position = AxisPosition.Left,
154 | MinorTickSize = 5,
155 | MajorTickSize = 5,
156 | MajorGridlineStyle = LineStyle.Dot,
157 | MinorGridlineStyle = LineStyle.Dot,
158 | Maximum = chart_max_range < 10 ? 10 : chart_max_range,
159 | Minimum = 0,
160 | AbsoluteMinimum = 0,
161 | AxislineStyle = LineStyle.Solid,
162 | AxislineThickness = 1,
163 | //TickStyle = TickStyle.Outside,
164 | IsTickCentered = true,
165 |
166 | LabelFormatter = (index =>
167 | {
168 | int ratio = (int)Math.Round(10 / 10.0, 0);
169 | int label = (int)index;
170 | return (ratio <= 1 || label % ratio == 1) ? label.ToString("D") : string.Empty;
171 | })
172 | });
173 |
174 | Pages.Dashboard.ChartController = new PlotController();
175 | Pages.Dashboard.ChartController.UnbindAll();
176 | Pages.Dashboard.ChartController.BindMouseEnter(PlotCommands.HoverSnapTrack);
177 |
178 | Pages.Dashboard.ChartModel = plotModel;
179 |
180 | Pages.Dashboard.ChartVisibility = Visibility.Visible;
181 | }
182 | }
183 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
--------------------------------------------------------------------------------
/Server/SoftwareParameters.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | using TrueMiningDesktop.Core;
8 |
9 | namespace TrueMiningDesktop.Server
10 | {
11 | public partial class TrueMiningDesktopParameters
12 | {
13 | [JsonProperty("MiningCoins", NullValueHandling = NullValueHandling.Ignore)]
14 | public List MiningCoins { get; set; }
15 |
16 | [JsonProperty("PaymentCoins", NullValueHandling = NullValueHandling.Ignore)]
17 | public List PaymentCoins { get; set; }
18 |
19 | [JsonProperty("MiningAlgorithms", NullValueHandling = NullValueHandling.Ignore)]
20 | public List MiningAlgorithms { get; set; }
21 |
22 | [JsonProperty("DynamicFee", NullValueHandling = NullValueHandling.Ignore)]
23 | public decimal DynamicFee { get; set; }
24 |
25 | [JsonProperty("AppFiles", NullValueHandling = NullValueHandling.Ignore)]
26 | public List AppFiles { get; set; }
27 |
28 | [JsonProperty("ExtraFiles", NullValueHandling = NullValueHandling.Ignore)]
29 | public ExtraFiles ExtraFiles { get; set; }
30 |
31 | [JsonProperty("RemovedFiles", NullValueHandling = NullValueHandling.Ignore)]
32 | public List RemovedFiles { get; set; }
33 |
34 | [JsonProperty("SponsorClickLink", NullValueHandling = NullValueHandling.Ignore)]
35 | public string SponsorClickLink { get; set; }
36 | }
37 |
38 | public partial class MiningCoin
39 | {
40 | [JsonProperty("coinTicker", NullValueHandling = NullValueHandling.Ignore)]
41 | public string CoinTicker { get; set; }
42 |
43 | [JsonProperty("coinName", NullValueHandling = NullValueHandling.Ignore)]
44 | public string CoinName { get; set; }
45 |
46 | [JsonProperty("algorithm", NullValueHandling = NullValueHandling.Ignore)]
47 | public string Algorithm { get; set; }
48 |
49 | [JsonProperty("marketDataSources", NullValueHandling = NullValueHandling.Ignore)]
50 | public List MarketDataSources { get; set; }
51 |
52 | [JsonProperty("poolName", NullValueHandling = NullValueHandling.Ignore)]
53 | public string PoolName { get; set; }
54 |
55 | [JsonProperty("poolFee", NullValueHandling = NullValueHandling.Ignore)]
56 | public decimal PoolFee { get; set; }
57 |
58 | [JsonProperty("poolHosts", NullValueHandling = NullValueHandling.Ignore)]
59 | public List PoolHosts { get; set; }
60 |
61 | [JsonProperty("stratumPort", NullValueHandling = NullValueHandling.Ignore)]
62 | public short? StratumPort { get; set; }
63 |
64 | [JsonProperty("stratumPortSSL", NullValueHandling = NullValueHandling.Ignore)]
65 | public short? StratumPortSsl { get; set; }
66 |
67 | [JsonProperty("depositAddressTrueMining", NullValueHandling = NullValueHandling.Ignore)]
68 | public string DepositAddressTrueMining { get; set; }
69 |
70 | [JsonProperty("email", NullValueHandling = NullValueHandling.Ignore)]
71 | public string Email { get; set; }
72 |
73 | [JsonProperty("password", NullValueHandling = NullValueHandling.Ignore)]
74 | public string Password { get; set; }
75 |
76 | [JsonProperty("shareCoef", NullValueHandling = NullValueHandling.Ignore)]
77 | public decimal ShareCoef { get; set; } = 1;
78 |
79 | [JsonProperty("shareMmc", NullValueHandling = NullValueHandling.Ignore)]
80 | public decimal ShareMmc { get; set; } = 1;
81 |
82 | [JsonProperty("defaultHashMuString", NullValueHandling = NullValueHandling.Ignore)]
83 | public string DefaultHashMuString { get; set; } = "H/s";
84 |
85 | [JsonProperty("defaultHashMuCoef", NullValueHandling = NullValueHandling.Ignore)]
86 | public int DefaultHashMuCoef { get; set; } = 1;
87 | }
88 |
89 | public partial class MiningAlgorithm
90 | {
91 | [JsonProperty("algorithmName", NullValueHandling = NullValueHandling.Ignore)]
92 | public string AlgorithmName { get; set; }
93 |
94 | [JsonProperty("settledName", NullValueHandling = NullValueHandling.Ignore)]
95 | public string SettledName { get; set; }
96 |
97 | [JsonProperty("suportedDevices", NullValueHandling = NullValueHandling.Ignore)]
98 | public List SuportedDevices { get; set; }
99 | }
100 |
101 | public partial class PaymentCoin
102 | {
103 | [JsonProperty("coinTicker", NullValueHandling = NullValueHandling.Ignore)]
104 | public string CoinTicker { get; set; }
105 |
106 | [JsonProperty("coinName", NullValueHandling = NullValueHandling.Ignore)]
107 | public string CoinName { get; set; }
108 |
109 | [JsonProperty("marketDataSources", NullValueHandling = NullValueHandling.Ignore)]
110 | public List MarketDataSources { get; set; }
111 |
112 | [JsonProperty("addressPatterns", NullValueHandling = NullValueHandling.Ignore)]
113 | public List AddressPatterns { get; set; }
114 |
115 | [JsonProperty("minPayout", NullValueHandling = NullValueHandling.Ignore)]
116 | public decimal MinPayout { get; set; }
117 |
118 | [JsonProperty("unlisting", NullValueHandling = NullValueHandling.Ignore)]
119 | public bool Unlisting { get; set; } = false;
120 | }
121 |
122 | public partial class ExtraFiles
123 | {
124 | [JsonProperty("tools", NullValueHandling = NullValueHandling.Ignore)]
125 | public List Tools { get; set; }
126 |
127 | [JsonProperty("backendMiners", NullValueHandling = NullValueHandling.Ignore)]
128 | public BackendMiners BackendMiners { get; set; }
129 | }
130 |
131 | public partial class BackendMiners
132 | {
133 | [JsonProperty("common", NullValueHandling = NullValueHandling.Ignore)]
134 | public List Common { get; set; }
135 |
136 | [JsonProperty("cpu", NullValueHandling = NullValueHandling.Ignore)]
137 | public List Cpu { get; set; }
138 |
139 | [JsonProperty("opencl", NullValueHandling = NullValueHandling.Ignore)]
140 | public List Opencl { get; set; }
141 |
142 | [JsonProperty("cuda", NullValueHandling = NullValueHandling.Ignore)]
143 | public List Cuda { get; set; }
144 | }
145 |
146 | public partial class FileInfo
147 | {
148 | [JsonProperty("dlLink", NullValueHandling = NullValueHandling.Ignore)]
149 | public string DlLink { get; set; }
150 |
151 | [JsonProperty("directory")]
152 | public string Directory { get; set; }
153 |
154 | [JsonProperty("fileName", NullValueHandling = NullValueHandling.Ignore)]
155 | public string FileName { get; set; }
156 |
157 | [JsonProperty("sha256", NullValueHandling = NullValueHandling.Ignore)]
158 | public string Sha256 { get; set; }
159 | }
160 |
161 | public class SoftwareParameters
162 | {
163 | public static TrueMiningDesktopParameters ServerConfig;
164 |
165 | private static DateTime lastUpdated = DateTime.Now.AddHours(-1).AddMinutes(-1);
166 |
167 | public static void Update(Uri uri, Uri backupUri = null)
168 | {
169 | while (!Tools.IsConnected()) { Thread.Sleep(3000); }
170 |
171 | if (lastUpdated.AddHours(1).Ticks < DateTime.Now.Ticks)
172 | {
173 | bool trying = true;
174 |
175 | int tried = 0;
176 |
177 | while (trying)
178 | {
179 | tried++;
180 |
181 | Task updateParameters = new(() =>
182 | {
183 | lastUpdated = DateTime.Now;
184 | try
185 | {
186 | SoftwareParameters.ServerConfig = JsonConvert.DeserializeObject(Tools.HttpGet((tried <= 3 || tried >= 7) ? uri.ToString() : backupUri.ToString(), Tools.UseTor), new JsonSerializerSettings() { Culture = CultureInfo.InvariantCulture }); //update parameters
187 | trying = false;
188 | }
189 | catch
190 | {
191 | try { Tools.AddFirewallRule("True Mining Desktop", System.Reflection.Assembly.GetExecutingAssembly().Location, true); Tools.UseTor = !Tools.UseTor; } catch { }
192 | }
193 | });
194 | updateParameters.Start();
195 | updateParameters.Wait(7000);
196 | }
197 | }
198 | }
199 | }
200 | }
--------------------------------------------------------------------------------
/Janelas/SubMenuSettings/SettingsCPU.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | auto-config
38 | 1
39 | 2
40 | 3
41 | 4
42 | 5
43 | 6
44 | 7
45 | 8
46 | 9
47 | 10
48 | 11
49 | 12
50 | 13
51 | 14
52 | 15
53 | 16
54 | 17
55 | 18
56 | 19
57 | 20
58 | 21
59 | 22
60 | 23
61 | 24
62 | 25
63 | 26
64 | 27
65 | 28
66 | 29
67 | 30
68 | 31
69 | 32
70 | 33
71 | 34
72 | 35
73 | 36
74 | 37
75 | 38
76 | 39
77 | 40
78 | 41
79 | 42
80 | 43
81 | 44
82 | 45
83 | 46
84 | 47
85 | 48
86 | 49
87 | 50
88 | 51
89 | 52
90 | 53
91 | 54
92 | 55
93 | 56
94 | 57
95 | 58
96 | 59
97 | 60
98 | 61
99 | 62
100 | 63
101 | 64
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/Janelas/SubMenuSettings/SettingsOPENCL.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Janelas/SubMenuSettings/SettingsCUDA.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Core/Miners/TRex/ApiSummary.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System.Collections.Generic;
3 |
4 | namespace TrueMiningDesktop.Core.Miners.TRex
5 | {
6 | public partial class ApiSummary
7 | {
8 | [JsonProperty("accepted_count", NullValueHandling = NullValueHandling.Ignore)]
9 | public long? AcceptedCount { get; set; }
10 |
11 | [JsonProperty("active_pool", NullValueHandling = NullValueHandling.Ignore)]
12 | public ActivePool ActivePool { get; set; }
13 |
14 | [JsonProperty("algorithm", NullValueHandling = NullValueHandling.Ignore)]
15 | public string Algorithm { get; set; }
16 |
17 | [JsonProperty("api", NullValueHandling = NullValueHandling.Ignore)]
18 | public string Api { get; set; }
19 |
20 | [JsonProperty("build_date", NullValueHandling = NullValueHandling.Ignore)]
21 | public string BuildDate { get; set; }
22 |
23 | [JsonProperty("coin", NullValueHandling = NullValueHandling.Ignore)]
24 | public string Coin { get; set; }
25 |
26 | [JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
27 | public string Description { get; set; }
28 |
29 | [JsonProperty("driver", NullValueHandling = NullValueHandling.Ignore)]
30 | public string Driver { get; set; }
31 |
32 | [JsonProperty("gpu_total", NullValueHandling = NullValueHandling.Ignore)]
33 | public long? GpuTotal { get; set; }
34 |
35 | [JsonProperty("gpus", NullValueHandling = NullValueHandling.Ignore)]
36 | public List Gpus { get; set; }
37 |
38 | [JsonProperty("hashrate", NullValueHandling = NullValueHandling.Ignore)]
39 | public long? Hashrate { get; set; }
40 |
41 | [JsonProperty("hashrate_day", NullValueHandling = NullValueHandling.Ignore)]
42 | public long? HashrateDay { get; set; }
43 |
44 | [JsonProperty("hashrate_hour", NullValueHandling = NullValueHandling.Ignore)]
45 | public long? HashrateHour { get; set; }
46 |
47 | [JsonProperty("hashrate_minute", NullValueHandling = NullValueHandling.Ignore)]
48 | public long? HashrateMinute { get; set; }
49 |
50 | [JsonProperty("invalid_count", NullValueHandling = NullValueHandling.Ignore)]
51 | public long? InvalidCount { get; set; }
52 |
53 | [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
54 | public string Name { get; set; }
55 |
56 | [JsonProperty("os", NullValueHandling = NullValueHandling.Ignore)]
57 | public string Os { get; set; }
58 |
59 | [JsonProperty("paused", NullValueHandling = NullValueHandling.Ignore)]
60 | public bool? Paused { get; set; }
61 |
62 | [JsonProperty("rejected_count", NullValueHandling = NullValueHandling.Ignore)]
63 | public long? RejectedCount { get; set; }
64 |
65 | [JsonProperty("revision", NullValueHandling = NullValueHandling.Ignore)]
66 | public string Revision { get; set; }
67 |
68 | [JsonProperty("sharerate", NullValueHandling = NullValueHandling.Ignore)]
69 | public decimal? Sharerate { get; set; }
70 |
71 | [JsonProperty("sharerate_average", NullValueHandling = NullValueHandling.Ignore)]
72 | public decimal? SharerateAverage { get; set; }
73 |
74 | [JsonProperty("solved_count", NullValueHandling = NullValueHandling.Ignore)]
75 | public long? SolvedCount { get; set; }
76 |
77 | [JsonProperty("success", NullValueHandling = NullValueHandling.Ignore)]
78 | public long? Success { get; set; }
79 |
80 | [JsonProperty("time", NullValueHandling = NullValueHandling.Ignore)]
81 | public long? Time { get; set; }
82 |
83 | [JsonProperty("uptime", NullValueHandling = NullValueHandling.Ignore)]
84 | public long? Uptime { get; set; }
85 |
86 | [JsonProperty("validate_shares", NullValueHandling = NullValueHandling.Ignore)]
87 | public bool? ValidateShares { get; set; }
88 |
89 | [JsonProperty("version", NullValueHandling = NullValueHandling.Ignore)]
90 | public string Version { get; set; }
91 |
92 | [JsonProperty("watchdog_stat", NullValueHandling = NullValueHandling.Ignore)]
93 | public WatchdogStat WatchdogStat { get; set; }
94 | }
95 |
96 | public partial class ActivePool
97 | {
98 | [JsonProperty("difficulty", NullValueHandling = NullValueHandling.Ignore)]
99 | public string Difficulty { get; set; }
100 |
101 | [JsonProperty("dns_https_server", NullValueHandling = NullValueHandling.Ignore)]
102 | public string DnsHttpsServer { get; set; }
103 |
104 | [JsonProperty("last_submit_ts", NullValueHandling = NullValueHandling.Ignore)]
105 | public long? LastSubmitTs { get; set; }
106 |
107 | [JsonProperty("ping", NullValueHandling = NullValueHandling.Ignore)]
108 | public long? Ping { get; set; }
109 |
110 | [JsonProperty("proxy", NullValueHandling = NullValueHandling.Ignore)]
111 | public string Proxy { get; set; }
112 |
113 | [JsonProperty("retries", NullValueHandling = NullValueHandling.Ignore)]
114 | public long? Retries { get; set; }
115 |
116 | [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
117 | public string Url { get; set; }
118 |
119 | [JsonProperty("user", NullValueHandling = NullValueHandling.Ignore)]
120 | public string User { get; set; }
121 |
122 | [JsonProperty("worker", NullValueHandling = NullValueHandling.Ignore)]
123 | public string Worker { get; set; }
124 | }
125 |
126 | public partial class Gpus
127 | {
128 | [JsonProperty("cclock", NullValueHandling = NullValueHandling.Ignore)]
129 | public long? Cclock { get; set; }
130 |
131 | [JsonProperty("dag_build_mode", NullValueHandling = NullValueHandling.Ignore)]
132 | public long? DagBuildMode { get; set; }
133 |
134 | [JsonProperty("device_id", NullValueHandling = NullValueHandling.Ignore)]
135 | public long? DeviceId { get; set; }
136 |
137 | [JsonProperty("efficiency", NullValueHandling = NullValueHandling.Ignore)]
138 | public string Efficiency { get; set; }
139 |
140 | [JsonProperty("fan_speed", NullValueHandling = NullValueHandling.Ignore)]
141 | public long? FanSpeed { get; set; }
142 |
143 | [JsonProperty("gpu_id", NullValueHandling = NullValueHandling.Ignore)]
144 | public long? GpuId { get; set; }
145 |
146 | [JsonProperty("gpu_user_id", NullValueHandling = NullValueHandling.Ignore)]
147 | public long? GpuUserId { get; set; }
148 |
149 | [JsonProperty("hashrate", NullValueHandling = NullValueHandling.Ignore)]
150 | public long? Hashrate { get; set; }
151 |
152 | [JsonProperty("hashrate_day", NullValueHandling = NullValueHandling.Ignore)]
153 | public long? HashrateDay { get; set; }
154 |
155 | [JsonProperty("hashrate_hour", NullValueHandling = NullValueHandling.Ignore)]
156 | public long? HashrateHour { get; set; }
157 |
158 | [JsonProperty("hashrate_instant", NullValueHandling = NullValueHandling.Ignore)]
159 | public long? HashrateInstant { get; set; }
160 |
161 | [JsonProperty("hashrate_minute", NullValueHandling = NullValueHandling.Ignore)]
162 | public long? HashrateMinute { get; set; }
163 |
164 | [JsonProperty("intensity", NullValueHandling = NullValueHandling.Ignore)]
165 | public long? Intensity { get; set; }
166 |
167 | [JsonProperty("lhr_tune", NullValueHandling = NullValueHandling.Ignore)]
168 | public long? LhrTune { get; set; }
169 |
170 | [JsonProperty("low_load", NullValueHandling = NullValueHandling.Ignore)]
171 | public bool? LowLoad { get; set; }
172 |
173 | [JsonProperty("mclock", NullValueHandling = NullValueHandling.Ignore)]
174 | public long? Mclock { get; set; }
175 |
176 | [JsonProperty("mtweak", NullValueHandling = NullValueHandling.Ignore)]
177 | public long? Mtweak { get; set; }
178 |
179 | [JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
180 | public string Name { get; set; }
181 |
182 | [JsonProperty("paused", NullValueHandling = NullValueHandling.Ignore)]
183 | public bool? Paused { get; set; }
184 |
185 | [JsonProperty("pci_bus", NullValueHandling = NullValueHandling.Ignore)]
186 | public long? PciBus { get; set; }
187 |
188 | [JsonProperty("pci_domain", NullValueHandling = NullValueHandling.Ignore)]
189 | public long? PciDomain { get; set; }
190 |
191 | [JsonProperty("pci_id", NullValueHandling = NullValueHandling.Ignore)]
192 | public long? PciId { get; set; }
193 |
194 | [JsonProperty("potentially_unstable", NullValueHandling = NullValueHandling.Ignore)]
195 | public bool? PotentiallyUnstable { get; set; }
196 |
197 | [JsonProperty("power", NullValueHandling = NullValueHandling.Ignore)]
198 | public long? Power { get; set; }
199 |
200 | [JsonProperty("power_avr", NullValueHandling = NullValueHandling.Ignore)]
201 | public long? PowerAvr { get; set; }
202 |
203 | [JsonProperty("shares", NullValueHandling = NullValueHandling.Ignore)]
204 | public Shares Shares { get; set; }
205 |
206 | [JsonProperty("temperature", NullValueHandling = NullValueHandling.Ignore)]
207 | public long? Temperature { get; set; }
208 |
209 | [JsonProperty("uuid", NullValueHandling = NullValueHandling.Ignore)]
210 | public string Uuid { get; set; }
211 |
212 | [JsonProperty("vendor", NullValueHandling = NullValueHandling.Ignore)]
213 | public string Vendor { get; set; }
214 | }
215 |
216 | public partial class Shares
217 | {
218 | [JsonProperty("accepted_count", NullValueHandling = NullValueHandling.Ignore)]
219 | public long? AcceptedCount { get; set; }
220 |
221 | [JsonProperty("invalid_count", NullValueHandling = NullValueHandling.Ignore)]
222 | public long? InvalidCount { get; set; }
223 |
224 | [JsonProperty("last_share_diff", NullValueHandling = NullValueHandling.Ignore)]
225 | public long? LastShareDiff { get; set; }
226 |
227 | [JsonProperty("last_share_submit_ts", NullValueHandling = NullValueHandling.Ignore)]
228 | public long? LastShareSubmitTs { get; set; }
229 |
230 | [JsonProperty("max_share_diff", NullValueHandling = NullValueHandling.Ignore)]
231 | public long? MaxShareDiff { get; set; }
232 |
233 | [JsonProperty("max_share_submit_ts", NullValueHandling = NullValueHandling.Ignore)]
234 | public long? MaxShareSubmitTs { get; set; }
235 |
236 | [JsonProperty("rejected_count", NullValueHandling = NullValueHandling.Ignore)]
237 | public long? RejectedCount { get; set; }
238 |
239 | [JsonProperty("solved_count", NullValueHandling = NullValueHandling.Ignore)]
240 | public long? SolvedCount { get; set; }
241 | }
242 |
243 | public partial class WatchdogStat
244 | {
245 | [JsonProperty("built_in", NullValueHandling = NullValueHandling.Ignore)]
246 | public bool? BuiltIn { get; set; }
247 |
248 | [JsonProperty("startup_ts", NullValueHandling = NullValueHandling.Ignore)]
249 | public long? StartupTs { get; set; }
250 |
251 | [JsonProperty("total_restarts", NullValueHandling = NullValueHandling.Ignore)]
252 | public long? TotalRestarts { get; set; }
253 |
254 | [JsonProperty("uptime", NullValueHandling = NullValueHandling.Ignore)]
255 | public long? Uptime { get; set; }
256 |
257 | [JsonProperty("wd_version", NullValueHandling = NullValueHandling.Ignore)]
258 | public string WdVersion { get; set; }
259 | }
260 | }
--------------------------------------------------------------------------------
/Janelas/Other.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
30 |
36 |
37 |
38 |
39 |
45 |
46 |
47 |
48 |
54 |
60 |
61 |
62 |
63 |
69 |
75 |
76 |
77 |
78 |
84 |
85 |
86 |
87 |
93 |
94 |
95 |
96 |
102 |
103 |
104 |
105 |
106 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/ViewModel/PageCreateWallet.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
26 |
32 |
38 |
44 |
45 |
46 |
47 |
48 |
54 |
60 |
66 |
72 |
78 |
79 |
80 |
81 |
82 |
88 |
94 |
100 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/Janelas/Popups/Calculator.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/Janelas/Popups/Calculator.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Windows;
4 | using System.Windows.Input;
5 | using TrueMiningDesktop.Core;
6 | using TrueMiningDesktop.ExternalApi;
7 |
8 | namespace TrueMiningDesktop.Janelas.Popups
9 | {
10 | ///
11 | /// Lógica interna para Calculator.xaml
12 | ///
13 | public partial class Calculator : Window
14 | {
15 | private readonly System.Timers.Timer timerUpdate = new(2000);
16 |
17 | public Calculator()
18 | {
19 | InitializeComponent();
20 |
21 | Closing += Calculator_Closing;
22 |
23 | timerUpdate.Elapsed += TimerUpdate_Elapsed;
24 | timerUpdate.AutoReset = false;
25 | timerUpdate.Start();
26 |
27 | Application.Current.Dispatcher.Invoke((Action)delegate
28 | {
29 | loadingVisualElement.Visibility = Visibility.Visible;
30 | AllContent.Visibility = Visibility.Hidden;
31 | });
32 |
33 | new System.Threading.Tasks.Task(() => TimerUpdate_Elapsed(null, null)).Start();
34 | }
35 |
36 | private void Calculator_Closing(object sender, System.ComponentModel.CancelEventArgs e)
37 | {
38 | timerUpdate.Stop();
39 | }
40 |
41 | private void TimerUpdate_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
42 | {
43 | CPU_hashrate_decimal = Device.Cpu.HashrateValue;
44 | OPENCL_hashrate_decimal = Device.Opencl.HashrateValue;
45 | CUDA_hashrate_decimal = Device.Cuda.HashrateValue;
46 |
47 | Application.Current.Dispatcher.Invoke((Action)delegate
48 | {
49 | CoinName = User.Settings.User.PayCoin != null ? User.Settings.User.PayCoin.CoinName : "Coins";
50 |
51 | CPU_algorithm = User.Settings.Device.cpu.Algorithm;
52 | if (CPU_hashrate_decimal <= 0) { CPUpannel.IsEnabled = false; CPU_hashrate_decimal = 0; } else { CPUpannel.IsEnabled = true; }
53 | CPU_hashrate = Device.Cpu.HashrateString;
54 |
55 | if (Server.SoftwareParameters.ServerConfig != null && Server.SoftwareParameters.ServerConfig.MiningCoins.Any(coin => coin.Algorithm.Equals(User.Settings.Device.cpu.Algorithm, StringComparison.OrdinalIgnoreCase)))
56 | {
57 | Server.MiningCoin miningCoin = Server.SoftwareParameters.ServerConfig.MiningCoins.First(coin => coin.Algorithm.Equals(User.Settings.Device.cpu.Algorithm, StringComparison.OrdinalIgnoreCase));
58 |
59 | if ("RandomX".Equals(User.Settings.Device.cpu.Algorithm, StringComparison.OrdinalIgnoreCase))
60 | {
61 | CPUestimated_day_Coins = CPU_hashrate_decimal / 1000 * NanopoolData.XMR_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
62 | CPUestimated_day_Bitcoin = CPUestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
63 | }
64 | if ("KawPow".Equals(User.Settings.Device.cpu.Algorithm, StringComparison.OrdinalIgnoreCase))
65 | {
66 | CPUestimated_day_Coins = CPU_hashrate_decimal / 1000 * NanopoolData.RVN_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
67 | CPUestimated_day_Bitcoin = CPUestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
68 | }
69 | if ("Etchash".Equals(User.Settings.Device.cpu.Algorithm, StringComparison.OrdinalIgnoreCase))
70 | {
71 | CPUestimated_day_Coins = CPU_hashrate_decimal / 1000 * NanopoolData.ETC_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
72 | CPUestimated_day_Bitcoin = CPUestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
73 | }
74 | CPUestimated_day_USD = CPUestimated_day_Bitcoin * (decimal)ExternalApi.BitcoinPrice.BTCUSD;
75 | CPUestimated_day_Coins_string = Math.Round(CPUestimated_day_Coins, 5).ToString();
76 | CPUestimated_day_Sats_string = ((decimal)Math.Round(CPUestimated_day_Bitcoin, 8)).ToString();
77 | CPUestimated_day_USD_string = Math.Round(CPUestimated_day_USD, 2).ToString();
78 | }
79 |
80 | OPENCL_algorithm = User.Settings.Device.opencl.Algorithm;
81 | if (OPENCL_hashrate_decimal <= 0) { OPENCLpannel.IsEnabled = false; OPENCL_hashrate_decimal = 0; } else { OPENCLpannel.IsEnabled = true; }
82 | OPENCL_hashrate = Device.Opencl.HashrateString;
83 |
84 | if (Server.SoftwareParameters.ServerConfig != null && Server.SoftwareParameters.ServerConfig.MiningCoins.Any(coin => coin.Algorithm.Equals(User.Settings.Device.opencl.Algorithm, StringComparison.OrdinalIgnoreCase)))
85 | {
86 | Server.MiningCoin miningCoin = Server.SoftwareParameters.ServerConfig.MiningCoins.First(coin => coin.Algorithm.Equals(User.Settings.Device.opencl.Algorithm, StringComparison.OrdinalIgnoreCase));
87 |
88 | if ("RandomX".Equals(User.Settings.Device.opencl.Algorithm, StringComparison.OrdinalIgnoreCase))
89 | {
90 | OPENCLestimated_day_Coins = OPENCL_hashrate_decimal / 1000 * NanopoolData.XMR_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
91 | OPENCLestimated_day_Bitcoin = OPENCLestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
92 | }
93 | if ("KawPow".Equals(User.Settings.Device.opencl.Algorithm, StringComparison.OrdinalIgnoreCase))
94 | {
95 | OPENCLestimated_day_Coins = OPENCL_hashrate_decimal / 1000 * NanopoolData.RVN_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
96 | OPENCLestimated_day_Bitcoin = OPENCLestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
97 | }
98 | if ("Etchash".Equals(User.Settings.Device.opencl.Algorithm, StringComparison.OrdinalIgnoreCase))
99 | {
100 | OPENCLestimated_day_Coins = OPENCL_hashrate_decimal / 1000 * NanopoolData.ETC_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
101 | OPENCLestimated_day_Bitcoin = OPENCLestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
102 | }
103 | OPENCLestimated_day_USD = OPENCLestimated_day_Bitcoin * (decimal)ExternalApi.BitcoinPrice.BTCUSD;
104 | OPENCLestimated_day_Coins_string = Math.Round(OPENCLestimated_day_Coins, 5).ToString();
105 | OPENCLestimated_day_Sats_string = ((decimal)Math.Round(OPENCLestimated_day_Bitcoin, 8)).ToString();
106 | OPENCLestimated_day_USD_string = Math.Round(OPENCLestimated_day_USD, 2).ToString();
107 | }
108 |
109 | CUDA_algorithm = User.Settings.Device.cuda.Algorithm;
110 | if (CUDA_hashrate_decimal <= 0) { CUDApannel.IsEnabled = false; CUDA_hashrate_decimal = 0; } else { CUDApannel.IsEnabled = true; }
111 | CUDA_hashrate = Device.Cuda.HashrateString;
112 |
113 | if (Server.SoftwareParameters.ServerConfig != null && Server.SoftwareParameters.ServerConfig.MiningCoins.Any(coin => coin.Algorithm.Equals(User.Settings.Device.cuda.Algorithm, StringComparison.OrdinalIgnoreCase)))
114 | {
115 | Server.MiningCoin miningCoin = Server.SoftwareParameters.ServerConfig.MiningCoins.First(coin => coin.Algorithm.Equals(User.Settings.Device.cuda.Algorithm, StringComparison.OrdinalIgnoreCase));
116 |
117 | if ("RandomX".Equals(User.Settings.Device.cuda.Algorithm, StringComparison.OrdinalIgnoreCase))
118 | {
119 | CUDAestimated_day_Coins = CUDA_hashrate_decimal / 1000 * NanopoolData.XMR_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
120 | CUDAestimated_day_Bitcoin = CUDAestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
121 | }
122 | if ("KawPow".Equals(User.Settings.Device.cuda.Algorithm, StringComparison.OrdinalIgnoreCase))
123 | {
124 | CUDAestimated_day_Coins = CUDA_hashrate_decimal / 1000 * NanopoolData.RVN_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
125 | CUDAestimated_day_Bitcoin = CUDAestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
126 | }
127 | if ("Etchash".Equals(User.Settings.Device.cuda.Algorithm, StringComparison.OrdinalIgnoreCase))
128 | {
129 | CUDAestimated_day_Coins = CUDA_hashrate_decimal / 1000 * NanopoolData.ETC_nanopool.approximated_earnings.data.day.bitcoins.SubtractFee(Server.SoftwareParameters.ServerConfig.DynamicFee) / ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.buyLevels[0].price;
130 | CUDAestimated_day_Bitcoin = CUDAestimated_day_Coins * (decimal)ExternalApi.ExchangeOrderbooks.PaymentCoinBTC.sellLevels[0].price;
131 | }
132 | CUDAestimated_day_USD = CUDAestimated_day_Bitcoin * (decimal)ExternalApi.BitcoinPrice.BTCUSD;
133 | CUDAestimated_day_Coins_string = Math.Round(CUDAestimated_day_Coins, 5).ToString();
134 | CUDAestimated_day_Sats_string = ((decimal)Math.Round(CUDAestimated_day_Bitcoin, 8)).ToString();
135 | CUDAestimated_day_USD_string = Math.Round(CUDAestimated_day_USD, 2).ToString();
136 | }
137 |
138 | timerUpdate.Enabled = true;
139 | });
140 |
141 | //if (CPU_hashrate_decimal <= 1 && OPENCL_hashrate_decimal <= 1 && CUDA_hashrate_decimal <= 1)
142 | //{
143 | // Application.Current.Dispatcher.Invoke((Action)delegate
144 | // {
145 | // timerUpdate.Stop();
146 | // this.Close();
147 | // });
148 | // if (this.Visibility == Visibility.Visible)
149 | // {
150 | // MessageBox.Show("Start mining and wait for the hashrate to appear."); return;
151 | // }
152 | //}
153 |
154 | Application.Current.Dispatcher.Invoke((Action)delegate
155 | {
156 | loadingVisualElement.Visibility = Visibility.Hidden;
157 | AllContent.Visibility = Visibility.Visible;
158 |
159 | DataContext = null;
160 | DataContext = this;
161 | });
162 | }
163 |
164 | public string CoinName { get; set; }
165 |
166 | public decimal CPU_hashrate_decimal { get; set; } = 0;
167 | public string CPU_hashrate { get; set; }
168 | public string CPU_algorithm { get; set; }
169 | public decimal CPUestimated_day_Coins { get; set; }
170 | public decimal CPUestimated_day_Bitcoin { get; set; }
171 | public decimal CPUestimated_day_USD { get; set; }
172 | public string CPUestimated_day_Coins_string { get; set; }
173 | public string CPUestimated_day_Sats_string { get; set; }
174 | public string CPUestimated_day_USD_string { get; set; }
175 |
176 | public decimal OPENCL_hashrate_decimal { get; set; } = 0;
177 | public string OPENCL_hashrate { get; set; }
178 | public string OPENCL_algorithm { get; set; }
179 | public decimal OPENCLestimated_day_Coins { get; set; }
180 | public decimal OPENCLestimated_day_Bitcoin { get; set; }
181 | public decimal OPENCLestimated_day_USD { get; set; }
182 | public string OPENCLestimated_day_Coins_string { get; set; }
183 | public string OPENCLestimated_day_Sats_string { get; set; }
184 | public string OPENCLestimated_day_USD_string { get; set; }
185 |
186 | public decimal CUDA_hashrate_decimal { get; set; } = 0;
187 | public string CUDA_hashrate { get; set; }
188 | public string CUDA_algorithm { get; set; }
189 | public decimal CUDAestimated_day_Coins { get; set; }
190 | public decimal CUDAestimated_day_Bitcoin { get; set; }
191 | public decimal CUDAestimated_day_USD { get; set; }
192 | public string CUDAestimated_day_Coins_string { get; set; }
193 | public string CUDAestimated_day_Sats_string { get; set; }
194 | public string CUDAestimated_day_USD_string { get; set; }
195 |
196 | private void CloseButton_click(object sender, System.Windows.Input.MouseButtonEventArgs e)
197 | {
198 | Close();
199 | }
200 |
201 | private static bool clicado;
202 | private Point lm;
203 |
204 | public void Down(object sender, MouseButtonEventArgs e)
205 | {
206 | clicado = true;
207 |
208 | lm.X = System.Windows.Forms.Control.MousePosition.X;
209 | lm.Y = System.Windows.Forms.Control.MousePosition.Y;
210 | lm.X = Convert.ToInt16(Left) - lm.X;
211 | lm.Y = Convert.ToInt16(Top) - lm.Y;
212 | }
213 |
214 | public void Move(object sender, MouseEventArgs e)
215 | {
216 | if (clicado && e.LeftButton == MouseButtonState.Pressed)
217 | {
218 | Left = (System.Windows.Forms.Control.MousePosition.X + lm.X);
219 | Top = (System.Windows.Forms.Control.MousePosition.Y + lm.Y);
220 | }
221 | else { clicado = false; }
222 | }
223 |
224 | public void Up(object sender, MouseButtonEventArgs e)
225 | {
226 | clicado = false;
227 | }
228 | }
229 | }
--------------------------------------------------------------------------------