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,
"restore": {
"G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {}
"D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {}
},
"projects": {
"G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {
"D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectUniqueName": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectName": "GenerateVDPCycle",
"projectPath": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\",
"outputPath": "G:\\Diagram-API\\GenerateVDPCycle\\obj\\",
"projectPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"packagesPath": "C:\\Users\\google\\.nuget\\packages\\",
"outputPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"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": [
"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.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
@ -70,7 +71,7 @@
"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>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<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>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.0</NuGetToolVersion>
</PropertyGroup>
<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\Xamarin\NuGet\" />
<SourceRoot Include="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>

@ -869,25 +869,27 @@
]
},
"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\\Xamarin\\NuGet\\": {}
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectUniqueName": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectName": "GenerateVDPCycle",
"projectPath": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\",
"outputPath": "G:\\Diagram-API\\GenerateVDPCycle\\obj\\",
"projectPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"packagesPath": "C:\\Users\\google\\.nuget\\packages\\",
"outputPath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"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": [
"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.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
@ -939,7 +941,7 @@
"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,
"dgSpecHash": "dJ5Zqs54MpkjiW1NERaYHKfRgGQP65O4keUR9GNguaynUdNiO69AuZXAqASCwpzj1hMK/KJxIfErvoq3wS3lUw==",
"dgSpecHash": "Dd4oBL4kr/THFI4/m4VlSCVmKH5MsMtnD9Qkqx9QLuVOE2Ahss9C78Lj/BGnHydjB0CcIZ376mAH9wC4PMI6ww==",
"success": true,
"projectFilePath": "G:\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"projectFilePath": "D:\\GIT\\diplom_vova\\Diagram-API\\GenerateVDPCycle\\GenerateVDPCycle.csproj",
"expectedPackageFiles": [
"C:\\Users\\Admin\\.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\\Admin\\.nuget\\packages\\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\\Admin\\.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\\Admin\\.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\\Admin\\.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\\Admin\\.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\\Admin\\.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\\Admin\\.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\\Admin\\.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\\Admin\\.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:\\Users\\Admin\\.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\\Admin\\.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\\Admin\\.nuget\\packages\\system.diagnostics.diagnosticsource\\4.7.1\\system.diagnostics.diagnosticsource.4.7.1.nupkg.sha512"
"C:\\Users\\google\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.1\\microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\microsoft.bcl.hashcode\\1.1.0\\microsoft.bcl.hashcode.1.1.0.nupkg.sha512",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\microsoft.csharp\\4.5.0\\microsoft.csharp.4.5.0.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\microsoft.entityframeworkcore\\3.1.8\\microsoft.entityframeworkcore.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\\google\\.nuget\\packages\\microsoft.entityframeworkcore.analyzers\\3.1.8\\microsoft.entityframeworkcore.analyzers.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\\google\\.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.memory\\3.1.8\\microsoft.extensions.caching.memory.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\\google\\.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.binder\\3.1.8\\microsoft.extensions.configuration.binder.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\\google\\.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.logging\\3.1.8\\microsoft.extensions.logging.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\\google\\.nuget\\packages\\microsoft.extensions.options\\3.1.8\\microsoft.extensions.options.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\\google\\.nuget\\packages\\mysqlconnector\\0.69.10\\mysqlconnector.0.69.10.nupkg.sha512",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder\\newtonsoft.json\\11.0.2\\newtonsoft.json.11.0.2.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\pomelo.entityframeworkcore.mysql\\3.2.4\\pomelo.entityframeworkcore.mysql.3.2.4.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\pomelo.jsonobject\\2.2.1\\pomelo.jsonobject.2.2.1.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\system.collections.immutable\\1.7.1\\system.collections.immutable.1.7.1.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\system.componentmodel.annotations\\4.7.0\\system.componentmodel.annotations.4.7.0.nupkg.sha512",
"C:\\Users\\google\\.nuget\\packages\\system.diagnostics.diagnosticsource\\4.7.1\\system.diagnostics.diagnosticsource.4.7.1.nupkg.sha512"
],
"logs": []
}

