Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4cafc621a1 | |||
| 6253b09ecd | |||
| 963af23e57 | |||
| 05b5824608 |
+4
-1
@@ -4,12 +4,15 @@ const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
||||
module.exports = {
|
||||
packagerConfig: {
|
||||
asar: true,
|
||||
icon: './mainicon',
|
||||
},
|
||||
rebuildConfig: {},
|
||||
makers: [
|
||||
{
|
||||
name: '@electron-forge/maker-squirrel',
|
||||
config: {},
|
||||
config: {
|
||||
setupIcon: './mainicon.ico',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-zip',
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px"><path d="M 24 4 C 20.704135 4 18 6.7041348 18 10 L 11.746094 10 A 1.50015 1.50015 0 0 0 11.476562 9.9785156 A 1.50015 1.50015 0 0 0 11.259766 10 L 7.5 10 A 1.50015 1.50015 0 1 0 7.5 13 L 10 13 L 10 38.5 C 10 41.519774 12.480226 44 15.5 44 L 32.5 44 C 35.519774 44 38 41.519774 38 38.5 L 38 13 L 40.5 13 A 1.50015 1.50015 0 1 0 40.5 10 L 36.746094 10 A 1.50015 1.50015 0 0 0 36.259766 10 L 30 10 C 30 6.7041348 27.295865 4 24 4 z M 24 7 C 25.674135 7 27 8.3258652 27 10 L 21 10 C 21 8.3258652 22.325865 7 24 7 z M 13 13 L 35 13 L 35 38.5 C 35 39.898226 33.898226 41 32.5 41 L 15.5 41 C 14.101774 41 13 39.898226 13 38.5 L 13 13 z M 20.476562 17.978516 A 1.50015 1.50015 0 0 0 19 19.5 L 19 34.5 A 1.50015 1.50015 0 1 0 22 34.5 L 22 19.5 A 1.50015 1.50015 0 0 0 20.476562 17.978516 z M 27.476562 17.978516 A 1.50015 1.50015 0 0 0 26 19.5 L 26 34.5 A 1.50015 1.50015 0 1 0 29 34.5 L 29 19.5 A 1.50015 1.50015 0 0 0 27.476562 17.978516 z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
+41
-62
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, h } from "vue";
|
||||
import {ref, onMounted, h} from "vue";
|
||||
import izitoast from "@/shared/izitoast";
|
||||
import { useEventListener } from "@vueuse/core";
|
||||
import {useEventListener} from "@vueuse/core";
|
||||
import MyDialog from "@/components/MyDialog.vue";
|
||||
import MyDropMenu from "@/components/MyDropMenu.vue";
|
||||
import copyToclipboard from "@/shared/copyToclipboard";
|
||||
@@ -14,7 +14,7 @@ import Preview from "@/components/UI/svg/Preview.vue";
|
||||
import Save from "@/components/UI/svg/Save.vue";
|
||||
import Trash from "@/components/UI/svg/Trash.vue";
|
||||
import Back from "@/components/UI/svg/Back.vue";
|
||||
import { NTooltip } from 'naive-ui'
|
||||
|
||||
|
||||
const numbers = ref([]); // Инициализируем массив с пустыми строками
|
||||
const clickCount = ref(1); // Счетчик нажатий
|
||||
@@ -60,8 +60,7 @@ function setNumber(item) {
|
||||
}
|
||||
}
|
||||
|
||||
function openPreview(event) {
|
||||
event.currentTarget.blur()
|
||||
function openPreview() {
|
||||
generateCode()
|
||||
if (!listOfTrips.value.length) {
|
||||
izitoast.error({
|
||||
@@ -73,9 +72,8 @@ function openPreview(event) {
|
||||
isCodeViewVisible.value = true;
|
||||
}
|
||||
|
||||
function saveResult(event) {
|
||||
function saveResult() {
|
||||
isModalVisible.value = true;
|
||||
event.currentTarget.blur()
|
||||
generateCode()
|
||||
}
|
||||
|
||||
@@ -96,18 +94,18 @@ function generateCode() {
|
||||
let textOfCode = color
|
||||
textOfCode = textOfCode.split('<<separator>>')
|
||||
colorDetectClass.value = textOfCode[0]
|
||||
colorDetectCode.value += ` ${textOfCode[1].trim()}\n`;
|
||||
colorDetectCode.value += `\t${textOfCode[1].trim()}\n`;
|
||||
}
|
||||
|
||||
if (isUsedQR) {
|
||||
let textOfCode = qr
|
||||
textOfCode = textOfCode.split('<<separator>>')
|
||||
QRDetectClass.value = textOfCode[0]
|
||||
QRDetectCode.value += ` ${textOfCode[1].trim()}\n`;
|
||||
QRDetectCode.value += `\t${textOfCode[1].trim()}\n`;
|
||||
}
|
||||
|
||||
for (const item of listOfTrips.value) {
|
||||
mainCode.value += ` navigate_wait(${item.x}, ${item.y})\n`;
|
||||
mainCode.value += `\tnavigate_wait(${item.x}, ${item.y})\n`;
|
||||
if (item.isPlatform) {
|
||||
mainCode.value += colorDetectCode.value + '\n'
|
||||
}
|
||||
@@ -129,8 +127,7 @@ function generateCode() {
|
||||
}
|
||||
}
|
||||
|
||||
function cancel(event) {
|
||||
event.currentTarget.blur()
|
||||
function cancel() {
|
||||
if (clickCount.value === 1) {
|
||||
return;
|
||||
}
|
||||
@@ -142,8 +139,7 @@ function cancel(event) {
|
||||
clickCount.value--;
|
||||
}
|
||||
|
||||
function cleanResult(event) {
|
||||
event.currentTarget.blur()
|
||||
function cleanResult() {
|
||||
clickCount.value = 1;
|
||||
numbers.value.forEach(item => {
|
||||
item.isPlatform = false;
|
||||
@@ -188,7 +184,7 @@ function copyAndToast(text) {
|
||||
function handleDownloadBtn() {
|
||||
// Создание файла
|
||||
const downloadUrl = ref('');
|
||||
const blob = new Blob([finallyText.value], { type: 'text/plain' });
|
||||
const blob = new Blob([finallyText.value], {type: 'text/plain'});
|
||||
downloadUrl.value = URL.createObjectURL(blob);
|
||||
// Задержка для избежания ошибок в некоторых браузерах
|
||||
setTimeout(() => {
|
||||
@@ -304,7 +300,7 @@ function onContextMenu(e, item) {
|
||||
{
|
||||
label: "Удалить",
|
||||
onClick: () => deletePlatform(item),
|
||||
icon: h(Trash),
|
||||
icon: createIcon('icons/trash.svg'),
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -320,14 +316,14 @@ function onContextMenu(e, item) {
|
||||
{
|
||||
label: "Удалить",
|
||||
onClick: () => deleteQR(item),
|
||||
icon: h(Trash)
|
||||
icon: createIcon('icons/trash.svg')
|
||||
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Удалить",
|
||||
icon: h(Trash),
|
||||
icon: createIcon('icons/trash.svg'),
|
||||
onClick: () => deletePointMap(item),
|
||||
},
|
||||
]
|
||||
@@ -345,32 +341,12 @@ function onContextMenu(e, item) {
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<Save @click="saveResult" />
|
||||
</template>
|
||||
Сохранить
|
||||
</n-tooltip>
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<Trash @click="cleanResult" />
|
||||
</template>
|
||||
Удалить
|
||||
</n-tooltip>
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<Back @click="cancel" />
|
||||
</template>
|
||||
Отменить
|
||||
</n-tooltip>
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<Preview @click="openPreview" />
|
||||
</template>
|
||||
Превью
|
||||
</n-tooltip>
|
||||
<Save @click="saveResult"/>
|
||||
<Trash @click="cleanResult"/>
|
||||
<Back @click="cancel"/>
|
||||
<Preview @click="openPreview"/>
|
||||
</div>
|
||||
<MyDropMenu ref="dropMenu" />
|
||||
<MyDropMenu ref="dropMenu"/>
|
||||
<MyDialog v-model:show="isModalVisible" class="dialogWindow" :is-success=Boolean(listOfTrips.length)>
|
||||
<template #header>
|
||||
<strong v-if="listOfTrips.length">Код готов!</strong>
|
||||
@@ -380,16 +356,14 @@ function onContextMenu(e, item) {
|
||||
<p v-if="listOfTrips.length">Скопируйте или скачайте ваш код</p>
|
||||
<p v-else>Выстройте маршрут перед сохранением кода.</p>
|
||||
</main>
|
||||
<template #footer>
|
||||
<div v-if="listOfTrips.length">
|
||||
<template v-if="listOfTrips.length" #footer>
|
||||
<button @click="isCodeViewVisible = true">Предпросмотр</button>
|
||||
<button @click="handleDownloadBtn">Скачать код</button>
|
||||
<button @click="copyAndToast(finallyText)">Скопировать код</button>
|
||||
</div>
|
||||
</template>
|
||||
</MyDialog>
|
||||
</div>
|
||||
<CodeView v-model:show="isCodeViewVisible" :code="finallyText" :show="isCodeViewVisible" />
|
||||
<CodeView v-model:show="isCodeViewVisible" :code="finallyText" :show="isCodeViewVisible"/>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
@@ -399,15 +373,16 @@ function onContextMenu(e, item) {
|
||||
|
||||
html {
|
||||
background-image: radial-gradient(#23aae3e2, #222222);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
:root {
|
||||
--side: 75px;
|
||||
--side: 8vh;
|
||||
--sizeActions: 5vh;
|
||||
}
|
||||
|
||||
.wraper {
|
||||
@@ -420,36 +395,40 @@ body {
|
||||
display: grid;
|
||||
padding: 3px;
|
||||
grid-template-columns: repeat(10, var(--side));
|
||||
grid-template-rows: repeat(10, var(--side));
|
||||
gap: 5px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.square {
|
||||
width: var(--side);
|
||||
height: var(--side);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
background-size: cover;
|
||||
border: 3px solid rgb(251, 251, 251);
|
||||
border: 3px solid #ffffff;
|
||||
cursor: pointer;
|
||||
overflow-y: scroll;
|
||||
|
||||
background-blend-mode: multiply;
|
||||
background-color: transparent;
|
||||
background-color: #ffffff;
|
||||
transition: background-color 0.3s ease;
|
||||
|
||||
color: white;
|
||||
text-shadow: -1px -1px 0 black,
|
||||
1px -1px 0 black,
|
||||
-1px 1px 0 black,
|
||||
1px 1px 0 black;
|
||||
color: #2267fce2;
|
||||
text-shadow: -1px -1px 0 #fff,
|
||||
1px -1px 0 #fff,
|
||||
-1px 1px 0 #fff,
|
||||
1px 1px 0 #fff;
|
||||
box-sizing: border-box;
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
.square:hover {
|
||||
background-color: rgb(166, 162, 162);
|
||||
background-color: #949494;
|
||||
}
|
||||
|
||||
.square:active {
|
||||
background-color: rgb(164, 162, 162);
|
||||
background-color: #747474;
|
||||
}
|
||||
|
||||
.square::-webkit-scrollbar {
|
||||
@@ -477,8 +456,8 @@ body {
|
||||
}
|
||||
|
||||
.actions svg {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
width: var(--sizeActions);
|
||||
height: var(--sizeActions);
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ const props = defineProps({
|
||||
<div class="code-view" v-if="show">
|
||||
<CustomButton
|
||||
@click.stop="$emit('update:show', false)">
|
||||
Вернуться к сохранению сгенерированного кода
|
||||
Вернуться к генерации маршрута
|
||||
</CustomButton>
|
||||
<CodeBlock :code="code" />
|
||||
|
||||
<CustomButton
|
||||
@click.stop="$emit('update:show', false)">
|
||||
Вернуться к сохранению сгенерированного кода
|
||||
Вернуться к генерации маршрута
|
||||
</CustomButton>
|
||||
<MovementButtons/>
|
||||
</div>
|
||||
|
||||
@@ -80,9 +80,9 @@ useEventListener("keydown", handleKeydown);
|
||||
overflow-x: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 500px;
|
||||
width: 90%;
|
||||
width: 55%;
|
||||
border-radius: 5px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.modal-header,
|
||||
@@ -110,16 +110,17 @@ useEventListener("keydown", handleKeydown);
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
justify-content: flex-end;
|
||||
border-top: 1px solid white;
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.modal-footer button {
|
||||
justify-content: flex-end;
|
||||
width: 33%;
|
||||
border-top: 1px solid white;
|
||||
padding: 5px;
|
||||
color: black;
|
||||
font-size: 15px;
|
||||
font-size: 20px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,8 +99,8 @@ defineExpose({open: () => (isOpen.value = true), close: closeMenu});
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
min-width: 40px;
|
||||
min-height: 30px;
|
||||
background: rgba(255, 255, 255, 0.508);
|
||||
border: 1px solid #383838;
|
||||
cursor: pointer;
|
||||
@@ -109,12 +109,18 @@ defineExpose({open: () => (isOpen.value = true), close: closeMenu});
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
||||
.menu-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.menu-content button{
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.line {
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.cls-1{
|
||||
fill:none;
|
||||
}
|
||||
#Layer_2 {
|
||||
color: black;
|
||||
}
|
||||
.cls-1{fill:none;}
|
||||
|
||||
</style>
|
||||
@@ -41,7 +41,7 @@ def emergency_stop():
|
||||
|
||||
"""Функция экстренной остановки, срабатывает при нажатии Ctrl + C"""
|
||||
|
||||
print("="*50)
|
||||
print("\n" + "="*50)
|
||||
print("EMERGENCY STOP ACTIVATED!")
|
||||
print("="*50)
|
||||
|
||||
@@ -81,7 +81,7 @@ def signal_handler(sig, frame):
|
||||
"""Перехват Ctrl+C: вместо аварийного завершения программы
|
||||
выполняет безопасную посадку дрона."""
|
||||
|
||||
print("Ctrl+C detected - Emergency stop!")
|
||||
print("\nCtrl+C detected - Emergency stop!")
|
||||
emergency_stop()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user