This commit is contained in:
Georgy Khatuncev 2021-05-18 09:14:14 +05:00
parent d771cf45e5
commit dd34aea664
16 changed files with 186 additions and 139 deletions

@ -1,24 +1,25 @@
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {} "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {}
}, },
"projects": { "projects": {
"G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": { "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj", "projectUniqueName": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectName": "GenerateVDPCycle", "projectName": "GenerateVDPCycle",
"projectPath": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj", "projectPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\", "packagesPath": "C:\\Users\\google\\.nuget\\packages\\",
"outputPath": "G:\\Diagram-API\\GenerateVDPCycle\\obj\\", "outputPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages", "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\" "C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
], ],
"configFilePaths": [ "configFilePaths": [
"C:\\Users\\Admin\\AppData\\Roaming\\NuGet\\NuGet.Config", "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.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
@ -70,7 +71,7 @@
"privateAssets": "all" "privateAssets": "all"
} }
}, },
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.200\\RuntimeIdentifierGraph.json" "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
} }
} }
} }

@ -5,14 +5,15 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Admin\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages;C:\Program Files (x86)\Microsoft\Xamarin\NuGet\</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> <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.0</NuGetToolVersion> <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.0</NuGetToolVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Admin\.nuget\packages\" /> <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 Visual Studio\Shared\NuGetPackages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" /> <SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" />
<SourceRoot Include="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>

@ -869,25 +869,27 @@
] ]
}, },
"packageFolders": { "packageFolders": {
"C:\\Users\\Admin\\.nuget\\packages\\": {}, "C:\\Users\\google\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}, "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {},
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\": {} "C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
}, },
"project": { "project": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj", "projectUniqueName": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectName": "GenerateVDPCycle", "projectName": "GenerateVDPCycle",
"projectPath": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj", "projectPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\", "packagesPath": "C:\\Users\\google\\.nuget\\packages\\",
"outputPath": "G:\\Diagram-API\\GenerateVDPCycle\\obj\\", "outputPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages", "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\" "C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
], ],
"configFilePaths": [ "configFilePaths": [
"C:\\Users\\Admin\\AppData\\Roaming\\NuGet\\NuGet.Config", "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.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
@ -939,7 +941,7 @@
"privateAssets": "all" "privateAssets": "all"
} }
}, },
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.200\\RuntimeIdentifierGraph.json" "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
} }
} }
} }

