Web Interface

This commit is contained in:
Georgy Khatuncev 2021-05-17 23:38:10 +05:00
parent f2fb4bcb8e
commit 13e6f59d44
40 changed files with 52394 additions and 0 deletions

25
Diagram-Canvas/Diagram.js Normal file

@ -0,0 +1,25 @@
var canvas = document.getElementsByTagName("canvas")[0];
var but1 = document.getElementById('submit');
function Resize() {
canvas.style.margin = "10px";
canvas.width = window.innerWidth - 20;
canvas.height = window.innerHeight - 70;
}
window.addEventListener("load", Resize, false);
window.addEventListener("resize", Resize, false);
but1.onclick = function () {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, window.innerWidth, window.innerHeight);
for (var i = 0; i < 10; i++) {
for (var j = 0; j < 20; j++) {
var t = new BlinkStatus(5 + 35 * i, 5 + 20 * j, 30, 15);
t.BuildDefault();
t.status = Math.floor(Math.random() * 4);
t.Print(ctx);
}
}
}

@ -0,0 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "DiagramCanvas", ".", "{2AF8B939-704A-4D60-A3F8-F1EF5D0FCF0E}"
ProjectSection(WebsiteProperties) = preProject
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
Debug.AspNetCompiler.VirtualPath = "/localhost_57940"
Debug.AspNetCompiler.PhysicalPath = "..\DiagramCanvas\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_57940\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_57940"
Release.AspNetCompiler.PhysicalPath = "..\DiagramCanvas\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_57940\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "57940"
SlnRelativePath = "..\DiagramCanvas\"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2AF8B939-704A-4D60-A3F8-F1EF5D0FCF0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AF8B939-704A-4D60-A3F8-F1EF5D0FCF0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {52E57725-7711-4ED5-AE64-6CB60088846C}
EndGlobalSection
EndGlobal

@ -0,0 +1,110 @@
function BlinkStatus(x, y, w, h) {
//Основной прямоугольник
var rAll = new Rectangle(x, y, w, h);
//Массив цветов статусов
var statColor = [];
//Текущий статус
var status = 0;
/*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/
var rotate = false;
/*Функции для работы с координатами
* основного прямоугольника */
this.X = function (val) {
if (val === undefined) return rAll().X();
rAll().X(val);
};
this.Y = function (val) {
if (val === undefined) return rAll().Y();
rAll().Y(val);
};
this.W = function (val) {
if (val === undefined) return rAll().W();
rAll().W(val);
};
this.H = function (val) {
if (val === undefined) return rAll().H();
rAll().H(val);
};
//Установка статуса от -1 до (кол-во элементов в массиве статусов - 1)
this.Status = function (val) {
if (val === undefined) return status;
var v = parseInt(val);
status = (isNaN(v) || v < -1) ? -1 :
v >= statColor.length ? (statColor.length - 1) : v;
};
//Количество статусов
this.StatCount = function () {
return statColor.length;
};
//Функция изменения начальной координаты и размеров прямоугольника
this.RectParam = function (_x, _y, _w, _h) {
rAll.RectParam(_x, _y, _w, _h);
};
//Функция изменения прямоугольника по другому прямоугольнику
this.Rect = function (val) {
if (val === undefined) return rAll;
rAll.Rect(val);
};
//Изменение направления отрисовки текста
this.Rotate = function (val) {
if (val === undefined) return rotate;
rotate = (typeof val === 'boolean') ? val : false;
};
//Установка нового статуса
this.AddStatus = function (index, color) {
if (color === undefined) color = '#000';
var c = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
c = (c === null) ? '#000000' : c[0];
var idx = parseInt(index);
if (isNaN(idx) || idx < 0 || idx > statColor.length - 1)
statColor.push(c);
else
statColor.splice(idx, 0, c);
};
//Изменение статуса
this.ChangeStatus = function (index, color) {
if (color === undefined) color = '#000';
var c = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
c = (c === null) ? '#000000' : c[0];
var idx = parseInt(index);
if (!isNaN(idx) && idx >= 0 && idx < statColor.length)
statColor.splice(idx, 1, c);
};
//Удаление статуса
this.DelStatus = function (index) {
var idx = parseInt(index);
if (!isNaN(idx) && idx >= 0 && idx < statColor.length)
statColor.splice(idx, 1);
else if (statColor.length > 0)
statColor.pop();
};
//Заполнение мигалки по умолчанию
this.BuildDefault = function () {
var defaultColor = ['#00f', '#f00', '#0f0'];
for (var i = 0; i < defaultColor.length; i++)
this.AddStatus(0, defaultColor[i]);
};
//Печать мигалки
this.Print = function (ctx) {
ctx.fillStyle = status >= 0 && status < statColor.length ? statColor[status] : '#ddd';
ctx.fillRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
ctx.strokeStyle = '#000'; //'#333'
ctx.strokeRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
};
//Печать текста мигалки
this.PrintText = function (ctx) {
ctx.save();
ctx.translate(rAll.X() + rAll.W() / 2, rAll.Y() + rAll.H() / 2);
if (rotate) ctx.rotate(3 * Math.PI / 2);
ctx.fillStyle = '#888';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
if (rotate)
ctx.font = (rAll.W() - 2 < 0 ? 0 : rAll.W() - 2) + 'px Arial';
else
ctx.font = (rAll.H() - 2 < 0 ? 0 : rAll.H() - 2) + 'px Arial';
ctx.fillText((status + 1) + '/' + statColor.length, 0, 0);
ctx.restore();
};
}

