Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
0.9 alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyLikness committed Jun 5, 2021
1 parent 84a6b82 commit b7179a7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
27 changes: 27 additions & 0 deletions src/Stellinator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,30 @@ IC443
img-0004.tif
```

## Options

The following options are available with Stellinator.

|Short|Long|Default|Description|
|---|---|---|---|
|`-d`|`--directory-only`|`false`|Only scans a single directory; does not recurse subdirectories.|
|`-q`|`--quiet-mode`|`false`|Suppress verbose updates.|
|`-s`|`--scan-only`|`false`|Scan only; show logic but do not copy files.|
|`-i`|`--ignore`|`Nothing`|Choose to ignore files. Combine multiple options by separating them with a comma. Options are:<br>`Nothing`<br>`Rejection` will process rejected files as if they are accepted.<br>`Rejected` will ignore and not copy rejected files.<br>`Jpeg`<br>`Tiff`<br>`AllButLast` will only copy the most recent `.jpeg` and `.tif` from Stellina.|
|`-g`|`--group-strategy`|`Date`|Choose how to group images together. Will create directories based on:<br>`Observation` folder per object<br>`Date` folder per object per date<br>`Capture` folder per capture|
-t, --target-filename-strategy (Default: TicksHex) Choose the strategy to
rename target images. Valid values:
Original, New, Ticks, TicksHex

-n, --new-filename Set the name of target files when using
target filename strategy 'New'.

--help Display this help screen.

--version Display version information.

SourceDirectory (pos. 0) Required. The path to the Stellina USB drive
folder to scan.

TargetDirectory (pos. 1) Required. The path to the root of the target
directory.
5 changes: 3 additions & 2 deletions src/Stellinator/Stellinator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stellinator", "Stellinator\Stellinator.csproj", "{7155F02F-B329-4212-9E02-2C42EEB2DF02}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stellinator", "Stellinator\Stellinator.csproj", "{7155F02F-B329-4212-9E02-2C42EEB2DF02}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AEB6FC62-EA26-4242-BC93-6CF73427971E}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
version.json = version.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StellinatorTests", "StellinatorTests\StellinatorTests.csproj", "{372D73DC-E2AC-462B-AED7-259F057A4A4C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StellinatorTests", "StellinatorTests\StellinatorTests.csproj", "{372D73DC-E2AC-462B-AED7-259F057A4A4C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion src/Stellinator/Stellinator/Configuration/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static IEnumerable<Example> Examples
/// <returns>The list of configured options.</returns>
public override string ToString()
{
var location = GetType().Assembly.Location;
var location = Process.GetCurrentProcess().MainModule.FileName;
var fileVersionInfo = FileVersionInfo.GetVersionInfo(location);
var heading = $"{fileVersionInfo.ProductName} {fileVersionInfo.ProductVersion}";
var copyright = fileVersionInfo.LegalCopyright;
Expand Down
16 changes: 6 additions & 10 deletions src/Stellinator/StellinatorTests/TestFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ public TestFileSystem()
// E:\
// E:\TGT

public void CopyFile(string src, string tgt)
{
}

public void CopyFile(string src, string tgt) => CreateFile(tgt);

public void CreateDirectory(string path)
{
Expand All @@ -45,7 +42,6 @@ public void CreateDirectory(string path)
var dir = idx == 0 ? $"{parts[0]}" :
string.Join(@"\", parts.Take(idx + 1));

dir = Path.GetDirectoryName(dir) ?? dir;
dir = NormalizeDirectory(dir);

if (fileSystem.ContainsKey(dir) == false)
Expand All @@ -67,7 +63,8 @@ public void CreateDirectory(string path)

public void CreateFile(string path)
{
var dir = Path.GetDirectoryName(path);
var dir = NormalizeDirectory(
Path.GetDirectoryName(path));
CreateDirectory(dir);
var file = new FileOrDirectory
{
Expand All @@ -79,8 +76,7 @@ public void CreateFile(string path)

public bool DirectoryExists(string path)
{
var dir = NormalizeDirectory(
Path.GetDirectoryName(path));
var dir = NormalizeDirectory(path);
return fileSystem.ContainsKey(dir);
}

Expand All @@ -91,7 +87,7 @@ public bool FileExists(string path) =>

public string[] GetFiles(string path)
{
var dir = NormalizeDirectory(Path.GetDirectoryName(path));
var dir = NormalizeDirectory(path);
if (fileSystem.ContainsKey(dir))
{
return fileSystem[dir].Where(f => f.isDirectory == false)
Expand All @@ -103,7 +99,7 @@ public string[] GetFiles(string path)

public string[] GetSubdirectories(string path)
{
var dir = NormalizeDirectory(Path.GetDirectoryName(path));
var dir = NormalizeDirectory(path);
if (fileSystem.ContainsKey(dir))
{
return fileSystem[dir].Where(f => f.isDirectory == true)
Expand Down
2 changes: 1 addition & 1 deletion src/Stellinator/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.1.0-alpha",
"version": "0.9.0-alpha",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit b7179a7

Please sign in to comment.