@ -1,34 +1,34 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "dJ5Zqs54MpkjiW1NERaYHKfRgGQP65O4keUR9GNguaynUdNiO69AuZXAqASCwpzj1hMK/KJxIfErvoq3wS3lUw==", "dgSpecHash": "Dd4oBL4kr/THFI4/m4VlSCVmKH5MsMtnD9Qkqx9QLuVOE2Ahss9C78Lj/BGnHydjB0CcIZ376mAH9wC4PMI6ww==",
"success": true, "success": true,
"projectFilePath": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj", "projectFilePath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.1\\microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.1\\microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.bcl.hashcode\\1.1.0\\microsoft.bcl.hashcode.1.1.0.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.bcl.hashcode\\1.1.0\\microsoft.bcl.hashcode.1.1.0.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.csharp\\4.5.0\\microsoft.csharp.4.5.0.nupkg.sha512", "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.csharp\\4.5.0\\microsoft.csharp.4.5.0.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.entityframeworkcore\\3.1.8\\microsoft.entityframeworkcore.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.entityframeworkcore\\3.1.8\\microsoft.entityframeworkcore.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.entityframeworkcore.abstractions\\3.1.8\\microsoft.entityframeworkcore.abstractions.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.entityframeworkcore.abstractions\\3.1.8\\microsoft.entityframeworkcore.abstractions.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.entityframeworkcore.analyzers\\3.1.8\\microsoft.entityframeworkcore.analyzers.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.entityframeworkcore.analyzers\\3.1.8\\microsoft.entityframeworkcore.analyzers.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.entityframeworkcore.relational\\3.1.8\\microsoft.entityframeworkcore.relational.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.entityframeworkcore.relational\\3.1.8\\microsoft.entityframeworkcore.relational.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\3.1.8\\microsoft.extensions.caching.abstractions.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.caching.abstractions\\3.1.8\\microsoft.extensions.caching.abstractions.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.caching.memory\\3.1.8\\microsoft.extensions.caching.memory.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.caching.memory\\3.1.8\\microsoft.extensions.caching.memory.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.configuration\\3.1.8\\microsoft.extensions.configuration.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.configuration\\3.1.8\\microsoft.extensions.configuration.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.configuration.abstractions\\3.1.8\\microsoft.extensions.configuration.abstractions.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.configuration.abstractions\\3.1.8\\microsoft.extensions.configuration.abstractions.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.configuration.binder\\3.1.8\\microsoft.extensions.configuration.binder.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.configuration.binder\\3.1.8\\microsoft.extensions.configuration.binder.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\3.1.8\\microsoft.extensions.dependencyinjection.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.dependencyinjection\\3.1.8\\microsoft.extensions.dependencyinjection.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\3.1.8\\microsoft.extensions.dependencyinjection.abstractions.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\3.1.8\\microsoft.extensions.dependencyinjection.abstractions.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.logging\\3.1.8\\microsoft.extensions.logging.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.logging\\3.1.8\\microsoft.extensions.logging.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\3.1.8\\microsoft.extensions.logging.abstractions.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\3.1.8\\microsoft.extensions.logging.abstractions.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.options\\3.1.8\\microsoft.extensions.options.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.options\\3.1.8\\microsoft.extensions.options.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\microsoft.extensions.primitives\\3.1.8\\microsoft.extensions.primitives.3.1.8.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\microsoft.extensions.primitives\\3.1.8\\microsoft.extensions.primitives.3.1.8.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\mysqlconnector\\0.69.10\\mysqlconnector.0.69.10.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\mysqlconnector\\0.69.10\\mysqlconnector.0.69.10.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\newtonsoft.json\\11.0.2\\newtonsoft.json.11.0.2.nupkg.sha512", "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\newtonsoft.json\\11.0.2\\newtonsoft.json.11.0.2.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\pomelo.entityframeworkcore.mysql\\3.2.4\\pomelo.entityframeworkcore.mysql.3.2.4.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\pomelo.entityframeworkcore.mysql\\3.2.4\\pomelo.entityframeworkcore.mysql.3.2.4.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\pomelo.jsonobject\\2.2.1\\pomelo.jsonobject.2.2.1.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\pomelo.jsonobject\\2.2.1\\pomelo.jsonobject.2.2.1.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\system.collections.immutable\\1.7.1\\system.collections.immutable.1.7.1.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\system.collections.immutable\\1.7.1\\system.collections.immutable.1.7.1.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\system.componentmodel.annotations\\4.7.0\\system.componentmodel.annotations.4.7.0.nupkg.sha512", "C:\\Users\\google\\.nuget\\packages\\system.componentmodel.annotations\\4.7.0\\system.componentmodel.annotations.4.7.0.nupkg.sha512",
"C:\\Users\\Admin\\.nuget\\packages\\system.diagnostics.diagnosticsource\\4.7.1\\system.diagnostics.diagnosticsource.4.7.1.nupkg.sha512" "C:\\Users\\google\\.nuget\\packages\\system.diagnostics.diagnosticsource\\4.7.1\\system.diagnostics.diagnosticsource.4.7.1.nupkg.sha512"
], ],
"logs": [] "logs": []
} }

@ -162,7 +162,7 @@
</site> </site>
<site name="Diagram-Canvas" id="2"> <site name="Diagram-Canvas" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool"> <application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="E:\GIT\diplom_vova\Diagram-Canvas" /> <virtualDirectory path="/" physicalPath="D:\GIT\diplom_vova\Diagram-Canvas" />
</application> </application>
<bindings> <bindings>
<binding protocol="http" bindingInformation="*:57940:localhost" /> <binding protocol="http" bindingInformation="*:57940:localhost" />

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
//Основной прямоугольник //Основной прямоугольник
var rAll = new Rectangle(x, y, w, h); var rAll = new Rectangle(x, y, w, h);
//Текущий статус по простою //Текущий статус по простою
var prostoy = false; var prostoy = true;
/*Проценты поднимаются снизу вверх (false) /*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/ *или слева направо (true)*/
var rotate = false; var rotate = false;

@ -8,7 +8,7 @@
//Проценты статуса //Проценты статуса
var percent = 0; var percent = 0;
//Номер статуса //Номер статуса
var status = 0; var status = -1;
/*Проценты поднимаются снизу вверх (false) /*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/ *или слева направо (true)*/
var rotate = false; var rotate = false;
@ -41,7 +41,7 @@
this.Status = function (val) { this.Status = function (val) {
if (val === undefined) return status; if (val === undefined) return status;
var v = parseInt(val); var v = parseInt(val);
status = (isNaN(v) || v < 0 || rStat.length === 0) ? 0 : status = (isNaN(v) || v < -1 || rStat.length === 0) ? -1 :
(v >= rStat.length) ? (rStat.length - 1) : v; (v >= rStat.length) ? (rStat.length - 1) : v;
}; };
//Функция изменения начальной координаты и размеров прямоугольника //Функция изменения начальной координаты и размеров прямоугольника