@ -0,0 +1,295 @@
function Diagram(x, y, w, h) {
// \|/Êîíñòàíòû äëÿ ðàñ÷åòîâ\|/ //
//Ðàññòîÿíèå ìåæäó ñòîëáöàìè
var stI = 2;
//Ðàññòîÿíèå ìåæäó ýëåìåíòàìè
var stE = 2;
//Ìèíèìàëüíàÿ øèðèíà ñòîëáöà
var szE = 4;
//Âûñîòà ìèãàëêè
var szB = 10;
//Âûñîòà íîìåðà
var szN = 17;
//Ìèíèìàëüíàÿ âûñîòà ñòàòóñà
var szP = 40;
//Èíòåðâàë îáíîâëåíèÿ
var timeCycle = 1000;
// /|\Êîíñòàíòû äëÿ ðàñ÷åòîâ/|\ //
//Îñíîâíîé ïðÿìîóãîëüíèê
var rAll = new Rectangle(x, y, w, h);
//Ìàññèâ ýëåìåíòîâ ïîä ïðîöåññû
var rProc = [];
//Ìàññèâ ýëåìåíòîâ ïîä ìèãàëêè
var rBlink = [];
//Ìàññèâ ýëåìåíòîâ ïîä íîìåðà
var rNumb = [];
//Ìàññèâ ýëåìåíòîâ ïîä âðåìÿ íà÷àëà ïðîöåññà
var rDStart = [];
//Ìàññèâ ýëåìåíòîâ ïîä âðåìÿ êîíöà ïðîöåññà
var rDEnd = [];
//Ôëàã ïîâîðåíèÿ öèêëà
var cCycle = false;
//Èíäåêñ öèêëà äëÿ óïðàâëåíèÿ
var wCycle = -1;
/*Ïðîöåíòû ïîäíèìàþòñÿ ñíèçó ââåðõ (false)
*èëè ñëåâà íàïðàâî (true)*/
var rotate = false;
//Ðàñ÷åò ìèíèìàëüíîé øèðèíû
this.minBoardW = function () {
return (stW + 1) * (rProc.length + 1) + (rProc.length * 5);
};
//Ðàñ÷åò ìèíèìàëüíîé âûñîòû
this.minBoardH = function () {
return (stH + 1) * 4 + szHP + szHB + szHN;
};
/*Ôóíêöèè äëÿ ðàáîòû ñ êîîðäèíàòàìè
* îñíîâíîãî ïðÿìîóãîëüíèêà */
this.X = function (val) {
if (val === undefined) return rAll().X();
rAll().X(val);
};
this.Y = function (val) {
if (val === undefined) return rAll().Y();
rAll().Y(val);
};
this.W = function (val) {
if (val === undefined) return rAll().W();
rAll().W(val);
};
this.H = function (val) {
if (val === undefined) return rAll().H();
rAll().H(val);
};
//Ôóíêöèÿ èçìåíåíèÿ íà÷àëüíîé êîîðäèíàòû è ðàçìåðîâ ïðÿìîóãîëüíèêà
this.RectParam = function (_x, _y, _w, _h) {
rAll.RectParam(_x, _y, _w, _h);
};
//Ôóíêöèÿ èçìåíåíèÿ ïðÿìîóãîëüíèêà ïî äðóãîìó ïðÿìîóãîëüíèêó
this.Rect = function (val) {
if (val === undefined) return rAll;
rAll.Rect(val);
};
//Êîëè÷åñòâî ïðîöåññîâ
this.ProcCount = function () {
return rProc.length;
};
//Óñòàíîâêà íîâîãî ïðîöåññà
this.AddProc = function (index, proc, blink, numb) {
var idx = parseInt(index);
idx = (isNaN(idx) || idx < 0 || idx >= rProc.length) ? -1 : idx;
var date = new Date();
if (idx == -1) {
rProc.push(proc);
rBlink.push(blink);
rNumb.push(numb);
rDStart.push(date);
rDEnd.push(date);
} else {
rProc.splice(idx, 0, proc);
rBlink.splice(idx, 0, blink);
rNumb.splice(idx, 0, numb);
rDStart.splice(idx, 0, date);
rDEnd.splice(idx, 0, date);
}
};
//Èçìåíåíèå ïðîöåññà
this.ChangeProc = function (index, proc, blink, numb) {
var idx = parseInt(index);
idx = (isNaN(idx) || idx < 0 || idx >= rProc.length) ? -1 : idx;
var date = new Date();
if (idx == -1) return;
rProc.splice(idx, 1, proc);
rBlink.splice(idx, 1, blink);
rNumb.splice(idx, 1, numb);
rDStart.splice(idx, 1, date);
rDEnd.splice(idx, 1, date);
};
//Óäàëåíèå ïðîöåññà
this.DelStove = function (index) {
if (rProc.length == 0) return;
var idx = parseInt(index);
idx = (isNaN(idx) || idx < 0 || idx >= rProc.length) ? -1 : idx;
if (idx == -1) {
rProc.pop();
rBlink.pop();
rNumb.pop();
rDStart.pop();
rDEnd.pop();
} else {
rProc.splice(idx, 1);
rBlink.splice(idx, 1);
rNumb.splice(idx, 1);
rDStart.splice(idx, 1);
rDEnd.splice(idx, 1);
}
};
//Óñòàíîâêà âðåìåíè íà÷àëà ïðîöåññà
this.StartDate = function (index, date) {
var idx = parseInt(index);
idx = (isNaN(idx) || idx < 0 || idx >= rDStart.length) ? -1 : idx;
if (idx == -1) return;
rDStart[idx] = date;
};
//Óñòàíîâêà âðåìåíè êîíöà ïðîöåññà
this.EndDate = function (index, date) {
var idx = parseInt(index);
idx = (isNaN(idx) || idx < 0 || idx >= rDStart.length) ? -1 : idx;
if (idx == -1) return;
rDEnd[idx] = date;
};
//Èçìåíåíèå ïàðàìåòðîâ ïðîöåññà
this.ChangeStatProc = function (index, stat, percent) {
var idx = parseInt(index);
if (!isNaN(idx) && idx >= 0 && idx < rProc.length) {
rProc[idx].Status(stat);
rProc[idx].Percent(percent);
}
};
//Èçìåíåíèå ïàðàìåòðîâ ìèãàëêè
this.ChangeStatBlink = function (index, stat) {
var idx = parseInt(index);
if (!isNaN(idx) && idx >= -1 && idx < rBlink.length)
rBlink[idx].Status(stat);
};
//Èçìåíåíèå ïàðàìåòðîâ íîìåðà
this.ChangeStatNumb = function (index, prostoy) {
var idx = parseInt(index);
if (!isNaN(idx) && idx >= 0 && idx < rNumb.length)
rNumb[idx].Prostoy(prostoy);
};
//Èçìåíåíèå íàïðàâëåíèÿ îòðèñîâêè ïðîöåíòîâ
this.Rotate = function (val) {
if (val === undefined) return rotate;
rotate = (typeof val === 'boolean') ? val : false;
for (var i = 0; i < rProc.length; i++) {
rProc[i].Rotate(rotate);
rNumb[i].Rotate(rotate);
rBlink[i].Rotate(rotate);
}
};
//Çàïîëíåíèå äèàãðàììû ïî óìîë÷àíèþ
this.BuildDefault = function () {
while (rProc.length < 48) {
rProc.push(new ProcessColumn(0, 0, 0, 0));
rProc[rProc.length - 1].BuildDefault();
rBlink.push(new BlinkStatus(0, 0, 0, 0));
rBlink[rProc.length - 1].BuildDefault();
rNumb.push(new NumberColumn(0, 0, 0, 0, rProc.length));
var date = new Date;
rDStart.push(date);
rDEnd.push(date);
}
};
//Ïåðåðàñ÷åò
this.Rebuild = function () {
var x = rAll.X() + stE + 1;
var y = rAll.Y() + stE + 1;
var wAll = rAll.W() - (rProc.length + 1) * (stE + 1);
var hAll = rAll.H() - (rProc.length + 1) * (stE + 1);
for (var i = 0; i < rProc.length; i++) {
var xP = 0, xB = 0, xN = 0;
var yP = 0, yB = 0, yN = 0;
var wP = 0, wB = 0, wN = 0;
var hP = 0, hB = 0, hN = 0;
if (!rotate) {
xP = x; xB = x; xN = x;
var w = Math.ceil(wAll / (rProc.length - i));
w = (w < szE) ? szE : w;
wAll -= w;
wP = w; wB = w; wN = w;
hB = szB; hN = szN;
hP = rAll.H() - (stI + 1) * 4 - szB - szN;
hP = (hP < szP) ? szP : hP;
yP = y;
yB = yP + hP + (stI + 1);
yN = yB + szB + (stI + 1);
} else {
yP = y; yB = y; yN = y;
var h = Math.ceil(hAll / (rProc.length - i));
h = (h < szE) ? szE : h;
hAll -= h;
hP = h; hB = h; hN = h;
wB = szB; wN = szN;
wP = rAll.W() - (stI + 1) * 4 - szB - szN;
wP = (wP < szP) ? szP : wP;
xP = x;
xB = xP + wP + (stI + 1);
xN = xB + szB + (stI + 1);
xN = x;
xB = xN + wN + (stI + 1);
xP = xB + szB + (stI + 1);
}
rProc[i].RectParam(xP, yP, wP, hP);
rBlink[i].RectParam(xB, yB, wB, hB);
rNumb[i].RectParam(xN, yN, wN, hN);
if (!rotate)
x += wP + stE + 1;
else
y += hP + stE + 1;
}
};
//Ïå÷àòü
this.Print = function (a) {
updateCycle();
this.Rotate(rotate);
this.Rebuild();
a.clearRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
a.fillStyle = "#ddd";
a.fillRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
for (var i = 0; i < rProc.length; i++) {
rProc[i].Print(a);
rBlink[i].Print(a);
rNumb[i].Print(a);
}
a.strokeStyle = "#333";
a.strokeRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
};
//Ïå÷àòü òåêñòà
this.PrintText = function (a) {
for (var i = 0; i < rProc.length; i++) {
rProc[i].PrintText(a);
rBlink[i].PrintText(a);
}
};
//Îáíîâëåíèå ïðîöåíòîâ
function updateCycle(currDate) {
var date = (currDate == undefined) ? new Date() : currDate;
var cycle = false;
for (var i = 0; i < rProc.length; i++) {
if (rDStart[i] == rDEnd[i]) continue;
var d = rDEnd[i] - rDStart[i];
var t = date - rDStart[i];
d = 100 * (date - rDStart[i]) / d;
rProc[i].Percent(d);
rNumb[i].Prostoy(d >= 100);
cycle = cycle || d < 100;
}
cCycle = cCycle && cycle;
date.setMilliseconds(date.getMilliseconds() + timeCycle);
if (cCycle)
if (currDate == undefined)
wCycle = setTimeout(updateCycle, timeCycle);
else
wCycle = setTimeout(updateCycle, timeCycle, date);
};
//Çàïóñê öèêëà îáíîâëåíèé ïðîöåíòîâ
this.Cycle = function (start, currDate) {
if (start == undefined || !(typeof start === 'boolean')) return cCycle;
if (start) {
this.CheckDate();
clearTimeout(wCycle);
cCycle = true;
updateCycle(currDate);
}
};
//Ïðîâåðêà âðåìåíè äëÿ ðàáîòû öèêëà
this.CheckDate = function () {
for (var i = 0; i < rProc.length; i++) {
if (rDStart[i] > rDEnd[i]) {
var tmp = rDStart[i];
rDStart[i] = rDEnd[i];
rDEnd[i] = tmp;
}
}
};
};

