Edit SZO Mailing
This commit is contained in:
2020-11-18 16:56:28 +05:00
parent 845afe8e75
commit 00c55b8a63
26 changed files with 483 additions and 90 deletions

112
Mailing/SZOEveryday.cs Normal file
View File

@@ -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<SZOWork> GetSZOWorks(DateTime timeStart, DateTime timeEnd, ushort vdp)
{
var result = new List<SZOWork>();
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);
}
}
}

View File

@@ -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"
}
}
}
}
}

View File

@@ -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": {

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "SpajZEf7/VRQUrDXoiTHU8aXoyHn3smrZZdD0UCJW8X2gPLouW0OsXdBb8ylFplsopwQkajR3U66biGjk4fcOQ==",
"dgSpecHash": "aHXTDIdLXP3oCdoTOAZ3VxpMEL7w4L9jxOAPSRPH9V3GgSJDIXxeqEjy8iqnhq7VTeVDHqq2QYHRPL2wp3RrJg==",
"success": true,
"projectFilePath": "D:\\GIT\\ASCKU_PC\\Mailing\\Mailing.csproj",
"expectedPackageFiles": [