Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mastersign committed Nov 30, 2018
2 parents ad3ac4c + 8df7687 commit 7bdb668
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 49 deletions.
4 changes: 2 additions & 2 deletions BenchManager/BenchCLI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.4.0")]
[assembly: AssemblyFileVersion("0.20.4.0")]
[assembly: AssemblyVersion("0.20.5.0")]
[assembly: AssemblyFileVersion("0.20.5.0")]
2 changes: 1 addition & 1 deletion BenchManager/BenchDashboard/AppList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void NotifyAppStateChange(string appId)
ForAppWrapper(appId, w =>
{
w.App.DiscardCachedValues();
w.NotifyChanges();
// w.NotifyChanges(); // huge performance impact!
});
}

Expand Down
2 changes: 2 additions & 0 deletions BenchManager/BenchDashboard/BenchDashboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@
<Content Include="Resources\error_grey_16.png" />
<None Include="Resources\remove_16.png" />
<None Include="Resources\error_outline_16.png" />
<None Include="Resources\interactive_log_16.png" />
<Content Include="Resources\library_16.png" />
<Content Include="Resources\log_16.png" />
<Content Include="Resources\MarkdownViewerTemplate.html" />
<None Include="Resources\doc_16.png" />
<None Include="Resources\docs_16.png" />
Expand Down
4 changes: 2 additions & 2 deletions BenchManager/BenchDashboard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.4.0")]
[assembly: AssemblyFileVersion("0.20.4.0")]
[assembly: AssemblyVersion("0.20.5.0")]
[assembly: AssemblyFileVersion("0.20.5.0")]
20 changes: 20 additions & 0 deletions BenchManager/BenchDashboard/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions BenchManager/BenchDashboard/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,10 @@
<data name="ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ok.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="interactive_log_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\interactive_log_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="log_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\log_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BenchManager/BenchDashboard/Resources/log_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 25 additions & 10 deletions BenchManager/BenchDashboard/SetupForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 24 additions & 9 deletions BenchManager/BenchDashboard/SetupForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ private void CoreBusyChangedHandler(object sender, EventArgs e)
btnAuto.Image = !busy
? Resources.do_32
: Resources.stop_32;
if (busy) BusyPanelVisible = true;
if (busy)
{
taskInfoList.Clear();
BusyPanelVisible = true;
}
}

private void CoreActionStateChangedHandler(object sender, EventArgs e)
Expand Down Expand Up @@ -444,24 +448,29 @@ private void DeactivationListHandler(object sender, EventArgs e)
}

private void AppListTaskInfoHandler(object sender, TaskInfoEventArgs ea)
=> ProcessTaskInfo(ea.TaskInfo);
=> TaskInfoHandler(ea.TaskInfo);

private void TaskInfoHandler(TaskInfo info)
{
if (Disposing || IsDisposed) return;
if (InvokeRequired)
BeginInvoke((Action<TaskInfo>)ProcessTaskInfo, info);
else
ProcessTaskInfo(info);
{
BeginInvoke((Action<TaskInfo>)TaskInfoHandler, info);
return;
}
ProcessTaskInfo(info);
taskInfoList.AddTaskInfo(info);
}

private void ProcessTaskInfo(TaskInfo info)
{
lblInfo.Text = info.Message;
lblInfo.Refresh();
if (info is TaskProgress progressInfo) UpdateProgressBar(progressInfo.Progress);
if (info is TaskError taskError) toolTip.SetToolTip(picState, taskError.Message);
taskInfoList.AddTaskInfo(info);
if (info.Message != null)
{
lblInfo.Text = info.Message;
lblInfo.Refresh();
}
}

private void AppListTaskStartedHandler(object sender, TaskStartedEventArgs ea)
Expand Down Expand Up @@ -756,14 +765,20 @@ private bool BusyPanelVisible
{
panelBusy.Visible = false;
appList.Visible = true;
taskInfoList.Clear();
}
tsmiShowTaskInfoList.Enabled = !value;
}
}

private void btnCloseBusyPanel_Click(object sender, EventArgs e)
{
BusyPanelVisible = false;
}

private void tsmiShowTaskInfoList_Click(object sender, EventArgs e)
{
BusyPanelVisible = true;
EnableBusyPanelButtons();
}
}
}
3 changes: 1 addition & 2 deletions BenchManager/BenchDashboard/TaskInfoList.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 33 additions & 19 deletions BenchManager/BenchDashboard/TaskInfoList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,53 @@
using System.Threading.Tasks;
using System.Windows.Forms;
using Mastersign.Bench.Dashboard.Properties;
using System.Collections.Concurrent;