@ -0,0 +1,71 @@
function NumberColumn(x, y, w, h, number) {
//Основной прямоугольник
var rAll = new Rectangle(x, y, w, h);
//Текущий статус по простою
var prostoy = false;
/*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/
var rotate = false;
/*Функции для работы с координатами
* основного прямоугольника */
this.X = function (val) {
if (val === undefined) return rAll().X();
rAll().X(val);
};
this.Y = function (val) {
if (val === undefined) return rAll().Y();
rAll().Y(val);
};
this.W = function (val) {
if (val === undefined) return rAll().W();
rAll().W(val);
};
this.H = function (val) {
if (val === undefined) return rAll().H();
rAll().H(val);
};
//Функция изменения начальной координаты и размеров прямоугольника
this.RectParam = function (_x, _y, _w, _h) {
rAll.RectParam(_x, _y, _w, _h);
};
//Функция изменения прямоугольника по другому прямоугольнику
this.Rect = function (val) {
if (val === undefined) return rAll;
rAll.Rect(val);
};
//Функция установки номера
this.Number = function (val) {
if (val === undefined) return number;
var v = parseInt(val);
number = (isNaN(v) || v < 0) ? 0 : v;
};
this.Number(number);
//Функция установки статуса по простою
this.Prostoy = function (val) {
if (val === undefined) return prostoy;
prostoy = (typeof val === 'boolean') ? val : false;
};
//Изменение направления отрисовки текста
this.Rotate = function (val) {
if (val === undefined) return rotate;
rotate = (typeof val === 'boolean') ? val : false;
};
//Печать номера
this.Print = function (ctx) {
ctx.fillStyle = (!prostoy) ? '#ff0' : '#ff8000';
ctx.fillRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
ctx.strokeStyle = '#000';//'#333'
ctx.strokeRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
ctx.save();
ctx.translate(rAll.X() + rAll.W() / 2, rAll.Y() + rAll.H() / 2);
if (rotate) ctx.rotate(3 * Math.PI / 2);
ctx.fillStyle = '#000';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
var px = rAll.H() < rAll.W() ? rAll.H() - 3 : rAll.W() - 3;
px = px < 0 ? 0 : px;
ctx.font = px + 'px Arial';
ctx.fillText(number, 0, 0);
ctx.restore();
};
}

@ -0,0 +1,92 @@
function PercentColumn(x, y, w, h) {
//Основной прямоугольник
var rAll = new Rectangle(x, y, w, h);
//Прямоугольник процентов
var rPerc = new Rectangle();
/*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/
var rotate = false;
//Проценты статуса
var percent = 0;
//Цвет
var color = '#000';
/*Функции для работы с координатами
* основного прямоугольника */
this.X = function (val) {
if (val === undefined) return rAll.X();
rAll.X(val);
};
this.Y = function (val) {
if (val === undefined) return rAll.Y();
rAll.Y(val);
};
this.W = function (val) {
if (val === undefined) return rAll.W();
rAll.W(val);
};
this.H = function (val) {
if (val === undefined) return rAll.H();
rAll.H(val);
};
//Установка процента от 0 до 100
this.Percent = function (val) {
if (val === undefined) return percent;
var v = parseFloat(val);
v = (isNaN(v) || v < 0) ? 0 : (v > 100) ? 100 : v;
percent = v;
};
//Установка цвета в формате #****** или #***
this.Color = function (val) {
if (val === undefined) return color;
var c = val.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);
color = (c === null) ? '#000000' : c[0];
};
//Функция изменения начальной координаты и размеров прямоугольника
this.RectParam = function (_x, _y, _w, _h) {
rAll.RectParam(_x, _y, _w, _h);
};
//Функция изменения прямоугольника по другому прямоугольнику
this.Rect = function (val) {
if (val === undefined) return rAll;
rAll.Rect(val);
};
//Изменение направления отрисовки процентов
this.Rotate = function (val) {
if (val === undefined) return rotate;
rotate = (typeof val === 'boolean') ? val : false;
};
//Перерасчитываем элементы
function Rebuild() {
var size = ((!rotate) ? rAll.H() : rAll.W()) * percent / 100;
rPerc.RectParam(
rAll.X(),
(rotate) ? rAll.Y() : rAll.Y() + rAll.H() - size,
(!rotate) ? rAll.W() : size,
(rotate) ? rAll.H() : size
);
}
//Рисуем проценты
this.Print = function (ctx) {
Rebuild();
ctx.fillStyle = color;
ctx.strokeStyle = color;
ctx.fillRect(rPerc.X(), rPerc.Y(), rPerc.W(), rPerc.H());
ctx.strokeRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
};
//Рисуем текст
this.PrintText = function (ctx) {
ctx.save();
ctx.translate(rAll.X() + rAll.W() / 2, rAll.Y() + rAll.H() / 2);
if (!rotate) ctx.rotate(3 * Math.PI / 2);
ctx.fillStyle = '#888';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
if (!rotate)
ctx.font = (rAll.W() - 10 < 0 ? 0 : rAll.W() - 10) + 'px Arial';
else
ctx.font = (rAll.H() - 10 < 0 ? 0 : rAll.H() - 10) + 'px Arial';
ctx.fillText(Math.floor(percent * 100) / 100 + '%', 0, 0);
ctx.restore();
};
}

