forked from yymin1022/CECOM4CUT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cecom4cut_main.sh
executable file
·41 lines (34 loc) · 1.38 KB
/
cecom4cut_main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
CURRENT_DATE=$(date +"%Y%m%d_%H%M%S")
IMAGE_FILENAME=$CURRENT_DATE
IMAGE_HEIGHT=240
IMAGE_WIDTH=320
QR_HEIGHT=100
QR_WIDTH=320
if [ -z "$PRINTER_MAC" ]; then
echo "Printer address is not registered."
echo "Please run <source set_printer_mac.sh> first"
exit 1
fi
sleep 1
echo "Capturing Image..."
python3 GPIO_Manager/gpio_led_camera_ready.py
python3 Image_Capture/camera.py "result/$IMAGE_FILENAME.jpg"
python3 GPIO_Manager/gpio_led_camera_done.py
echo "Capture Image Done..!"
echo "Processing Image..."
python3 Image_Processing/process.py "result/$IMAGE_FILENAME.jpg" "result/$IMAGE_FILENAME.bmp" $IMAGE_WIDTH $IMAGE_HEIGHT
python3 Image_QR/qr_generator.py "result/$IMAGE_FILENAME"
python3 Image_Processing/process.py "result/$IMAGE_FILENAME.qr.bmp" "result/$IMAGE_FILENAME.qr.bmp" $QR_WIDTH $QR_HEIGHT
echo "Process Image Done..!"
echo "Printing Image..."
bash Print_Scripts/print_bmp.sh "resources/frame_h_rev.bmp" 40 $IMAGE_WIDTH
bash Print_Scripts/print_bmp.sh "result/$IMAGE_FILENAME.bmp" $((IMAGE_HEIGHT + 5)) $IMAGE_WIDTH
bash Print_Scripts/print_bmp.sh "resources/frame_f_rev.bmp" 255 $IMAGE_WIDTH
bash Print_Scripts/print_bmp.sh "result/$IMAGE_FILENAME.qr.bmp" $((QR_HEIGHT + 5)) $QR_WIDTH
sleep 0.1
bash Print_Scripts/print_feed.sh 5
echo "Print Image Done..!"
echo "Uploading Image..."
python3 Image_Upload/image_upload.py "result/$IMAGE_FILENAME.jpg"
echo "Upload Image Done..!"