namespace Mastersign.Bench.Dashboard
{
public partial class TaskInfoList : UserControl
{
private BindingList<TaskInfoWrapper> infos = new BindingList<TaskInfoWrapper>();
private ConcurrentQueue<TaskInfoWrapper> infoQueue = new ConcurrentQueue<TaskInfoWrapper>();
private Timer timer;

public TaskInfoList()
{
InitializeComponent();
dataGrid.AutoGenerateColumns = false;
dataGrid.DataSource = infos;
InitializeTimer();
Disposed += DisposedHandler;
}

public void AddTaskInfo(TaskInfo info)
private void InitializeTimer()
{
infos.Insert(0, new TaskInfoWrapper(info));
dataGrid.Rows[0].Selected = true;
timer = new Timer { Interval = 250 };
timer.Tick += Timer_Tick;
timer.Enabled = true;
}

public void Clear()
private void DisposedHandler(object sender, EventArgs e)
{
infos.Clear();
timer.Enabled = false;
timer.Tick -= Timer_Tick;
timer.Dispose();
}

private void Timer_Tick(object sender, EventArgs e)
{
var added = false;
while (infoQueue.TryDequeue(out var wrapper))
{
dataGrid.Rows.Insert(0, wrapper.Icon, wrapper.Timestamp, wrapper.Context, wrapper.Message);
dataGrid.Rows[0].Tag = wrapper.TaskInfo;
added = true;
}
if (added) dataGrid.Rows[0].Selected = true;
}

public void AddTaskInfo(TaskInfo info) => infoQueue.Enqueue(new TaskInfoWrapper(info));

public void Clear() => dataGrid.Rows.Clear();

class TaskInfoWrapper
{
public TaskInfoWrapper(TaskInfo info)
Expand All @@ -42,14 +64,7 @@ public TaskInfoWrapper(TaskInfo info)

public TaskInfo TaskInfo { get; }

public Bitmap Icon
{
get
{
if (TaskInfo is TaskError) return Resources.error_outline_16;
return Resources.ok_outline_16;
}
}
public Bitmap Icon => TaskInfo is TaskError ? Resources.error_outline_16 : Resources.ok_outline_16;

public string Timestamp => TaskInfo.Timestamp.ToString("HH:mm:ss");

Expand All @@ -58,12 +73,11 @@ public Bitmap Icon
public string Message => TaskInfo.Message;
}

private void dataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
private void CellDoubleClickHandler(object sender, DataGridViewCellEventArgs e)
{
var infoWrapper = dataGrid.Rows[e.RowIndex].DataBoundItem as TaskInfoWrapper;
if (infoWrapper != null)
if (dataGrid.Rows[e.RowIndex].Tag is TaskInfo info)
{
ShowTaskInfoForm(infoWrapper.TaskInfo);
ShowTaskInfoForm(info);
}
}

Expand Down
4 changes: 2 additions & 2 deletions BenchManager/BenchLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.4.0")]
[assembly: AssemblyFileVersion("0.20.4.0")]
[assembly: AssemblyVersion("0.20.5.0")]
[assembly: AssemblyFileVersion("0.20.5.0")]
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Add a link to the GitHub diff like

[Unreleased]: https://github.com/winbench/bench/compare/master...dev

## [0.20.5] - 2018-11-30

[0.20.5]: https://github.com/winbench/bench/compare/v0.20.4...v0.20.5

### Fixed
* Performance issues in setup dialog

### Added
* Menu item for showing event log after successful setup

## [0.20.4] - 2018-10-30

[0.20.4]: https://github.com/winbench/bench/compare/v0.20.3...v0.20.4
Expand Down
2 changes: 1 addition & 1 deletion res/bench-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SetLocal
:: https://winbench.org/guide/setup/
::

SET VERSION=0.20.4
SET VERSION=0.20.5
SET TAG=v%VERSION%
SET ROOT=%~dp0
IF [%1] NEQ [] SET ROOT=%~dpnx1\
Expand Down
2 changes: 1 addition & 1 deletion res/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20.4
0.20.5

0 comments on commit 7bdb668

Please sign in to comment.