@ -0,0 +1,183 @@
function ProcessColumn(x, y, w, h) {
//Основной прямоугольник
var rAll = new Rectangle(x, y, w, h);
//Массив элементов под статусы
var rStat = [];
//Массив элементы под коэффициенты
var point = [];
//Проценты статуса
var percent = 0;
//Номер статуса
var status = 0;
/*Проценты поднимаются снизу вверх (false)
*или слева направо (true)*/
var rotate = false;
/*Функции для работы с координатами
* основного прямоугольника */
this.X = function (val) {
if (val === undefined) return rAll().X();
rAll().X(val);
};
this.Y = function (val) {
if (val === undefined) return rAll().Y();
rAll().Y(val);
};
this.W = function (val) {
if (val === undefined) return rAll().W();
rAll().W(val);
};
this.H = function (val) {
if (val === undefined) return rAll().H();
rAll().H(val);
};
//Установка процента от 0 до 100
this.Percent = function (val) {
if (val === undefined) return percent;
var v = parseFloat(val);
percent = (isNaN(v) || v < 0) ? 0 :
(v > 100) ? 100 : v;
};
//Установка статуса от 0 до (кол-во элементов в массиве статусов - 1)
this.Status = function (val) {
if (val === undefined) return status;
var v = parseInt(val);
status = (isNaN(v) || v < 0 || rStat.length === 0) ? 0 :
(v >= rStat.length) ? (rStat.length - 1) : v;
};
//Функция изменения начальной координаты и размеров прямоугольника
this.RectParam = function (_x, _y, _w, _h) {
rAll.RectParam(_x, _y, _w, _h);
};
//Функция изменения прямоугольника по другому прямоугольнику
this.Rect = function (val) {
if (val === undefined) return rAll;
rAll.Rect(val);
};
//Изменение направления отрисовки процентов
this.Rotate = function (val) {
if (val === undefined) return rotate;
rotate = (typeof val === 'boolean') ? val : false;
for (var i = 0; i < rStat.length; i++)
rStat[i].Rotate(rotate);
};
//Количество статусов
this.StatCount = function () {
return rStat.length;
};
//Установка коеффициента
function Point(_index, _point) {
var idx = parseInt(_index);
var pnt = parseFloat(_point);
if (!isNaN(idx)) {
while (idx >= point.length)
point.push(1);
point[idx] = isNaN(pnt) || pnt <= 0 ? 1 : pnt;
}
}
//Установка нового статуса
this.AddRStat = function (index, point, color) {
var idx = parseInt(index);
if (isNaN(idx) || idx < 0 || idx - 1 > rStat.length) {
rStat.push(new PercentColumn());
idx = rStat.length - 1;
}
else
rStat.splice(idx, 0, new PercentColumn());
rStat[idx].Color(color);
Point(idx, point);
};
//Изменение статуса
this.ChangeRStat = function (index, point, color) {
var idx = parseInt(index);
if (!isNaN(idx) && idx >= 0 && idx < rStat.length) {
rStat[idx].Color(color);
Point(idx, point);
}
};
//Удаление статуса
this.DelRStat = function (index) {
var idx = parseInt(index);
if (!isNaN(idx) && idx >= 0 && idx < rStat.length) {
rStat.splice(idx, 1);
point.splice(idx, 1);
}
else if (rStat.length > 0) {
rStat.pop();
point.pop();
}
};
//Заполнение столбца процесса по умолчанию
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)
this.DelRStat();
for (var i = 0; i < defaultPoint.length; i++)
this.AddRStat(i, defaultPoint[i], defaultColor[i]);
};
//Сумма всех коэффициентов
function AllPoint() {
var count = 0;
for (var i = 0; i < point.length; i++)
count += point[i];
return count;
}
//
function PointSize() {
var res = ((rotate) ? rAll.W() : rAll.H()) - (1 + rStat.length);
res = (res < 0) ? 0 : res;
return (AllPoint() <= 0) ? 0 : (res / AllPoint());
}
//Перерасчет статусов и процентов
function Restat() {
for (var i = 0; i < rStat.length; i++) {
rStat[i].Percent(i < status ? 100 : i == status ? percent : 0);
}
}
//Перерасчет размеров статусов
function Rebuild() {
var _x = rAll.X() + 1;
var _y = rAll.Y() + 1;
for (var i = 0; i < rStat.length; i++) {
var currStat = (rotate) ? i : rStat.length - (i + 1);
var _w = (!rotate) ? rAll.W() - 2 : point[currStat] * PointSize();
var _h = (rotate) ? rAll.H() - 2 : point[currStat] * PointSize();
rStat[currStat].RectParam(_x, _y, _w, _h);
_x = (!rotate) ? _x : _x + 1 + _w;
_y = (rotate) ? _y : _y + 1 + _h;
}
}
//Печать столбца процесса
this.Print = function (ctx) {
this.Rotate(rotate);
Restat();
Rebuild();
ctx.clearRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
ctx.fillStyle = '#ddd';
ctx.fillRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
for (var i = 0; i < rStat.length; i++)
if (i <= status)
rStat[i].Print(ctx);
ctx.strokeStyle = '#000'; //'#333'
ctx.strokeRect(rAll.X(), rAll.Y(), rAll.W(), rAll.H());
};
//Печать текста столбца процесса
this.PrintText = function (ctx) {
this.Rotate(rotate);
Restat();
Rebuild();
ctx.save();
ctx.translate(rAll.X() + rAll.W() / 2, rAll.Y() + rAll.H() / 2);
if (!rotate) ctx.rotate(3 * Math.PI / 2);
ctx.fillStyle = '#888';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
if (!rotate)
ctx.font = (rAll.W() - 10 < 0 ? 0 : rAll.W() - 10) + 'px Arial';
else
ctx.font = (rAll.H() - 10 < 0 ? 0 : rAll.H() - 10) + 'px Arial';
ctx.fillText((Math.floor(percent * 100) / 100) + '% ' + (status + 1) + '/' + rStat.length, 0, 0);
ctx.restore();
};
}

@ -0,0 +1,46 @@
//Объявление класса прямоугольника
function Rectangle(x, y, w, h) {
/*Функции для работы с координатами
* основного прямоугольника */
function chkVal(val) {
var a = parseFloat(val);
return (isNaN(a) || a < 0) ? 0 : a;
}
this.X = function (val) {
if (val === undefined) return x;
x = chkVal(val);
};
this.Y = function (val) {
if (val === undefined) return y;
y = chkVal(val);
};
this.W = function (val) {
if (val === undefined) return w;
w = chkVal(val);
};
this.H = function (val) {
if (val === undefined) return h;
h = chkVal(val);
};
//Функция изменения начальной координаты и размеров прямоугольника
this.RectParam = function (_x, _y, _w, _h) {
this.X(_x);
this.Y(_y);
this.W(_w);
this.H(_h);
};
//Функция изменения прямоугольника по другому прямоугольнику
this.Rect = function (val) {
if (val === undefined) return this;
this.RectParam(val.X(), val.Y(), val.W(), val.H());
};
//Первая инициализация
if (x === undefined) x = 0;
else this.X(x);
if (y === undefined) y = 0;
else this.Y(y);
if (w === undefined) w = 0;
else this.W(w);
if (h === undefined) h = 0;
else this.H(h);
}

