Skip to content

Commit a455b8b

Browse files
authored
Merge pull request #25 from BitPoolMining/Dev
Added additional tours for getting started
2 parents 7bdd925 + e045ee9 commit a455b8b

13 files changed

Lines changed: 292 additions & 103 deletions

BitPoolMiner/App.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ private void SetupLogging()
3131

3232
private void BitPoolMiner_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
3333
{
34+
// Hotfix to prevent excessive errors
35+
// TODO - fix this shit
36+
if (e.Exception.Message == "Cannot set Owner property to a Window that has not been shown previously.")
37+
{
38+
e.Handled = true;
39+
return;
40+
}
41+
3442
logger.Error(e.Exception, $"Unhandled exception caught");
3543
e.Handled = true;
3644
}

BitPoolMiner/BitPoolMiner.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<UpdateMode>Background</UpdateMode>
2727
<UpdateInterval>4</UpdateInterval>
2828
<UpdateIntervalUnits>Hours</UpdateIntervalUnits>
29-
<UpdatePeriodically>true</UpdatePeriodically>
29+
<UpdatePeriodically>false</UpdatePeriodically>
3030
<UpdateRequired>false</UpdateRequired>
3131
<MapFileExtensions>true</MapFileExtensions>
3232
<InstallUrl>https://raw.githubusercontent.com/BitPoolMining/BitPoolMiner/master/BitPoolMiner/publish/</InstallUrl>
@@ -205,7 +205,10 @@
205205
<Compile Include="Utils\Core.cs" />
206206
<Compile Include="Utils\CryptoCompare\CryptoCompareAPI.cs" />
207207
<Compile Include="Utils\FeatureTour\FeatureTourElementID.cs" />
208+
<Compile Include="Utils\FeatureTour\Tours\TourAdditionalWorkerSetup.cs" />
208209
<Compile Include="Utils\FeatureTour\Tours\TourFirstMiningWorkerSetup.cs" />
210+
<Compile Include="Utils\FeatureTour\Tours\TourMineMultipleCoins.cs" />
211+
<Compile Include="Utils\FeatureTour\Tours\TourMonitoringOnlyInstance.cs" />
209212
<Compile Include="Utils\HashrateFormatter.cs" />
210213
<Compile Include="Utils\NLogProcessing.cs" />
211214
<Compile Include="Utils\OpenHardwareMonitor\OpenHardwareMonitor.cs" />

BitPoolMiner/MainWindow.xaml

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<!--Define Views-->
2525
<Window.Resources>
26-
26+
2727
<!-- Style - Left Menu - Buttons -->
2828
<Style x:Key = "buttonStyleLeftMenu" TargetType = "Button">
2929
<Setter Property = "Foreground" Value = "#9f9f9f" />
@@ -112,7 +112,7 @@
112112
</DataTrigger>
113113
<DataTrigger Binding="{Binding IsOnline}" Value="False">
114114
<Setter Property="Visibility" Value="Hidden"/>
115-
</DataTrigger>
115+
</DataTrigger>
116116
</Style.Triggers>
117117
</Style>
118118

@@ -278,19 +278,26 @@
278278
</Border>
279279

280280
<!--Left Menu -->
281-
<Expander IsExpanded="True" ExpandDirection="Left" Grid.Row="1" Grid.Column="0" Grid.RowSpan="8" Foreground="#FFFFFF" BorderBrush="#444444" Background="#1a1a1a" BorderThickness="0 4 1 4" >
281+
<Expander IsExpanded="True" ExpandDirection="Left" Grid.Row="1" Grid.Column="0" Grid.RowSpan="8" Foreground="#FFFFFF" BorderBrush="#444444" Background="#1a1a1a" BorderThickness="0 4 1 4">
282282
<Expander.Header>
283283
<TextBlock Text="Main Menu">
284284
<TextBlock.LayoutTransform>
285285
<RotateTransform Angle="90"/>
286286
</TextBlock.LayoutTransform>
287287
</TextBlock>
288288
</Expander.Header>
289-
<Border >
289+
<ScrollViewer Grid.Row="1" Grid.Column="0" Grid.RowSpan="8" Background="#1a1a1a" HorizontalAlignment="Left" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
290+
<ScrollViewer.Resources>
291+
<Style TargetType="ScrollBar">
292+
<Setter Property="Background" Value="#212121" />
293+
<Setter Property="BorderBrush" Value="#9f9f9f" />
294+
</Style>
295+
</ScrollViewer.Resources>
296+
<Border >
290297
<StackPanel>
291298

