Skip to content

Commit

Permalink
Merge pull request #285 from DougSchmidt-AI/feature/PF-1365-NtdnrRepo…
Browse files Browse the repository at this point in the history
…rtingTool

Feature/pf 1365 ntdnr reporting tool
  • Loading branch information
Doug Schmidt authored Feb 3, 2022
2 parents 35629a4 + cbb51cb commit 3e2104f
Show file tree
Hide file tree
Showing 17 changed files with 1,451 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Samples/DotNetSdk/DotNetSdkExamples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{5CD4DD8E-B
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NWFWMD-LabFileImporter", "NWFWMD-LabFileImporter\NWFWMD-LabFileImporter.csproj", "{68A1831C-8662-40F5-B12F-3A4E1A1E72A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObservationReportExporter", "ObservationReportExporter\ObservationReportExporter.csproj", "{8D25D462-6D50-48A1-A5E4-05116EC7B51F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -50,6 +52,10 @@ Global
{68A1831C-8662-40F5-B12F-3A4E1A1E72A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68A1831C-8662-40F5-B12F-3A4E1A1E72A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68A1831C-8662-40F5-B12F-3A4E1A1E72A7}.Release|Any CPU.Build.0 = Release|Any CPU
{8D25D462-6D50-48A1-A5E4-05116EC7B51F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D25D462-6D50-48A1-A5E4-05116EC7B51F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D25D462-6D50-48A1-A5E4-05116EC7B51F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D25D462-6D50-48A1-A5E4-05116EC7B51F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
18 changes: 18 additions & 0 deletions Samples/DotNetSdk/ObservationReportExporter/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.14.0" newVersion="2.0.14.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
27 changes: 27 additions & 0 deletions Samples/DotNetSdk/ObservationReportExporter/Context.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;

namespace ObservationReportExporter
{
public class Context
{
public string SamplesServer { get; set; }
public string SamplesApiToken { get; set; }
public string TimeSeriesServer { get; set; }
public string TimeSeriesUsername { get; set; }
public string TimeSeriesPassword { get; set; }
public string ExportTemplateName { get; set; }
public string AttachmentFilename { get; set; } = "Report.xlsx";
public bool DryRun { get; set; }
public bool DeleteExistingAttachments { get; set; } = true;

public Dictionary<string, string> AttachmentTags { get; } =
new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
public List<string> LocationIds { get; } = new List<string>();
public List<string> LocationGroupIds { get; } = new List<string>();
public List<string> AnalyticalGroupIds { get; } = new List<string>();
public List<string> ObservedPropertyIds { get; } = new List<string>();
public DateTimeOffset? StartTime { get; set; }
public DateTimeOffset? EndTime { get; set; }
}
}
16 changes: 16 additions & 0 deletions Samples/DotNetSdk/ObservationReportExporter/ExeHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Diagnostics;
using System.IO;
using System.Reflection;

namespace ObservationReportExporter
{
public class ExeHelper
{
// ReSharper disable once PossibleNullReferenceException
public static string ExeFullPath => Path.GetFullPath(Assembly.GetEntryAssembly().Location);
public static string ExeDirectory => Path.GetDirectoryName(ExeFullPath);
public static string ExeVersion => FileVersionInfo.GetVersionInfo(ExeFullPath).FileVersion;
public static string ExeName => Path.GetFileNameWithoutExtension(ExeFullPath);
public static string ExeNameAndVersion => $"{ExeName} (v{ExeVersion})";
}
}
12 changes: 12 additions & 0 deletions Samples/DotNetSdk/ObservationReportExporter/ExpectedException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace ObservationReportExporter
{
public class ExpectedException : Exception
{
public ExpectedException(string message)
: base(message)
{
}
}
}
Loading

0 comments on commit 3e2104f

Please sign in to comment.