@ -0,0 +1,524 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.3';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
/*------------------------------- Print Shiv -------------------------------*/
/** Used to filter media types */
var reMedia = /^$|\b(?:all|print)\b/;
/** Used to namespace printable elements */
var shivNamespace = 'html5shiv';
/** Detect whether the browser supports shivable style sheets */
var supportsShivableSheets = !supportsUnknownElements && (function() {
// assign a false negative if unable to shiv
var docEl = document.documentElement;
return !(
typeof document.namespaces == 'undefined' ||
typeof document.parentWindow == 'undefined' ||
typeof docEl.applyElement == 'undefined' ||
typeof docEl.removeNode == 'undefined' ||
typeof window.attachEvent == 'undefined'
);
}());
/*--------------------------------------------------------------------------*/
/**
* Wraps all HTML5 elements in the given document with printable elements.
* (eg. the "header" element is wrapped with the "html5shiv:header" element)
* @private
* @param {Document} ownerDocument The document.
* @returns {Array} An array wrappers added.
*/
function addWrappers(ownerDocument) {
var node,
nodes = ownerDocument.getElementsByTagName('*'),
index = nodes.length,
reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
result = [];
while (index--) {
node = nodes[index];
if (reElements.test(node.nodeName)) {
result.push(node.applyElement(createWrapper(node)));
}
}
return result;
}
/**
* Creates a printable wrapper for the given element.
* @private
* @param {Element} element The element.
* @returns {Element} The wrapper.
*/
function createWrapper(element) {
var node,
nodes = element.attributes,
index = nodes.length,
wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);
// copy element attributes to the wrapper
while (index--) {
node = nodes[index];
node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
}
// copy element styles to the wrapper
wrapper.style.cssText = element.style.cssText;
return wrapper;
}
/**
* Shivs the given CSS text.
* (eg. header{} becomes html5shiv\:header{})
* @private
* @param {String} cssText The CSS text to shiv.
* @returns {String} The shived CSS text.
*/
function shivCssText(cssText) {
var pair,
parts = cssText.split('{'),
index = parts.length,
reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
replacement = '$1' + shivNamespace + '\\:$2';
while (index--) {
pair = parts[index] = parts[index].split('}');
pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
parts[index] = pair.join('}');
}
return parts.join('{');
}
/**
* Removes the given wrappers, leaving the original elements.
* @private
* @params {Array} wrappers An array of printable wrappers.
*/
function removeWrappers(wrappers) {
var index = wrappers.length;
while (index--) {
wrappers[index].removeNode();
}
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document for print.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces,
ownerWindow = ownerDocument.parentWindow;
if (!supportsShivableSheets || ownerDocument.printShived) {
return ownerDocument;
}
if (typeof namespaces[shivNamespace] == 'undefined') {
namespaces.add(shivNamespace);
}
function removeSheet() {
clearTimeout(data._removeSheetTimer);
if (shivedSheet) {
shivedSheet.removeNode(true);
}
shivedSheet= null;
}
ownerWindow.attachEvent('onbeforeprint', function() {
removeSheet();
var imports,
length,
sheet,
collection = ownerDocument.styleSheets,
cssText = [],
index = collection.length,
sheets = Array(index);
// convert styleSheets collection to an array
while (index--) {
sheets[index] = collection[index];
}
// concat all style sheet CSS text
while ((sheet = sheets.pop())) {
// IE does not enforce a same origin policy for external style sheets...
// but has trouble with some dynamically created stylesheets
if (!sheet.disabled && reMedia.test(sheet.media)) {
try {
imports = sheet.imports;
length = imports.length;
} catch(er){
length = 0;
}
for (index = 0; index < length; index++) {
sheets.push(imports[index]);
}
try {
cssText.push(sheet.cssText);
} catch(er){}
}
}
// wrap all HTML5 elements with printable elements and add the shived style sheet
cssText = shivCssText(cssText.reverse().join(''));
wrappers = addWrappers(ownerDocument);
shivedSheet = addStyleSheet(ownerDocument, cssText);
});
ownerWindow.attachEvent('onafterprint', function() {
// remove wrappers, leaving the original elements, and remove the shived style sheet
removeWrappers(wrappers);
clearTimeout(data._removeSheetTimer);
data._removeSheetTimer = setTimeout(removeSheet, 500);
});
ownerDocument.printShived = true;
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
// expose API
html5.type += ' print';
html5.shivPrint = shivPrint;
// shiv for print
shivPrint(document);
if(typeof module == 'object' && module.exports){
module.exports = html5;
}
}(typeof window !== "undefined" ? window : this, document));

@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document);

326
Diagram-Canvas/Scripts/html5shiv.js vendored Normal file

@ -0,0 +1,326 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.3';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document|DocumentFragment} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
if(typeof module == 'object' && module.exports){
module.exports = html5;
}
}(typeof window !== "undefined" ? window : this, document));

@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);

File diff suppressed because it is too large Load Diff

10364
Diagram-Canvas/Scripts/jquery-3.3.1.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

304
Diagram-Canvas/Test.js Normal file

