Test
This commit is contained in:
@@ -23,9 +23,9 @@ namespace DataClients
|
||||
|
||||
public FileClient()
|
||||
{
|
||||
fileClient(@"/archive_rmt/data");
|
||||
//fileClient(@"/archive_rmt/data");
|
||||
//fileClient(@"Y:\data");
|
||||
//fileClient(@"C:\data");
|
||||
fileClient(@"C:\data");
|
||||
}
|
||||
public FileClient(string directory)
|
||||
{
|
||||
|
@@ -17,6 +17,7 @@ namespace DataClients
|
||||
public enum Cmd : uint
|
||||
{
|
||||
check_command = 4294967295,
|
||||
version = 0,
|
||||
pasp_download = 4,
|
||||
download_nh = 21,
|
||||
dir_browse = 23,
|
||||
@@ -68,6 +69,9 @@ namespace DataClients
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case Cmd.version:
|
||||
check_start_mark = false;
|
||||
break;
|
||||
case Cmd.check_command:
|
||||
check_end_mark = false;
|
||||
static_size = 4;
|
||||
@@ -131,7 +135,7 @@ namespace DataClients
|
||||
case 0x00:
|
||||
if (!check_end_mark)
|
||||
throw new Exception("Can't catch all packeges.");
|
||||
if (result.Count == 0)
|
||||
if (result.Count == 0 || code == Cmd.version)
|
||||
return result.ToArray();
|
||||
mark = 0xff;
|
||||
break;
|
||||
|
@@ -24,6 +24,19 @@ namespace DataClients
|
||||
netClient = nc;
|
||||
fileClient = fc;
|
||||
}
|
||||
|
||||
public bool CheckConnection()
|
||||
{
|
||||
var byteStr = netClient.SocketWork(NetClient.Cmd.version);
|
||||
if (byteStr.Length < 1) return false;
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
var enc = Encoding.GetEncoding(866);
|
||||
var version = enc.GetString(byteStr[0]);
|
||||
if (version.Contains("STP TCP Server"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public Pasport GetPasport(string link)
|
||||
{
|
||||
var result = new Pasport();
|
||||
@@ -52,9 +65,9 @@ namespace DataClients
|
||||
} while (flag_err && count_error < 3);
|
||||
return result;
|
||||
}
|
||||
public Tuple<string, string>[] GetListPasport(DateTime date)
|
||||
public (string name, string dir)[] GetListPasport(DateTime date)
|
||||
{
|
||||
var result = new List<Tuple<string, string>>();
|
||||
var result = new List<(string name, string dir)>();
|
||||
var str = date.ToString(@"yyyy\/MM\/dd");
|
||||
var e = netClient.SocketWork(NetClient.Cmd.dir_browse, str);
|
||||
|
||||
@@ -70,8 +83,9 @@ namespace DataClients
|
||||
if (subres.Length > 0) subres = subres + "-";
|
||||
subres = subres + r2[i].Split('.')[0];
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(subres))
|
||||
result.Add(new Tuple<string, string>(subres, str + '/' + r1));
|
||||
result.Add((subres, str + '/' + r1));
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
@@ -89,7 +103,6 @@ namespace DataClients
|
||||
}
|
||||
return STPConverter.AnalogDiscret(resByteMatrix,vdp);
|
||||
}
|
||||
|
||||
public List<IshData> GetIshData(DateTime start, DateTime end, ushort vdp)
|
||||
{
|
||||
var result = new List<IshData>();
|
||||
@@ -179,7 +192,6 @@ namespace DataClients
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<Protect> GetProtectData(DateTime start, DateTime end, ushort vdp)
|
||||
{
|
||||
var result = new List<Protect>();
|
||||
@@ -197,8 +209,6 @@ namespace DataClients
|
||||
} while (cursor <= end);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private byte[] GetFile(DateTime time, ushort vdp, ushort index)
|
||||
{
|
||||
var result = new List<byte>();
|
||||
@@ -330,7 +340,6 @@ namespace DataClients
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static ADresult AnalogDiscret(List<ByteMatrix> adBytes, int vdp)
|
||||
{
|
||||
var result = new ADresult();
|
||||
@@ -373,7 +382,6 @@ namespace DataClients
|
||||
}
|
||||
result.di.Add(di.Key, subRes.ToArray());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -381,7 +389,6 @@ namespace DataClients
|
||||
Console.WriteLine(e.StackTrace);
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
public static List<ByteMatrix> GetADByteMatrix(DateTime time, byte[] arr)
|
||||
|
@@ -521,7 +521,7 @@ namespace DataClients
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString()
|
||||
override public string ToString()
|
||||
{
|
||||
var r = new StringBuilder();
|
||||
r.Append("numVDP:\t"); r.Append(numVDP); r.Append('\n');
|
||||
@@ -571,6 +571,11 @@ namespace DataClients
|
||||
public AnalogsMatrix(int vdp = 0)
|
||||
{
|
||||
matrix.Add(13, new Analog() { min = 0, max = 1000, mul = 0.1, byteId = new ushort[] { 26, 27 } });
|
||||
if (vdp == 50)
|
||||
{
|
||||
matrix.Add(0, new Analog() { min = -10000, max = 10000, mul = 1, byteId = new ushort[] { 0, 1 } });
|
||||
matrix.Add(1, new Analog() { min = -10000, max = 10000, mul = 1, byteId = new ushort[] { 2, 3 } });
|
||||
}
|
||||
}
|
||||
}
|
||||
public class Analog
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -14,11 +14,13 @@
|
||||
"outputPath": "D:\\GIT\\ASCKU_PC\\DataClients\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Microsoft\\Xamarin\\NuGet\\",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\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.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
|
||||
],
|
||||
@@ -31,6 +33,7 @@
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {
|
||||
"D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": {
|
||||
"projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj"
|
||||
@@ -46,6 +49,7 @@
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
@@ -72,7 +76,7 @@
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -86,11 +90,13 @@
|
||||
"outputPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Microsoft\\Xamarin\\NuGet\\",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\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.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
|
||||
],
|
||||
@@ -103,6 +109,7 @@
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
@@ -114,6 +121,7 @@
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
@@ -132,7 +140,7 @@
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -5,12 +5,15 @@
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\google\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\google\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages;C:\Program Files (x86)\Microsoft\Xamarin\NuGet\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.7.0</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="$([MSBuild]::EnsureTrailingSlash($(NuGetPackageFolders)))" />
|
||||
<SourceRoot Include="C:\Users\google\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" />
|
||||
<SourceRoot Include="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -322,7 +322,8 @@
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\google\\.nuget\\packages\\": {},
|
||||
"C:\\Microsoft\\Xamarin\\NuGet\\": {},
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {},
|
||||
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\": {},
|
||||
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
|
||||
},
|
||||
"project": {
|
||||
@@ -335,11 +336,13 @@
|
||||
"outputPath": "D:\\GIT\\ASCKU_PC\\DataClients\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Microsoft\\Xamarin\\NuGet\\",
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
|
||||
"C:\\Program Files (x86)\\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.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
|
||||
],
|
||||
@@ -352,6 +355,7 @@
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"projectReferences": {
|
||||
"D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj": {
|
||||
"projectPath": "D:\\GIT\\ASCKU_PC\\SupportClasses\\SupportClasses.csproj"
|
||||
@@ -367,6 +371,7 @@
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard2.0": {
|
||||
"targetAlias": "netstandard2.0",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": {
|
||||
"suppressParent": "All",
|
||||
@@ -393,7 +398,7 @@
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.403\\RuntimeIdentifierGraph.json"
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "sLKZfVMkCNEVT7uyfvutFp/QvWP0nA+zkfgEmrlynF90hQbh8SrlMNp5eIIAuw5br+yO5vuezeQKEiVCZ9c1Qw==",
|
||||
"dgSpecHash": "uA9rgRXaUEUYoOTmuecMN9sEzQQ9h4wmOmVaX+dlb8QuS5RVxDdEJxCv+xV1gZk+Klv90ZG2LpnZBC8Qo/W4FA==",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\GIT\\ASCKU_PC\\DataClients\\DataClients.csproj",
|
||||
"expectedPackageFiles": [
|
||||
|
Reference in New Issue
Block a user