diff --git a/.vs/Projects/DesignTimeBuild/.dtbcache.v2 b/.vs/Projects/DesignTimeBuild/.dtbcache.v2 index 11cc254..67cfeba 100644 Binary files a/.vs/Projects/DesignTimeBuild/.dtbcache.v2 and b/.vs/Projects/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Projects/v16/.suo b/.vs/Projects/v16/.suo index eea4d07..082dc5d 100644 Binary files a/.vs/Projects/v16/.suo and b/.vs/Projects/v16/.suo differ diff --git a/DataClients/FileClient.cs b/DataClients/FileClient.cs index 56a79cf..013bb4b 100644 --- a/DataClients/FileClient.cs +++ b/DataClients/FileClient.cs @@ -5,25 +5,36 @@ using System.Collections.Generic; using System.IO; using System.Text; using System.Threading; +using SupportClasses; namespace DataClients { public class FileClient { - private char split = '/'; - //private char split = '\\'; + private char split = _Directory.Slash; //private string dir = @"Y:\data"; //private string dir = @"C:\data"; - private string dir = @"/archive_rmt/data"; + private string dir; + public string Dir { + get { return dir; } + set { dir = value; } + } + public FileClient() { - TempDir.StartCkeckDir(); + fileClient(@"/archive_rmt/data"); + //fileClient(@"Y:\data"); + //fileClient(@"C:\data"); } public FileClient(string directory) + { + fileClient(directory); + } + private void fileClient(string directory) { TempDir.StartCkeckDir(); - dir = directory; + Dir = directory; } public byte[] GetFile(DateTime time, ushort vdp, ushort index) @@ -39,36 +50,38 @@ namespace DataClients if (!TempDir.IsExist(name)) return new byte[0]; while (TempDir.IsProtect(name)) Thread.Sleep(1000); TempDir.AddProtect(name); - Stream fs = File.OpenRead(tmpFileName); - var result = new List(); - try + using (var fs = (Stream)File.OpenRead(tmpFileName)) { - for (var i = 0; i < fs.Length; i++) - result.Add((byte)fs.ReadByte()); - return result.ToArray(); - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Console.WriteLine(e.StackTrace); - return new byte[0]; - } - finally - { - TempDir.RemoveProtect(name); - fs.Close(); + var result = new List(); + try + { + for (var i = 0; i < fs.Length; i++) + result.Add((byte)fs.ReadByte()); + return result.ToArray(); + } + catch (Exception e) + { + Logger.Add("Can't read file: " + name, Logger.Level.error); + Logger.Add(e.Message, Logger.Level.error); + Logger.Add(e.StackTrace, Logger.Level.error); + return new byte[0]; + } + finally + { + TempDir.RemoveProtect(name); + } } } private bool CheckArchive(DateTime time, ushort vdp) { - var tmp = + var a = dir + split + time.Year.ToString("D4") + split + time.Month.ToString("D2") + split + time.Day.ToString("D2") + split + vdp.ToString("D2"); - return (File.Exists(tmp + ".tar") || File.Exists(tmp + ".tar.gz")); + return (File.Exists(a + ".tar") || File.Exists(a + ".tar.gz")); } private bool ExtractArchive(DateTime time, ushort vdp) { @@ -92,45 +105,34 @@ namespace DataClients } private void ExtractTarGZ(String gzArchiveName, String destFolder) { - Stream inStream = File.OpenRead(gzArchiveName); - Stream gzipStream = new GZipInputStream(inStream); - try - { - TarArchive tarArchive = TarArchive.CreateInputTarArchive(gzipStream); - tarArchive.ExtractContents(destFolder); - tarArchive.Close(); - } - catch (Exception e) - { - Console.WriteLine("Can't extract: " + gzArchiveName); - Console.WriteLine(e.Message); - Console.WriteLine(e.StackTrace); - } - finally - { - gzipStream.Close(); - inStream.Close(); - } + using (var a = (Stream)File.OpenRead(gzArchiveName)) + using (var b = (Stream)new GZipInputStream(a)) + try + { + using (var c = TarArchive.CreateInputTarArchive(b)) + c.ExtractContents(destFolder); + } + catch (Exception e) + { + Logger.Add("Can't extract: " + gzArchiveName, Logger.Level.error); + Logger.Add(e.Message, Logger.Level.error); + Logger.Add(e.StackTrace, Logger.Level.error); + } } private void ExtractTar(String tarFileName, String destFolder) { - Stream inStream = File.OpenRead(tarFileName); - try - { - TarArchive tarArchive = TarArchive.CreateInputTarArchive(inStream); - tarArchive.ExtractContents(destFolder); - tarArchive.Close(); - } - catch (Exception e) - { - Console.WriteLine("Can't extract: " + tarFileName); - Console.WriteLine(e.Message); - Console.WriteLine(e.StackTrace); - } - finally - { - inStream.Close(); - } + using (var a = (Stream)File.OpenRead(tarFileName)) + try + { + using (var b = TarArchive.CreateInputTarArchive(a)) + b.ExtractContents(destFolder); + } + catch (Exception e) + { + Logger.Add("Can't extract: " + tarFileName, Logger.Level.error); + Logger.Add(e.Message, Logger.Level.error); + Logger.Add(e.StackTrace, Logger.Level.error); + } } } } diff --git a/DataClients/STPClient.cs b/DataClients/STPClient.cs index 54853be..5b4e26d 100644 --- a/DataClients/STPClient.cs +++ b/DataClients/STPClient.cs @@ -19,6 +19,11 @@ namespace DataClients netClient = new NetClient(); fileClient = new FileClient(); } + public STPClient(NetClient nc, FileClient fc) + { + netClient = nc; + fileClient = fc; + } public Pasport GetPasport(string link) { var result = new Pasport(); @@ -107,28 +112,26 @@ namespace DataClients var result = new List(); var cursor = start; byte[] subRes = new byte[0]; - do - { - cursor = cursor.AddDays(-1); - subRes = GetFile(cursor, vdp, 3); - } while (subRes.Length == 0 && cursor > start.AddDays(-10)); - - TechCycle a = new TechCycle() + TechCycle currTechCycle = new TechCycle() { start = start, index = TechCycle.Operation.unloading_loading }; + do + { + cursor = cursor.AddDays(-1); + subRes = GetFile(cursor, vdp, 3); + } while (subRes.Length == 0 && cursor > start.AddDays(-10)); + { if (subRes.Length > 0) { var b = STPConverter.TechCycle(subRes); - if (b.Length > 0) a = b.Last(); + if (b.Length > 0) currTechCycle = b.Last(); } - a.start = start; } - cursor = start.AddDays(-1); do { cursor = cursor.AddDays(1); @@ -138,23 +141,42 @@ namespace DataClients { if (e.start <= start) { - a = e; + currTechCycle = e; continue; } if (e.start >= end) { - a.end = end; - result.Add(a); + currTechCycle.end = e.start; + result.Add(currTechCycle); + currTechCycle = e; break; } if (e.start > start && e.start < end) { - a.end = e.start; - result.Add(a); - a = e; + currTechCycle.end = e.start; + if (result.Count > 0 && result[result.Count - 1].index == currTechCycle.index) + result[result.Count - 1].end = currTechCycle.end; + else + result.Add(currTechCycle); + currTechCycle = e; } } + } while (cursor <= end); + + { + if (result.Count == 0) + { + currTechCycle.start = start; + currTechCycle.end = end; + result.Add(currTechCycle); + } + else if (result[result.Count - 1].end < end) + { + currTechCycle.end = end; + result.Add(currTechCycle); + } + } return result; } @@ -246,6 +268,7 @@ namespace DataClients var cycle = new TechCycle(); cycle.index = (DataClients.TechCycle.Operation)UInt32.Parse(substr[0]); cycle.start = Converter.ConvertUnixTimeToDateTime(Int32.Parse(substr[2])); + if (result.Count > 0) result[result.Count - 1].end = cycle.start; result.Add(cycle); } return result.ToArray(); diff --git a/DataClients/TempDir.cs b/DataClients/TempDir.cs index 74ec1c4..44a7a15 100644 --- a/DataClients/TempDir.cs +++ b/DataClients/TempDir.cs @@ -1,4 +1,5 @@ -using System; +using SupportClasses; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -10,7 +11,7 @@ namespace DataClients { public static class TempDir { - private static readonly char split = '/'; + private static readonly char split = _Directory.Slash; private static string dir = Directory.GetCurrentDirectory() + split + "temp"; private static List protect = new List(); private static Task checkTask = null; diff --git a/DataClients/obj/DataClients.csproj.nuget.dgspec.json b/DataClients/obj/DataClients.csproj.nuget.dgspec.json index 151c6bc..4926904 100644 --- a/DataClients/obj/DataClients.csproj.nuget.dgspec.json +++ b/DataClients/obj/DataClients.csproj.nuget.dgspec.json @@ -31,7 +31,11 @@ }, "frameworks": { "netstandard2.0": { - "projectReferences": {} + "projectReferences": { + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj" + } + } } }, "warningProperties": { @@ -71,6 +75,66 @@ "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" } } + }, + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj", + "projectName": "SupportClasses", + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" + } + } } } } \ No newline at end of file diff --git a/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache b/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache index b4c9863..c09430e 100644 Binary files a/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache and b/DataClients/obj/Debug/netstandard2.0/DataClients.csprojAssemblyReference.cache differ diff --git a/DataClients/obj/project.assets.json b/DataClients/obj/project.assets.json index a0f2f4c..4f932a5 100644 --- a/DataClients/obj/project.assets.json +++ b/DataClients/obj/project.assets.json @@ -61,6 +61,16 @@ "rid": "win" } } + }, + "SupportClasses/1.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "compile": { + "bin/placeholder/SupportClasses.dll": {} + }, + "runtime": { + "bin/placeholder/SupportClasses.dll": {} + } } } }, @@ -295,12 +305,18 @@ "useSharedDesignerContext.txt", "version.txt" ] + }, + "SupportClasses/1.0.0": { + "type": "project", + "path": "../SupportClasses/SupportClasses.csproj", + "msbuildProject": "../SupportClasses/SupportClasses.csproj" } }, "projectFileDependencyGroups": { ".NETStandard,Version=v2.0": [ "NETStandard.Library >= 2.0.3", "SharpZipLib >= 1.2.0", + "SupportClasses >= 1.0.0", "System.Text.Encoding.CodePages >= 4.7.1" ] }, @@ -336,7 +352,11 @@ }, "frameworks": { "netstandard2.0": { - "projectReferences": {} + "projectReferences": { + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj" + } + } } }, "warningProperties": { diff --git a/DataClients/obj/project.nuget.cache b/DataClients/obj/project.nuget.cache index f7b6e36..da91414 100644 --- a/DataClients/obj/project.nuget.cache +++ b/DataClients/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "7BT9QmMgOwS6t99cv7fCXOBzEuqVwmhl2HP4ljC3vr6o2Uq2GZQULmiLXAJ9NJ7T4nDLaRlmIbUCNZp+mmA0Dw==", + "dgSpecHash": "sLKZfVMkCNEVT7uyfvutFp/QvWP0nA+zkfgEmrlynF90hQbh8SrlMNp5eIIAuw5br+yO5vuezeQKEiVCZ9c1Qw==", "success": true, "projectFilePath": "D:\\GIT\\ASCKU_PC\\DataClients\\DataClients.csproj", "expectedPackageFiles": [ diff --git a/Mailing/SZOEveryday.cs b/Mailing/SZOEveryday.cs new file mode 100644 index 0000000..0314b6e --- /dev/null +++ b/Mailing/SZOEveryday.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using DataClients; + +namespace Mailing +{ + public class SZOWork + { + public TechCycle tc = new TechCycle(); + public DateTime tStart = DateTime.Now; + public DateTime tEnd = DateTime.Now; + public TimeSpan workTime + { + get + { + return tEnd - tStart; + } + } + } + + public static class SZOEveryday + { + public static List GetSZOWorks(DateTime timeStart, DateTime timeEnd, ushort vdp) + { + var result = new List(); + var a = new STPClient(); + int[] chk1 = { + (int)TechCycle.Operation.cooling_ingot, + (int)TechCycle.Operation.cooling_reflow, + (int)TechCycle.Operation.cooling_welding + }; + int[] chk2 = + { + (int)TechCycle.Operation.end_tech_cycle, + (int)TechCycle.Operation.unloading_loading, + (int)TechCycle.Operation.looking_welding, + (int)TechCycle.Operation.unloading_kit + }; + + var tc = a.GetTechCycle(timeStart, timeEnd, vdp); + var ad = a.GetAnalogDiscret(timeStart, timeEnd, vdp); + foreach(var cycle in tc) + { + if (!chk1.Contains((int)cycle.index) && !chk2.Contains((int)cycle.index)) + continue; + if (chk1.Contains((int)cycle.index)) + { + var test = + (from l in ad.an[13] + where l.Item1 >= cycle.start && + l.Item1 <= cycle.end && + l.Item2 >= 30 + select l).ToArray(); + if (test.Length == 0) + continue; + } + + for(var i = 0; i < ad.di[22].Length; i++) + { + var ts = ad.di[22][i].Item1; + var te = (i == ad.di[22].Length) ? + (ad.di[22][i].Item1 < timeEnd) ? + timeEnd : + ad.di[22][i].Item1 : + ad.di[22][i + 1].Item1; + var v = ad.di[22][i].Item2; + + if ( + ts <= cycle.end && + te >= cycle.start && + v.HasValue && + v.Value + ) + { + var t1 = ts > cycle.start ? ts : cycle.start; + var t2 = te > cycle.end ? cycle.end : te; + var res = t2 - t1; + if (res.TotalMinutes < 15) + continue; + result.Add(new SZOWork() + { + tc = cycle, + tStart = t1, + tEnd = t2 + }); + } + } + } + return result; + } + + + + + + public static void GetPDF(DateTime time) + { + timeStart = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0); + timeEnd = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0).AddDays(1); + GetData(); + PDFGenSZO.AddHeader("Контроль работы водокольцевых насосов SZO ", timeStart, timeEnd); + foreach (var e in resFull) + PDFGenSZO.AddSZOTable(e.Key, e.Value); + PDFGenSZO.AddTotalTime(); + PDFGenSZO.Print(time); + } + + + } +} diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache index 8ab6fe7..c789d1e 100644 Binary files a/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.assets.cache differ diff --git a/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache index 4aefce3..7d35cb8 100644 Binary files a/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache and b/Mailing/obj/Debug/netcoreapp3.1/Mailing.csprojAssemblyReference.cache differ diff --git a/Mailing/obj/Mailing.csproj.nuget.dgspec.json b/Mailing/obj/Mailing.csproj.nuget.dgspec.json index d808594..0240ff7 100644 --- a/Mailing/obj/Mailing.csproj.nuget.dgspec.json +++ b/Mailing/obj/Mailing.csproj.nuget.dgspec.json @@ -31,7 +31,11 @@ }, "frameworks": { "netstandard2.0": { - "projectReferences": {} + "projectReferences": { + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj" + } + } } }, "warningProperties": { @@ -417,6 +421,66 @@ "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" } } + }, + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj", + "projectName": "SupportClasses", + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" + } + } } } } \ No newline at end of file diff --git a/Mailing/obj/project.assets.json b/Mailing/obj/project.assets.json index 7c47bb2..ce438fa 100644 --- a/Mailing/obj/project.assets.json +++ b/Mailing/obj/project.assets.json @@ -84,6 +84,7 @@ "framework": ".NETStandard,Version=v2.0", "dependencies": { "SharpZipLib": "1.2.0", + "SupportClasses": "1.0.0", "System.Text.Encoding.CodePages": "4.7.1" }, "compile": { @@ -148,6 +149,16 @@ "runtime": { "bin/placeholder/PdfSharp.Charting.dll": {} } + }, + "SupportClasses/1.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "compile": { + "bin/placeholder/SupportClasses.dll": {} + }, + "runtime": { + "bin/placeholder/SupportClasses.dll": {} + } } } }, @@ -305,6 +316,11 @@ "type": "project", "path": "../PdfSharp.Charting/PdfSharp.Charting.csproj", "msbuildProject": "../PdfSharp.Charting/PdfSharp.Charting.csproj" + }, + "SupportClasses/1.0.0": { + "type": "project", + "path": "../SupportClasses/SupportClasses.csproj", + "msbuildProject": "../SupportClasses/SupportClasses.csproj" } }, "projectFileDependencyGroups": { diff --git a/Mailing/obj/project.nuget.cache b/Mailing/obj/project.nuget.cache index 28a7b79..fedc1b5 100644 --- a/Mailing/obj/project.nuget.cache +++ b/Mailing/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "SpajZEf7/VRQUrDXoiTHU8aXoyHn3smrZZdD0UCJW8X2gPLouW0OsXdBb8ylFplsopwQkajR3U66biGjk4fcOQ==", + "dgSpecHash": "aHXTDIdLXP3oCdoTOAZ3VxpMEL7w4L9jxOAPSRPH9V3GgSJDIXxeqEjy8iqnhq7VTeVDHqq2QYHRPL2wp3RrJg==", "success": true, "projectFilePath": "D:\\GIT\\ASCKU_PC\\Mailing\\Mailing.csproj", "expectedPackageFiles": [ diff --git a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache index f060efc..5816fbc 100644 Binary files a/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache and b/MigraDoc.DocumentObjectModel/obj/Debug/netstandard2.0/MigraDoc.DocumentObjectModel.csprojAssemblyReference.cache differ diff --git a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache index 1d2cf79..b7360ce 100644 Binary files a/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache and b/MigraDoc.Rendering/obj/Debug/netstandard2.0/MigraDoc.Rendering.csprojAssemblyReference.cache differ diff --git a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache index fa6bea5..ce56f24 100644 Binary files a/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache and b/PdfSharp.Charting/obj/Debug/netstandard2.0/PdfSharp.Charting.csprojAssemblyReference.cache differ diff --git a/SupportClasses/Directory.cs b/SupportClasses/Directory.cs index 7fc6300..09e5dc3 100644 --- a/SupportClasses/Directory.cs +++ b/SupportClasses/Directory.cs @@ -3,13 +3,14 @@ using System.IO; namespace SupportClasses { - public static class Direct + public static class _Directory { public static char Slash { get { - if (Environment.OSVersion.Platform == PlatformID.Unix) + var p = (int)Environment.OSVersion.Platform; + if ((p == 4) || (p == 6) || (p == 128)) return '/'; else return '\\'; @@ -21,9 +22,9 @@ namespace SupportClasses { get { - if (String.IsNullOrEmpty(tempDir)) + if (string.IsNullOrEmpty(tempDir)) { - tempDir = Directory.GetCurrentDirectory() + Direct.Slash + "temp"; + tempDir = Directory.GetCurrentDirectory() + Slash + "temp"; Directory.CreateDirectory(tempDir); } return tempDir; diff --git a/SupportClasses/Logger.cs b/SupportClasses/Logger.cs index dfe5214..462d86e 100644 --- a/SupportClasses/Logger.cs +++ b/SupportClasses/Logger.cs @@ -1,11 +1,21 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text; namespace SupportClasses { public static class Logger { - public enum Level { info,} + public enum Level { fatal, error, warning, info, debug}; + public static Level[] show = { Level.info, Level.warning, Level.debug}; + public static void Add (string msg, Level l = Level.info) + { + if (show.Contains(l)) + { + Console.Write(DateTime.Now.ToString(@"yyyy.MM.dd HH:mm:ss.ff") + "\t"); + Console.WriteLine(msg); + } + } } } diff --git a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache index 4a57151..b3a2a55 100644 Binary files a/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache and b/SupportClasses/obj/Debug/netstandard2.0/SupportClasses.csprojAssemblyReference.cache differ diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache index f755dcd..5799b0d 100644 Binary files a/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache and b/Tests/obj/Debug/netcoreapp3.1/Tests.assets.cache differ diff --git a/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache b/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache index 17d315f..44fdfc3 100644 Binary files a/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache and b/Tests/obj/Debug/netcoreapp3.1/Tests.csprojAssemblyReference.cache differ diff --git a/Tests/obj/Tests.csproj.nuget.dgspec.json b/Tests/obj/Tests.csproj.nuget.dgspec.json index 7e138e0..f91ceff 100644 --- a/Tests/obj/Tests.csproj.nuget.dgspec.json +++ b/Tests/obj/Tests.csproj.nuget.dgspec.json @@ -31,7 +31,11 @@ }, "frameworks": { "netstandard2.0": { - "projectReferences": {} + "projectReferences": { + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj" + } + } } }, "warningProperties": { @@ -418,6 +422,66 @@ } } }, + "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj", + "projectName": "SupportClasses", + "projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj", + "packagesPath": "C:\\Users\\google\\.nuget\\packages\\", + "outputPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\", + "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" + ], + "configFilePaths": [ + "C:\\Users\\google\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "netstandard2.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.0": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netstandard2.0": { + "dependencies": { + "NETStandard.Library": { + "suppressParent": "All", + "target": "Package", + "version": "[2.0.3, )", + "autoReferenced": true + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json" + } + } + }, "D:\\GIT\\ASCKU_PC\\Tests\\Tests.csproj": { "version": "1.0.0", "restore": { diff --git a/Tests/obj/project.assets.json b/Tests/obj/project.assets.json index 0db9ddf..4cb9fee 100644 --- a/Tests/obj/project.assets.json +++ b/Tests/obj/project.assets.json @@ -84,6 +84,7 @@ "framework": ".NETStandard,Version=v2.0", "dependencies": { "SharpZipLib": "1.2.0", + "SupportClasses": "1.0.0", "System.Text.Encoding.CodePages": "4.7.1" }, "compile": { @@ -165,6 +166,16 @@ "runtime": { "bin/placeholder/PdfSharp.Charting.dll": {} } + }, + "SupportClasses/1.0.0": { + "type": "project", + "framework": ".NETStandard,Version=v2.0", + "compile": { + "bin/placeholder/SupportClasses.dll": {} + }, + "runtime": { + "bin/placeholder/SupportClasses.dll": {} + } } } }, @@ -327,6 +338,11 @@ "type": "project", "path": "../PdfSharp.Charting/PdfSharp.Charting.csproj", "msbuildProject": "../PdfSharp.Charting/PdfSharp.Charting.csproj" + }, + "SupportClasses/1.0.0": { + "type": "project", + "path": "../SupportClasses/SupportClasses.csproj", + "msbuildProject": "../SupportClasses/SupportClasses.csproj" } }, "projectFileDependencyGroups": { diff --git a/Tests/obj/project.nuget.cache b/Tests/obj/project.nuget.cache index 375e738..0ef0ede 100644 --- a/Tests/obj/project.nuget.cache +++ b/Tests/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "bgcV9wNTqjPJ+z+j2HnkfQSdCVelCqwYd1WkmQSoLDFRHDbnRNexT7l1lQZ5ipiwzaqTKo+QW7rZKfEU5GiVcQ==", + "dgSpecHash": "/uQWWLVSo6XokPZZUrTOSR8rFH5d2Vvq9lYHOcuqdChMgd7SVFHxYZsKAf9wrUNUGjeQpa1buFJ4tgUKP5t3fg==", "success": true, "projectFilePath": "D:\\GIT\\ASCKU_PC\\Tests\\Tests.csproj", "expectedPackageFiles": [