@ -0,0 +1,304 @@
var canvas = document.getElementsByTagName("canvas")[0];
var ctx = canvas.getContext("2d");
var menu = document.getElementById('menu');
var chkText = document.getElementById('PText');
var chkData = document.getElementById('DefData');
var chkRotate = document.getElementById('Rotate');
var chkloop = document.getElementById('ChkLoop');
var but1 = document.getElementById('TestPercent');
var but2 = document.getElementById('TestProcess');
var but3 = document.getElementById('TestBlinkStatus');
var but4 = document.getElementById('TestNumberColumn')
var but5 = document.getElementById('TestDiagramStove');
var but6 = document.getElementById('TestPost');
var text = document.getElementById('TestDiv');
//Функция изменения размера полотна
function Resize() {
canvas.style.margin = "10px";
canvas.width = window.innerWidth - 20;
canvas.height = window.innerHeight - 30 - menu.clientHeight;
ctx = canvas.getContext("2d");
}
window.addEventListener("load", Resize, false);
window.addEventListener("resize", Resize, false);
//Функция проверки столбцов процесса
but1.onclick = function () {
ctx.clearRect(0, 0, canvas.width, canvas.height);
var height = 200;
var width = 40;
if (chkRotate.checked){
var tmp = height;
height = width;
width = tmp;
}
for (var i = 0; ((width * (i + 1)) + (i * 5)) < (canvas.width - 1); i++) {
for (var j = 0; ((height * (j + 1)) + (j * 5)) < (canvas.height - 1); j++) {
var t = new PercentColumn(
(i * (width + 5)) + 0.5,
(j * (height + 5)) + 0.5,
width,
height);
if (!chkData.checked)
t.Color(getRColor());
t.Percent(Math.random() * 101);
t.Rotate(chkRotate.checked);
t.Print(ctx);
if (chkText.checked)
t.PrintText(ctx);
}
}
}
//Функция проверки столбцов статусов
but2.onclick = function () {
var y = 200;
var x = 40;
var count = Math.floor(Math.random() * 6 + 2);
var arrPoint = [];
var arrColor = [];
for(var i = 0; i < count; i++){
arrPoint.push(Math.random() * 5 + 1);
arrColor.push(getRColor());
}
if (chkData.checked){
y = y * 2;
}
if (chkRotate.checked){
var tmp = y;
y = x;
x = tmp;
}
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0; ((x * (i + 1)) + (i * 5)) < (canvas.width - 1); i++) {
for (var j = 0; ((y * (j + 1)) + (j * 5)) < (canvas.height - 1); j++) {
var t = new ProcessColumn(
(i * (x + 5)) + 0.5,
(j * (y + 5)) + 0.5,
x, y);
t.Rotate(chkRotate.checked);
if (chkData.checked)
t.BuildDefault();
else
for (var k = 0; k < count; k++)
t.AddRStat(k, arrPoint[k], arrColor[k]);
t.Status(Math.floor(Math.random() * t.StatCount()));
t.Percent(Math.random() * 101);
t.Print(ctx);
if (chkText.checked)
t.PrintText(ctx);
}
}
}
//Функция проверки мигалки
but3.onclick = function () {
var y = 40;
var x = 70;
var count = Math.floor(Math.random() * 5 + 1);
var arrColor = [];
for (var i = 0; i < count; i++)
arrColor.push(getRColor());
if (chkRotate.checked) {
var tmp = y;
y = x;
x = tmp;
}
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0; ((x * (i + 1)) + (i * 5)) < (canvas.width - 1); i++) {
for (var j = 0; ((y * (j + 1)) + (j * 5)) < (canvas.height - 1); j++) {
var t = new BlinkStatus(
(i * (x + 5)) + 0.5,
(j * (y + 5)) + 0.5,
x, y);
t.Rotate(chkRotate.checked);
if (chkData.checked)
t.BuildDefault();
else
for (var k = 0; k < count; k++)
t.AddStatus(k, arrColor[k]);
t.Status(Math.floor(Math.random() * (t.StatCount() + 1) - 1));
t.Print(ctx);
if (chkText.checked)
t.PrintText(ctx);
}
}
}
//Функция проверки номера
but4.onclick = function () {
var y = 40;
var x = 70;
var num = 0;
if (chkRotate.checked) {
var tmp = y;
y = x;
x = tmp;
}
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0; ((y * (i + 1)) + (i * 5)) < (canvas.height - 1); i++) {
for (var j = 0; ((x * (j + 1)) + (j * 5)) < (canvas.width - 1); j++) {
var t = new NumberColumn(
(j * (x + 5)) + 0.5,
(i * (y + 5)) + 0.5,
x, y, num++);
t.Rotate(chkRotate.checked);
t.Prostoy(Math.floor(Math.random() * 2) == 1);
t.Print(ctx);
}
}
}
//Переменные для диаграммы
var cycle;
var diagTest;
//Функция цикла
function cycle_print() {
diagTest.RectParam(0.5, 0.5, canvas.width - 1, canvas.height - 1)
diagTest.Print(ctx);
if (chkText.checked)
diagTest.PrintText(ctx);
if (diagTest.Cycle())
cycle = setTimeout(cycle_print, 1000);
}
but5.onclick = function () {
var chkDate = true;
ctx.clearRect(0, 0, canvas.width, canvas.height);
diagTest = new Diagram(0.5, 0.5, canvas.width - 1, canvas.height - 1);
if (chkData.checked) {
diagTest.BuildDefault();
for (var i = 0; i < diagTest.ProcCount(); i++) {
diagTest.ChangeStatProc(i,
Math.floor(Math.random() * 11),
Math.floor(Math.random() * 101));
diagTest.ChangeStatBlink(i, Math.floor(Math.random() * 5 - 1));
diagTest.ChangeStatNumb(i, Math.floor(Math.random() * 2) == 1);
}
}
else
{
var countStove = Math.floor(Math.random() * 20 + 30);
var countProc = Math.floor(Math.random() * 9 + 1);
var countBlink = Math.floor(Math.random() * 4 + 1);
var colorProc = [];
for (var i = 0; i < countProc; i++)
colorProc.push(getRColor());
var pointProc = [];
for (var i = 0; i < countProc; i++)
pointProc.push(Math.random() * 10);
var colorBlink = [];
for (var i = 0; i < countBlink; i++)
colorBlink.push(getRColor());
for (var i = 0; i < countStove; i++) {
var tP = new ProcessColumn(0, 0, 0, 0);
for (var k = 0; k < countProc; k++)
tP.AddRStat(k, pointProc[k], colorProc[k]);
tP.Status(Math.floor(Math.random() * countProc));
tP.Percent(Math.floor(Math.random() * 101));
var tB = new BlinkStatus(0, 0, 0, 0);
for (var k = 0; k < countBlink; k++)
tB.AddStatus(k, colorBlink[k]);
tB.Status(Math.floor(Math.random() * (countBlink + 1) -1));
var tN = new NumberColumn(0, 0, 0, 0, i + 1);
tN.Prostoy(Math.floor(Math.random() * 2) == 1);
diagTest.AddProc(i, tP, tB, tN);
}
}
diagTest.Rotate(chkRotate.checked);
if (chkloop.checked) {
for (var i = 0; i < diagTest.ProcCount(); i++) {
var dStart = new Date();
var dEnd = new Date();
dStart.setSeconds(dStart.getSeconds() + Math.floor(Math.random() * 61 - 50));
dEnd.setSeconds(dEnd.getSeconds() + Math.floor(Math.random() * 61 - 10));
diagTest.StartDate(i, dStart);
diagTest.EndDate(i, dEnd);
}
diagTest.Cycle(true);
cycle_print();
} else {
diagTest.Print(ctx);
if (chkText.checked)
diagTest.PrintText(ctx);
}
}
var btn6CycleSend;
but6.onclick = function () {
var xhr = new XMLHttpRequest();
//xhr.withCredentials = true;
xhr.open('POST', 'http://127.0.0.1:65041/currcycles', true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState != 4) return;
if (xhr.status != 200) {
alert(xhr.status + ': ' + xhr.statusText);
return;
}
PrintDiagram(xhr.responseText);
if (chkloop.checked) {
btn6CycleSend = setTimeout(but6.onclick, 60000);
but6.disabled = true;
} else {
but6.disabled = false;
}
}
}
function PrintDiagram(pechstatus) {
var Pech = JSON.parse(pechstatus);
ctx.clearRect(0, 0, canvas.width, canvas.height);
var t = new Diagram(0.5, 0.5, canvas.width - 1, canvas.height - 1);
t.BuildDefault();
t.Rotate(chkRotate.checked);
for (var key in Pech.data) {
var idx = Pech.data[key].vdp - 1;
var s = -1;
var b = -1;
switch (Pech.data[key].cycle) {
case 0: s = 0; b = -1; break;
case 1: s = 0; b = 1; break;
case 2: s = 1; b = 0; break;
case 5: s = 2; b = 0; break;
case 6: s = 3; b = 0; break;
case 7: s = 4; b = 0; break;
case 8: s = 5; b = 3; break;
case 9: s = 6; b = 3; break;
case 10: s = 7; b = 3; break;
case 11: s = 8; b = 3; break;
case 12: s = 9; b = 3; break;
case 14: s = 1; b = 1; break;
case 15: s = 2; b = 1; break;
case 16: s = 3; b = 1; break;
default: s = 0; b = -1;
}
t.ChangeStatProc(idx, s, 0);
t.ChangeStatBlink(idx, b);
t.StartDate(idx, new Date(Pech.data[key].factStart));
t.EndDate(idx, new Date(Pech.data[key].thinkEnd));
}
t.Print(ctx);
if (chkText.checked)
t.PrintText(ctx);
}
function getRColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}

