-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#17 partially reworked app styles \ There is a dark side! :)
- Loading branch information
1 parent
bdbf989
commit aad8eb8
Showing
29 changed files
with
1,574 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Application/ASD.CellUniverse.Infrastructure/Properties/Settings.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Application/ASD.CellUniverse.Infrastructure/Services/EPSGenerationService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Windows.Media; | ||
using System.Windows.Threading; | ||
|
||
namespace ASD.CellUniverse.Infrastructure.Services { | ||
|
||
using Interfaces; | ||
|
||
public class EPSGenerationService : IEPSGenerator { | ||
|
||
private DispatcherTimer timer; | ||
|
||
private DoubleCollection epsCollection; | ||
private double MinEPS => epsCollection.First(); | ||
private double MaxEPS => epsCollection.Last(); | ||
private double eps; | ||
|
||
public DoubleCollection EPSCollection => epsCollection; | ||
public double EPS { get => eps; set { eps = ValidEps(value); UpdateTimerInterval(); } } | ||
|
||
|
||
public event Action NextFrameTime; | ||
public void Start() => timer.Start(); | ||
public void Stop() => timer.Stop(); | ||
|
||
internal EPSGenerationService() { | ||
epsCollection = new DoubleCollection { 1.0, 2.0, 3.0, 5.0, 15.0, 30.0, 60.0, 120.0, 125.0 }; // Last = NoLimit | ||
timer = new DispatcherTimer(); | ||
timer.Tick += (s, e) => NextFrameTime?.Invoke(); | ||
EPS = epsCollection.TakeWhile(f => f < 120.0).Last(); | ||
} | ||
|
||
private double ValidEps(double eps) => eps < MinEPS ? MinEPS : eps > MaxEPS ? MaxEPS : eps; | ||
private void UpdateTimerInterval() => timer.Interval = | ||
eps == epsCollection.Last() // <-- if Last - No Limit | ||
? TimeSpan.FromTicks(1) | ||
: TimeSpan.FromMilliseconds(1000.0 / ValidEps(eps)); | ||
} | ||
} |
40 changes: 0 additions & 40 deletions
40
Application/ASD.CellUniverse.Infrastructure/Services/MPSGenerationService.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.