292299
<!--Left Menu Rigs-->
293-
<Border x:Name="BorderRigs" BorderThickness="0 4 1 4" BorderBrush="#444444" Grid.Row="1" Grid.Column="0" Grid.RowSpan="5" Background="#1a1a1a" Width="270" HorizontalAlignment="Left" VerticalAlignment="Stretch">
300+
<Border BorderThickness="0 4 1 4" BorderBrush="#444444" Grid.Row="1" Grid.Column="0" Grid.RowSpan="5" Background="#1a1a1a" Width="270" HorizontalAlignment="Left" VerticalAlignment="Stretch">
294301
<ItemsControl
295302
x:Name="MenuStackPanelRigs"
296303
Grid.Row="1"
@@ -301,41 +308,41 @@
301308
HorizontalAlignment="Left"
302309
VerticalAlignment="Stretch"
303310
ItemsSource="{Binding Source={StaticResource MainWindowViewModel}, Path=AccountWorkersList}">
304-
<ItemsControl.ItemTemplate>
305-
<DataTemplate>
306-
<Button x:Name="WorkerButton" Style="{StaticResource buttonStyleLeftMenu}" Click="WorkerButton_Clicked">
307-
<Button.CommandParameter>
308-
<MultiBinding Converter="{StaticResource converter}">
309-
<Binding Path="WorkerName"/>
310-
<Binding Path="CoinType"/>
311-
</MultiBinding>
312-
</Button.CommandParameter>
313-
<Button.Triggers>
314-
<EventTrigger RoutedEvent="MouseEnter">
315-
<BeginStoryboard>
316-
<Storyboard>
317-
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="CadetBlue"/>
318-
</Storyboard>
319-
</BeginStoryboard>
320-
</EventTrigger>
321-
</Button.Triggers>
322-
323-
<StackPanel Orientation="Horizontal" >
324-
<Label Style="{StaticResource labelStyleLeftMenuGrey}" Content="{Binding WorkerName}" Width="115" />
325-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
326-
<Border Style="{StaticResource borderStyleLeftMenuGreySmall}">
327-
<Label Style="{StaticResource labelStyleLeftMenuGreySmall}" Content="{Binding Status}"/>
328-
</Border>
329-
<Border Style="{StaticResource borderStyleHeaderCoinType}" BorderThickness="1" BorderBrush="#444444" Padding="4 0 4 0" Margin="0 2 2 0">
330-
<Label Foreground="#444444" Padding="4" FontSize="10" Content="{Binding CoinType}"/>
331-
</Border>
332-
<Image Margin="5 1 5 0" Height="20" Width="20" Source="{Binding CoinLogo}" VerticalAlignment="Top" />
311+
<ItemsControl.ItemTemplate>
312+
<DataTemplate>
313+
<Button x:Name="WorkerButton" Style="{StaticResource buttonStyleLeftMenu}" Click="WorkerButton_Clicked">
314+
<Button.CommandParameter>
315+
<MultiBinding Converter="{StaticResource converter}">
316+
<Binding Path="WorkerName"/>
317+
<Binding Path="CoinType"/>
318+
</MultiBinding>
319+
</Button.CommandParameter>
320+
<Button.Triggers>
321+
<EventTrigger RoutedEvent="MouseEnter">
322+
<BeginStoryboard>
323+
<Storyboard>
324+
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="CadetBlue"/>
325+
</Storyboard>
326+
</BeginStoryboard>
327+
</EventTrigger>
328+
</Button.Triggers>
329+
330+
<StackPanel Orientation="Horizontal" >
331+
<Label Style="{StaticResource labelStyleLeftMenuGrey}" Content="{Binding WorkerName}" Width="115" />
332+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
333+
<Border Style="{StaticResource borderStyleLeftMenuGreySmall}">
334+
<Label Style="{StaticResource labelStyleLeftMenuGreySmall}" Content="{Binding Status}"/>
335+
</Border>
336+
<Border Style="{StaticResource borderStyleHeaderCoinType}" BorderThickness="1" BorderBrush="#444444" Padding="4 0 4 0" Margin="0 2 2 0">
337+
<Label Foreground="#444444" Padding="4" FontSize="10" Content="{Binding CoinType}"/>
338+
</Border>
339+
<Image Margin="5 1 5 0" Height="20" Width="20" Source="{Binding CoinLogo}" VerticalAlignment="Top" />
340+
</StackPanel>
333341
</StackPanel>
334-
</StackPanel>
335-
</Button>
336-
</DataTemplate>
337-
</ItemsControl.ItemTemplate>
338-
</ItemsControl>
342+
</Button>
343+
</DataTemplate>
344+
</ItemsControl.ItemTemplate>
345+
</ItemsControl>
339346
</Border>
340347

