Skip to content

Commit fd4135d

Browse files
authored
Add warning if ffmpeg.exe file not found. (#5)
* Add warning if ffmpeg.exe file not found. Update version to 0.1.0.1. Update Nugets references to the newest version. Set default decimal places to 3. Update documentation index.md, CVS to CSV. Add and fix some links. * Update documentation Update documentation
1 parent 45e69ae commit fd4135d

File tree

10 files changed

+96
-25
lines changed

10 files changed

+96
-25
lines changed

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,28 @@ The screenshot of Bar Chart Race Generator
77

88
The more complete documentation can be read in the [Bar Chart Race Website](https://yoyokits.github.io/BarChartRaceNet/).
99

10-
{% include youtube_embed.html id="Xtnz7N6mwX4" %}
11-
The video example of Bar Chart Race output
10+
The video example of Bar Chart Race output: [Youtube example](https://www.youtube.com/watch?v=onQ0V4cIgMQ)
1211

13-
The input of for this application is CVS files that can be exported from your Excell sheet or simply created using Notepad.<br/>
12+
The input of for this application is CSV files that can be exported from your Excell sheet or simply created using Notepad.<br/>
1413

15-
The CVS example can be downloaded from [CVS example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples).
14+
The CVS example can be downloaded from [CSV example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples).
1615

17-
The cvs file is like:
16+
The CSV file is like:
1817

1918
<img src="https://yoyokits.github.io/BarChartRaceNet/images/CsvSourceExample.jpg"><br/>
19+
20+
Installation:<br/>
21+
1. [Download the latest release in zip file.](https://github.com/yoyokits/BarChartRaceNet/releases)
22+
2. Extract the zip file in the Program Files or your favourite folder
23+
3. Simply double click BarChartRaceNet.exe
24+
25+
Usages:
26+
1. Double click BarChartRaceNet.exe
27+
2. Click load button on the top left of the window
28+
3. Select the csv file with format above
29+
4. Adjust the settings like add icon for every bar and background
30+
5. Generate the bar chart race animation in a MPEG format by clicking Export to Video button on the right side of load button
31+
6. Select the output folder and file name and press Save
32+
7. Wait until the process is done
33+
34+
If you have a problem please ask me in [Facebook StatAnim Page](https://www.facebook.com/StatAnim-106525391163002) or open an issue here.

docs/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Bar Chart Race is a free application used to visualize the progress of some deve
66
The screenshot of Bar Chart Race Generator
77

88
{% include youtube_embed.html id="Xtnz7N6mwX4" %}
9-
The video example of Bar Chart Race output
9+
The video example of Bar Chart Race output: [Youtube example](https://www.youtube.com/watch?v=onQ0V4cIgMQ)
1010

11-
The input of for this application is CVS files that can be exported from your Excell sheet or simply created using Notepad.<br/>
11+
The input of for this application is CSV files that can be exported from your Excell sheet or simply created using Notepad.<br/>
1212

13-
The CVS example can be downloaded from [CVS example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples).
13+
The CSV example can be downloaded from [CSV example](https://github.com/yoyokits/BarChartRaceNet/tree/master/docs/examples).
1414

15-
The cvs file is like:
15+
The CSV file is like:
1616

1717
<img src="https://yoyokits.github.io/BarChartRaceNet/images/CsvSourceExample.jpg"><br/>
1818

@@ -29,3 +29,5 @@ Usages:
2929
5. Generate the bar chart race animation in a MPEG format by clicking Export to Video button on the right side of load button
3030
6. Select the output folder and file name and press Save
3131
7. Wait until the process is done
32+
33+
If you have a problem please ask me in [Facebook StatAnim Page](https://www.facebook.com/StatAnim-106525391163002) or open an issue here.

src/BarChartRaceNet.Test/BarChartRaceNet.Test.csproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@
1111

1212
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
1313

14-
<Version>0.1.0</Version>
14+
<Version>0.1.0.1</Version>
15+
16+
<RepositoryUrl>https://github.com/yoyokits/BarChartRaceNet</RepositoryUrl>
17+
18+
<Company>Cekli</Company>
19+
20+
<PackageProjectUrl>https://github.com/yoyokits/BarChartRaceNet</PackageProjectUrl>
21+
22+
<RepositoryType>git</RepositoryType>
1523
</PropertyGroup>
1624

1725
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -33,11 +41,14 @@
3341
</ItemGroup>
3442

3543
<ItemGroup>
36-
<PackageReference Include="FluentAssertions" Version="5.10.3" />
44+
<PackageReference Include="FluentAssertions" Version="6.1.0" />
3745
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
3846
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
3947
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
40-
<PackageReference Include="coverlet.collector" Version="1.2.0" />
48+
<PackageReference Include="coverlet.collector" Version="3.1.0">
49+
<PrivateAssets>all</PrivateAssets>
50+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
51+
</PackageReference>
4152
</ItemGroup>
4253

4354
<ItemGroup>

src/BarChartRaceNet/BarChartRaceNet.csproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<Platforms>AnyCPU;x64</Platforms>
88
<SignAssembly>true</SignAssembly>
99
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
10+
<Version>0.1.0.1</Version>
11+
<Company>Cekli</Company>
12+
<PackageProjectUrl>https://github.com/yoyokits/BarChartRaceNet</PackageProjectUrl>
13+
<RepositoryUrl>https://github.com/yoyokits/BarChartRaceNet</RepositoryUrl>
14+
<RepositoryType>git</RepositoryType>
1015
</PropertyGroup>
1116

1217
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -18,10 +23,10 @@
1823
</PropertyGroup>
1924

2025
<ItemGroup>
21-
<PackageReference Include="CsvHelper" Version="26.1.0" />
22-
<PackageReference Include="FFMpegCore" Version="4.1.0" />
26+
<PackageReference Include="CsvHelper" Version="27.1.1" />
27+
<PackageReference Include="FFMpegCore" Version="4.5.0" />
2328
<PackageReference Include="log4net" Version="2.0.12" />
24-
<PackageReference Include="MahApps.Metro" Version="2.4.4" />
29+
<PackageReference Include="MahApps.Metro" Version="2.4.7" />
2530
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2631
<PackageReference Include="Ookii.Dialogs.Wpf.NETCore" Version="2.2.1" />
2732
</ItemGroup>

src/BarChartRaceNet/Helpers/FFMpegHelper.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@
2020
/// </summary>
2121
public static class FFMpegHelper
2222
{
23+
#region Properties
24+
25+
/// <summary>
26+
/// Gets the FFMpegLib.
27+
/// </summary>
28+
public static string FFMpegLib { get; } = "ffmpeg.exe";
29+
30+
/// <summary>
31+
/// Gets a value indicating whether IsFFMpegLibExist.
32+
/// </summary>
33+
public static bool IsFFMpegLibExist
34+
{
35+
get
36+
{
37+
var exist = File.Exists(FFMpegLib);
38+
return exist;
39+
}
40+
}
41+
42+
#endregion Properties
43+
2344
#region Methods
2445

2546
/// <summary>

src/BarChartRaceNet/Helpers/SettingsHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static string GetImageUrl(this IDictionary<string, string> stringToImageU
7070
/// <returns>The <see cref="SettingsModel"/>.</returns>
7171
internal static SettingsModel Load()
7272
{
73-
Logger.Info($"Loading Browser setting {UserJsonSettingsPath}");
73+
Logger.Info($"Loading {AppEnvironment.LongName} setting {UserJsonSettingsPath}");
7474
if (!File.Exists(UserJsonSettingsPath))
7575
{
7676
return null;
@@ -87,7 +87,7 @@ internal static SettingsModel Load()
8787
}
8888
catch (Exception e)
8989
{
90-
Logger.Error($"Error Loading Browser Setting: {e.Message}");
90+
Logger.Error($"Error Loading {AppEnvironment.LongName} Setting: {e.Message}");
9191
}
9292

9393
return null;

src/BarChartRaceNet/Models/SettingsModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class SettingsModel
5555
/// <summary>
5656
/// Gets or sets the DecimalPlaces.
5757
/// </summary>
58-
public int DecimalPlaces { get; set; }
58+
public int DecimalPlaces { get; set; } = 3;
5959

6060
/// <summary>
6161
/// Gets or sets the InitialDirectory.

src/BarChartRaceNet/ViewModels/ChartEditorViewModel.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,17 @@ internal void CancelRendering()
100100
/// <summary>
101101
/// The OnExportChart.
102102
/// </summary>
103-
internal void ExportChart()
103+
internal async void ExportChart()
104104
{
105+
if (!FFMpegHelper.IsFFMpegLibExist)
106+
{
107+
var title = $"FFMpeg Library {FFMpegHelper.FFMpegLib} Not Found";
108+
var message = $"Please download {FFMpegHelper.FFMpegLib} from https://ffbinaries.com/downloads," +
109+
$" extract and copy to the application path.";
110+
await this.GlobalData.ShowMessageAsync(title, message);
111+
return;
112+
}
113+
105114
var fileName = $"{this.BarChartViewModel.Title}.mp4";
106115
var dialog = new VistaSaveFileDialog
107116
{
@@ -123,15 +132,15 @@ internal void ExportChart()
123132
this.RenderCancellationTokenSource?.Cancel();
124133
this.RenderCancellationTokenSource = new CancellationTokenSource();
125134
var token = this.RenderCancellationTokenSource.Token;
126-
Task.Run(() =>
135+
await Task.Run(async () =>
127136
{
128137
try
129138
{
130139
FFMpegHelper.Record(filePath, this.BarChartView, this.OnDrawChart, this.BarAnimationModel.FrameCount, token);
131140
}
132141
catch (Exception e)
133142
{
134-
this.GlobalData.ShowMessageAsync($"Export Failed", $"Error: {e.Message}");
143+
await this.GlobalData.ShowMessageAsync($"Export Failed", $"Error: {e.Message}\r\n{e.StackTrace}");
135144
}
136145
}, token);
137146
}

src/BarChartRaceNet/ViewModels/MainWindowViewModel.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System;
99
using System.Collections.ObjectModel;
1010
using System.IO;
11+
using System.Threading.Tasks;
1112
using System.Windows;
1213
using System.Windows.Input;
1314

@@ -113,8 +114,11 @@ private void OnClosing(object obj)
113114
/// </summary>
114115
private void OnExportChart()
115116
{
116-
this.CancelRenderingButton.IsEnabled = true;
117-
this.ChartEditorViewModel.ExportChart();
117+
Task.Run(() =>
118+
{
119+
this.CancelRenderingButton.IsEnabled = true;
120+
this.ChartEditorViewModel.ExportChart();
121+
});
118122
}
119123

120124
/// <summary>

src/BarChartRaceNetTestApp/BarChartRaceNetTestApp.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<UseWPF>true</UseWPF>
7-
<Version>0.1.0</Version>
7+
<Version>0.1.0.1</Version>
88
<Platforms>AnyCPU;x64</Platforms>
99
<SignAssembly>true</SignAssembly>
1010
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
11+
<Company>Cekli</Company>
12+
<RepositoryUrl>https://github.com/yoyokits/BarChartRaceNet</RepositoryUrl>
13+
<PackageProjectUrl>https://github.com/yoyokits/BarChartRaceNet</PackageProjectUrl>
14+
<RepositoryType>git</RepositoryType>
1115
</PropertyGroup>
1216

1317
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -29,7 +33,7 @@
2933
</ItemGroup>
3034

3135
<ItemGroup>
32-
<PackageReference Include="MahApps.Metro" Version="2.4.4" />
36+
<PackageReference Include="MahApps.Metro" Version="2.4.7" />
3337
</ItemGroup>
3438

3539
<ItemGroup>

0 commit comments

Comments
 (0)