21
Diagram-Canvas/index.html Normal file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>Diagram Stoves</title>
</head>
<body style="margin:0px; padding:0px">
<canvas id="canvas" style="margin:0px; padding:0px"></canvas>
<div>
<input id="submit" type="button" size="5" value="submit" style=" margin:10px;"/>
</div>
<script src="Scripts/jquery-3.3.1.min.js"></script>
<script src="DiagramStoveDll/Rectangle.js"></script>
<script src="DiagramStoveDll/PercentColumn.js"></script>
<script src="DiagramStoveDll/ProcessColumn.js"></script>
<script src="DiagramStoveDll/BlinkStatus.js"></script>
<script src="Diagram.js"></script>
</body>
</html>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="html5-shiv" version="3.7.3" targetFramework="net40" />
<package id="jQuery" version="3.3.1" targetFramework="net40" />
</packages>

@ -0,0 +1,524 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.3';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
/*------------------------------- Print Shiv -------------------------------*/
/** Used to filter media types */
var reMedia = /^$|\b(?:all|print)\b/;
/** Used to namespace printable elements */
var shivNamespace = 'html5shiv';
/** Detect whether the browser supports shivable style sheets */
var supportsShivableSheets = !supportsUnknownElements && (function() {
// assign a false negative if unable to shiv
var docEl = document.documentElement;
return !(
typeof document.namespaces == 'undefined' ||
typeof document.parentWindow == 'undefined' ||
typeof docEl.applyElement == 'undefined' ||
typeof docEl.removeNode == 'undefined' ||
typeof window.attachEvent == 'undefined'
);
}());
/*--------------------------------------------------------------------------*/
/**
* Wraps all HTML5 elements in the given document with printable elements.
* (eg. the "header" element is wrapped with the "html5shiv:header" element)
* @private
* @param {Document} ownerDocument The document.
* @returns {Array} An array wrappers added.
*/
function addWrappers(ownerDocument) {
var node,
nodes = ownerDocument.getElementsByTagName('*'),
index = nodes.length,
reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
result = [];
while (index--) {
node = nodes[index];
if (reElements.test(node.nodeName)) {
result.push(node.applyElement(createWrapper(node)));
}
}
return result;
}
/**
* Creates a printable wrapper for the given element.
* @private
* @param {Element} element The element.
* @returns {Element} The wrapper.
*/
function createWrapper(element) {
var node,
nodes = element.attributes,
index = nodes.length,
wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);
// copy element attributes to the wrapper
while (index--) {
node = nodes[index];
node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
}
// copy element styles to the wrapper
wrapper.style.cssText = element.style.cssText;
return wrapper;
}
/**
* Shivs the given CSS text.
* (eg. header{} becomes html5shiv\:header{})
* @private
* @param {String} cssText The CSS text to shiv.
* @returns {String} The shived CSS text.
*/
function shivCssText(cssText) {
var pair,
parts = cssText.split('{'),
index = parts.length,
reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
replacement = '$1' + shivNamespace + '\\:$2';
while (index--) {
pair = parts[index] = parts[index].split('}');
pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
parts[index] = pair.join('}');
}
return parts.join('{');
}
/**
* Removes the given wrappers, leaving the original elements.
* @private
* @params {Array} wrappers An array of printable wrappers.
*/
function removeWrappers(wrappers) {
var index = wrappers.length;
while (index--) {
wrappers[index].removeNode();
}
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document for print.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivPrint(ownerDocument) {
var shivedSheet,
wrappers,
data = getExpandoData(ownerDocument),
namespaces = ownerDocument.namespaces,
ownerWindow = ownerDocument.parentWindow;
if (!supportsShivableSheets || ownerDocument.printShived) {
return ownerDocument;
}
if (typeof namespaces[shivNamespace] == 'undefined') {
namespaces.add(shivNamespace);
}
function removeSheet() {
clearTimeout(data._removeSheetTimer);
if (shivedSheet) {
shivedSheet.removeNode(true);
}
shivedSheet= null;
}
ownerWindow.attachEvent('onbeforeprint', function() {
removeSheet();
var imports,
length,
sheet,
collection = ownerDocument.styleSheets,
cssText = [],
index = collection.length,
sheets = Array(index);
// convert styleSheets collection to an array
while (index--) {
sheets[index] = collection[index];
}
// concat all style sheet CSS text
while ((sheet = sheets.pop())) {
// IE does not enforce a same origin policy for external style sheets...
// but has trouble with some dynamically created stylesheets
if (!sheet.disabled && reMedia.test(sheet.media)) {
try {
imports = sheet.imports;
length = imports.length;
} catch(er){
length = 0;
}
for (index = 0; index < length; index++) {
sheets.push(imports[index]);
}
try {
cssText.push(sheet.cssText);
} catch(er){}
}
}
// wrap all HTML5 elements with printable elements and add the shived style sheet
cssText = shivCssText(cssText.reverse().join(''));
wrappers = addWrappers(ownerDocument);
shivedSheet = addStyleSheet(ownerDocument, cssText);
});
ownerWindow.attachEvent('onafterprint', function() {
// remove wrappers, leaving the original elements, and remove the shived style sheet
removeWrappers(wrappers);
clearTimeout(data._removeSheetTimer);
data._removeSheetTimer = setTimeout(removeSheet, 500);
});
ownerDocument.printShived = true;
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
// expose API
html5.type += ' print';
html5.shivPrint = shivPrint;
// shiv for print
shivPrint(document);
if(typeof module == 'object' && module.exports){
module.exports = html5;
}
}(typeof window !== "undefined" ? window : this, document));

@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document);