341348
<!--Left Menu Settings-->
@@ -363,6 +370,7 @@
363370

364371
</StackPanel>
365372
</Border>
373+
</ScrollViewer>
366374
</Expander>
367375

368376
<!--Right Column -->
@@ -399,7 +407,7 @@
399407
Margin="0"
400408
VerticalAlignment="Top"
401409
VerticalContentAlignment="Top"
402-
HorizontalAlignment="Left"
410+
HorizontalAlignment="Left"
403411
HorizontalContentAlignment="Left"
404412
ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyleGPU}"
405413
RowHeaderStyle="{StaticResource DataGridRowHeaderStyleGPU}"

BitPoolMiner/MainWindow.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public MainWindow()
9292
private void InitFeatureTourNavigation()
9393
{
9494
var navigator = FeatureTour.GetNavigator();
95+
96+
navigator.OnStepEntering(FeatureTourElementID.AccountViewButtonSaveHardwareSettings).Execute(s => DataContext = AccountViewModel);
97+
navigator.OnStepEntering(FeatureTourElementID.AccountViewTextBoxAccountID).Execute(s => DataContext = AccountViewModel);
9598
navigator.OnStepEntering(FeatureTourElementID.AccountViewTextBoxWorkerName).Execute(s => DataContext = AccountViewModel);
9699
navigator.OnStepEntering(FeatureTourElementID.WalletViewDataGridWalletAddresses).Execute(s => DataContext = WalletViewModel);
97100
}
@@ -138,7 +141,7 @@ private void WorkerButton_Clicked(object sender, RoutedEventArgs e)
138141
Button button = (Button)sender;
139142
WorkerParameters workerParameters = (WorkerParameters)button.CommandParameter;
140143

141-
WorkerViewModel.WorkerName = workerParameters .WorkerName;
144+
WorkerViewModel.WorkerName = workerParameters.WorkerName;
142145
WorkerViewModel.CoinType = workerParameters.CoinType;
143146

144147
WorkerViewModel.InitMonitorMining();

BitPoolMiner/Utils/FeatureTour/FeatureTourElementID.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public static class FeatureTourElementID
99
public static readonly string MainViewButtonAccountWorkerSettings = "MainViewButtonAccountWorkerSettings";
1010

