diff --git a/server.js b/server.js index aeb8b33..47f5197 100644 --- a/server.js +++ b/server.js @@ -2852,7 +2852,19 @@ app.put('/device-parameters', async (req, res) => { VE, SE, GE, - DE + DE, + TX, + TY, + SX, + SY, + VX, + VY, + GX, + GY, + NX, + NY, + DX, + DY } = requestData; @@ -2868,23 +2880,23 @@ app.put('/device-parameters', async (req, res) => { "GM": parseInt(GEOMOD, 10) }, "EOSD": [ - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE }, - ] + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + { "GE": GE, "NE": NE, "SE": SE, "TE": TE, "VE": VE, "DE": DE, "TX": TX, "TY": TY, "SX": SX, "SY": SY, "VX": VX, "VY": VY, "GX": GX, "GY": GY, "NX": NX, "NY": NY, "DX": DX, "DY": DY }, + ] }; // Отправляем GET запрос с JSON BODY diff --git a/static/scripts/draggable.js b/static/scripts/draggable.js new file mode 100644 index 0000000..25f1f04 --- /dev/null +++ b/static/scripts/draggable.js @@ -0,0 +1,35 @@ +$(function () { + var initialOffsetX1, initialOffsetY1; + var initialOffsetX2, initialOffsetY2; + var initialOffsetX3, initialOffsetY3; + var initialOffsetX4, initialOffsetY4; + var initialOffsetX5, initialOffsetY5; + var initialOffsetX6, initialOffsetY6; + + function makeDraggable($element, posX, posY) { + $element.draggable({ + containment: ".container", + cursor: "crosshair", + start: function (event, ui) { + var offset = $element.offset(); + var containerOffset = $(".container").offset(); + posX = offset.left - ui.position.left - containerOffset.left; + posY = offset.top - ui.position.top - containerOffset.top; + }, + drag: function (event, ui) { + $('#posY' + $element.attr('id')).val((ui.position.top + posY) * 3); + $('#posX' + $element.attr('id')).val((ui.position.left + posX) * 3); + } + }); + + + } + + makeDraggable($("#boxTime"), initialOffsetX1, initialOffsetY1); + makeDraggable($("#boxSpeed"), initialOffsetX2, initialOffsetY2); + makeDraggable($("#boxNumber"), initialOffsetX3, initialOffsetY3); + makeDraggable($("#boxGPS"), initialOffsetX4, initialOffsetY4); + makeDraggable($("#boxName"), initialOffsetX5, initialOffsetY5); + makeDraggable($("#boxID"), initialOffsetX6, initialOffsetY6); + +}); diff --git a/static/scripts/parameters-form.js b/static/scripts/parameters-form.js index 88de46f..c1ec4db 100644 --- a/static/scripts/parameters-form.js +++ b/static/scripts/parameters-form.js @@ -124,6 +124,8 @@ for (let radioButton of radioButtons) { console.log(data.DATA); + draggItems(data.DATA.EOSD[1]) + document.getElementById('system-date').value = data.DATA.TIMEP.DATEM; document.getElementById('system-time').value = data.DATA.TIMEP.TIMEM; document.getElementById('system-language').value = data.DATA.GSP.LANT; diff --git a/static/styles/main.css b/static/styles/main.css index 81a5bb5..089ac9b 100644 --- a/static/styles/main.css +++ b/static/styles/main.css @@ -1405,6 +1405,30 @@ tr:nth-child(even) { filter: brightness(0.9); } +.container{ + width: 420px; + height: 265px; + background-color: rgba(245, 245, 250, 1); + margin-bottom: 20px; + position: relative; +} +.box{ + width: fit-content; + height: 18px !important; + padding: 1px; + border: solid 1px white; + background-color: #8086f9; + font-size: 16px; + font-weight: lighter; + color: white; + cursor: move; + white-space: nowrap; +} + +.box-inputs { + display: none; +} + .upload-input { margin-top: 5px; background: rgba(128, 134, 249, 0.05); diff --git a/static/templates/devices/system.html b/static/templates/devices/system.html index 2f898b3..bb2fdf2 100644 --- a/static/templates/devices/system.html +++ b/static/templates/devices/system.html @@ -108,6 +108,8 @@ + +