@ -0,0 +1,326 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
;(function(window, document) {
/*jshint evil:true */
/** version */
var version = '3.7.3';
/** Preset options */
var options = window.html5 || {};
/** Used to skip problem elements */
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
/** Not all elements can be cloned in IE **/
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
/** Detect whether the browser supports default html5 styles */
var supportsHtml5Styles;
/** Name of the expando, to work with multiple documents or to re-shiv one document */
var expando = '_html5shiv';
/** The id for the the documents expando */
var expanID = 0;
/** Cached data for each document */
var expandoData = {};
/** Detect whether the browser supports unknown elements */
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
// assign a false positive if unable to shiv
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
// assign a false positive if detection fails => unable to shiv
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a style sheet with the given CSS text and adds it to the document.
* @private
* @param {Document} ownerDocument The document.
* @param {String} cssText The CSS text.
* @returns {StyleSheet} The style element.
*/
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
/**
* Returns the value of `html5.elements` as an array.
* @private
* @returns {Array} An array of shived element node names.
*/
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
/**
* Extends the built-in list of html5 elements
* @memberOf html5
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
* @param {Document} ownerDocument The context document.
*/
function addElements(newElements, ownerDocument) {
var elements = html5.elements;
if(typeof elements != 'string'){
elements = elements.join(' ');
}
if(typeof newElements != 'string'){
newElements = newElements.join(' ');
}
html5.elements = elements +' '+ newElements;
shivDocument(ownerDocument);
}
/**
* Returns the data associated to the given document
* @private
* @param {Document} ownerDocument The document.
* @returns {Object} An object of data.
*/
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
/**
* returns a shived element for the given nodeName and document
* @memberOf html5
* @param {String} nodeName name of the element
* @param {Document|DocumentFragment} ownerDocument The context document.
* @returns {Object} The shived element.
*/
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
// Avoid adding some elements to fragments in IE < 9 because
// * Attributes like `name` or `type` cannot be set/changed once an element
// is inserted into a document/fragment
// * Link elements with `src` attributes that are inaccessible, as with
// a 403 response, will cause the tab/window to crash
// * Script elements appended to fragments will execute when their `src`
// or `text` property is set
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
/**
* returns a shived DocumentFragment for the given document
* @memberOf html5
* @param {Document} ownerDocument The context document.
* @returns {Object} The shived DocumentFragment.
*/
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
/**
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
* @private
* @param {Document|DocumentFragment} ownerDocument The document.
* @param {Object} data of the document.
*/
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
//abort shiv
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
// unroll the `createElement` calls
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
/*--------------------------------------------------------------------------*/
/**
* Shivs the given document.
* @memberOf html5
* @param {Document} ownerDocument The document to shiv.
* @returns {Document} The shived document.
*/
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
// corrects block display not defined in IE6/7/8/9
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}' +
// hides non-rendered elements
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
/*--------------------------------------------------------------------------*/
/**
* The `html5` object is exposed so that more elements can be shived and
* existing shiving can be detected on iframes.
* @type Object
* @example
*
* // options can be changed before the script is included
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
*/
var html5 = {
/**
* An array or space separated string of node names of the elements to shiv.
* @memberOf html5
* @type Array|String
*/
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
/**
* current version of html5shiv
*/
'version': version,
/**
* A flag to indicate that the HTML5 style sheet should be inserted.
* @memberOf html5
* @type Boolean
*/
'shivCSS': (options.shivCSS !== false),
/**
* Is equal to true if a browser supports creating unknown/HTML5 elements
* @memberOf html5
* @type boolean
*/
'supportsUnknownElements': supportsUnknownElements,
/**
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
* methods should be overwritten.
* @memberOf html5
* @type Boolean
*/
'shivMethods': (options.shivMethods !== false),
/**
* A string to describe the type of `html5` object ("default" or "default print").
* @memberOf html5
* @type String
*/
'type': 'default',
// shivs the document according to the specified `html5` object options
'shivDocument': shivDocument,
//creates a shived element
createElement: createElement,
//creates a shived documentFragment
createDocumentFragment: createDocumentFragment,
//extends list of elements
addElements: addElements
};
/*--------------------------------------------------------------------------*/
// expose html5
window.html5 = html5;
// shiv the document
shivDocument(document);
if(typeof module == 'object' && module.exports){
module.exports = html5;
}
}(typeof window !== "undefined" ? window : this, document));

@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,117 @@
function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $cryptoProvider.ComputeHash($stream)
$checksum = ''
foreach ($byte in $bytes) {
$checksum += $byte.ToString('x2')
}
$stream.Close() | Out-Null
return $checksum
}
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
# _references.js file not found
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 0) {
# File has no existing matching reference line
# Add the full reference line to the beginning of the file
"/// <reference path=""$newFileName"" />" | Add-Content $referencesTempFilePath -Encoding UTF8
Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
}
else {
# Loop through file and replace old file name with new file name
Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
}
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
# Delete the line referencing the file
Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
}
function Delete-ProjectItem($item) {
$itemDeleted = $false
for ($1=1; $i -le 5; $i++) {
try {
$item.Delete()
$itemDeleted = $true
break
}
catch {
# Try again in 200ms
[System.Threading.Thread]::Sleep(200)
}
}
if ($itemDeleted -eq $false) {
throw "Unable to delete project item after five attempts."
}
}
# Extract the version number from the jquery file in the package's content\scripts folder
$packageScriptsFolder = Join-Path $installPath Content\Scripts
$jqueryFileName = Join-Path $packageScriptsFolder "jquery-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js","*.slim.js" | Split-Path -Leaf
$jqueryFileNameRegEx = "jquery-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
$jqueryFileName -match $jqueryFileNameRegEx
$ver = $matches[1]
$intelliSenseFileName = "jquery-$ver.intellisense.js"
# Get the project item for the scripts folder
try {
$scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
$projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
}
catch {
# No Scripts folder
Write-Host "No scripts folder found"
}

@ -0,0 +1,41 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersion = $vsVersion.Major
Write-Host "IntelliSense JS files are not supported by your version of Visual Studio: $displayVersion"
exit
}
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Delete the vsdoc file from the project
try {
$vsDocProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("jquery-$ver-vsdoc.js")
Delete-ProjectItem $vsDocProjectItem
}
catch {
Write-Host "Error deleting vsdoc file: " + $_.Exception -ForegroundColor Red
exit
}
# Copy the intellisense file to the project from the tools folder
$intelliSenseFileSourcePath = Join-Path $toolsPath $intelliSenseFileName
try {
$scriptsFolderProjectItem.ProjectItems.AddFromFileCopy($intelliSenseFileSourcePath)
}
catch {
# This will throw if the file already exists, so we need to catch here
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx $jqueryFileName

File diff suppressed because it is too large Load Diff

@ -0,0 +1,41 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSenseFilePath) {
if ((Get-Checksum $projectIntelliSenseFilePath) -eq (Get-Checksum $origIntelliSenseFilePath)) {
# The intellisense file in the project matches the file in the tools folder, delete it
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
exit
}
try {
# Get the project item for the intellisense file
$intelliSenseFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item($intelliSenseFileName)
}
catch {
# The item wasn't found
exit
}
# Delete the project item
Delete-ProjectItem $intelliSenseFileProjectItem
}
else {
$projectScriptsFolderLeaf = Split-Path $projectScriptsFolderPath -Leaf
Write-Host "Skipping '$projectScriptsFolderLeaf\$intelliSenseFileName' because it was modified." -ForegroundColor Magenta
}
}
else {
# The intellisense file was not found in project
Write-Host "The intellisense file was not found in project at path $projectIntelliSenseFilePath"
}
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx

Binary file not shown.

36
Diagram-Canvas/test.html Normal file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<title>Diagram Stoves</title>
<!--[if lt IE 9]>
<script src="Scripts/html5shiv.min.js"></script>
<![endif]-->
</head>
<body style="margin:0px; padding:0px">
<canvas id="canvas" style="margin:0px; padding:0px"></canvas>
<div id="menu">
<input id="PText" type="checkbox" style=" margin:10px 0px 10px 10px;"> Text
<input id="DefData" type="checkbox" style=" margin:10px 0px 10px 10px;"> Default Data
<input id="Rotate" type="checkbox" style=" margin:10px 0px 10px 10px;"> Rotate
<input id="TestPercent" type="button" value="Test Percent" style=" margin:10px;" />
<input id="TestProcess" type="button" value="Test Process" style=" margin:10px;" />
<input id="TestBlinkStatus" type="button" value="Test Blink" style=" margin:10px;" />
<input id="TestNumberColumn" type="button" value="Test Number" style=" margin:10px;" />
<input id="TestDiagramStove" type="button" value="Test Diagram" style=" margin:10px;" />
<input id="TestPost" value="Test Post" style=" margin:10px;" type="button">
<input id="ChkLoop" type="checkbox" style=" margin:10px 0px 10px 10px;"> Loop
</div>
<script src="Scripts/jquery-3.3.1.min.js"></script>
<script src="DiagramStoveDll/Rectangle.js"></script>
<script src="DiagramStoveDll/PercentColumn.js"></script>
<script src="DiagramStoveDll/ProcessColumn.js"></script>
<script src="DiagramStoveDll/BlinkStatus.js"></script>
<script src="DiagramStoveDll/NumberColumn.js"></script>
<script src="DiagramStoveDll/Diagram.js"></script>
<script src="Test.js"></script>
</body>
</html>