1111
// AccountView
12+
public static readonly string AccountViewTextBoxAccountID = "AccountViewTextBoxAccountID";
13+
public static readonly string AccountViewButtonSaveAccountID = "AccountViewButtonSaveAccountID";
1214
public static readonly string AccountViewTextBoxWorkerName = "AccountViewTextBoxWorkerName";
1315
public static readonly string AccountViewCheckBoxAutoStartMining = "AccountViewCheckBoxAutoStartMining";
1416
public static readonly string AccountViewComboBoxRegion = "AccountViewComboBoxRegion";
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using ThinkSharp.FeatureTouring.Models;
2+
3+
namespace BitPoolMiner.Utils.FeatureTour.Tours
4+
{
5+
public static class TourAdditionalWorkerSetup
6+
{
7+
public static void StartTourAdditionalWorkerSetup()
8+
{
9+
var tour = new Tour
10+
{
11+
Name = "Set up an additional mining rig",
12+
ShowNextButtonDefault = true,
13+
Steps = new[]
14+
{
15+
// Set up account ID
16+
new Step(FeatureTourElementID.AccountViewTextBoxAccountID, "Use existing account ID", "Please copy and paste your account ID from your previous workers. This will link your workers together."),
17+
new Step(FeatureTourElementID.AccountViewButtonSaveAccountID, "Save", "Once you enter your existing account ID, press save."),
18+
19+
// Set up worker account
20+
new Step(FeatureTourElementID.AccountViewTextBoxWorkerName, "Enter a unique worker name", "Please give your worker a unique name so it is easy to identify."),
21+
new Step(FeatureTourElementID.AccountViewCheckBoxAutoStartMining, "Auto Start Mining", "Enable if you would like to start mining as soon as BPM is open."),
22+
new Step(FeatureTourElementID.AccountViewComboBoxRegion, "Mining Region", "Select the region to use when connecting to the pool."),
23+
new Step(FeatureTourElementID.AccountViewComboBoxFiatCurrency, "Fiat Currency", "Select the fiat currency that you would like to see your figures displayed in."),
24+
new Step(FeatureTourElementID.AccountViewButtonSaveWorkerSettings, "Save", "Once you have set your worker settings, click save."),
25+
26+
// Verify worker list
27+
new Step(FeatureTourElementID.AccountViewDataGridConnectedWorkers, "Verify Connected Workers List", "Please ensure that your your new worker is listed here."),
28+
new Step(FeatureTourElementID.AccountViewDataGridConnectedWorkers, "Verify Connected Workers List", "Please ensure that your previous workers are listed."),
29+
new Step(FeatureTourElementID.AccountViewDataGridConnectedWorkers, "Verify Connected Workers List", "Please remove any unneeded workers."),
30+
31+
// Set up hardware
32+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Configure Hardware", "Enable all cards to mine with, select which coin to mine and miner for each enabled card."),
33+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Save", "Once you have set your hardware settings, click save."),
34+
35+
// Set up wallet
36+
new Step(FeatureTourElementID.WalletViewDataGridWalletAddresses, "Verify Addresses", "Your addresses should now be copied from your previous workers, please verify."),
37+
new Step(FeatureTourElementID.WalletViewButtonSaveWalletAddresses, "Save", "If you have made any changes to your wallet addresses, click save.")
38+
}
39+
};
40+
tour.Start();
41+
}
42+
}
43+
}

BitPoolMiner/Utils/FeatureTour/Tours/TourFirstMiningWorkerSetup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static void StartTourFirstMiningWorkerSetup()
2323
new Step(FeatureTourElementID.AccountViewDataGridConnectedWorkers, "Verify Connected Workers List", "Please ensure that your worker is listed here, and that there are no additional workers."),
2424

2525
// Set up hardware
26-
new Step(FeatureTourElementID.AccountViewDataGridHardware, "Configure Hardware", "Enable all cards to mine with, select which coin to mine and miner for each enabled card."),
26+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Configure Hardware", "Enable all cards to mine with, select which coin to mine and miner for each enabled card."),
2727
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Save", "Once you have set your hardware settings, click save."),
2828

2929
// Set up wallet
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using ThinkSharp.FeatureTouring.Models;
2+
3+
namespace BitPoolMiner.Utils.FeatureTour.Tours
4+
{
5+
public static class TourMineMultipleCoins
6+
{
7+
public static void StartTourMineMultipleCoins()
8+
{
9+
var tour = new Tour
10+
{
11+
Name = "Mine multiple coins on one rig",
12+
ShowNextButtonDefault = true,
13+
Steps = new[]
14+
{
15+
// Set up hardware
16+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Configure Hardware", "You can select which cards you would like to mine with."),
17+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Configure Hardware", "You can select which coin and which miner to use for each coin."),
18+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Configure Hardware", "BPM will run separate miners for you depending on the selections you make."),
19+
20+
new Step(FeatureTourElementID.AccountViewButtonSaveHardwareSettings, "Save", "Once you have set your hardware settings, click save.")
21+
}
22+
};
23+
tour.Start();
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)