@ -162,7 +162,7 @@
</site>
<site name="Diagram-Canvas" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="E:\GIT\diplom_vova\Diagram-Canvas" />
<virtualDirectory path="/" physicalPath="D:\GIT\diplom_vova\Diagram-Canvas" />
</application>
<bindings>
<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 prostoy = false;
var prostoy = true;
/*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/
var rotate = false;

@ -8,7 +8,7 @@
//Проценты статуса
var percent = 0;
//Номер статуса
var status = 0;
var status = -1;
/*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/
var rotate = false;
@ -41,7 +41,7 @@
this.Status = function (val) {
if (val === undefined) return status;
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;
};
//Функция изменения начальной координаты и размеров прямоугольника
@ -110,7 +110,7 @@
this.BuildDefault = function () {
var defaultPoint = [57, 49, 49, 71, 28, 49, 21, 171, 114, 103];
var defaultColor = ["#0ff", "#00f", "#f00", "#0f0", "#0ff", "#00f", "#8500b6", "#f00", "#f0f", "#0f0"];
while(rStat.length > 0)
while (rStat.length > 0)
this.DelRStat();
for (var i = 0; i < defaultPoint.length; i++)
this.AddRStat(i, defaultPoint[i], defaultColor[i]);

@ -81,7 +81,7 @@ but2.onclick = function () {
else
for (var k = 0; k < count; 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.Print(ctx);
if (chkText.checked)

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

@ -3,123 +3,166 @@ var htmlDateClient = document.getElementById("DateClient");
var htmlDateServer = document.getElementById("DateServer");
var htmlDateSynch = document.getElementById("DateSynch");
var htmlErrMSG = document.getElementById("Error_Message");
var canvas = document.getElementsByTagName("canvas")[0];
var ctx = canvas.getContext("2d");
var diagram = new Diagram(0, 0, canvas.width, canvas.height);
diagram.BuildDefault();
diagram.Cycle(true);
var update_button = document.getElementById("Update_Button");
//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 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 dateServer = null;
var dateSynch = null;
function PrintDateNow() {
var tmp = new Date();
htmlDateClient.innerHTML = DateToString(tmp);
if (dateServer !== null)
if (dateClient !== null)
tmp =
htmlDateServer.innerHTML = timeNow;
htmlDateSynch.innerHTML = timeNow;
var dn = new Date();
if (dateServer !== null && dateClient !== null)
dateServer.setMilliseconds(dateServer.getMilliseconds() + (dn - dateClient));
dateClient = dn;
htmlDateClient.innerHTML = DateToString(dateClient);
if (dateServer != null)
htmlDateServer.innerHTML = DateToString(dateServer);
if (dateSynch !== null)
htmlDateSynch.innerHTML = DateToString(dateSynch);
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();
/*
//End Show Date Now
//Show Date Now /\ /\ /\
//Start Resize Canvas
//Resize Canvas \/ \/ \/
function Resize() {
if (window.innerWidth > window.innerHeight) {
canvas.height = window.innerHeight - 20
- document.getElementById("First_Head").offsetHeight
- document.getElementById("Second_Head").offsetHeight
- document.getElementById("Third_Head").offsetHeight;
canvas.width = document.getElementById("Canvas_Body").offsetWidth;
diagramStove.Rotate = 0;
diagramStove.RectParam(0, 0, canvas.width, canvas.height);
}
else {
canvas.height = diagramStove.ProcessCount() * 25;
canvas.width = document.getElementById("Canvas_Body").offsetWidth;
diagramStove.Rotate = 1;
diagramStove.RectParam(0, 0, canvas.height, canvas.width);
}
ctx = canvas.getContext("2d");
diagramStove.Print(ctx);
if (window.innerWidth > window.innerHeight) {
canvas.height =
window.innerHeight - 20
- document.getElementById("First_Head").offsetHeight
- document.getElementById("Second_Head").offsetHeight
- document.getElementById("Third_Head").offsetHeight;
canvas.width = document.getElementById("Canvas_Body").offsetWidth;
diagram.Rotate(false);
diagram.RectParam(0.5, 0.5, canvas.width - 1, canvas.height - 1);
}
else {
canvas.height = diagram.ProcCount() * 25;
canvas.width = document.getElementById("Canvas_Body").offsetWidth;
diagram.Rotate(true);
diagram.RectParam(0.5, 0.5, canvas.width - 1, canvas.height - 1);
}
ctx = canvas.getContext("2d");
diagram.Print(ctx);
}
window.addEventListener("load", Resize, false);
window.addEventListener("resize", Resize, false);
//End Resize Canvas
//Resize Canvas /\ /\ /\
//Start Update Status
diagramStove.BuildDefault();
//Autoprint diagram \/ \/ \/
function PrintCycle() {
diagram.Print(ctx);
setTimeout(PrintCycle, 1000);
}
PrintCycle();
//Autoprint diagram /\ /\ /\
//Update Status \/ \/ \/
function UpdateStatus() {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'getinfo', true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState != 4) return;
if (xhr.status != 200) {
document.getElementById("Error_Message").innerHTML = "Не удается установить соединение";
$("#Error_Border").show();
$("#Update_Button").show();
return;
}
else
$("#Error_Border").hide();
var Pech = JSON.parse(xhr.responseText);
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 1; i <= diagramStove.ProcessCount(); i++) {
diagramStove.ChangeStatBlink(i, Pech[i].Bstatus);
diagramStove.ChangeStatProc(i, Pech[i].Pstatus);
diagramStove.ChangeStartDate(i, ConvDate(Pech[i].Start));
diagramStove.ChangeEndDate(i, ConvDate(Pech[i].EndTeor));
}
var b = ConvDate(Pech[0].DateNow);
dateUpdateHTML.innerHTML =
b.getFullYear() + "." +
FNL(b.getMonth() + 1, 2) + "." +
FNL(b.getDate(), 2) + " " +
FNL(b.getHours(), 2) + ":" +
FNL(b.getMinutes(), 2) + ":" +
FNL(b.getSeconds(), 2);
if (Math.abs(b - new Date()) > 60000) {
document.getElementById("Error_Message").innerHTML = "Разница между системным и серверным временем " + Math.floor(Math.abs(b - new Date()) / 1000) + " сек";
$("#Error_Border").show();
$("#Update_Button").hide();
}
else
$("#Error_Border").hide();
setTimeout(UpdateStatus, 60000);
diagramStove.Print(ctx);
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://test1.mbucb.ru/api/currcycles', true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState != 4) return;
if (xhr.status != 200) {
htmlErrMSG.innerHTML = "Не удается установить соединение";
$("#Error_Border").show();
$("#Update_Button").show();
return;
}
else
$("#Error_Border").hide();
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);
for (var i = 1; i <= diagramStove.ProcessCount(); i++) {
diagramStove.ChangeStatBlink(i, Pech[i].Bstatus);
diagramStove.ChangeStatProc(i, Pech[i].Pstatus);
diagramStove.ChangeStartDate(i, ConvDate(Pech[i].Start));
diagramStove.ChangeEndDate(i, ConvDate(Pech[i].EndTeor));
}
var b = ConvDate(Pech[0].DateNow);
dateUpdateHTML.innerHTML =
b.getFullYear() + "." +
FNL(b.getMonth() + 1, 2) + "." +
FNL(b.getDate(), 2) + " " +
FNL(b.getHours(), 2) + ":" +
FNL(b.getMinutes(), 2) + ":" +
FNL(b.getSeconds(), 2);
if (Math.abs(b - new Date()) > 60000) {
document.getElementById("Error_Message").innerHTML = "Разница между системным и серверным временем " + Math.floor(Math.abs(b - new Date()) / 1000) + " сек";
$("#Error_Border").show();
$("#Update_Button").hide();
}
else
$("#Error_Border").hide();
*/
diagram.Print();
setTimeout(UpdateStatus, 60 * 1000);
}
}
UpdateStatus();
function PrintCycle() {
diagramStove.Print(ctx);
setTimeout(PrintCycle, 1000);
}
PrintCycle();
function ConvDate(a) {
a = a.split(".")[0].split("T");
var d = a[0].split("-");
var h = a[1].split(":");
var date = new Date(d[0], parseInt(d[1]) - 1, d[2], h[0], h[1], h[2]);
return date;
a = a.split(".")[0].split("T");
var d = a[0].split("-");
var h = a[1].split(":");
var date = new Date(d[0], parseInt(d[1]) - 1, d[2], h[0], h[1], h[2]);
return date;
}
update_button.onclick = function () {
UpdateStatus();
UpdateStatus();
}
//Update Status /\ /\ /\
//End Update Status
/*
//End Show Date Now
*/