Exemple #1
0
    def test_author_detailed_found(self):
        with tmp_folder() as tmp_dir:
            create_project_structure(tmp_dir, 'one_post')

            cmd = Commands({'<name>': 'john'})
            with capture() as output:
                cmd.authors()

            regex = re.compile(r".*A post example.*", re.DOTALL)
            self.assertTrue(regex.match(output[0]))
Exemple #2
0
    def test_draft_found(self):
        with tmp_folder() as tmp_dir:
            create_project_structure(tmp_dir, 'one_post_drafted')

            cmd = Commands({})
            with capture() as output:
                cmd.drafts()

            regex = re.compile(r".*A draft example.*", re.DOTALL)
            self.assertTrue(regex.match(output[0]))
Exemple #3
0
    def test_category_found(self):
        with tmp_folder() as tmp_dir:
            create_project_structure(tmp_dir, 'one_post')

            cmd = Commands({'<name>': None})
            with capture() as output:
                cmd.categories()

            regex = re.compile(r".*ExampleCat.*", re.DOTALL)
            self.assertTrue(regex.match(output[0]))
Exemple #4
0
for i in range(-3,5):

    gv.counter = 0
    gv.Kp = 20
    gv.Kd = 10**i
    gv.Ki = 0

    gv.file.write("\n"+str(gv.Kp)+" | "+str(gv.Kd)+" | "+str(gv.Kd)+"\n")

    gv.start = time.time()
    start_global = time.time()
    for frame in gv.camera.capture_continuous(gv.rawCapture, format="bgr", use_video_port=True):

        gv.counter = gv.counter + 1
        success = capture(frame)

        if success:
            PID()
            send_result()

        if gv.logging:
            write_data()

        gv.start = gv.end

        # don't get rid of any of this stuff
        key = cv2.waitKey(1) & 0xFF
        if key == ord("q"):
           break
        gv.rawCapture.truncate(0)
Exemple #5
0
from functions import capture
from datetime import datetime
import sys
import cv2
import numpy as np
import picamera

#usage: push s to shot, push q to quit
rgbcamera = picamera.PiCamera()
rgbcamera.resolution = (800, 600)

while (True):
    frame = capture()
    orig = frame.copy()
    frame = cv2.resize(frame, (0, 0), fx=8, fy=8)
    cv2.imshow('thermal', frame)
    if cv2.waitKey(1) & 0xFF == ord('s'):
        cv2.imwrite("/home/pi/test_shots/" + str(datetime.now()) + "small.jpg",
                    orig)
        cv2.imwrite("/home/pi/test_shots/" + str(datetime.now()) + "large.jpg",
                    frame)
        rgbcamera.capture("/home/pi/test_shots/" + str(datetime.now()) +
                          "color.jpg")
        print("pair photos shot")
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cv2.destroyAllWindows()