@ -81,7 +81,7 @@ but2.onclick = function () {
else else
for (var k = 0; k < count; k++) for (var k = 0; k < count; k++)
t.AddRStat(k, arrPoint[k], arrColor[k]); t.AddRStat(k, arrPoint[k], arrColor[k]);
t.Status(Math.floor(Math.random() * t.StatCount())); t.Status(Math.floor(Math.random() * (t.StatCount() + 1) - 1));
t.Percent(Math.random() * 101); t.Percent(Math.random() * 101);
t.Print(ctx); t.Print(ctx);
if (chkText.checked) if (chkText.checked)

@ -19,7 +19,7 @@
Время клиента: <span id="DateClient">2018.02.27 08:41:24</span> Время клиента: <span id="DateClient">2018.02.27 08:41:24</span>
</div> </div>
<div class="col-12 col-lg-4 text-center"> <div class="col-12 col-lg-4 text-center">
Время сервер: <span id="DateServer"></span> Время сервера: <span id="DateServer"></span>
</div> </div>
<div class="col-12 col-lg-4 text-center"> <div class="col-12 col-lg-4 text-center">
Время синхр.: <span id="DateSynch"></span> Время синхр.: <span id="DateSynch"></span>

@ -3,79 +3,114 @@ var htmlDateClient = document.getElementById("DateClient");
var htmlDateServer = document.getElementById("DateServer"); var htmlDateServer = document.getElementById("DateServer");
var htmlDateSynch = document.getElementById("DateSynch"); var htmlDateSynch = document.getElementById("DateSynch");
var htmlErrMSG = document.getElementById("Error_Message");
var canvas = document.getElementsByTagName("canvas")[0]; var canvas = document.getElementsByTagName("canvas")[0];
var ctx = canvas.getContext("2d"); var ctx = canvas.getContext("2d");
var diagram = new Diagram(0, 0, canvas.width, canvas.height); var diagram = new Diagram(0, 0, canvas.width, canvas.height);
diagram.BuildDefault();
diagram.Cycle(true);
var update_button = document.getElementById("Update_Button"); var update_button = document.getElementById("Update_Button");
//Global Params //Global Params
//Start Show Date Now //Show Date Now \/ \/ \/
function FNL(a, b) { for (var d = "" + a; d.length < b;)d = "0" + d; return d } function FNL(a, b) { for (var d = "" + a; d.length < b;)d = "0" + d; return d }
function DateToString(date) { return date.getFullYear() + "." + FNL(date.getMonth() + 1, 2) + "." + FNL(date.getDate(), 2) + " " + FNL(date.getHours(), 2) + ":" + FNL(date.getMinutes(), 2) + ":" + FNL(date.getSeconds(), 2); } function DateToString(date) { return date.getFullYear() + "." + FNL(date.getMonth() + 1, 2) + "." + FNL(date.getDate(), 2) + " " + FNL(date.getHours(), 2) + ":" + FNL(date.getMinutes(), 2) + ":" + FNL(date.getSeconds(), 2); }
var dateClient = null; var dateClient = null;
var dateServer = null; var dateServer = null;
var dateSynch = null;
function PrintDateNow() { function PrintDateNow() {
var tmp = new Date(); var dn = new Date();
htmlDateClient.innerHTML = DateToString(tmp); if (dateServer !== null && dateClient !== null)
if (dateServer !== null) dateServer.setMilliseconds(dateServer.getMilliseconds() + (dn - dateClient));
if (dateClient !== null)
tmp =
htmlDateServer.innerHTML = timeNow;
htmlDateSynch.innerHTML = timeNow;
dateClient = dn;
htmlDateClient.innerHTML = DateToString(dateClient);
if (dateServer != null)
htmlDateServer.innerHTML = DateToString(dateServer);
if (dateSynch !== null)
htmlDateSynch.innerHTML = DateToString(dateSynch);
setTimeout(PrintDateNow, 1000); setTimeout(PrintDateNow, 1000);
} }
function updateDateServer(date) {
if (typeof date.getMonth === 'function') {
dateClient = null;
dateServer = date;
} else
dateServer = null;
}
function updateDateSynch(date) {
if (typeof date.getMonth === 'function') {
dateSynch = date;
} else
dateSynch = null;
}
PrintDateNow(); PrintDateNow();
/* //Show Date Now /\ /\ /\
//End Show Date Now
//Start Resize Canvas //Resize Canvas \/ \/ \/
function Resize() { function Resize() {
if (window.innerWidth > window.innerHeight) { if (window.innerWidth > window.innerHeight) {
canvas.height = window.innerHeight - 20 canvas.height =
window.innerHeight - 20
- document.getElementById("First_Head").offsetHeight - document.getElementById("First_Head").offsetHeight
- document.getElementById("Second_Head").offsetHeight - document.getElementById("Second_Head").offsetHeight
- document.getElementById("Third_Head").offsetHeight; - document.getElementById("Third_Head").offsetHeight;
canvas.width = document.getElementById("Canvas_Body").offsetWidth; canvas.width = document.getElementById("Canvas_Body").offsetWidth;
diagramStove.Rotate = 0; diagram.Rotate(false);
diagramStove.RectParam(0, 0, canvas.width, canvas.height); diagram.RectParam(0.5, 0.5, canvas.width - 1, canvas.height - 1);
} }
else { else {
canvas.height = diagramStove.ProcessCount() * 25; canvas.height = diagram.ProcCount() * 25;
canvas.width = document.getElementById("Canvas_Body").offsetWidth; canvas.width = document.getElementById("Canvas_Body").offsetWidth;
diagramStove.Rotate = 1; diagram.Rotate(true);
diagramStove.RectParam(0, 0, canvas.height, canvas.width); diagram.RectParam(0.5, 0.5, canvas.width - 1, canvas.height - 1);
} }
ctx = canvas.getContext("2d"); ctx = canvas.getContext("2d");
diagramStove.Print(ctx); diagram.Print(ctx);
} }
window.addEventListener("load", Resize, false); window.addEventListener("load", Resize, false);
window.addEventListener("resize", Resize, false); window.addEventListener("resize", Resize, false);
//End Resize Canvas //Resize Canvas /\ /\ /\
//Start Update Status //Autoprint diagram \/ \/ \/
diagramStove.BuildDefault(); function PrintCycle() {
diagram.Print(ctx);
setTimeout(PrintCycle, 1000);
}
PrintCycle();
//Autoprint diagram /\ /\ /\
//Update Status \/ \/ \/
function UpdateStatus() { function UpdateStatus() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'getinfo', true); xhr.open('POST', 'https://test1.mbucb.ru/api/currcycles', true);
xhr.send(); xhr.send();
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
if (xhr.readyState != 4) return; if (xhr.readyState != 4) return;
if (xhr.status != 200) { if (xhr.status != 200) {
document.getElementById("Error_Message").innerHTML = "Не удается установить соединение"; htmlErrMSG.innerHTML = "Не удается установить соединение";
$("#Error_Border").show(); $("#Error_Border").show();
$("#Update_Button").show(); $("#Update_Button").show();
return; return;
} }
else else
$("#Error_Border").hide(); $("#Error_Border").hide();
var Pech = JSON.parse(xhr.responseText); var data = JSON.parse(xhr.responseText);
if (data.currTime === undefined) {
htmlErrMSG.innerHTML = "Ошибка в полученных данных";
$("#Error_Border").show();
$("#Update_Button").show();
return;
}
updateDateSynch(new Date());
updateDateServer(new Date(data.currTime));
/*
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 1; i <= diagramStove.ProcessCount(); i++) { for (var i = 1; i <= diagramStove.ProcessCount(); i++) {
diagramStove.ChangeStatBlink(i, Pech[i].Bstatus); diagramStove.ChangeStatBlink(i, Pech[i].Bstatus);
@ -98,18 +133,13 @@ function UpdateStatus() {
} }
else else
$("#Error_Border").hide(); $("#Error_Border").hide();
setTimeout(UpdateStatus, 60000); */
diagramStove.Print(ctx); diagram.Print();
setTimeout(UpdateStatus, 60 * 1000);
} }
} }
UpdateStatus(); UpdateStatus();
function PrintCycle() {
diagramStove.Print(ctx);
setTimeout(PrintCycle, 1000);
}
PrintCycle();
function ConvDate(a) { function ConvDate(a) {
a = a.split(".")[0].split("T"); a = a.split(".")[0].split("T");
var d = a[0].split("-"); var d = a[0].split("-");
@ -121,5 +151,18 @@ function ConvDate(a) {
update_button.onclick = function () { update_button.onclick = function () {
UpdateStatus(); UpdateStatus();
} }
//Update Status /\ /\ /\
//End Update Status //End Update Status
/*
//End Show Date Now
*/ */