-
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.
Merge pull request #64 from carlst99/develop
Release v1.0.2
- Loading branch information
Showing
47 changed files
with
617 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
# TrialManager | ||
TrialManager helps NZ sheepdog trialing clubs to create draws for their trials. | ||
It uses data from a CSV file, generally downloaded from Google Forms, and sorts trialists into a draw based on certain parameters, such as their preferred day and distance to the trial grounds. | ||
TrialManager is a solution for New Zealand sheepdog trialing clubs that accelerates and eases the process of making draws for their trials. | ||
|
||
TrialManager currently only works on Windows computers with a .NET Core 3.1 runtime. | ||
It uses data from a CSV file, generally downloaded from Google Forms, and sorts trialists into a draw based on certain parameters, such as their preferred day and distance to the trial grounds. | ||
|
||
### Important :warning: | ||
TrialManager is still in development and is undergoing regular, significant feature changes. Furthermore, it is not fully hand or unit tested and should therefore be considered unreliable. | ||
Please use only if you understand what you are doing. | ||
|
||
### Roadmap | ||
**Update** | ||
|
||
We are nearing the release of the first version. Please hold tight! | ||
|
||
--- | ||
I intend to release TrialManager only when I am confident that all features work properly and it is customisable to the extent that it will fulfil the requirements of most different trial formats. | ||
This means a significant amount of work and testing is required before I start work on release features like installers and documentation. | ||
TrialManager is still in development and is not fully hand or unit tested and should therefore be considered unreliable. Furthermore, documentation is at a minimum. You are welcome to install TrialManager and try it out, however be aware that it may not perform as expected. |
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
11 changes: 10 additions & 1 deletion
11
TrialManager/Resources/HelpUrls.Designer.cs → TrialManager/Resources/HelpUrls1.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using CsvHelper; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
namespace TrialManager.Services | ||
{ | ||
public class EventSeparatorService | ||
{ | ||
private readonly ICsvImportService _importService; | ||
|
||
public EventSeparatorService(ICsvImportService importService) | ||
{ | ||
_importService = importService; | ||
} | ||
|
||
public async Task Separate(string path, int headerIndex) | ||
{ | ||
List<string> recordEvents = new List<string>(); | ||
|
||
using (CsvReader reader = _importService.GetCsvReader(path)) | ||
{ | ||
await reader.ReadAsync().ConfigureAwait(false); // Make sure that we don't read the header record | ||
while (await reader.ReadAsync().ConfigureAwait(false)) | ||
recordEvents.Add(reader.GetField(headerIndex)); | ||
} | ||
|
||
Dictionary<string, StreamWriter> eventFileWriters = new Dictionary<string, StreamWriter>(); | ||
string fileName = path.Replace(".csv", string.Empty); | ||
|
||
using (StreamReader sr = new StreamReader(path)) | ||
{ | ||
string headerRecord = await sr.ReadLineAsync().ConfigureAwait(false); | ||
|
||
foreach (string rEvent in recordEvents) | ||
{ | ||
if (!eventFileWriters.ContainsKey(rEvent)) | ||
{ | ||
string filePath = fileName + " - " + rEvent + ".csv"; | ||
eventFileWriters.Add(rEvent, new StreamWriter(filePath)); | ||
await eventFileWriters[rEvent].WriteLineAsync(headerRecord).ConfigureAwait(false); | ||
} | ||
string record = await sr.ReadLineAsync().ConfigureAwait(false); | ||
await eventFileWriters[rEvent].WriteLineAsync(record).ConfigureAwait(false); | ||
} | ||
} | ||
|
||
foreach (StreamWriter sw in eventFileWriters.Values) | ||
{ | ||
await sw.FlushAsync().ConfigureAwait(false); | ||
sw.Dispose(); | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.