Develop #17
+8
-6
@@ -8,6 +8,11 @@ import copyToclipboard from "@/shared/copyToclipboard";
|
||||
import ContextMenu from "@imengyu/vue3-context-menu";
|
||||
import CustomButton from '@/components/UI/CustomButton.vue'
|
||||
|
||||
import emergencyAndNavigate from './shablons/emergency_and_navigate.js'
|
||||
import color from './shablons/color.js'
|
||||
import qr from './shablons/qr.js'
|
||||
|
||||
|
||||
const numbers = ref([]); // Инициализируем массив с пустыми строками
|
||||
const clickCount = ref(1); // Счетчик нажатий
|
||||
const listOfTrips = ref([]);
|
||||
@@ -61,16 +66,14 @@ async function saveResult() {
|
||||
const isUsedQR = listOfTrips.value.some(item => item.isQR);
|
||||
|
||||
if (isUsedPlatform) {
|
||||
const response = await fetch("/shablons/color.txt")
|
||||
let textOfCode = await response.text()
|
||||
let textOfCode = color
|
||||
textOfCode = textOfCode.split('<<separator>>')
|
||||
colorDetectClass.value = textOfCode[0]
|
||||
colorDetectCode.value += `\t${textOfCode[1].trim()}\n`;
|
||||
}
|
||||
|
||||
if (isUsedQR) {
|
||||
const response = await fetch("/shablons/qr.txt")
|
||||
let textOfCode = await response.text()
|
||||
let textOfCode = qr
|
||||
textOfCode = textOfCode.split('<<separator>>')
|
||||
QRDetectClass.value = textOfCode[0]
|
||||
QRDetectCode.value += `\t${textOfCode[1].trim()}\n`;
|
||||
@@ -85,8 +88,7 @@ async function saveResult() {
|
||||
mainCode.value += QRDetectCode.value + '\n'
|
||||
}
|
||||
}
|
||||
const response = await fetch("/shablons/emergency_and_navigate.txt")
|
||||
let textOfCode = await response.text()
|
||||
let textOfCode = emergencyAndNavigate
|
||||
finallyText.value = textOfCode.replace("<<main>>", mainCode.value);
|
||||
if (isUsedPlatform) {
|
||||
finallyText.value = finallyText.value.replace("<<ColorDetect>>", colorDetectClass.value);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
def color_detection(data, print_type='str'):
|
||||
export default `def color_detection(data, print_type='str'):
|
||||
'''определение цвета'''
|
||||
|
||||
frame = bridge.imgmsg_to_cv2(data, 'bgr8')
|
||||
@@ -42,4 +42,4 @@ def color_detection(data, print_type='str'):
|
||||
<<separator>>
|
||||
color_sub = rospy.Subscriber('main_camera/image_raw', Image, lambda img: color_detection(img, print_type='rgb'), queue_size=1)
|
||||
rospy.sleep(2)
|
||||
color_sub.unregister()
|
||||
color_sub.unregister()`
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
export default `#!/usr/bin/env python3
|
||||
|
||||
import rospy
|
||||
import time
|
||||
@@ -102,4 +102,4 @@ def main():
|
||||
land() #посадка
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()`
|
||||
@@ -1,4 +1,4 @@
|
||||
def qr_detection(data):
|
||||
export default `def qr_detection(data):
|
||||
cv_image = bridge.imgmsg_to_cv2(data, 'bgr8')
|
||||
barcodes = pyzbar.decode(cv_image)
|
||||
|
||||
@@ -9,4 +9,4 @@ def qr_detection(data):
|
||||
<<separator>>
|
||||
qr_sub = rospy.Subscriber('main_camera/image_raw', Image, qr_detection, queue_size=1)
|
||||
rospy.sleep(2)
|
||||
qr_sub.unregister()
|
||||
qr_sub.unregister()`
|
||||
Reference in New Issue
Block a user