diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 0e259d42..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,121 +0,0 @@
-Creative Commons Legal Code
-
-CC0 1.0 Universal
-
- CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
- LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
- ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
- INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
- REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
- PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
- THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
- HEREUNDER.
-
-Statement of Purpose
-
-The laws of most jurisdictions throughout the world automatically confer
-exclusive Copyright and Related Rights (defined below) upon the creator
-and subsequent owner(s) (each and all, an "owner") of an original work of
-authorship and/or a database (each, a "Work").
-
-Certain owners wish to permanently relinquish those rights to a Work for
-the purpose of contributing to a commons of creative, cultural and
-scientific works ("Commons") that the public can reliably and without fear
-of later claims of infringement build upon, modify, incorporate in other
-works, reuse and redistribute as freely as possible in any form whatsoever
-and for any purposes, including without limitation commercial purposes.
-These owners may contribute to the Commons to promote the ideal of a free
-culture and the further production of creative, cultural and scientific
-works, or to gain reputation or greater distribution for their Work in
-part through the use and efforts of others.
-
-For these and/or other purposes and motivations, and without any
-expectation of additional consideration or compensation, the person
-associating CC0 with a Work (the "Affirmer"), to the extent that he or she
-is an owner of Copyright and Related Rights in the Work, voluntarily
-elects to apply CC0 to the Work and publicly distribute the Work under its
-terms, with knowledge of his or her Copyright and Related Rights in the
-Work and the meaning and intended legal effect of CC0 on those rights.
-
-1. Copyright and Related Rights. A Work made available under CC0 may be
-protected by copyright and related or neighboring rights ("Copyright and
-Related Rights"). Copyright and Related Rights include, but are not
-limited to, the following:
-
- i. the right to reproduce, adapt, distribute, perform, display,
- communicate, and translate a Work;
- ii. moral rights retained by the original author(s) and/or performer(s);
-iii. publicity and privacy rights pertaining to a person's image or
- likeness depicted in a Work;
- iv. rights protecting against unfair competition in regards to a Work,
- subject to the limitations in paragraph 4(a), below;
- v. rights protecting the extraction, dissemination, use and reuse of data
- in a Work;
- vi. database rights (such as those arising under Directive 96/9/EC of the
- European Parliament and of the Council of 11 March 1996 on the legal
- protection of databases, and under any national implementation
- thereof, including any amended or successor version of such
- directive); and
-vii. other similar, equivalent or corresponding rights throughout the
- world based on applicable law or treaty, and any national
- implementations thereof.
-
-2. Waiver. To the greatest extent permitted by, but not in contravention
-of, applicable law, Affirmer hereby overtly, fully, permanently,
-irrevocably and unconditionally waives, abandons, and surrenders all of
-Affirmer's Copyright and Related Rights and associated claims and causes
-of action, whether now known or unknown (including existing as well as
-future claims and causes of action), in the Work (i) in all territories
-worldwide, (ii) for the maximum duration provided by applicable law or
-treaty (including future time extensions), (iii) in any current or future
-medium and for any number of copies, and (iv) for any purpose whatsoever,
-including without limitation commercial, advertising or promotional
-purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
-member of the public at large and to the detriment of Affirmer's heirs and
-successors, fully intending that such Waiver shall not be subject to
-revocation, rescission, cancellation, termination, or any other legal or
-equitable action to disrupt the quiet enjoyment of the Work by the public
-as contemplated by Affirmer's express Statement of Purpose.
-
-3. Public License Fallback. Should any part of the Waiver for any reason
-be judged legally invalid or ineffective under applicable law, then the
-Waiver shall be preserved to the maximum extent permitted taking into
-account Affirmer's express Statement of Purpose. In addition, to the
-extent the Waiver is so judged Affirmer hereby grants to each affected
-person a royalty-free, non transferable, non sublicensable, non exclusive,
-irrevocable and unconditional license to exercise Affirmer's Copyright and
-Related Rights in the Work (i) in all territories worldwide, (ii) for the
-maximum duration provided by applicable law or treaty (including future
-time extensions), (iii) in any current or future medium and for any number
-of copies, and (iv) for any purpose whatsoever, including without
-limitation commercial, advertising or promotional purposes (the
-"License"). The License shall be deemed effective as of the date CC0 was
-applied by Affirmer to the Work. Should any part of the License for any
-reason be judged legally invalid or ineffective under applicable law, such
-partial invalidity or ineffectiveness shall not invalidate the remainder
-of the License, and in such case Affirmer hereby affirms that he or she
-will not (i) exercise any of his or her remaining Copyright and Related
-Rights in the Work or (ii) assert any associated claims and causes of
-action with respect to the Work, in either case contrary to Affirmer's
-express Statement of Purpose.
-
-4. Limitations and Disclaimers.
-
- a. No trademark or patent rights held by Affirmer are waived, abandoned,
- surrendered, licensed or otherwise affected by this document.
- b. Affirmer offers the Work as-is and makes no representations or
- warranties of any kind concerning the Work, express, implied,
- statutory or otherwise, including without limitation warranties of
- title, merchantability, fitness for a particular purpose, non
- infringement, or the absence of latent or other defects, accuracy, or
- the present or absence of errors, whether or not discoverable, all to
- the greatest extent permissible under applicable law.
- c. Affirmer disclaims responsibility for clearing rights of other persons
- that may apply to the Work or any use thereof, including without
- limitation any person's Copyright and Related Rights in the Work.
- Further, Affirmer disclaims responsibility for obtaining any necessary
- consents, permissions or other rights required for any use of the
- Work.
- d. Affirmer understands and acknowledges that Creative Commons is not a
- party to this document and has no duty or obligation with respect to
- this CC0 or use of the Work.
diff --git a/Project1/Project1.md b/Project1/Project1.md
deleted file mode 100644
index 07e8650b..00000000
--- a/Project1/Project1.md
+++ /dev/null
@@ -1,271 +0,0 @@
-
-9/7
-
-## Team _'Lamborghini'_ made it!_
-
-First, Assemble our piracer with wiki guide.
-
-
-
-Second, Install Raspberry pi imager to program in to the SD card.
-
-Insert SD card in the laptop, and execute Raspberry pi imager.
-
-
-- Choose operating system.
-
-- Choose storage (our SD card)
-
-- Choose advanced options to use SSH, Wifi
-
-
-(we can use VNC viewer to SSH)
-
-- Set id, passward for using SSH
-
-- Connect Wifi
-
-- Choose Wireless LAN country : DE (Germany)
-
-- Write
-
-Third, setup workspace with wiki guide.
-
-Follow guide of Donkeycar.
-
-1. Setup Raspberry pi
-
-We have problem installing libraries for OpenCV
-
-We can’t install `libqtgui4 libqt4-test`
-
-Because we got this error message.
-
-**E: Package 'libqtgui4' has no installation candidate**
-
-**E: Unable to locate package libqt4-test**
-
-Also, we have problem installing tensorflow.
-
-For this reason, We did install the other version. (tensorflow-1.9.0)
-
-`pip3 install --upgrade [https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl](https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl)`
-
-1. VNC viewer
-
-If we want to use raspberry pi, we needed a moniter.
-
-Each team can’t get one moniter so we connect VNC viewer.
-
-- Download VNC viewer.
-- Install putty
-
-`sudo apt install putty`
-
-`putty —version`
-- Execute putty client.
-
-- Fill IP address & choose SSH.
-
-- Change fonts server:fixed → Ubuntu mono.
-
-- Login raspberry pi (we set id, passward for using SSH before).
-
-- Execute VNC viewer.
-
-We got this error "The connection was refused by the host computer”
-
-It can be solved VNC → Enable (for using VNC viewer).
-
-1. WEB control
-
-For WEB control to Donkeycar, we have to change interface options.
-
-`sudo raspi-config`
-
-
-
-- Legacy Camera → Enable
-
-- SSH → Enable
-
-- VNC → Enable (for using VNC viewer)
-
-
-If you have picamera error, change Legacy Camera → enable .
-
-But we also have other problem to using Donkeycar.
-`Traceback (most recent call last):
- File "/home/lambo/mycar/manage.py", line 717, in
- drive(cfg, model_path=args['--model'], use_joystick=args['--js'],
- File "/home/lambo/mycar/manage.py", line 525, in drive
- steering_controller = PCA9685(cfg.STEERING_CHANNEL, cfg.PCA9685_I2C_ADDR, busnum=cfg.PCA9685_I2C_BUSNUM)
- File "/home/lambo/projects/donkeycar/donkeycar/parts/actuator.py", line 30, in __init__
- self.pwm = Adafruit_PCA9685.PCA9685(address=address)
- File "/home/lambo/env/lib/python3.9/site-packages/Adafruit_PCA9685/PCA9685.py", line 74, in __init__
- self._device = i2c.get_i2c_device(address, **kwargs)
- File "/home/lambo/env/lib/python3.9/site-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
- busnum = get_default_bus()
- File "/home/lambo/env/lib/python3.9/site-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
- raise RuntimeError('Could not determine default I2C bus for platform.')
-RuntimeError: Could not determine default I2C bus for platform.`
-For solve this problem, I tried next things.
-
-- Change Adafruit_GPIO script.
-
-one workaround is edit this file:
-
-/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/Platform.py
-
-Search:
-
-elif match.group(1) == '**BCM2835**':
-
-replace it with:
-
-elif match.group(1) == '**BCM2711**':
-
-- uninstall Adafruit_GPIO & re install Adafruit_GPIO
-
-`sudo pip3 uninstall Adafruit-PureIO`
-`sudo pip3 install Adafruit-PureIO`
-
-But we can’t solve this problem.
-
-And also we can't connect web control **https://our raspberry pi ip:8887**
-
-
---------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-2022.09.07
-
-
-Like yesterday, Joypad was well connected with RB Pi, but It didn't work with servo or motor in Jetracer.
-
-we assume that problem was not software, but hardware.
-we reassembled the jet racer, but motor still doesn't work at all.
-
-After that, we found code from rasberrypi / config.py
-which is
-```
-Joystick_mode = 'xbox'
-```
-
-I've follow the guidline in jetracer wiki again.
-.
-
-.
-
-Or, just use the xbox gamepad in the lobby, but there was no special things.
-
-
-
-After that, we found that Error about 'PCA9685' which there is no driver for 'servo'
-
-to solve, we codded below.
-
-
-
-
-
-
-
-
-
-9/8
-
-There were so many versions of Rasberry pi,
-Today, we planned that rather than down-grade the version of RPI4, watch one more guideline, and install the proper software.
-[DONKEY CAR]: <[https://docs.donkeycar.com/]>
-
-```
-donkey createcar --path ~/mycar
-````
-
-```
-cd ~/mycar
-nano myconfig.py
-```
-
-```
-sudo usermod -aG i2c $USER
-sudo reboot
-```
-
-
-```
-sudo i2cdetect -r -y 1
-```
-
-
-```
-sudo apt-get install -y i2c-tools
-sudo i2cdetect -y 1
-```
---------------------------------------------------------------------------------------------
-every thing was going great to this project
-but we have a lot of time spending to solve this problem
-
-```
-# result must do like this
- 0 1 2 3 4 5 6 7 8 9 a b c d e f
-00: -- -- -- -- -- -- -- -- -- -- -- -- --
-10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-70: 70 -- -- -- -- -- -- --
-```
-
-
-```
-# but our result was this
- 0 1 2 3 4 5 6 7 8 9 a b c d e f
-00: -- -- -- -- -- -- -- -- -- -- -- -- --
-10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-70: -- -- -- -- -- -- -- --
-```
-
-it means that our connection between servo and RPI doesn't match.
-
-
-
-
-
-
-
-9/12
-
-
-
-We assume that connection error was not for driver, but for hardware, so we changed only the board(not the piracer, not the rasberry pi), and solve the problem.
-All the process was well running, and we can operate the piracer forward or backward.
-
-
-Also, we want to customize the key between joypad and Piracer,
-So, we have to create joystick creator wizard to type
-
-```
-cd ~/mycar
-donkey createjs
-```
-
-after the process, I completed my settings like this
-
-
-
-
-
-P.S
-There was unexpected issue in cable. so always be careful!
-
-
-
-
diff --git a/Project1/Readme.md b/Project1/Readme.md
new file mode 100644
index 00000000..7880ee15
--- /dev/null
+++ b/Project1/Readme.md
@@ -0,0 +1,336 @@
+# Project 1
+
+First project is to assemble RC car, and make software environment about RPI.
+
+In SEA:ME we use ‘PiRacer Pro’.
+
+@[https://www.waveshare.com/wiki/PiRacer_Pro_AI_Kit](https://www.waveshare.com/wiki/PiRacer_Pro_AI_Kit)
+
+here is the official wiki, and you can get information about piracer
+# Prepare Software
+
+Rpi will be a main computer of our project.
+
+To run RPI, first you have to install OS in the RPI board.
+
+Not all the versions are compatible. So you have to download this version
+
+@[https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip](https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip)
+
+Also you need ‘Imager’ to install OS from .zip file
+
+@[https://www.raspberrypi.com/software/](https://www.raspberrypi.com/software/) you can download it here.
+
+1. operate Rasberry Pi Imager.
+2. Choose operating system
+
+
+
+3. select custom
+
+
+
+
+4. upload [2021-12-02-raspios-buster-armhf-lite.zip]
+
+
+
+
+5. select ‘setting’ and do like this
+
+
+
+
+
+‘Host name’ represent your RPI user name
+
+‘SSH’ enables you to connect RPI in other computer. It enables you use RPI without display monitor.
+
+‘Wireless LAN’ To use RPI in your laptop, you have the same network with RPI, laptop.
+
+1. Select your storage, and press ‘write’ to write down [2021-12-02-raspios-buster-armhf-lite.zip](https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip) in your RPI OS.
+
+
+
+
+
+6. If all installation completed, put your sd card in raspberry pi.
+
+7. coneect the power cable, and HDMI cable to check your RPI IP adress.
+
+### Install Putty
+
+To connect your raspberry pi with your computer, you have to install putty in your lap top.
+
+@[https://www.putty.org/](https://www.putty.org/)
+
+download putty in your laptop, and opertate putty.
+
+Type your Rpi IP adress in ‘Host Name’
+
+
+
+
+
+## Install requirements for Donkey car.
+
+Now, your RPI is connected with your laptop. You can type command in putty to send message to RPI.
+
+Type thes to install requirements for Donkey car in your RPI
+
+`raspberry pi`
+
+1. Update&Upgrade RP
+
+```jsx
+sudo apt-get update --allow-releaseinfo-change
+sudo apt-get upgrade
+```
+
+2. Setting
+
+```jsx
+sudo raspi-config
+```
+
+
+
+
+
+interfacing - camera
+
+- 2. `interfacing` → `camera` enable
+- 2. `interfacing` → `ssh` enable
+- 2. `interfacing` → `i2c` enable
+- 6. `advanced options` → `expand filesystem` enable
+
+3. Install requirements
+
+```jsx
+sudo apt-get install build-essential python3 python3-dev python3-pip python3-virtualenv python3-numpy python3-picamera python3-pandas python3-rpi.gpio i2c-tools avahi-utils joystick libopenjp2-7-dev libtiff5-dev gfortran libatlas-base-dev libopenblas-dev libhdf5-serial-dev libgeos-dev git ntp
+```
+
+```jsx
+sudo apt-get install libilmbase-dev libopenexr-dev libgstreamer1.0-dev libjasper-dev libwebp-dev libatlas-base-dev libavcodec-dev libavformat-dev libswscale-dev libqtgui4 libqt4-testpython3 -m virtualenv -p python3 env --system-site-packages
+echo "source ~/env/bin/activate" >> ~/.bashrc
+source ~/.bashrc
+```
+
+```jsx
+cd ~
+mkdir projects
+cd projects
+```
+
+```jsx
+git clone https://github.com/autorope/donkeycar
+cd donkeycar
+git checkout main
+pip install -e .[pi]
+pip install https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.2.0/tensorflow-2.2.0-cp37-none-linux_armv7l.whl
+```
+
+```jsx
+sudo apt install python3-opencv
+```
+
+```jsx
+python -c "import cv2"
+```
+
+4. Install diplay
+
+```jsx
+cd ~
+git clone https://github.com/waveshare/pi-display
+cd pi-display
+sudo ./install.sh
+```
+
+```jsx
+sudo pip3 install flask
+```
+
+```jsx
+cd pidisplay
+sudo vi display_server.py
+```
+
+
+
+5. change line8
+
+**.utils** to **utils**
+
+ displya_server.py
+
+
+ import threading
+ import Adafruit_SSD1306
+ import time
+ import PIL.Image
+ import PIL.ImageFont
+ import PIL.ImageDraw
+ from flask import Flask
+ from utils import ip_address, cpu_usage, memory_usage, disk_usage, temp
+ from pidisplay import ads1115
+ from pidisplay import ina219
+ import os
+
+
+
+
+6. reboot
+
+```jsx
+sudo reboot
+```
+
+Now, you can see your IP through display.
+
+7. Fix your Raspberrypi address
+
+```jsx
+cd ~
+sudo vi /etc/dhcpcd.conf
+```
+
+add below line at the end of code.
+
+```jsx
+interface wlan0
+static ip_address="your IP Address"
+static routers="your IP address, but end is 1"
+```
+
+
+
+ dhcpcd.conf (in my case)
+
+
+ ~
+ # A list of options to request from the DHCP server.
+ option domain_name_servers, domain_name, domain_search, host_name
+ option classless_static_routes
+ # Respect the network MTU. This is applied to DHCP routes.
+ option interface_mtu
+
+ # Most distributions have NTP support.
+ #option ntp_servers
+
+ # A ServerID is required by RFC2131.
+ require dhcp_server_identifier
+
+ # Generate SLAAC address using the Hardware Address of the interface
+ #slaac hwaddr
+ # OR generate Stable Private IPv6 Addresses based from the DUID
+ slaac private
+
+ # Example static IP configuration:
+ #interface eth0
+ #static ip_address=192.168.0.10/24
+ #static ip6_address=fd51:42f8:caae:d92e::ff/64
+ #static routers=192.168.0.1
+ #static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
+
+ # It is possible to fall back to a static IP if DHCP fails:
+ # define static profile
+ #profile static_eth0
+ #static ip_address=192.168.1.23/24
+ #static routers=192.168.1.1
+ #static domain_name_servers=192.168.1.1
+
+ # fallback to static profile on eth0
+ #interface eth0
+ #fallback static_eth0
+
+ interface wlan0
+ static ip_address="192.168.0.107"
+ static routers="192.168.0.1"
+ interface wlan0
+ static ip_address="192.168.0.107"
+ static routers="192.168.0.1"
+
+
+
+type this to restart network
+
+```jsx
+sudo /etc/init.d/networking restart
+```
+
+## Install Donkey car
+
+`raspberry pi`
+
+1. create donkeycar path
+
+```jsx
+donkey createcar --path ~/mycar
+```
+
+2. Install I2C board.
+
+```jsx
+sudo apt-get install -y i2c-tools
+```
+
+type this to check If i2c board is connected with your RPI
+
+```jsx
+sudo i2cdetect -y 1
+```
+
+
+
+If I2C board is connected like this,
+
+you can see the output
+
+```jsx
+(env) joe@joe:~ $ sudo i2cdetect -y 1
+ 0 1 2 3 4 5 6 7 8 9 a b c d e f
+00: -- -- -- -- -- -- -- -- -- -- -- -- --
+10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
+40: 40 -- 42 -- -- -- -- -- -- -- -- -- -- -- -- --
+50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+70: 70 -- -- -- -- -- -- --
+```
+
+※ If there’s no response like this, or more than 3 secodns to print this message, maybe your I2C board is broken. So replace your I2C board.
+
+3. Time to operate Donkey car!
+
+`(Web Control)`
+
+```jsx
+source ~/env/bin/activate
+cd ~/mycar
+python manage.py drive
+```
+
+go to :8887
+
+In my case it was `192.168.0.107:8887`
+
+`(Joypad Control)`
+
+```jsx
+source ~/eng/bin/activate
+cd ~/mycar
+python manage.py drive --js
+```
+
+Connect your USB dongle and joypad which was included in Pi-Racer Box.
+
+If there’s an error, make sure your hardware setting.
+
+(for example, you didn’t connect Camera wire with Raspberry pi / your I2C board is broken..)
\ No newline at end of file
diff --git a/Project1/image/1.png b/Project1/image/1.png
new file mode 100644
index 00000000..7036a515
Binary files /dev/null and b/Project1/image/1.png differ
diff --git a/Project1/image/2.png b/Project1/image/2.png
new file mode 100644
index 00000000..7e15596a
Binary files /dev/null and b/Project1/image/2.png differ
diff --git a/Project1/image/3.png b/Project1/image/3.png
new file mode 100644
index 00000000..6e431144
Binary files /dev/null and b/Project1/image/3.png differ
diff --git a/Project1/image/4.png b/Project1/image/4.png
new file mode 100644
index 00000000..93d7e262
Binary files /dev/null and b/Project1/image/4.png differ
diff --git a/Project1/image/5.png b/Project1/image/5.png
new file mode 100644
index 00000000..cb778bc8
Binary files /dev/null and b/Project1/image/5.png differ
diff --git a/Project1/image/6.png b/Project1/image/6.png
new file mode 100644
index 00000000..ed5d195b
Binary files /dev/null and b/Project1/image/6.png differ
diff --git a/Project1/image/7.png b/Project1/image/7.png
new file mode 100644
index 00000000..40dc0bf0
Binary files /dev/null and b/Project1/image/7.png differ
diff --git a/Project1/image/8.jpg b/Project1/image/8.jpg
new file mode 100644
index 00000000..fc9dc64d
Binary files /dev/null and b/Project1/image/8.jpg differ
diff --git a/Project2/project2.md b/Project2/Readme.md
similarity index 98%
rename from Project2/project2.md
rename to Project2/Readme.md
index f410d750..edf4a82b 100644
--- a/Project2/project2.md
+++ b/Project2/Readme.md
@@ -1,3 +1,9 @@
+
+
# Intro
Third project is making an Operating System for Raspberry Pi 4.
@@ -8,49 +14,47 @@ Sensor checker / CAN / D-Bus / Dashboard.
We are gonna make an Operating System to operate these whole programs.
-So.. we need to install CAN / D-Bus / QT in our custom recipes.\
-
-# 참고한 사이트들
+So.. we need to install CAN / D-Bus / QT in our custom recipes.
+
-[https://github.com/jynik/ready-set-yocto](https://github.com/jynik/ready-set-yocto)
# About Yocto
+
+ About Yocto
+
-- About Yocto
-
- ### OS
-
- In Project 1
- We installed [2021-12-02-raspios-buster.zip](https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip) using Rasbian Imager.
+## OS
- But in this Project. We have to install OS In sd card without using Rasbian Imager.
+In Project 1
- ### Yocto
+We installed [2021-12-02-raspios-buster.zip](https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2021-12-02/2021-12-02-raspios-buster-armhf-lite.zip) using Rasbian Imager.
- @[https://selfish-developer.com/entry/Yocto란-무엇인가](https://selfish-developer.com/entry/Yocto%EB%9E%80-%EB%AC%B4%EC%97%87%EC%9D%B8%EA%B0%80)
+But in this Project. We have to install OS In sd card without using Rasbian Imager.
+
- To use Yocto, you must use git skillfully. Yocto automatically patches source code to new version through git.
+## Yocto
- ### Poky
+@[https://selfish-developer.com/entry/Yocto란-무엇인가](https://selfish-developer.com/entry/Yocto%EB%9E%80-%EB%AC%B4%EC%97%87%EC%9D%B8%EA%B0%80)
- also there’s lots of extension
+To use Yocto, you must use git skillfully. Yocto automatically patches source code to new version through git.
+
- But, we use Raspberrypi. So we will use Raspberrypi extension.
+## Poky
- @[https://github.com/agherzan/meta-raspberrypi/tree/kirkstone](https://github.com/agherzan/meta-raspberrypi/tree/kirkstone)
+also there’s lots of extension
- ### BitBake
+But, we use Raspberrypi. So we will use Raspberrypi extension.
- ### AGL
+@[https://github.com/agherzan/meta-raspberrypi/tree/kirkstone](https://github.com/agherzan/meta-raspberrypi/tree/kirkstone)
+
- ### BSP
-
- board support package
+
+### BSP
- maybe
+board support package
- ```jsx
+```jsx
/home/**username**/yocto/kirkstone/poky/meta \
/home/**username**/yocto/kirkstone/poky/meta-poky \
/home/**username**/yocto/kirkstone/poky/meta-yocto-bsp \
@@ -59,134 +63,137 @@ So.. we need to install CAN / D-Bus / QT in our custom recipes.\
/home/**username**/yocto/kirkstone/meta-openembedded/meta-networking \
/home/**username**/yocto/kirkstone/meta-openembedded/meta-python \
/home/**username**/yocto/kirkstone/meta-raspberrypi \
- ```
-
- this will be BSP
+```
+this will be BSP
+
+
# Make Basic OS
-- Make Basic OS
-
- ## 1. Poky
-
- `PC`
-
- 1. Install dependencies
-
- ```jsx
- sudo apt install build-essential chrpath gawk git bmap-tools texinfo diffstat
- ```
-
- 1. Make a directory to run yocto. In my case I made it in the home directory
-
- ```jsx
- mkdir ~yocto
- cd ~/yocto
- mkdir kirkstone
- cd kirkstone
- mkdir builds
- mkdir downloads
- ```
-
- 1. Clone poky
-
- ```jsx
- git clone -b kirkstone git://git.yoctoproject.org/poky.git
- ```
-
- 1. Clone poky raspberry pi extension / dependencies of raspberry pi extension
-
- ```jsx
- git clone -b kirkstone https://github.com/agherzan/meta-raspberrypi.git
- git clone -b kirkstone git://git.openembedded.org/meta-openembedded
- ```
-
- 1. Enter build environment
-
- ```jsx
- source oe-init-build-env projectname
- ```
-
- source oe-init-build-env 경로명
-
- 이 명령어를 사용시, 해당 경로에 build디렉토리가 생성된다.
-
- 나의 경우는 ↓명령어로 디렉토리를 설정해주었다.
-
- ```jsx
- source ~/yocto/kirkstone/poky/oe-init-build-env ../**Projectname**
- ```
-
- - In my case
-
- ```jsx
- source ~/yocto/kirkstone/poky/oe-init-build-env ../**raspberrypi4**
- ```
-
-
- 코드설명 : 최신상태로 변경된 poky/oe-init-build-env라는 파일을 실행시킨 후, builds/rpi라는 폴더에 build파일 만듦.
-
- 1. Add layers
-
- Go to the directory just before you made.
-
- ```jsx
- cd ~/yocto/kirkstone/builds/raspberrypi4/conf
- vi bblayers.conf
- ```
-
- add below lines.
-
- ```jsx
- /home/**username**/yocto/kirkstone/poky/meta \
- /home/**username**/yocto/kirkstone/poky/meta-poky \
- /home/**username**/yocto/kirkstone/poky/meta-yocto-bsp \
- /home/**username**/yocto/kirkstone/meta-openembedded/meta-oe \
- /home/**username**//yocto/kirkstone/meta-openembedded/meta-multimedia \
- /home/**username**/yocto/kirkstone/meta-openembedded/meta-networking \
- /home/**username**/yocto/kirkstone/meta-openembedded/meta-python \
- /home/**username**/yocto/kirkstone/meta-raspberrypi \
- ```
-
- - bblayers.conf (in my case)
-
- ```jsx
- # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
- # changes incompatibly
- POKY_BBLAYERS_CONF_VERSION = "2"
-
- BBPATH = "${TOPDIR}"
- BBFILES ?= ""
-
- BBLAYERS ?= " \
- /home/seame-fablab/yocto/kirkstone/poky/meta \
- /home/seame-fablab/yocto/kirkstone/poky/meta-poky \
- /home/seame-fablab/yocto/kirkstone/poky/meta-yocto-bsp \
- /home/seame-fablab/yocto/kirkstone/meta-openembedded/meta-oe \
- /home/seame-fablab//yocto/kirkstone/meta-openembedded/meta-multimedia \
- /home/seame-fablab/yocto/kirkstone/meta-openembedded/meta-networking \
- /home/seame-fablab/yocto/kirkstone/meta-openembedded/meta-python \
- /home/seame-fablab/yocto/kirkstone/meta-raspberrypi \
- "
- ```
-
+
+ Make Basic OS
+
+
+
+## 1. Install dependencies
+
+```jsx
+sudo apt install build-essential chrpath gawk git bmap-tools texinfo diffstat
+```
+
+## 2. Make a directory to run yocto.
+In my case I made it in the home directory
+
+```jsx
+mkdir ~yocto
+cd ~/yocto
+mkdir kirkstone
+cd kirkstone
+mkdir builds
+mkdir downloads
+```
+
+## 3. Clone poky
+
+```jsx
+git clone -b kirkstone git://git.yoctoproject.org/poky.git
+```
+
+
+
+## 4. Clone poky raspberry pi extension / dependencies of raspberry pi extension
+
+```jsx
+git clone -b kirkstone https://github.com/agherzan/meta-raspberrypi.git
+git clone -b kirkstone git://git.openembedded.org/meta-openembedded
+```
+
+## 5. Enter build environment
+
+```jsx
+source oe-init-build-env projectname
+```
+(You can use this command to make build directory.
+In my case, I used this↓ command to make directory)
+
+ In my case
+
+
- 1. Update MACHINE and change directory
+ source ~/yocto/kirkstone/poky/oe-init-build-env ~/yocto/kirkstone/builds/rpi
- ```jsx
- cd ~/yocto/kirkstone/builds/rpi/conf
- vi local.conf
- ```
+ # It means, activate oe-init-build-env, and make build file at builds/rpi.
+
+
+
+## 6. Add layers
+
+Go to the directory just before you made.
+
+```jsx
+cd ~/yocto/kirkstone/builds/rpi/conf
+vi bblayers.conf
+```
+
+add below lines.
+
+```jsx
+ /home/**username**/yocto/kirkstone/poky/meta \
+ /home/**username**/yocto/kirkstone/poky/meta-poky \
+ /home/**username**/yocto/kirkstone/poky/meta-yocto-bsp \
+ /home/**username**/yocto/kirkstone/meta-openembedded/meta-oe \
+ /home/**username**//yocto/kirkstone/meta-openembedded/meta-multimedia \
+ /home/**username**/yocto/kirkstone/meta-openembedded/meta-networking \
+ /home/**username**/yocto/kirkstone/meta-openembedded/meta-python \
+ /home/**username**/yocto/kirkstone/meta-raspberrypi \
+```
+
+
+
+- bblayers.conf (in my case)
+
+
- ```jsx
- MACHINE = "raspberrypi4"
- #DL_DIR ?= "~/yocto/kirkstone/downloads"
- ENABLE_UART = "1"
- RPI_USE_U_BOOT = "1"
```
-
- ```jsx
also attached this
at the end of line
@@ -195,385 +202,401 @@ So.. we need to install CAN / D-Bus / QT in our custom recipes.\
```
- - local.conf (in my case)
-
- ```jsx
- #
- # This file is your local configuration file and is where all local user settings
- # are placed. The comments in this file give some guide to the options a new user
- # to the system might want to change but pretty much any configuration option can
- # be set in this file. More adventurous users can look at
- # local.conf.sample.extended which contains other examples of configuration which
- # can be placed in this file but new users likely won't need any of them
- # initially.
- #
- # Lines starting with the '#' character are commented out and in some cases the
- # default values are provided as comments to show people example syntax. Enabling
- # the option is a question of removing the # character and making any change to the
- # variable as required.
-
- #
- # Machine Selection
- #
- # You need to select a specific machine to target the build with. There are a selection
- # of emulated machines available which can boot and run in the QEMU emulator:
- #
- #MACHINE ?= "qemuarm"
- #MACHINE ?= "qemuarm64"
- #MACHINE ?= "qemumips"
- #MACHINE ?= "qemumips64"
- #MACHINE ?= "qemuppc"
- #MACHINE ?= "qemux86"
- #MACHINE ?= "qemux86-64"
- MACHINE ?= "raspberrypi4"
- #
- # There are also the following hardware board target machines included for
- # demonstration purposes:
- #
- #MACHINE ?= "beaglebone-yocto"
- #MACHINE ?= "genericx86"
- #MACHINE ?= "genericx86-64"
- #MACHINE ?= "edgerouter"
- #
- # This sets the default machine to be qemux86-64 if no other machine is selected:
- MACHINE = "raspberrypi4"
-
- #
- # Where to place downloads
- #
- # During a first build the system will download many different source code tarballs
- # from various upstream projects. This can take a while, particularly if your network
- # connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
- # can preserve this directory to speed up this part of subsequent builds. This directory
- # is safe to share between multiple builds on the same machine too.
- #
- # The default is a downloads directory under TOPDIR which is the build directory.
- #
- #DL_DIR = "~/yocto/kirkstone/downloads"
-
- #
- # Where to place shared-state files
- #
- # BitBake has the capability to accelerate builds based on previously built output.
- # This is done using "shared state" files which can be thought of as cache objects
- # and this option determines where those files are placed.
- #
- # You can wipe out TMPDIR leaving this directory intact and the build would regenerate
- # from these files if no changes were made to the configuration. If changes were made
- # to the configuration, only shared state files where the state was still valid would
- # be used (done using checksums).
- #
- # The default is a sstate-cache directory under TOPDIR.
- #
- #SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
-
- #
- # Where to place the build output
- #
- # This option specifies where the bulk of the building work should be done and
- # where BitBake should place its temporary files and output. Keep in mind that
- # this includes the extraction and compilation of many applications and the toolchain
- # which can use Gigabytes of hard disk space.
- #
- # The default is a tmp directory under TOPDIR.
- #
- #TMPDIR = "${TOPDIR}/tmp"
-
- #
- # Default policy config
- #
- # The distribution setting controls which policy settings are used as defaults.
- # The default value is fine for general Yocto project use, at least initially.
- # Ultimately when creating custom policy, people will likely end up subclassing
- # these defaults.
- #
- DISTRO ?= "poky"
- # As an example of a subclass there is a "bleeding" edge policy configuration
- # where many versions are set to the absolute latest code from the upstream
- # source control systems. This is just mentioned here as an example, its not
- # useful to most new users.
- # DISTRO ?= "poky-bleeding"
-
- #
- # Package Management configuration
- #
- # This variable lists which packaging formats to enable. Multiple package backends
- # can be enabled at once and the first item listed in the variable will be used
- # to generate the root filesystems.
- # Options are:
- # - 'package_deb' for debian style deb files
- # - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
- # - 'package_rpm' for rpm style packages
- # E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
- # We default to rpm:
- PACKAGE_CLASSES ?= "package_rpm"
-
- #
- # SDK target architecture
- #
- # This variable specifies the architecture to build SDK items for and means
- # you can build the SDK packages for architectures other than the machine you are
- # running the build on (i.e. building i686 packages on an x86_64 host).
- # Supported values are i686, x86_64, aarch64
- #SDKMACHINE ?= "i686"
-
- #
- # Extra image configuration defaults
- #
- # The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
- # images. Some of these options are added to certain image types automatically. The
- # variable can contain the following options:
- # "dbg-pkgs" - add -dbg packages for all installed packages
- # (adds symbol information for debugging/profiling)
- # "src-pkgs" - add -src packages for all installed packages
- # (adds source code for debugging)
- # "dev-pkgs" - add -dev packages for all installed packages
- # (useful if you want to develop against libs in the image)
- # "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
- # (useful if you want to run the package test suites)
- # "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
- # "tools-debug" - add debugging tools (gdb, strace)
- # "eclipse-debug" - add Eclipse remote debugging support
- # "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
- # "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
- # "debug-tweaks" - make an image suitable for development
- # e.g. ssh root access has a blank password
- # There are other application targets that can be used here too, see
- # meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
- # We default to enabling the debugging tweaks.
- EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
-
- #
- # Additional image features
- #
- # The following is a list of additional classes to use when building images which
- # enable extra features. Some available options which can be included in this variable
- # are:
- # - 'buildstats' collect build statistics
- USER_CLASSES ?= "buildstats"
-
- #
- # Runtime testing of images
- #
- # The build system can test booting virtual machine images under qemu (an emulator)
- # after any root filesystems are created and run tests against those images. It can also
- # run tests against any SDK that are built. To enable this uncomment these lines.
- # See classes/test{image,sdk}.bbclass for further details.
- #IMAGE_CLASSES += "testimage testsdk"
- #TESTIMAGE_AUTO:qemuall = "1"
-
- #
- # Interactive shell configuration
- #
- # Under certain circumstances the system may need input from you and to do this it
- # can launch an interactive shell. It needs to do this since the build is
- # multithreaded and needs to be able to handle the case where more than one parallel
- # process may require the user's attention. The default is iterate over the available
- # terminal types to find one that works.
- #
- # Examples of the occasions this may happen are when resolving patches which cannot
- # be applied, to use the devshell or the kernel menuconfig
- #
- # Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
- # Note: currently, Konsole support only works for KDE 3.x due to the way
- # newer Konsole versions behave
- #OE_TERMINAL = "auto"
- # By default disable interactive patch resolution (tasks will just fail instead):
- PATCHRESOLVE = "noop"
-
- #
- # Disk Space Monitoring during the build
- #
- # Monitor the disk space during the build. If there is less that 1GB of space or less
- # than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
- # shutdown the build. If there is less than 100MB or 1K inodes, perform a hard halt
- # of the build. The reason for this is that running completely out of space can corrupt
- # files and damages the build in ways which may not be easily recoverable.
- # It's necessary to monitor /tmp, if there is no space left the build will fail
- # with very exotic errors.
- BB_DISKMON_DIRS ??= "\
- STOPTASKS,${TMPDIR},1G,100K \
- STOPTASKS,${DL_DIR},1G,100K \
- STOPTASKS,${SSTATE_DIR},1G,100K \
- STOPTASKS,/tmp,100M,100K \
- HALT,${TMPDIR},100M,1K \
- HALT,${DL_DIR},100M,1K \
- HALT,${SSTATE_DIR},100M,1K \
- HALT,/tmp,10M,1K"
-
- #
- # Shared-state files from other locations
- #
- # As mentioned above, shared state files are prebuilt cache data objects which can be
- # used to accelerate build time. This variable can be used to configure the system
- # to search other mirror locations for these objects before it builds the data itself.
- #
- # This can be a filesystem directory, or a remote url such as https or ftp. These
- # would contain the sstate-cache results from previous builds (possibly from other
- # machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
- # cache locations to check for the shared objects.
- # NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
- # at the end as shown in the examples below. This will be substituted with the
- # correct path within the directory structure.
- #SSTATE_MIRRORS ?= "\
- #file://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \
- #file://.* file:///some/local/dir/sstate/PATH"
-
- #
- # Yocto Project SState Mirror
- #
- # The Yocto Project has prebuilt artefacts available for its releases, you can enable
- # use of these by uncommenting the following lines. This will mean the build uses
- # the network to check for artefacts at the start of builds, which does slow it down
- # equally, it will also speed up the builds by not having to build things if they are
- # present in the cache. It assumes you can download something faster than you can build it
- # which will depend on your network.
- # Note: For this to work you also need hash-equivalence passthrough to the matching server
- #
- #BB_HASHSERVE_UPSTREAM = "typhoon.yocto.io:8687"
- #SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
-
- #
- # Qemu configuration
- #
- # By default native qemu will build with a builtin VNC server where graphical output can be
- # seen. The line below enables the SDL UI frontend too.
- PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
- # By default libsdl2-native will be built, if you want to use your host's libSDL instead of
- # the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
- #ASSUME_PROVIDED += "libsdl2-native"
-
- # You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
- # a handy set of menus for controlling the emulator.
- #PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
-
- #
- # Hash Equivalence
- #
- # Enable support for automatically running a local hash equivalence server and
- # instruct bitbake to use a hash equivalence aware signature generator. Hash
- # equivalence improves reuse of sstate by detecting when a given sstate
- # artifact can be reused as equivalent, even if the current task hash doesn't
- # match the one that generated the artifact.
- #
- # A shared hash equivalent server can be set with ":" format
- #
- #BB_HASHSERVE = "auto"
- #BB_SIGNATURE_HANDLER = "OEEquivHash"
-
- #
- # Memory Resident Bitbake
- #
- # Bitbake's server component can stay in memory after the UI for the current command
- # has completed. This means subsequent commands can run faster since there is no need
- # for bitbake to reload cache files and so on. Number is in seconds, after which the
- # server will shut down.
- #
- #BB_SERVER_TIMEOUT = "60"
-
- # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
- # track the version of this file when it was generated. This can safely be ignored if
- # this doesn't mean anything to you.
- CONF_VERSION = "2"
- ENABLE_UART = "1"
- RPI_USE_U_BOOT = "1"
- ```
-
-
- Make sure your update to reactivate oe-init-build-env again
-
- ```jsx
- source ~/yocto/kirkstone/poky/oe-init-build-env ../**Projectname**
```
+ #
+ # This file is your local configuration file and is where all local user settings
+ # are placed. The comments in this file give some guide to the options a new user
+ # to the system might want to change but pretty much any configuration option can
+ # be set in this file. More adventurous users can look at
+ # local.conf.sample.extended which contains other examples of configuration which
+ # can be placed in this file but new users likely won't need any of them
+ # initially.
+ #
+ # Lines starting with the '#' character are commented out and in some cases the
+ # default values are provided as comments to show people example syntax. Enabling
+ # the option is a question of removing the # character and making any change to the
+ # variable as required.
+
+ #
+ # Machine Selection
+ #
+ # You need to select a specific machine to target the build with. There are a selection
+ # of emulated machines available which can boot and run in the QEMU emulator:
+ #
+ #MACHINE ?= "qemuarm"
+ #MACHINE ?= "qemuarm64"
+ #MACHINE ?= "qemumips"
+ #MACHINE ?= "qemumips64"
+ #MACHINE ?= "qemuppc"
+ #MACHINE ?= "qemux86"
+ #MACHINE ?= "qemux86-64"
+ MACHINE ?= "raspberrypi4"
+ #
+ # There are also the following hardware board target machines included for
+ # demonstration purposes:
+ #
+ #MACHINE ?= "beaglebone-yocto"
+ #MACHINE ?= "genericx86"
+ #MACHINE ?= "genericx86-64"
+ #MACHINE ?= "edgerouter"
+ #
+ # This sets the default machine to be qemux86-64 if no other machine is selected:
+ MACHINE = "raspberrypi4"
- 1. Build
-
- ```jsx
- cd ~/yocto/kirkstone/Projectname
- bitbake core-image-minimal
+ #
+ # Where to place downloads
+ #
+ # During a first build the system will download many different source code tarballs
+ # from various upstream projects. This can take a while, particularly if your network
+ # connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
+ # can preserve this directory to speed up this part of subsequent builds. This directory
+ # is safe to share between multiple builds on the same machine too.
+ #
+ # The default is a downloads directory under TOPDIR which is the build directory.
+ #
+ #DL_DIR = "~/yocto/kirkstone/downloads"
+
+ #
+ # Where to place shared-state files
+ #
+ # BitBake has the capability to accelerate builds based on previously built output.
+ # This is done using "shared state" files which can be thought of as cache objects
+ # and this option determines where those files are placed.
+ #
+ # You can wipe out TMPDIR leaving this directory intact and the build would regenerate
+ # from these files if no changes were made to the configuration. If changes were made
+ # to the configuration, only shared state files where the state was still valid would
+ # be used (done using checksums).
+ #
+ # The default is a sstate-cache directory under TOPDIR.
+ #
+ #SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
+
+ #
+ # Where to place the build output
+ #
+ # This option specifies where the bulk of the building work should be done and
+ # where BitBake should place its temporary files and output. Keep in mind that
+ # this includes the extraction and compilation of many applications and the toolchain
+ # which can use Gigabytes of hard disk space.
+ #
+ # The default is a tmp directory under TOPDIR.
+ #
+ #TMPDIR = "${TOPDIR}/tmp"
+
+ #
+ # Default policy config
+ #
+ # The distribution setting controls which policy settings are used as defaults.
+ # The default value is fine for general Yocto project use, at least initially.
+ # Ultimately when creating custom policy, people will likely end up subclassing
+ # these defaults.
+ #
+ DISTRO ?= "poky"
+ # As an example of a subclass there is a "bleeding" edge policy configuration
+ # where many versions are set to the absolute latest code from the upstream
+ # source control systems. This is just mentioned here as an example, its not
+ # useful to most new users.
+ # DISTRO ?= "poky-bleeding"
+
+ #
+ # Package Management configuration
+ #
+ # This variable lists which packaging formats to enable. Multiple package backends
+ # can be enabled at once and the first item listed in the variable will be used
+ # to generate the root filesystems.
+ # Options are:
+ # - 'package_deb' for debian style deb files
+ # - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
+ # - 'package_rpm' for rpm style packages
+ # E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
+ # We default to rpm:
+ PACKAGE_CLASSES ?= "package_rpm"
+
+ #
+ # SDK target architecture
+ #
+ # This variable specifies the architecture to build SDK items for and means
+ # you can build the SDK packages for architectures other than the machine you are
+ # running the build on (i.e. building i686 packages on an x86_64 host).
+ # Supported values are i686, x86_64, aarch64
+ #SDKMACHINE ?= "i686"
+
+ #
+ # Extra image configuration defaults
+ #
+ # The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
+ # images. Some of these options are added to certain image types automatically. The
+ # variable can contain the following options:
+ # "dbg-pkgs" - add -dbg packages for all installed packages
+ # (adds symbol information for debugging/profiling)
+ # "src-pkgs" - add -src packages for all installed packages
+ # (adds source code for debugging)
+ # "dev-pkgs" - add -dev packages for all installed packages
+ # (useful if you want to develop against libs in the image)
+ # "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
+ # (useful if you want to run the package test suites)
+ # "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
+ # "tools-debug" - add debugging tools (gdb, strace)
+ # "eclipse-debug" - add Eclipse remote debugging support
+ # "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
+ # "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
+ # "debug-tweaks" - make an image suitable for development
+ # e.g. ssh root access has a blank password
+ # There are other application targets that can be used here too, see
+ # meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
+ # We default to enabling the debugging tweaks.
+ EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
+
+ #
+ # Additional image features
+ #
+ # The following is a list of additional classes to use when building images which
+ # enable extra features. Some available options which can be included in this variable
+ # are:
+ # - 'buildstats' collect build statistics
+ USER_CLASSES ?= "buildstats"
+
+ #
+ # Runtime testing of images
+ #
+ # The build system can test booting virtual machine images under qemu (an emulator)
+ # after any root filesystems are created and run tests against those images. It can also
+ # run tests against any SDK that are built. To enable this uncomment these lines.
+ # See classes/test{image,sdk}.bbclass for further details.
+ #IMAGE_CLASSES += "testimage testsdk"
+ #TESTIMAGE_AUTO:qemuall = "1"
+
+ #
+ # Interactive shell configuration
+ #
+ # Under certain circumstances the system may need input from you and to do this it
+ # can launch an interactive shell. It needs to do this since the build is
+ # multithreaded and needs to be able to handle the case where more than one parallel
+ # process may require the user's attention. The default is iterate over the available
+ # terminal types to find one that works.
+ #
+ # Examples of the occasions this may happen are when resolving patches which cannot
+ # be applied, to use the devshell or the kernel menuconfig
+ #
+ # Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
+ # Note: currently, Konsole support only works for KDE 3.x due to the way
+ # newer Konsole versions behave
+ #OE_TERMINAL = "auto"
+ # By default disable interactive patch resolution (tasks will just fail instead):
+ PATCHRESOLVE = "noop"
+
+ #
+ # Disk Space Monitoring during the build
+ #
+ # Monitor the disk space during the build. If there is less that 1GB of space or less
+ # than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
+ # shutdown the build. If there is less than 100MB or 1K inodes, perform a hard halt
+ # of the build. The reason for this is that running completely out of space can corrupt
+ # files and damages the build in ways which may not be easily recoverable.
+ # It's necessary to monitor /tmp, if there is no space left the build will fail
+ # with very exotic errors.
+ BB_DISKMON_DIRS ??= "\
+ STOPTASKS,${TMPDIR},1G,100K \
+ STOPTASKS,${DL_DIR},1G,100K \
+ STOPTASKS,${SSTATE_DIR},1G,100K \
+ STOPTASKS,/tmp,100M,100K \
+ HALT,${TMPDIR},100M,1K \
+ HALT,${DL_DIR},100M,1K \
+ HALT,${SSTATE_DIR},100M,1K \
+ HALT,/tmp,10M,1K"
+
+ #
+ # Shared-state files from other locations
+ #
+ # As mentioned above, shared state files are prebuilt cache data objects which can be
+ # used to accelerate build time. This variable can be used to configure the system
+ # to search other mirror locations for these objects before it builds the data itself.
+ #
+ # This can be a filesystem directory, or a remote url such as https or ftp. These
+ # would contain the sstate-cache results from previous builds (possibly from other
+ # machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
+ # cache locations to check for the shared objects.
+ # NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
+ # at the end as shown in the examples below. This will be substituted with the
+ # correct path within the directory structure.
+ #SSTATE_MIRRORS ?= "\
+ #file://.* https://someserver.tld/share/sstate/PATH;downloadfilename=PATH \
+ #file://.* file:///some/local/dir/sstate/PATH"
+
+ #
+ # Yocto Project SState Mirror
+ #
+ # The Yocto Project has prebuilt artefacts available for its releases, you can enable
+ # use of these by uncommenting the following lines. This will mean the build uses
+ # the network to check for artefacts at the start of builds, which does slow it down
+ # equally, it will also speed up the builds by not having to build things if they are
+ # present in the cache. It assumes you can download something faster than you can build it
+ # which will depend on your network.
+ # Note: For this to work you also need hash-equivalence passthrough to the matching server
+ #
+ #BB_HASHSERVE_UPSTREAM = "typhoon.yocto.io:8687"
+ #SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
+
+ #
+ # Qemu configuration
+ #
+ # By default native qemu will build with a builtin VNC server where graphical output can be
+ # seen. The line below enables the SDL UI frontend too.
+ PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
+ # By default libsdl2-native will be built, if you want to use your host's libSDL instead of
+ # the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below.
+ #ASSUME_PROVIDED += "libsdl2-native"
+
+ # You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds
+ # a handy set of menus for controlling the emulator.
+ #PACKAGECONFIG:append:pn-qemu-system-native = " gtk+"
+
+ #
+ # Hash Equivalence
+ #
+ # Enable support for automatically running a local hash equivalence server and
+ # instruct bitbake to use a hash equivalence aware signature generator. Hash
+ # equivalence improves reuse of sstate by detecting when a given sstate
+ # artifact can be reused as equivalent, even if the current task hash doesn't
+ # match the one that generated the artifact.
+ #
+ # A shared hash equivalent server can be set with ":" format
+ #
+ #BB_HASHSERVE = "auto"
+ #BB_SIGNATURE_HANDLER = "OEEquivHash"
+
+ #
+ # Memory Resident Bitbake
+ #
+ # Bitbake's server component can stay in memory after the UI for the current command
+ # has completed. This means subsequent commands can run faster since there is no need
+ # for bitbake to reload cache files and so on. Number is in seconds, after which the
+ # server will shut down.
+ #
+ #BB_SERVER_TIMEOUT = "60"
+
+ # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
+ # track the version of this file when it was generated. This can safely be ignored if
+ # this doesn't mean anything to you.
+ CONF_VERSION = "2"
+ ENABLE_UART = "1"
+ RPI_USE_U_BOOT = "1"
```
+
- Now, you can see building.
-
- I don’t know the accurate time to build, but I’m sure it will takes more than 1 hour.
-
- So take a meal / rest / play game/ or do something.
-
- 
+## 9. Build
+
+you can type this to check bitbake
+
+```jsx
+cd ~/yocto/kirkstone/meta-raspberrypi
+ls recipes-*/images
+I use this at this time
+bitbake core-image-minimal
+```
+
+```jsx
+cd ~/yocto/kirkstone/builds/rpi
+bitbake core-image-minimal
+```
+
+Now, you can see building.
+
+
+I don’t know the accurate time to build, but I’m sure it will takes more than 1 hour.
+
+So take a meal / rest / play game/ or do something.
+
+
+
+
# Write on SD card
-- Write on SD card
-
- ### After build, you can check your image on
-
- ~build diercotry/tmp/deploy/images/raspberrypi4/core-image-minimal-raspberrypi4-20221221163429.rootfs.wic.bz2
-
- 1. Move wic.bz2 file to somewhere, In my case I move it to home directory.
-
- then, unzip it
-
- ```jsx
- sudo bzip2 -dk core-image-minimal-raspberrypi4-20221025172232.rootfs.wic.bz2
- ```
-
- 1. Write on SD card
-
- insert sd card in USB port. Type this
-
- ```jsx
- sudo fdisk -l
- ```
-
- ```jsx
- umount /dev/sda
- ```
-
- go to the directory where you moved wic.bz2 file.
-
- Type this.
-
- ```jsx
- sudo dd if=core-image-minimal-raspberrypi4-20221128122747.rootfs.wic of=/dev/sda
- sync
- ```
-
- 1. Efect and reinsert SD card,
-
- Go to boot directory in your SDcard, and change config.txt
-
- ```jsx
- #dtoverlay vc4 kms어쩌구 저쩌구 이거 주석처리하셈
-
- located at
- boot/config.txt
- ```
+
+ Write on SD card
+
+
+
+## After build, you can check your image on
+
+```jsx
+~build diercotry/tmp/deploy/images/raspberrypi4/core-image-minimal-raspberrypi4-20221221163429.rootfs.wic.bz2
+```
+
+1. Move wic.bz2 file to somewhere, In my case I move it to home directory.
+
+then, unzip it
+
+```jsx
+sudo bzip2 -dk core-image-minimal-raspberrypi4-20221025172232.rootfs.wic.bz2
+```
+
+2. Write on SD card
- ```jsx
- ## dtoverlay=vc4-kms-v3d
- to
- dtoverlay=vc4-fkms-v3d-pi4
- ```
+insert sd card in USB port. Type this
+
+```jsx
+sudo fdisk -l
+```
+
+```jsx
+umount /dev/sda
+```
+
+go to the directory where you moved wic.bz2 file.
+
+Type this.
+
+```jsx
+sudo dd if=core-image-minimal-raspberrypi4-20221128122747.rootfs.wic of=/dev/sda
+sync
+```
+
+3. Efect and reinsert SD card,
+
+Go to boot directory in your SDcard, and change config.txt
+
+comment this line like this
+/boot/config.txt
+```jsx
+#dtoverlay=vc4-kms-v3d
+```
+or
+
+```jsx
+## dtoverlay=vc4-kms-v3d
+to
+dtoverlay=vc4-fkms-v3d-pi4
+```
+
+
# Add python
-- Add python
-
- If you done previous step, It would not takes more than 10minutes to build.
-
- 1. Add [image.bb](http://image.bb) file
-
- ```jsx
- cd ~/yocto/kirkstone/poky/meta/recipes-core/images
- ```
-
- 1. Make new [image.bb](http://image.bb) file
-
- ```jsx
- core-image-python.bb
- ```
+
+ Add python
+
+
+
+If you done previous step, It would not takes more than 10minutes to build.
+
+
+1. Add [image.bb](http://image.bb) file
+
+```jsx
+cd ~/yocto/kirkstone/poky/meta/recipes-core/images
+```
+
+
+2. Make new [image.bb](http://image.bb) file
+
+```jsx
+core-image-python.bb
+```
- [core-image-python.bb](http://core-image-python.bb)
@@ -595,439 +618,500 @@ So.. we need to install CAN / D-Bus / QT in our custom recipes.\
IMAGE_ROOTFS_SIZE ?= "8192"
IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}"
- ```
- 1. Build
-
- ```jsx
- cd ~/yocto/kirkstone/poky
- source oe-init-build-env ../raspberrypi4
- ```
-
- 1. Add new layer at sd card
-
- Same with previous step
-
-
-# Build QT exe (Only for example code)
-- Build QT
- 1. Download met-QT5
+
+3. Build
- ```jsx
- cd ~/yocto/kirkstone
- git clone -b kirkstone https://github.com/meta-qt5/meta-qt5
- ```
-
- 1. Add new layer at local.conf , bblayers.conf
-
- ```jsx
- cd ~/yocto/kirkstone/**Projectname**/conf
- vim local.conf
- ```
-
- Add this line
- ```jsx
- CORE_IMAGE_EXTRA_INSTALL:append = "qtbase-examples"
- ```
-
- ```jsx
- vim bblayers.conf
- ```
-
- Add this line
-
- ```jsx
- /home/seame-fablab/yocto/kirkstone/meta-qt5 \
- ```
-
- 1. Make .bbappend file
-
- ```jsx
- cd ~yocto/kirkstone/poky/meta-poky
- mkdir -p recipes-qt/qt5
- cd recipes-qt/qt5
- vim qtbase_%.bbappend
- ```
-
- Add this line
-
- ```jsx
- PACKAGECONFIG:append = " examples gles2 eglfs"
- PACKAGECONFIG:remove = "tslib"
- ```
-
- 1. Build
-
- ```jsx
cd ~/yocto/kirkstone/poky
source oe-init-build-env ../raspberrypi4
- bitbake core-image-minimal
- ```
-
- 1. Check example code
-
- ```jsx
- cd /usr/share/qt5/examples/opengl/hellowindow
-
- ./hellowindow -platform eglfs
- ```
+
+4. Add new layer at sd card
+
+Same with previous step
+
+
+
-# Build Custom QT file
+## Build QT exe (Only for example file version)
+
+ Build QT exe (Only for example file version)
+
-- Build Custom Qt file
- 1. Create custom layer
-
- ```jsx
- cd ~
- ```
-
+1. Download met-QT5
-# QT in Rpi (add exist layer)
+```jsx
+cd ~/yocto/kirkstone
+git clone -b kirkstone https://github.com/meta-qt5/meta-qt5
+```
-- QT in Rpi
-
- ```jsx
- goto root
- usr/share/examples/opengl/hellowindow
- there are so many qt examples
-
- In my case, I use hellowindow
-
- ./hellowindow -platform eglfs
- ```
-
- 
-
- this is original window
-
- 
-
- this is in root directory (which is in sd card)
-
- So, the difference is only for listnames.pro.user / listnames.exe
-
- location of ‘listname’ before bitbake.
-
- 
-
+2. Add new layer at local.conf , bblayers.conf
-# command
+```jsx
+cd ~/yocto/kirkstone/**Projectname**/conf
+vim local.conf
+```
-- where can i get bb file?
-
- ```jsx
- /yocto/kirkstone/poky/meta/recipes-core/images
- ```
-
- ```jsx
- # type this in terminal
-
- yocto/kirkstone/builds/raspberrypi4/tmp/work/raspberrypi4-poky-linux-gnueabi/core-image-minimal/1.0-r0/rootfs$ find . -name python3
- ```
-
-- how can i add bbfile?
-
- ```jsx
- unsharp below
-
- SUMMARY = "A small image just capable of allowing a device to boot."
-
- IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
-
- IMAGE_LINGUAS = " "
-
- LICENSE = "MIT"
-
- inherit core-image
-
- IMAGE_ROOTFS_SIZE ?= "8192"
- IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "", d)}"
-
- # ybelow like this
- # RDEPENDS_${PN}: = "python3 c++ QT "
- # use init script file to autoexcute something file
- ```
-
-- where is core-iamge.bbclass
-
- ```jsx
- ~yocto/kirkstone/poky/meta/classes/core-image.bbclass
- ```
-
-- why the core-image-minimal doesnt work?
-
- ```jsx
- excute config.txt.sb-c2dfd18a-9XwQq6
- uncomment
- # Enable VC4 Graphics
- ```
-
+Add this line
-# Make Custom Layer
+local.conf
-- make custom layer
- 1. Activate environment, what you are planning to add.
-
- In my case, I want to add my custom layer at ‘raspberrypi4’ folder
-
- ```jsx
- source ~/yocto/kirkstone/poky/oe-init-build-env ~/yocto/kirkstone/builds/raspberrypi4
- ```
-
- 1. go to directory address where you want to make custom layer
-
- In my case, I want to make directory at home/yocto/kirkstone
-
- `bitbake-layers create-layer meta-`
-
- ```jsx
- cd ~/yocto/kirkstone
- bitbake-layers create-layer meta-mylayer
- ```
-
- 1. Add new layer
-
- ```jsx
- cd ~/yocto/kirkstone/builds/raspberrypi4/conf/bblayers.conf
- vim bbalyers.conf
- ```
-
- add this line
-
- ```jsx
- /home/seame-fablab/yocto/kirkstone/meta-mylayer \
- ```
-
- 1. Write a new image recipe
-
- ```jsx
- cd ~/yocto/kirkstone//meta-mylayer
- mkdir -p recipes-core/images
- cd recipes-core/images
- ```
-
- ```jsx
- vim basic-qt5-image.bb
- ```
-
- ```jsx
- SUMMARY = "A basic Qt5 dev image"
-
- require recipes-core/images/core-image-minimal.bb
-
- QT_BASE = " \
- qtbase \
- qtbase-dev \
- qtbase-mkspecs \
- qtbase-plugins \
- qtbase-tools \
- "
-
- QT_PKGS = " \
- qt3d \
- qt3d-dev \
- qt3d-mkspecs \
- qtcharts \
- qtcharts-dev \
- qtcharts-mkspecs \
- qtconnectivity-dev \
- qtconnectivity-mkspecs \
- qtquickcontrols2 \
- qtquickcontrols2-dev \
- qtquickcontrols2-mkspecs \
- qtdeclarative \
- qtdeclarative-dev \
- qtdeclarative-mkspecs \
- qtgraphicaleffects \
- qtgraphicaleffects-dev \
- "
-
- IMAGE_INSTALL += " \
- ${QT_BASE} \
- ${QT_PKGS} \
- "
-
- export IMAGE_BASENAME = "basic-qt5-image"
- ```
-
- 1. Write additional package recipe
-
- ```jsx
- cd ~/yocto/kirkstone/meta-mylayer/recipes-example/example
- mv example_0.1.bb qtbase_git.bbappend #change name from example_0.1 to qtbase
- vim qtbase_git.bbappend
- ```
-
- Edit bbappend to this:
-
- ```jsx
- SUMMARY = "bitbake-layers recipe"
- DESCRIPTION = "Recipe created by bitbake-layers"
- LICENSE = "MIT"
-
- PACKAGECONFIG_append = " eglfs fontconfig gles2"
- DEPENDS += "userland"
- ```
-
- 1. Build
-
- ```jsx
- cd ~/yocto/kirkstone/builds/raspberrypi4
- source oe-init-build-env
- bitbake basic-qt5-image
- ```
-
- # Build SDK
-
- 1. Edit basic-qt5-image.bb
-
- ```jsx
- cd ~/yocto/kirkstone/meta-mylayer/recipes-core/image
- vim basic-qt5-image.bb
- ```
-
- Add this line top of file:
-
- ```jsx
- inherit populate_sdk populate_sdk_qt5
- ```
-
- 1. Edit local.config
-
- ```jsx
- cd ~/yocto/kirkstone/builds/raspberrypi4/conf
- vim local.conf
- ```
-
- Add this line:
-
- ```jsx
- DISTRO_FEATURES:remove = "x11 wayland vulkan"
- ```
-
- 1. Build
-
- ```jsx
- cd ~/yocto/kirkstone/builds/raspberrypi4
- source oe-init-build-env
- bitbake basic-qt5-image
- bitbake basic-qt5-image -c populate_sdk
- ```
-
+```jsx
+CORE_IMAGE_EXTRA_INSTALL:append = "qtbase-examples"
+DISTRO_FEATURES:remove = "x11 wayland vulkan"
+```
-# Encountered Error
+```jsx
+vim bblayers.conf
+```
-- Errors
- - Error message - `No space left on device ENOSPC`
-
- ```jsx
- seame-fablab@seamefablab-Precision-7550:~/yocto/kirkstone/builds/rpi$ bitbake core-image-minimal
- Traceback (most recent call last):
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/bin/bitbake", line 37, in
- sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/main.py", line 378, in bitbake_main
- return ui_module.main(server_connection.connection, server_connection.events,
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/ui/knotty.py", line 415, in main
- params.updateToServer(server, os.environ.copy())
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/cookerdata.py", line 75, in updateToServer
- raise Exception("Unable to update the server configuration with local parameters: %s" % error)
- Exception: Unable to update the server configuration with local parameters: Traceback (most recent call last):
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/command.py", line 90, in runCommand
- result = command_method(self, commandline)
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/command.py", line 286, in updateConfig
- command.cooker.updateConfigOpts(options, environment, cmdline)
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/cooker.py", line 535, in updateConfigOpts
- self.reset()
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/cooker.py", line 1774, in reset
- self.initConfigurationData()
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/cooker.py", line 404, in initConfigurationData
- self.add_filewatch(mc.getVar("__base_depends", False), self.configwatcher)
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/bb/cooker.py", line 313, in add_filewatch
- watcher.add_watch(f, self.watchmask, quiet=False)
- File "/home/seame-fablab/yocto/kirkstone/poky/bitbake/lib/pyinotify.py", line 1888, in add_watch
- raise WatchManagerError(err, ret_)
- pyinotify.WatchManagerError: add_watch: cannot watch /home/seame-fablab/yocto/kirkstone/builds/rpi/conf WD=-1, Errno=No space left on device (ENOSPC)
- ```
-
- there was planty of spaces in laptop.
-
- so error was caused from `max_user_watches`
-
- It means the number of max directories that can laptop checks about the changes.
-
- you can check the number of max_user_watches using this command
-
- ```jsx
- ysctl -n fs.inotify.max_user_watches
- ```
-
- - solution
-
- This is because you need more max_user_watches. Type below to enhace your max_user_watches
-
- ```jsx
- sudo sysctl fs.inotify.max_user_watches=654622
- ```
-
- - Error message - `Set a MACHINE`
-
- ```jsx
- ERROR: OE-core's config sanity checker detected a potential misconfiguration.
- Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
- Following is the list of potential problems / advisories:
-
- Please set a MACHINE in your local.conf or environment
-
- or
-
- ERROR: ParseError at /home/seame-fablab/yocto/kirkstone/builds/rpi/conf/local.conf:39: unparsed line: 'MACHINE = raspberrypi4'
- ```
-
- - solution
-
- ```jsx
- #add MACHINE local.conf
- MACHINE = "raspberrypi4"
-
- ```
-
-- Building OS in Poky
-
- input
-
- ```jsx
- bitbake-layers -h
- ```
-
- output
-
- ```jsx
- NOTE: Starting bitbake server...
- ERROR: No space left on device or exceeds fs.inotify.max_user_watches?
- ERROR: To check max_user_watches: sysctl -n fs.inotify.max_user_watches.
- ERROR: To modify max_user_watches: sysctl -n -w fs.inotify.max_user_watches=.
- ERROR: Root privilege is required to modify max_user_watches.
- ```
-
-- OE-Core Error
-
- ```jsx
- ERROR: OE-core's config sanity checker detected a potential misconfiguration.
- Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
- Following is the list of potential problems / advisories:
-
- DL_DIR uses ~ but Bitbake will not expand this, use an absolute path or variables.
- ```
-
- go to build directory
-
- In my case, I set machine for rpi so I moved to `~/yocto/kirkstone/builds/rpi`
-
- open terminal in that directory and type this
-
- ```jsx
- touch conf/sanity.conf
- ```
+Add this line
+
+bblayers.conf
+
+```jsx
+/home/seame-fablab/yocto/kirkstone/meta-qt5 \
+```
+
+3. Make .bbappend file
+
+```jsx
+cd ~yocto/kirkstone/poky/meta-poky
+mkdir -p recipes-qt/qt5
+cd recipes-qt/qt5
+vim qtbase_%.bbappend
+```
+
+Add this line
+
+```jsx
+PACKAGECONFIG:append = " examples gles2 eglfs"
+PACKAGECONFIG:remove = "tslib"
+```
+
+4. Build
+
+```jsx
+cd ~/yocto/kirkstone/poky
+source oe-init-build-env ../raspberrypi4
+bitbake -c cleanall core-image-minimal
+bitbake core-image-minimal
+```
+
+5. Check setting, Check example code
+
+5-1
+
+Make sure chage below line located in boot/config.txt in your custom sdcard
+
+```jsx
+## dtoverlay=vc4-kms-v3d
+to
+dtoverlay=vc4-fkms-v3d-pi4
+```
+
+5-2
+
+Simply you can find example code in root folder
+
+Go to root, and search where hellowindow direcotry is. In my case ‘usr/share/examples/opengl/hellowindow’
+
+
+
+## Auto start program after loading
+
+
+ Auto start program after loading
+
+
+recipe_what_you_gonna_build.bb
+
+```jsx
+IMAGE_INSTALL:append = " \
+ qt5-env \
+```
+
+add this two bbfile to somewhere
+
+qt5-env.bb
+
+```jsx
+SUMMARY = "Add Qt5 bin dir to PATH"
+
+LICENSE = "CLOSED"
+
+SRC_URI = "file://qt5-env.sh"
+
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}/profile.d
+ install -m 0755 qt5-env.sh ${D}${sysconfdir}/profile.d
+}
+
+FILES_${PN} = "${sysconfdir}"
+```
+
+qt5-env.sh
+
+```jsx
+#!/bin/sh
+
+# export QT_LOGGING_RULES=qt.qpa.*=true # Optional for logging
+#export QT_QPA_EGLFS_KMS_CONFIG=/etc/kms.conf
+export QT_QPA_EGLFS_INTEGRATION=kms
+# export QT_QPA_EGLFS_INTEGRATION=eglfs_kms # kms doesn't work on boot2qt but eglfs_kms
+export QT_QPA_PLATFORM=eglfs
+export QT_QPA_EGLFS_KMS_ATOMIC=1
+export XDG_RUNTIME_DIR=/run/user/0
+
+#ip link set can0 up type an birtare 5000
+#cd usr/bin
+#simple
+# or
+/usr/bin/colidingmice
+**# this can be a name of auto start program**
+```
+
+
+
+
+## Change boot logo
+
+
+ Change boot logo
+
+ refer this
+https://github.com/hamzamac/meta-splash](https://github.com/hamzamac/meta-splash
+
+
+
+### It is final!
+## Dash board on Yocto!
+
+
+ Dashboard on Yocto!
+
+In the second project, I designed Dasboard using QT.
+Now we installed all the requirements.
+We can add Dashboard to our own OS!
+Download this QT file,
+Dashbaord_QT_file
+ and make custom .bb file to append this.
+
+
+# Project 4
+
+
+
+I got SRF 08 ultra sonic sensor.
+
+Unfortunately, there’s no guideline about SRF08, But I guess there would no difference between SRF and other ultrasonic sensor.
+
+So I started just connect this sensor to Rpi, and operate that.
+
+I can find that SRF08 uses SDA/SCL to send / recive data from raspberrypi
+
+Below is pinmap
+
+
+
+
+
+
+
+
+
+
+Connect like this
+
+
+| SRF08 | Raspberrypi |
+| --- | --- |
+| 5V | 5V PWR |
+| SDA | GPIO2 |
+| SCL | GPIO3 |
+| Nicht anschlieben | X |
+| GND | GND |
+
+
+※ SDA / SCL can be Digital pin in Arduino
+※ You might need to solder SRF-08
+
+
+ 1. make this sonic.cpp file using something like "VIM"
+
+ 2. Type "g++ mysonic.cpp -o sonic" to compile
+
+ 3. Type "./sonic" to operate
+
+
+
+
+# OPEN CV
+
+If your camera doesn't work in QT, consider to install Open CV
+
+Open CV is a necessary program to process media file from camera.
+
+we already installed Open CV in project 1, but that’s for python.
+
+We need to install C++ Open CV to run QT in raspberry pi
+
+You can also refer this to install OpenCV, or follow my guide.
+
+[Raspberry Pi 4에 OpenCV 4.6.0 설치하는 방법](https://webnautes.tistory.com/916)
+
+
+ Install guide
+
+
+`raspberrypi4`
+
+1. Check if OpenCV is already installed
+
+```jsx
+pkg-config --modversion opencv
+```
+
+If not installed, output must be like
+
+```jsx
+Package opencv was not found in the pkg-config search path.
+
+Perhaps you should add the directory containing `opencv.pc'
+
+to the PKG_CONFIG_PATH environment variable
+
+No package 'opencv' found
+```
+
+If it was already installed, output must be like
+
+```jsx
+2.4.9.1
+```
+
+You can uninstall OpenCv package if you like
+
+```jsx
+sudo apt-get purge libopencv* python-opencv
+sudo apt-get autoremove
+```
+
+2. Preprocessing for install OpenCV
+
+```jsx
+sudo apt update
+sudo apt upgrade
+sudo reboot
+```
+
+3. Install requirements for OpenCV
+
+```jsx
+sudo apt install build-essential cmake
+sudo apt install libjpeg-dev libtiff5-dev libjasper-dev libpng-dev
+sudo apt install libavcodec-dev libavformat-dev libswscale-dev libxvidcore-dev libx264-dev libxine2-dev
+sudo apt install libv4l-dev v4l-utils
+sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly
+sudo apt install libgtk-3-dev
+sudo apt install libatlas-base-dev gfortran libeigen3-dev
+sudo apt install python3-dev python3-numpy
+```
+
+4. Install OpenCV
+
+```jsx
+cd ~
+mkdir opencv
+cd opencv
+wget -O opencv.zip https://github.com/opencv/opencv/archive/4.6.0.zip
+unzip opencv.zip
+wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.6.0.zip
+unzip opencv_contrib.zip
+rm opencv.zip
+rm opencv_contrib.zip
+cd opencv-4.6.0
+mkdir build
+cd build
+```
+
+You need to check your python library path
+
+`input`
+
+```jsx
+python3 -m site
+```
+
+`output`
+
+```jsx
+/home/joe/env/lib/python3.7/site.py:165: DeprecationWarning: 'U' mode is deprecated
+ f = open(fullname, "rU")
+sys.path = [
+ '/home/joe/opencv/opencv-4.6.0/build',
+ '/home/joe/env/lib/python37.zip',
+ '/home/joe/env/lib/python3.7',
+ '/home/joe/env/lib/python3.7/lib-dynload',
+ '/usr/lib/python3.7',
+ '/home/joe/env/lib/python3.7/site-packages',
+ '/home/joe/projects/donkeycar',
+ **'/usr/local/lib/python3.7/dist-packages',**
+ '/usr/local/lib/python3.7/dist-packages/pidisplay-0.0.0-py3.7.egg',
+ '/usr/local/lib/python3.7/dist-packages/Adafruit_SSD1306-1.6.2-py3.7.egg',
+ '/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO-1.0.4-py3.7.egg',
+ '/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO-1.1.9-py3.7.egg',
+ '/usr/lib/python3/dist-packages',
+ '/usr/local/lib/python3.7/dist-packages/pidisplay-0.0.0-py3.7.egg',
+ '/usr/local/lib/python3.7/dist-packages/Adafruit_SSD1306-1.6.2-py3.7.egg',
+ '/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO-1.0.4-py3.7.egg',
+ '/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO-1.1.9-py3.7.egg',
+]
+```
+
+Red line is the path
+
+Replace the path, OpenCV version, and install
+
+```jsx
+cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=OFF -D WITH_IPP=OFF -D WITH_1394=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D BUILD_DOCS=OFF -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D ENABLE_NEON=ON -D ENABLE_VFPV3=ON -D WITH_QT=OFF -D WITH_GTK=ON -D WITH_OPENGL=ON -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.6.0/modules -D WITH_V4L=ON -D WITH_FFMPEG=ON -D WITH_XINE=ON -D ENABLE_PRECOMPILED_HEADERS=OFF -D BUILD_NEW_PYTHON_SUPPORT=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.7/dist-packages ../
+```
+
+5. Extend swap size
+
+```jsx
+sudo /etc/init.d/dphys-swapfile restart
+```
+
+change CONF_SWAPSIZE=100 to 2048
+
+6. Compile
+
+```jsx
+time make -j4
+```
+
+7. Install
+
+```jsx
+sudo make install
+sudo ldconfig
+```
+
+8. swap again to 100
+
+```jsx
+sudo nano /etc/dphys-swapfile
+
+# set size to absolute value, leaving empty (default) then uses computed value
+
+# you most likely don't want this, unless you have an special disk situation
+
+CONF_SWAPSIZE=100
+```
+
+9. Check installation
+
+It can’t run in terminal
+
+So open GUI in your raspberrypi4, and type the below code.
+
+```jsx
+cp /usr/local/share/opencv4/samples/cpp/videocapture_basic.cpp
+```
+
+```jsx
+g++ -o videocapture_basic videocapture_basic.cpp $(pkg-config opencv4 --libs --cflags)
+```
+
+
+
+Error
+
+ Error message
+
+seame-fablab@seamefablab-Precision-7550:~/Desktop/QTultra$ make
+/home/seame-fablab/rpi/qt5.15/bin/uic ultrasonic.ui -o ui_ultrasonic.h
+/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/seame-fablab/rpi/sysroot -O2 -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../rpi/qt5.15/include -I../../rpi/qt5.15/include/QtWidgets -I../../rpi/qt5.15/include/QtGui -I../../rpi/qt5.15/include/QtCore -I. -I. -I../../rpi/qt5.15/mkspecs/devices/linux-rasp-pi4-v3d-g++ -o main.o main.cpp
+/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/seame-fablab/rpi/sysroot -O2 -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../rpi/qt5.15/include -I../../rpi/qt5.15/include/QtWidgets -I../../rpi/qt5.15/include/QtGui -I../../rpi/qt5.15/include/QtCore -I. -I. -I../../rpi/qt5.15/mkspecs/devices/linux-rasp-pi4-v3d-g++ -o ultrasonic.o ultrasonic.cpp
+/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/seame-fablab/rpi/sysroot -O2 -std=gnu++1z -Wall -Wextra -dM -E -o moc_predefs.h ../../rpi/qt5.15/mkspecs/features/data/dummy.cpp
+/home/seame-fablab/rpi/qt5.15/bin/moc -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /home/seame-fablab/Desktop/QTultra/moc_predefs.h -I/home/seame-fablab/rpi/qt5.15/mkspecs/devices/linux-rasp-pi4-v3d-g++ -I/home/seame-fablab/Desktop/QTultra -I/home/seame-fablab/rpi/qt5.15/include -I/home/seame-fablab/rpi/qt5.15/include/QtWidgets -I/home/seame-fablab/rpi/qt5.15/include/QtGui -I/home/seame-fablab/rpi/qt5.15/include/QtCore -I/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1 -I/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1/arm-linux-gnueabihf -I/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1/backward -I/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1/include -I/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1/include-fixed -I/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include -I/home/seame-fablab/rpi/sysroot/usr/include/arm-linux-gnueabihf -I/home/seame-fablab/rpi/sysroot/usr/include ultrasonic.h -o moc_ultrasonic.cpp
+/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/seame-fablab/rpi/sysroot -O2 -std=gnu++1z -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../rpi/qt5.15/include -I../../rpi/qt5.15/include/QtWidgets -I../../rpi/qt5.15/include/QtGui -I../../rpi/qt5.15/include/QtCore -I. -I. -I../../rpi/qt5.15/mkspecs/devices/linux-rasp-pi4-v3d-g++ -o moc_ultrasonic.o moc_ultrasonic.cpp
+/home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/seame-fablab/rpi/sysroot -Wl,-O1 -Wl,-rpath,/usr/local/qt5.15/lib -Wl,-rpath-link,/home/seame-fablab/rpi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/seame-fablab/rpi/sysroot/lib/arm-linux-gnueabihf -o QTultra main.o ultrasonic.o moc_ultrasonic.o /home/seame-fablab/rpi/qt5.15/lib/libQt5Widgets.so /home/seame-fablab/rpi/qt5.15/lib/libQt5Gui.so /home/seame-fablab/rpi/qt5.15/lib/libQt5Core.so -L/home/seame-fablab/rpi/sysroot/usr/lib/arm-linux-gnueabihf -lGLESv2 -lpthread
+/home/seame-fablab/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libpthread.a(unwind.o): In function `unwind_stop':
+/build/glibc-Ir6W4B/glibc-2.28/nptl/unwind.c:72: undefined reference to `__pointer_chk_guard_local'
+collect2: error: ld returned 1 exit status
+make: *** [Makefile:268: QTultra] Error 1
+
+
+
+solution:
+
+```jsx
+~/rpi/sysroot/usr/lib/arm-linux-gnueabihf$ sudo ln -sf libpthread.so.0 libpthread.so
+```
\ No newline at end of file
diff --git a/Project4/SRF08.jpg b/Project4/SRF08.jpg
new file mode 100644
index 00000000..9909b2e2
Binary files /dev/null and b/Project4/SRF08.jpg differ
diff --git a/Project4/camera/.qmake.stash b/Project4/camera/.qmake.stash
new file mode 100644
index 00000000..8df727bb
--- /dev/null
+++ b/Project4/camera/.qmake.stash
@@ -0,0 +1,27 @@
+QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
+QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 7
+QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 4
+QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 1
+QMAKE_CXX.COMPILER_MACROS = \
+ QT_COMPILER_STDCXX \
+ QMAKE_GCC_MAJOR_VERSION \
+ QMAKE_GCC_MINOR_VERSION \
+ QMAKE_GCC_PATCH_VERSION
+QMAKE_CXX.INCDIRS = \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1 \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1/arm-linux-gnueabihf \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/7.4.1/backward \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1/include \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1/include-fixed \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include \
+ /home/seame-fablab/rpi/sysroot/usr/include/arm-linux-gnueabihf \
+ /home/seame-fablab/rpi/sysroot/usr/include
+QMAKE_CXX.LIBDIRS = \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf/7.4.1 \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc/arm-linux-gnueabihf \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/lib/gcc \
+ /home/seame-fablab/rpi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib \
+ /home/seame-fablab/rpi/sysroot/lib/arm-linux-gnueabihf \
+ /home/seame-fablab/rpi/sysroot/lib \
+ /home/seame-fablab/rpi/sysroot/usr/lib/arm-linux-gnueabihf \
+ /home/seame-fablab/rpi/sysroot/usr/lib
diff --git a/Project4/camera/camera.cpp b/Project4/camera/camera.cpp
new file mode 100644
index 00000000..1255b9c1
--- /dev/null
+++ b/Project4/camera/camera.cpp
@@ -0,0 +1,496 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "camera.h"
+#include "ui_camera.h"
+#include "videosettings.h"
+#include "imagesettings.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+
+Q_DECLARE_METATYPE(QCameraInfo)
+
+Camera::Camera() : ui(new Ui::Camera)
+{
+ ui->setupUi(this);
+
+ //Camera devices:
+
+ QActionGroup *videoDevicesGroup = new QActionGroup(this);
+ videoDevicesGroup->setExclusive(true);
+ const QList availableCameras = QCameraInfo::availableCameras();
+ for (const QCameraInfo &cameraInfo : availableCameras) {
+ QAction *videoDeviceAction = new QAction(cameraInfo.description(), videoDevicesGroup);
+ videoDeviceAction->setCheckable(true);
+ videoDeviceAction->setData(QVariant::fromValue(cameraInfo));
+ if (cameraInfo == QCameraInfo::defaultCamera())
+ videoDeviceAction->setChecked(true);
+
+ ui->menuDevices->addAction(videoDeviceAction);
+ }
+
+ connect(videoDevicesGroup, &QActionGroup::triggered, this, &Camera::updateCameraDevice);
+ connect(ui->captureWidget, &QTabWidget::currentChanged, this, &Camera::updateCaptureMode);
+
+ setCamera(QCameraInfo::defaultCamera());
+
+ timer = new QTimer(this);
+
+ connect(timer, SIGNAL(timeout()),
+ this, SLOT(sensor()));
+
+ timer->start(1000);
+
+
+
+ sensor();
+
+}
+
+
+void Camera::sensor()
+{
+ int address = 0x70;
+ unsigned char buf[10];
+ int fd = open("/dev/i2c-1", O_RDWR); // O_RDWR = open for reading and writing
+ ioctl(fd, I2C_SLAVE, address);
+
+ buf[0] = 0;
+ buf[1] = 81;
+
+ write(fd, buf, 2);
+
+ usleep(750000);
+
+ write(fd, buf, 1);
+
+ read(fd, buf, 4);
+
+
+ buf[0] = 0;
+
+ unsigned char highByte = buf[2];
+ unsigned char lowByte = buf[3];
+ unsigned int result = (highByte <<8) + lowByte;
+ QString s = QString::number(result);
+ ui->sonicdata->setPlainText(s);// Calculate range
+ //QString as = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss");
+ //QString str = QString("Recorded %1 sec").arg(m_mediaRecorder->duration()/1000);
+ //ui->sonicdata->insertPlainText(as);
+ //ui->sonicdata->setPlainText(as);
+
+}
+
+
+void Camera::setCamera(const QCameraInfo &cameraInfo)
+{
+ m_camera.reset(new QCamera(cameraInfo));
+
+ connect(m_camera.data(), &QCamera::stateChanged, this, &Camera::updateCameraState);
+ connect(m_camera.data(), QOverload::of(&QCamera::error), this, &Camera::displayCameraError);
+
+ m_mediaRecorder.reset(new QMediaRecorder(m_camera.data()));
+ connect(m_mediaRecorder.data(), &QMediaRecorder::stateChanged, this, &Camera::updateRecorderState);
+
+ m_imageCapture.reset(new QCameraImageCapture(m_camera.data()));
+
+ connect(m_mediaRecorder.data(), &QMediaRecorder::durationChanged, this, &Camera::updateRecordTime);
+ connect(m_mediaRecorder.data(), QOverload::of(&QMediaRecorder::error),
+ this, &Camera::displayRecorderError);
+
+ m_mediaRecorder->setMetaData(QMediaMetaData::Title, QVariant(QLatin1String("Test Title")));
+
+ connect(ui->exposureCompensation, &QAbstractSlider::valueChanged, this, &Camera::setExposureCompensation);
+
+ m_camera->setViewfinder(ui->viewfinder);
+
+ updateCameraState(m_camera->state());
+ updateLockStatus(m_camera->lockStatus(), QCamera::UserRequest);
+ updateRecorderState(m_mediaRecorder->state());
+
+ connect(m_imageCapture.data(), &QCameraImageCapture::readyForCaptureChanged, this, &Camera::readyForCapture);
+ connect(m_imageCapture.data(), &QCameraImageCapture::imageCaptured, this, &Camera::processCapturedImage);
+ connect(m_imageCapture.data(), &QCameraImageCapture::imageSaved, this, &Camera::imageSaved);
+ connect(m_imageCapture.data(), QOverload::of(&QCameraImageCapture::error),
+ this, &Camera::displayCaptureError);
+
+ connect(m_camera.data(), QOverload::of(&QCamera::lockStatusChanged),
+ this, &Camera::updateLockStatus);
+
+ ui->captureWidget->setTabEnabled(0, (m_camera->isCaptureModeSupported(QCamera::CaptureStillImage)));
+ ui->captureWidget->setTabEnabled(1, (m_camera->isCaptureModeSupported(QCamera::CaptureVideo)));
+
+ updateCaptureMode();
+ m_camera->start();
+}
+
+void Camera::keyPressEvent(QKeyEvent * event)
+{
+ if (event->isAutoRepeat())
+ return;
+
+ switch (event->key()) {
+ case Qt::Key_CameraFocus:
+ displayViewfinder();
+ m_camera->searchAndLock();
+ event->accept();
+ break;
+ case Qt::Key_Camera:
+ if (m_camera->captureMode() == QCamera::CaptureStillImage) {
+ takeImage();
+ } else {
+ if (m_mediaRecorder->state() == QMediaRecorder::RecordingState)
+ stop();
+ else
+ record();
+ }
+ event->accept();
+ break;
+ default:
+ QMainWindow::keyPressEvent(event);
+ }
+}
+
+void Camera::keyReleaseEvent(QKeyEvent *event)
+{
+ if (event->isAutoRepeat())
+ return;
+
+ switch (event->key()) {
+ case Qt::Key_CameraFocus:
+ m_camera->unlock();
+ break;
+ default:
+ QMainWindow::keyReleaseEvent(event);
+ }
+}
+
+void Camera::updateRecordTime()
+{
+ QString str = QString("Recorded %1 sec").arg(m_mediaRecorder->duration()/1000);
+ ui->statusbar->showMessage(str);
+}
+
+void Camera::processCapturedImage(int requestId, const QImage& img)
+{
+ Q_UNUSED(requestId);
+ QImage scaledImage = img.scaled(ui->viewfinder->size(),
+ Qt::KeepAspectRatio,
+ Qt::SmoothTransformation);
+
+ ui->lastImagePreviewLabel->setPixmap(QPixmap::fromImage(scaledImage));
+
+ // Display captured image for 4 seconds.
+ displayCapturedImage();
+ QTimer::singleShot(4000, this, &Camera::displayViewfinder);
+}
+
+void Camera::configureCaptureSettings()
+{
+ switch (m_camera->captureMode()) {
+ case QCamera::CaptureStillImage:
+ configureImageSettings();
+ break;
+ case QCamera::CaptureVideo:
+ configureVideoSettings();
+ break;
+ default:
+ break;
+ }
+}
+
+void Camera::configureVideoSettings()
+{
+ VideoSettings settingsDialog(m_mediaRecorder.data());
+ settingsDialog.setWindowFlags(settingsDialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
+ settingsDialog.setAudioSettings(m_audioSettings);
+ settingsDialog.setVideoSettings(m_videoSettings);
+ settingsDialog.setFormat(m_videoContainerFormat);
+
+ if (settingsDialog.exec()) {
+ m_audioSettings = settingsDialog.audioSettings();
+ m_videoSettings = settingsDialog.videoSettings();
+ m_videoContainerFormat = settingsDialog.format();
+
+ m_mediaRecorder->setEncodingSettings(
+ m_audioSettings,
+ m_videoSettings,
+ m_videoContainerFormat);
+
+ m_camera->unload();
+ m_camera->start();
+ }
+}
+
+void Camera::configureImageSettings()
+{
+ ImageSettings settingsDialog(m_imageCapture.data());
+ settingsDialog.setWindowFlags(settingsDialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
+ settingsDialog.setImageSettings(m_imageSettings);
+
+ if (settingsDialog.exec()) {
+ m_imageSettings = settingsDialog.imageSettings();
+ m_imageCapture->setEncodingSettings(m_imageSettings);
+ }
+}
+
+void Camera::record()
+{
+ m_mediaRecorder->record();
+ updateRecordTime();
+}
+
+void Camera::pause()
+{
+ m_mediaRecorder->pause();
+}
+
+void Camera::stop()
+{
+ m_mediaRecorder->stop();
+}
+
+void Camera::setMuted(bool muted)
+{
+ m_mediaRecorder->setMuted(muted);
+}
+
+void Camera::toggleLock()
+{
+ switch (m_camera->lockStatus()) {
+ case QCamera::Searching:
+ case QCamera::Locked:
+ m_camera->unlock();
+ break;
+ case QCamera::Unlocked:
+ m_camera->searchAndLock();
+ }
+}
+
+void Camera::updateLockStatus(QCamera::LockStatus status, QCamera::LockChangeReason reason)
+{
+ QColor indicationColor = Qt::black;
+
+ switch (status) {
+ case QCamera::Searching:
+ indicationColor = Qt::yellow;
+ ui->statusbar->showMessage(tr("Focusing..."));
+ ui->lockButton->setText(tr("Focusing..."));
+ break;
+ case QCamera::Locked:
+ indicationColor = Qt::darkGreen;
+ ui->lockButton->setText(tr("Unlock"));
+ ui->statusbar->showMessage(tr("Focused"), 2000);
+ break;
+ case QCamera::Unlocked:
+ indicationColor = reason == QCamera::LockFailed ? Qt::red : Qt::black;
+ ui->lockButton->setText(tr("Focus"));
+ if (reason == QCamera::LockFailed)
+ ui->statusbar->showMessage(tr("Focus Failed"), 2000);
+ }
+
+ QPalette palette = ui->lockButton->palette();
+ palette.setColor(QPalette::ButtonText, indicationColor);
+ ui->lockButton->setPalette(palette);
+}
+
+void Camera::takeImage()
+{
+ m_isCapturingImage = true;
+ m_imageCapture->capture();
+}
+
+void Camera::displayCaptureError(int id, const QCameraImageCapture::Error error, const QString &errorString)
+{
+ Q_UNUSED(id);
+ Q_UNUSED(error);
+ QMessageBox::warning(this, tr("Image Capture Error"), errorString);
+ m_isCapturingImage = false;
+}
+
+void Camera::startCamera()
+{
+ m_camera->start();
+}
+
+void Camera::stopCamera()
+{
+ m_camera->stop();
+}
+
+void Camera::updateCaptureMode()
+{
+ int tabIndex = ui->captureWidget->currentIndex();
+ QCamera::CaptureModes captureMode = tabIndex == 0 ? QCamera::CaptureStillImage : QCamera::CaptureVideo;
+
+ if (m_camera->isCaptureModeSupported(captureMode))
+ m_camera->setCaptureMode(captureMode);
+}
+
+void Camera::updateCameraState(QCamera::State state)
+{
+ switch (state) {
+ case QCamera::ActiveState:
+ ui->actionStartCamera->setEnabled(false);
+ ui->actionStopCamera->setEnabled(true);
+ ui->captureWidget->setEnabled(true);
+ ui->actionSettings->setEnabled(true);
+ break;
+ case QCamera::UnloadedState:
+ case QCamera::LoadedState:
+ ui->actionStartCamera->setEnabled(true);
+ ui->actionStopCamera->setEnabled(false);
+ ui->captureWidget->setEnabled(false);
+ ui->actionSettings->setEnabled(false);
+ }
+}
+
+void Camera::updateRecorderState(QMediaRecorder::State state)
+{
+ switch (state) {
+ case QMediaRecorder::StoppedState:
+ ui->recordButton->setEnabled(true);
+ ui->pauseButton->setEnabled(true);
+ ui->stopButton->setEnabled(false);
+ break;
+ case QMediaRecorder::PausedState:
+ ui->recordButton->setEnabled(true);
+ ui->pauseButton->setEnabled(false);
+ ui->stopButton->setEnabled(true);
+ break;
+ case QMediaRecorder::RecordingState:
+ ui->recordButton->setEnabled(false);
+ ui->pauseButton->setEnabled(true);
+ ui->stopButton->setEnabled(true);
+ break;
+ }
+}
+
+void Camera::setExposureCompensation(int index)
+{
+ m_camera->exposure()->setExposureCompensation(index*0.5);
+}
+
+void Camera::displayRecorderError()
+{
+ QMessageBox::warning(this, tr("Capture Error"), m_mediaRecorder->errorString());
+}
+
+void Camera::displayCameraError()
+{
+ QMessageBox::warning(this, tr("Camera Error"), m_camera->errorString());
+}
+
+void Camera::updateCameraDevice(QAction *action)
+{
+ setCamera(qvariant_cast(action->data()));
+}
+
+void Camera::displayViewfinder()
+{
+ ui->stackedWidget->setCurrentIndex(0);
+}
+
+void Camera::displayCapturedImage()
+{
+ ui->stackedWidget->setCurrentIndex(1);
+}
+
+void Camera::readyForCapture(bool ready)
+{
+ ui->takeImageButton->setEnabled(ready);
+}
+
+void Camera::imageSaved(int id, const QString &fileName)
+{
+ Q_UNUSED(id);
+ ui->statusbar->showMessage(tr("Captured \"%1\"").arg(QDir::toNativeSeparators(fileName)));
+
+ m_isCapturingImage = false;
+ if (m_applicationExiting)
+ close();
+}
+
+void Camera::closeEvent(QCloseEvent *event)
+{
+ if (m_isCapturingImage) {
+ setEnabled(false);
+ m_applicationExiting = true;
+ event->ignore();
+ } else {
+ event->accept();
+ }
+}
diff --git a/Project4/camera/camera.h b/Project4/camera/camera.h
new file mode 100644
index 00000000..5b92a118
--- /dev/null
+++ b/Project4/camera/camera.h
@@ -0,0 +1,85 @@
+#ifndef CAMERA_H
+#define CAMERA_H
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class Camera; }
+QT_END_NAMESPACE
+
+class Camera : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ Camera();
+
+private slots:
+ void setCamera(const QCameraInfo &cameraInfo);
+ void sensor();
+
+ void startCamera();
+ void stopCamera();
+
+ void record();
+ void pause();
+ void stop();
+ void setMuted(bool);
+
+ void toggleLock();
+ void takeImage();
+ void displayCaptureError(int, QCameraImageCapture::Error, const QString &errorString);
+
+ void configureCaptureSettings();
+ void configureVideoSettings();
+ void configureImageSettings();
+
+ void displayRecorderError();
+ void displayCameraError();
+
+ void updateCameraDevice(QAction *action);
+
+ void updateCameraState(QCamera::State);
+ void updateCaptureMode();
+ void updateRecorderState(QMediaRecorder::State state);
+ void setExposureCompensation(int index);
+
+ void updateRecordTime();
+
+ void processCapturedImage(int requestId, const QImage &img);
+ void updateLockStatus(QCamera::LockStatus, QCamera::LockChangeReason);
+
+ void displayViewfinder();
+ void displayCapturedImage();
+
+ void readyForCapture(bool ready);
+ void imageSaved(int id, const QString &fileName);
+
+protected:
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+ void closeEvent(QCloseEvent *event) override;
+
+private:
+ Ui::Camera *ui;
+ QTimer *timer;
+
+ QScopedPointer m_camera;
+ QScopedPointer m_imageCapture;
+ QScopedPointer m_mediaRecorder;
+
+ QImageEncoderSettings m_imageSettings;
+ QAudioEncoderSettings m_audioSettings;
+ QVideoEncoderSettings m_videoSettings;
+ QString m_videoContainerFormat;
+ bool m_isCapturingImage = false;
+ bool m_applicationExiting = false;
+};
+
+#endif
diff --git a/Project4/camera/camera.pro b/Project4/camera/camera.pro
new file mode 100644
index 00000000..a8344742
--- /dev/null
+++ b/Project4/camera/camera.pro
@@ -0,0 +1,27 @@
+TEMPLATE = app
+TARGET = camera
+
+QT += multimedia multimediawidgets widgets
+
+HEADERS = \
+ camera.h \
+ imagesettings.h \
+ videosettings.h
+
+SOURCES = \
+ main.cpp \
+ camera.cpp \
+ imagesettings.cpp \
+ videosettings.cpp
+
+FORMS += \
+ camera.ui \
+ videosettings.ui \
+ imagesettings.ui
+
+RESOURCES += camera.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/multimediawidgets/camera
+INSTALLS += target
+
+include(../../multimedia/shared/shared.pri)
diff --git a/Project4/camera/camera.pro.user b/Project4/camera/camera.pro.user
new file mode 100644
index 00000000..eb7286de
--- /dev/null
+++ b/Project4/camera/camera.pro.user
@@ -0,0 +1,263 @@
+
+
+
+
+
+ EnvironmentId
+ {be442c1a-bc83-4d03-852b-7b1a7188f327}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ false
+ true
+ false
+ 0
+ true
+ true
+ 0
+ 8
+ true
+ false
+ 1
+ true
+ true
+ true
+ *.md, *.MD, Makefile
+ false
+ true
+ true
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+ true
+ false
+ true
+ true
+ true
+ true
+
+
+ 0
+ true
+
+ true
+ true
+ Builtin.DefaultTidyAndClazy
+ 6
+
+
+
+ true
+
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop
+ QT5.12
+ QT5.12
+ {186efa0a-b522-415e-8887-8ee8b2d171f0}
+ 0
+ 0
+ 0
+
+ 0
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/camera/../build-camera-QT5_12-Debug
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/build-camera-QT5_12-Debug
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Debug
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+
+
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/camera/../build-camera-QT5_12-Release
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/build-camera-QT5_12-Release
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Release
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ 0
+
+
+ 0
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/camera/../build-camera-QT5_12-Profile
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/build-camera-QT5_12-Profile
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Profile
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ 0
+ 0
+
+ 3
+
+
+ 0
+ Deploy
+ Deploy
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+
+ false
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+ true
+ true
+ true
+
+ 2
+
+ Qt4ProjectManager.Qt4RunConfiguration:/home/seame-fablab/Desktop/SEA-ME/Project4/camera/camera.pro
+ /home/seame-fablab/Desktop/SEA-ME/Project4/camera/camera.pro
+ false
+ true
+ true
+ false
+ true
+ /home/seame-fablab/Qt/Examples/Qt-5.15.2/multimediawidgets/build-camera-QT5_12-Debug
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 22
+
+
+ Version
+ 22
+
+
diff --git a/Project4/camera/camera.qrc b/Project4/camera/camera.qrc
new file mode 100644
index 00000000..5b06f3a6
--- /dev/null
+++ b/Project4/camera/camera.qrc
@@ -0,0 +1,5 @@
+
+
+ images/shutter.svg
+
+
diff --git a/Project4/camera/camera.ui b/Project4/camera/camera.ui
new file mode 100644
index 00000000..c1464798
--- /dev/null
+++ b/Project4/camera/camera.ui
@@ -0,0 +1,535 @@
+
+
+ Camera
+
+
+
+ 0
+ 0
+ 668
+ 621
+
+
+
+ Camera
+
+
+
+
+
+
+
+ 1
+ 0
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 145
+ 145
+ 145
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 145
+ 145
+ 145
+
+
+
+
+
+
+
+
+ 145
+ 145
+ 145
+
+
+
+
+
+
+ 145
+ 145
+ 145
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+ QFrame::Box
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+ 1
+
+
+
+ 0
+ 0
+
+
+
+
+ Image
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 161
+
+
+
+
+
+
+
+ Exposure Compensation:
+
+
+
+
+
+
+ false
+
+
+ Capture Photo
+
+
+
+ :/images/shutter.svg:/images/shutter.svg
+
+
+
+
+
+
+ -4
+
+
+ 4
+
+
+ 2
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksAbove
+
+
+
+
+
+
+
+ Video
+
+
+
+
+
+ Mute
+
+
+ true
+
+
+
+
+
+
+ Record
+
+
+
+
+
+
+ Stop
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 76
+
+
+
+
+
+
+
+ Pause
+
+
+
+
+
+
+
+
+
+
+
+ 16777215
+ 50
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+ Focus
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 668
+ 22
+
+
+
+
+ File
+
+
+
+
+
+
+
+
+
+
+ Devices
+
+
+
+
+
+
+
+
+ Exit
+
+
+
+
+ Start Camera
+
+
+
+
+ Stop Camera
+
+
+
+
+ Settings
+
+
+
+
+
+ QCameraViewfinder
+ QWidget
+ qcameraviewfinder.h
+ 1
+
+
+
+
+
+
+
+ actionExit
+ triggered()
+ Camera
+ close()
+
+
+ -1
+ -1
+
+
+ 154
+ 130
+
+
+
+
+ actionSettings
+ triggered()
+ Camera
+ configureCaptureSettings()
+
+
+ -1
+ -1
+
+
+ 333
+ 210
+
+
+
+
+ actionStartCamera
+ triggered()
+ Camera
+ startCamera()
+
+
+ -1
+ -1
+
+
+ 333
+ 210
+
+
+
+
+ actionStopCamera
+ triggered()
+ Camera
+ stopCamera()
+
+
+ -1
+ -1
+
+
+ 333
+ 210
+
+
+
+
+ takeImageButton
+ clicked()
+ Camera
+ takeImage()
+
+
+ 625
+ 132
+
+
+ 603
+ 169
+
+
+
+
+ exposureCompensation
+ valueChanged(int)
+ Camera
+ setExposureCompensation(int)
+
+
+ 559
+ 367
+
+
+ 665
+ 365
+
+
+
+
+ stopButton
+ clicked()
+ Camera
+ stop()
+
+
+ 647
+ 225
+
+
+ 140
+ 236
+
+
+
+
+ muteButton
+ toggled(bool)
+ Camera
+ setMuted(bool)
+
+
+ 647
+ 377
+
+
+ 5
+ 280
+
+
+
+
+ recordButton
+ clicked()
+ Camera
+ record()
+
+
+ 647
+ 149
+
+
+ 61
+ 238
+
+
+
+
+ pauseButton
+ clicked()
+ Camera
+ pause()
+
+
+ 647
+ 187
+
+
+ 234
+ 237
+
+
+
+
+ lockButton
+ clicked()
+ Camera
+ toggleLock()
+
+
+ 658
+ 75
+
+
+ 453
+ 119
+
+
+
+
+
+ record()
+ pause()
+ stop()
+ enablePreview(bool)
+ configureCaptureSettings()
+ takeImage()
+ startCamera()
+ toggleLock()
+ setMuted(bool)
+ stopCamera()
+ setExposureCompensation(int)
+
+
diff --git a/Project4/camera/doc/images/camera-example.png b/Project4/camera/doc/images/camera-example.png
new file mode 100644
index 00000000..12e1b572
Binary files /dev/null and b/Project4/camera/doc/images/camera-example.png differ
diff --git a/Project4/camera/doc/src/camera.qdoc b/Project4/camera/doc/src/camera.qdoc
new file mode 100644
index 00000000..361149c7
--- /dev/null
+++ b/Project4/camera/doc/src/camera.qdoc
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+
+/*!
+
+\example multimediawidgets/camera
+\title Camera Example
+\ingroup multimedia_examples
+\ingroup camera_examples
+\brief The Camera Example shows how to use the API to capture a still image
+or video.
+
+The Camera Example demonstrates how you can use \l{Qt Multimedia} to implement
+some basic Camera functionality to take still images and record video clips
+with audio.
+
+\include examples-run.qdocinc
+
+A Camera class is created that will act as our Camera. It has a user interface,
+control functions, setting values and a means of defining the location where
+the image or video clip is to be saved. It will also store the image and video
+settings.
+
+The Camera class contains an instance of \l {QCamera}, the API class interface to
+the hardware. It also has an instance of \l {QCameraImageCapture} to take still images
+and an instance of \l {QMediaRecorder} to record video. It also contains the user
+interface object.
+
+The Camera constructor does some basic initialization. The camera object is
+set to '0', the user interface is initialized and UI signal are connected to
+slots that react to the triggering event. However, most of the work is done when
+the \e{setCamera()} function is called, passing in a \l {QByteArray}.
+
+\e{setCamera()} sets up various connections between the user interface and the functionality
+of the Camera class using signals and slots. It also instantiates and initializes the \l {QCamera},
+\l {QCameraImageCapture} and \l {QMediaRecorder} objects mentioned above. The still
+and video recording visual tabs are enabled and finally the
+\l {QCamera::start()}{start()} function of the \l{QCamera} object is called.
+
+Now that the camera is ready for user commands it waits for a suitable event.
+Such an event will be the key press of either the \l {Qt::Key_CameraFocus} or
+\l {Qt::Key_Camera} buttons on the application window. Camera focus will
+simply display the viewfinder and lock the camera settings. Key_Camera will
+either call \e{takeImage()} if the \l {QCamera::captureMode()}{captureMode()}
+is QCamera::CaptureStillImage, or if the capture mode is for video then one
+of two actions will occur. If the recording state shows that we are currently
+recording then the \e{stop()} function is called resulting in a call to
+\l {QCamera::stop()}, whereas if we are not recording then a video recording
+is started with a call to \l {QMediaRecorder::record()}.
+
+\image camera-example.png
+
+*/
diff --git a/Project4/camera/images/shutter.svg b/Project4/camera/images/shutter.svg
new file mode 100644
index 00000000..67da2c2c
--- /dev/null
+++ b/Project4/camera/images/shutter.svg
@@ -0,0 +1,21 @@
+
+
+
diff --git a/Project4/camera/imagesettings.cpp b/Project4/camera/imagesettings.cpp
new file mode 100644
index 00000000..3c273960
--- /dev/null
+++ b/Project4/camera/imagesettings.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "imagesettings.h"
+#include "ui_imagesettings.h"
+
+#include
+#include
+#include
+#include
+
+
+ImageSettings::ImageSettings(QCameraImageCapture *imageCapture, QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ImageSettingsUi),
+ imagecapture(imageCapture)
+{
+ ui->setupUi(this);
+
+ //image codecs
+ ui->imageCodecBox->addItem(tr("Default image format"), QVariant(QString()));
+ const QStringList supportedImageCodecs = imagecapture->supportedImageCodecs();
+ for (const QString &codecName : supportedImageCodecs) {
+ QString description = imagecapture->imageCodecDescription(codecName);
+ ui->imageCodecBox->addItem(codecName + ": " + description, QVariant(codecName));
+ }
+
+ ui->imageQualitySlider->setRange(0, int(QMultimedia::VeryHighQuality));
+
+ ui->imageResolutionBox->addItem(tr("Default Resolution"));
+ const QList supportedResolutions = imagecapture->supportedResolutions();
+ for (const QSize &resolution : supportedResolutions) {
+ ui->imageResolutionBox->addItem(QString("%1x%2").arg(resolution.width()).arg(resolution.height()),
+ QVariant(resolution));
+ }
+}
+
+ImageSettings::~ImageSettings()
+{
+ delete ui;
+}
+
+void ImageSettings::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+QImageEncoderSettings ImageSettings::imageSettings() const
+{
+ QImageEncoderSettings settings = imagecapture->encodingSettings();
+ settings.setCodec(boxValue(ui->imageCodecBox).toString());
+ settings.setQuality(QMultimedia::EncodingQuality(ui->imageQualitySlider->value()));
+ settings.setResolution(boxValue(ui->imageResolutionBox).toSize());
+
+ return settings;
+}
+
+void ImageSettings::setImageSettings(const QImageEncoderSettings &imageSettings)
+{
+ selectComboBoxItem(ui->imageCodecBox, QVariant(imageSettings.codec()));
+ selectComboBoxItem(ui->imageResolutionBox, QVariant(imageSettings.resolution()));
+ ui->imageQualitySlider->setValue(imageSettings.quality());
+}
+
+QVariant ImageSettings::boxValue(const QComboBox *box) const
+{
+ int idx = box->currentIndex();
+ if (idx == -1)
+ return QVariant();
+
+ return box->itemData(idx);
+}
+
+void ImageSettings::selectComboBoxItem(QComboBox *box, const QVariant &value)
+{
+ for (int i = 0; i < box->count(); ++i) {
+ if (box->itemData(i) == value) {
+ box->setCurrentIndex(i);
+ break;
+ }
+ }
+}
diff --git a/Project4/camera/imagesettings.h b/Project4/camera/imagesettings.h
new file mode 100644
index 00000000..f9e32920
--- /dev/null
+++ b/Project4/camera/imagesettings.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef IMAGESETTINGS_H
+#define IMAGESETTINGS_H
+
+#include
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+class QComboBox;
+class QCameraImageCapture;
+namespace Ui { class ImageSettingsUi; }
+QT_END_NAMESPACE
+
+class ImageSettings : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit ImageSettings(QCameraImageCapture *imageCapture, QWidget *parent = nullptr);
+ ~ImageSettings();
+
+ QAudioEncoderSettings audioSettings() const;
+ void setAudioSettings(const QAudioEncoderSettings &settings);
+
+ QImageEncoderSettings imageSettings() const;
+ void setImageSettings(const QImageEncoderSettings &settings);
+
+ QString format() const;
+ void setFormat(const QString &format);
+
+protected:
+ void changeEvent(QEvent *e) override;
+
+private:
+ QVariant boxValue(const QComboBox *box) const;
+ void selectComboBoxItem(QComboBox *box, const QVariant &value);
+
+ Ui::ImageSettingsUi *ui;
+ QCameraImageCapture *imagecapture;
+};
+
+#endif // IMAGESETTINGS_H
diff --git a/Project4/camera/imagesettings.ui b/Project4/camera/imagesettings.ui
new file mode 100644
index 00000000..c9a4d947
--- /dev/null
+++ b/Project4/camera/imagesettings.ui
@@ -0,0 +1,123 @@
+
+
+ ImageSettingsUi
+
+
+
+ 0
+ 0
+ 332
+ 270
+
+
+
+ Image Settings
+
+
+
+
+
+ Image
+
+
+
+
+
+ Resolution:
+
+
+
+
+
+
+
+
+
+ Image Format:
+
+
+
+
+
+
+
+
+
+ Quality:
+
+
+
+
+
+
+ 4
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 14
+
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ ImageSettingsUi
+ accept()
+
+
+ 322
+ 272
+
+
+ 44
+ 230
+
+
+
+
+ buttonBox
+ rejected()
+ ImageSettingsUi
+ reject()
+
+
+ 405
+ 262
+
+
+ 364
+ 227
+
+
+
+
+
diff --git a/Project4/camera/main.cpp b/Project4/camera/main.cpp
new file mode 100644
index 00000000..0315c9e4
--- /dev/null
+++ b/Project4/camera/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "camera.h"
+#include
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ Camera camera;
+ camera.show();
+
+
+ return app.exec();
+};
diff --git a/Project4/camera/moc_predefs.h b/Project4/camera/moc_predefs.h
new file mode 100644
index 00000000..726962be
--- /dev/null
+++ b/Project4/camera/moc_predefs.h
@@ -0,0 +1,487 @@
+#define __DBL_MIN_EXP__ (-1021)
+#define __HQ_FBIT__ 15
+#define __FLT32X_MAX_EXP__ 1024
+#define __cpp_attributes 200809
+#define __UINT_LEAST16_MAX__ 0xffff
+#define __ARM_SIZEOF_WCHAR_T 4
+#define __ATOMIC_ACQUIRE 2
+#define __SFRACT_IBIT__ 0
+#define __FLT_MIN__ 1.1754943508222875e-38F
+#define __GCC_IEC_559_COMPLEX 2
+#define __cpp_aggregate_nsdmi 201304
+#define __UFRACT_MAX__ 0XFFFFP-16UR
+#define __UINT_LEAST8_TYPE__ unsigned char
+#define __DQ_FBIT__ 63
+#define __INTMAX_C(c) c ## LL
+#define __ARM_FEATURE_SAT 1
+#define __ULFRACT_FBIT__ 32
+#define __SACCUM_EPSILON__ 0x1P-7HK
+#define __CHAR_BIT__ 8
+#define __USQ_IBIT__ 0
+#define __UINT8_MAX__ 0xff
+#define __ACCUM_FBIT__ 15
+#define __WINT_MAX__ 0xffffffffU
+#define __FLT32_MIN_EXP__ (-125)
+#define __cpp_static_assert 200410
+#define __USFRACT_FBIT__ 8
+#define __ORDER_LITTLE_ENDIAN__ 1234
+#define __SIZE_MAX__ 0xffffffffU
+#define __ARM_ARCH_ISA_ARM 1
+#define __WCHAR_MAX__ 0xffffffffU
+#define __LACCUM_IBIT__ 32
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
+#define __DBL_DENORM_MIN__ double(4.9406564584124654e-324L)
+#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
+#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
+#define __GCC_IEC_559 2
+#define __FLT32X_DECIMAL_DIG__ 17
+#define __FLT_EVAL_METHOD__ 0
+#define __unix__ 1
+#define __cpp_binary_literals 201304
+#define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK
+#define __FLT64_DECIMAL_DIG__ 17
+#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
+#define __FRACT_FBIT__ 15
+#define __cpp_variadic_templates 200704
+#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL
+#define __SIG_ATOMIC_TYPE__ int
+#define __UACCUM_FBIT__ 16
+#define __DBL_MIN_10_EXP__ (-307)
+#define __FINITE_MATH_ONLY__ 0
+#define __ARMEL__ 1
+#define __cpp_variable_templates 201304
+#define __ARM_FEATURE_UNALIGNED 1
+#define __LFRACT_IBIT__ 0
+#define __GNUC_PATCHLEVEL__ 1
+#define __FLT32_HAS_DENORM__ 1
+#define __LFRACT_MAX__ 0X7FFFFFFFP-31LR
+#define __UINT_FAST8_MAX__ 0xff
+#define __has_include(STR) __has_include__(STR)
+#define __DEC64_MAX_EXP__ 385
+#define __INT8_C(c) c
+#define __INT_LEAST8_WIDTH__ 8
+#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL
+#define __SA_FBIT__ 15
+#define __SHRT_MAX__ 0x7fff
+#define __LDBL_MAX__ 1.7976931348623157e+308L
+#define __ARM_FEATURE_IDIV 1
+#define __FRACT_MAX__ 0X7FFFP-15R
+#define __thumb2__ 1
+#define __UFRACT_FBIT__ 16
+#define __ARM_FP 14
+#define __UFRACT_MIN__ 0.0UR
+#define __UINT_LEAST8_MAX__ 0xff
+#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
+#define __UINTMAX_TYPE__ long long unsigned int
+#define __LLFRACT_EPSILON__ 0x1P-63LLR
+#define __linux 1
+#define __DEC32_EPSILON__ 1E-6DF
+#define __FLT_EVAL_METHOD_TS_18661_3__ 0
+#define __OPTIMIZE__ 1
+#define __CHAR_UNSIGNED__ 1
+#define __UINT32_MAX__ 0xffffffffU
+#define __GXX_EXPERIMENTAL_CXX0X__ 1
+#define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR
+#define __TA_IBIT__ 64
+#define __LDBL_MAX_EXP__ 1024
+#define __WINT_MIN__ 0U
+#define __ARM_ASM_SYNTAX_UNIFIED__ 1
+#define __linux__ 1
+#define __ARM_ARCH_8A__ 1
+#define __INT_LEAST16_WIDTH__ 16
+#define __ULLFRACT_MIN__ 0.0ULLR
+#define __SCHAR_MAX__ 0x7f
+#define __WCHAR_MIN__ 0U
+#define __INT64_C(c) c ## LL
+#define __DBL_DIG__ 15
+#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
+#define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK)
+#define __SIZEOF_INT__ 4
+#define __SIZEOF_POINTER__ 4
+#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
+#define __USACCUM_IBIT__ 8
+#define __USER_LABEL_PREFIX__
+#define __STDC_HOSTED__ 1
+#define __LDBL_HAS_INFINITY__ 1
+#define __LFRACT_MIN__ (-0.5LR-0.5LR)
+#define __HA_IBIT__ 8
+#define __FLT32_DIG__ 6
+#define __ARM_NEON_FP 6
+#define __TQ_IBIT__ 0
+#define __FLT_EPSILON__ 1.1920928955078125e-7F
+#define __APCS_32__ 1
+#define __GXX_WEAK__ 1
+#define __SHRT_WIDTH__ 16
+#define __USFRACT_IBIT__ 0
+#define __LDBL_MIN__ 2.2250738585072014e-308L
+#define __FRACT_MIN__ (-0.5R-0.5R)
+#define __DEC32_MAX__ 9.999999E96DF
+#define __cpp_threadsafe_static_init 200806
+#define __DA_IBIT__ 32
+#define __ARM_SIZEOF_MINIMAL_ENUM 4
+#define __FLT32X_HAS_INFINITY__ 1
+#define __INT32_MAX__ 0x7fffffff
+#define __UQQ_FBIT__ 8
+#define __INT_WIDTH__ 32
+#define __SIZEOF_LONG__ 4
+#define __UACCUM_MAX__ 0XFFFFFFFFP-16UK
+#define __STDC_IEC_559__ 1
+#define __STDC_ISO_10646__ 201706L
+#define __UINT16_C(c) c
+#define __PTRDIFF_WIDTH__ 32
+#define __DECIMAL_DIG__ 17
+#define __LFRACT_EPSILON__ 0x1P-31LR
+#define __FLT64_EPSILON__ 2.2204460492503131e-16F64
+#define __ULFRACT_MIN__ 0.0ULR
+#define __gnu_linux__ 1
+#define __INTMAX_WIDTH__ 64
+#define __FLT64_MIN_EXP__ (-1021)
+#define __has_include_next(STR) __has_include_next__(STR)
+#define __ARM_PCS_VFP 1
+#define __LDBL_HAS_QUIET_NAN__ 1
+#define __ULACCUM_IBIT__ 32
+#define __FLT64_MANT_DIG__ 53
+#define __UACCUM_EPSILON__ 0x1P-16UK
+#define __GNUC__ 7
+#define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK
+#define __GXX_RTTI 1
+#define __cpp_delegating_constructors 200604
+#define __HQ_IBIT__ 0
+#define __FLT_HAS_DENORM__ 1
+#define __SIZEOF_LONG_DOUBLE__ 8
+#define __BIGGEST_ALIGNMENT__ 8
+#define __STDC_UTF_16__ 1
+#define __FLT64_MAX_10_EXP__ 308
+#define __GNUC_STDC_INLINE__ 1
+#define __ARM_FEATURE_CRYPTO 1
+#define __DQ_IBIT__ 0
+#define __FLT32_HAS_INFINITY__ 1
+#define __DBL_MAX__ double(1.7976931348623157e+308L)
+#define __ULFRACT_IBIT__ 0
+#define __cpp_raw_strings 200710
+#define __INT_FAST32_MAX__ 0x7fffffff
+#define __DBL_HAS_INFINITY__ 1
+#define __INT64_MAX__ 0x7fffffffffffffffLL
+#define __ACCUM_IBIT__ 16
+#define __DEC32_MIN_EXP__ (-94)
+#define __THUMB_INTERWORK__ 1
+#define __INTPTR_WIDTH__ 32
+#define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK
+#define __FLT32X_HAS_DENORM__ 1
+#define __INT_FAST16_TYPE__ int
+#define __LDBL_HAS_DENORM__ 1
+#define __ARM_FEATURE_LDREX 15
+#define __cplusplus 201402L
+#define __cpp_ref_qualifiers 200710
+#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
+#define __INT_LEAST32_MAX__ 0x7fffffff
+#define __DEC32_MIN__ 1E-95DF
+#define __ACCUM_MAX__ 0X7FFFFFFFP-15K
+#define __DEPRECATED 1
+#define __cpp_rvalue_references 200610
+#define __DBL_MAX_EXP__ 1024
+#define __USACCUM_EPSILON__ 0x1P-8UHK
+#define __WCHAR_WIDTH__ 32
+#define __FLT32_MAX__ 3.4028234663852886e+38F32
+#define __DEC128_EPSILON__ 1E-33DL
+#define __SFRACT_MAX__ 0X7FP-7HR
+#define __FRACT_IBIT__ 0
+#define __PTRDIFF_MAX__ 0x7fffffff
+#define __UACCUM_MIN__ 0.0UK
+#define __UACCUM_IBIT__ 16
+#define __FLT32_HAS_QUIET_NAN__ 1
+#define __GNUG__ 7
+#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
+#define __SIZEOF_SIZE_T__ 4
+#define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK
+#define __cpp_rvalue_reference 200610
+#define __cpp_nsdmi 200809
+#define __SIZEOF_WINT_T__ 4
+#define __LONG_LONG_WIDTH__ 64
+#define __cpp_initializer_lists 200806
+#define __FLT32_MAX_EXP__ 128
+#define __SA_IBIT__ 16
+#define __ULLACCUM_MIN__ 0.0ULLK
+#define __cpp_hex_float 201603
+#define __GXX_ABI_VERSION 1011
+#define __UTA_FBIT__ 64
+#define __FLT_MIN_EXP__ (-125)
+#define __USFRACT_MAX__ 0XFFP-8UHR
+#define __UFRACT_IBIT__ 0
+#define __cpp_lambdas 200907
+#define __ARM_FEATURE_QBIT 1
+#define __INT_FAST64_TYPE__ long long int
+#define __FP_FAST_FMAF 1
+#define __FP_FAST_FMAL 1
+#define __FLT64_DENORM_MIN__ 4.9406564584124654e-324F64
+#define __DBL_MIN__ double(2.2250738585072014e-308L)
+#define __FLT32X_EPSILON__ 2.2204460492503131e-16F32x
+#define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK)
+#define __ULLACCUM_FBIT__ 32
+#define __GXX_TYPEINFO_EQUALITY_INLINE 0
+#define __FLT64_MIN_10_EXP__ (-307)
+#define __ULLFRACT_EPSILON__ 0x1P-64ULLR
+#define __DEC128_MIN__ 1E-6143DL
+#define __REGISTER_PREFIX__
+#define __UINT16_MAX__ 0xffff
+#define __DBL_HAS_DENORM__ 1
+#define __ACCUM_MIN__ (-0X1P15K-0X1P15K)
+#define __SQ_IBIT__ 0
+#define __FLT32_MIN__ 1.1754943508222875e-38F32
+#define __UINT8_TYPE__ unsigned char
+#define __UHA_FBIT__ 8
+#define __SFRACT_MIN__ (-0.5HR-0.5HR)
+#define __UTQ_FBIT__ 128
+#define __FLT_MANT_DIG__ 24
+#define __LDBL_DECIMAL_DIG__ 17
+#define __VERSION__ "7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4]"
+#define __UINT64_C(c) c ## ULL
+#define __ULLFRACT_FBIT__ 64
+#define __cpp_unicode_characters 200704
+#define __FRACT_EPSILON__ 0x1P-15R
+#define __ULACCUM_MIN__ 0.0ULK
+#define _STDC_PREDEF_H 1
+#define __UDA_FBIT__ 32
+#define __cpp_decltype_auto 201304
+#define __LLACCUM_EPSILON__ 0x1P-31LLK
+#define __ARM_FEATURE_FMA 1
+#define __GCC_ATOMIC_INT_LOCK_FREE 2
+#define __FLT32_MANT_DIG__ 24
+#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __USFRACT_MIN__ 0.0UHR
+#define __ULLACCUM_IBIT__ 32
+#define __UQQ_IBIT__ 0
+#define __STDC_IEC_559_COMPLEX__ 1
+#define __ARM_NEON__ 1
+#define __SCHAR_WIDTH__ 8
+#define __INT32_C(c) c
+#define __DEC64_EPSILON__ 1E-15DD
+#define __ORDER_PDP_ENDIAN__ 3412
+#define __DEC128_MIN_EXP__ (-6142)
+#define __UHQ_FBIT__ 16
+#define __LLACCUM_FBIT__ 31
+#define __FLT32_MAX_10_EXP__ 38
+#define __LINARO_SPIN__ 0
+#define __INT_FAST32_TYPE__ int
+#define __UINT_LEAST16_TYPE__ short unsigned int
+#define unix 1
+#define __INT16_MAX__ 0x7fff
+#define __cpp_rtti 199711
+#define __SIZE_TYPE__ unsigned int
+#define __UINT64_MAX__ 0xffffffffffffffffULL
+#define __UDQ_FBIT__ 64
+#define __INT8_TYPE__ signed char
+#define __thumb__ 1
+#define __cpp_digit_separators 201309
+#define __ELF__ 1
+#define __ULFRACT_EPSILON__ 0x1P-32ULR
+#define __LLFRACT_FBIT__ 63
+#define __FLT_RADIX__ 2
+#define __INT_LEAST16_TYPE__ short int
+#define __ARM_ARCH_PROFILE 65
+#define __LDBL_EPSILON__ 2.2204460492503131e-16L
+#define __UINTMAX_C(c) c ## ULL
+#define __SACCUM_MAX__ 0X7FFFP-7HK
+#define __SIG_ATOMIC_MAX__ 0x7fffffff
+#define __LINARO_RELEASE__ 201902
+#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
+#define __cpp_sized_deallocation 201309
+#define __VFP_FP__ 1
+#define __SIZEOF_PTRDIFF_T__ 4
+#define __FLT32X_MANT_DIG__ 53
+#define __LACCUM_EPSILON__ 0x1P-31LK
+#define __FLT32X_MIN_EXP__ (-1021)
+#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
+#define __INT_FAST16_MAX__ 0x7fffffff
+#define __FLT64_DIG__ 15
+#define __UINT_FAST32_MAX__ 0xffffffffU
+#define __UINT_LEAST64_TYPE__ long long unsigned int
+#define __USACCUM_MAX__ 0XFFFFP-8UHK
+#define __SFRACT_EPSILON__ 0x1P-7HR
+#define __FLT_HAS_QUIET_NAN__ 1
+#define __FLT_MAX_10_EXP__ 38
+#define __LONG_MAX__ 0x7fffffffL
+#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
+#define __FLT_HAS_INFINITY__ 1
+#define __unix 1
+#define __cpp_unicode_literals 200710
+#define __USA_FBIT__ 16
+#define __UINT_FAST16_TYPE__ unsigned int
+#define __DEC64_MAX__ 9.999999999999999E384DD
+#define __ARM_32BIT_STATE 1
+#define __INT_FAST32_WIDTH__ 32
+#define __CHAR16_TYPE__ short unsigned int
+#define __PRAGMA_REDEFINE_EXTNAME 1
+#define __SIZE_WIDTH__ 32
+#define __INT_LEAST16_MAX__ 0x7fff
+#define __DEC64_MANT_DIG__ 16
+#define __UINT_LEAST32_MAX__ 0xffffffffU
+#define __SACCUM_FBIT__ 7
+#define __FLT32_DENORM_MIN__ 1.4012984643248171e-45F32
+#define __GCC_ATOMIC_LONG_LOCK_FREE 2
+#define __SIG_ATOMIC_WIDTH__ 32
+#define __INT_LEAST64_TYPE__ long long int
+#define __ARM_FEATURE_CLZ 1
+#define __INT16_TYPE__ short int
+#define __INT_LEAST8_TYPE__ signed char
+#define __SQ_FBIT__ 31
+#define __DEC32_MAX_EXP__ 97
+#define __ARM_ARCH_ISA_THUMB 2
+#define __INT_FAST8_MAX__ 0x7f
+#define __ARM_ARCH 8
+#define __INTPTR_MAX__ 0x7fffffff
+#define __QQ_FBIT__ 7
+#define linux 1
+#define __cpp_range_based_for 200907
+#define __UTA_IBIT__ 64
+#define __FLT64_HAS_QUIET_NAN__ 1
+#define __FLT32_MIN_10_EXP__ (-37)
+#define __EXCEPTIONS 1
+#define __LDBL_MANT_DIG__ 53
+#define __SFRACT_FBIT__ 7
+#define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK)
+#define __DBL_HAS_QUIET_NAN__ 1
+#define __FLT64_HAS_INFINITY__ 1
+#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
+#define __cpp_return_type_deduction 201304
+#define __INTPTR_TYPE__ int
+#define __UINT16_TYPE__ short unsigned int
+#define __WCHAR_TYPE__ unsigned int
+#define __SIZEOF_FLOAT__ 4
+#define __THUMBEL__ 1
+#define __USQ_FBIT__ 32
+#define __UINTPTR_MAX__ 0xffffffffU
+#define __INT_FAST64_WIDTH__ 64
+#define __DEC64_MIN_EXP__ (-382)
+#define __cpp_decltype 200707
+#define __FLT32_DECIMAL_DIG__ 9
+#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL
+#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
+#define __FLT_DIG__ 6
+#define __UINT_FAST64_TYPE__ long long unsigned int
+#define __INT_MAX__ 0x7fffffff
+#define __LACCUM_FBIT__ 31
+#define __USACCUM_MIN__ 0.0UHK
+#define __UHA_IBIT__ 8
+#define __INT64_TYPE__ long long int
+#define __FLT_MAX_EXP__ 128
+#define __UTQ_IBIT__ 0
+#define __DBL_MANT_DIG__ 53
+#define __cpp_inheriting_constructors 201511
+#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL
+#define __DEC64_MIN__ 1E-383DD
+#define __WINT_TYPE__ unsigned int
+#define __UINT_LEAST32_TYPE__ unsigned int
+#define __SIZEOF_SHORT__ 2
+#define __ULLFRACT_IBIT__ 0
+#define __LDBL_MIN_EXP__ (-1021)
+#define __arm__ 1
+#define __FLT64_MAX__ 1.7976931348623157e+308F64
+#define __UDA_IBIT__ 32
+#define __WINT_WIDTH__ 32
+#define __INT_LEAST8_MAX__ 0x7f
+#define __FLT32X_MAX_10_EXP__ 308
+#define __LFRACT_FBIT__ 31
+#define __WCHAR_UNSIGNED__ 1
+#define __LDBL_MAX_10_EXP__ 308
+#define __ATOMIC_RELAXED 0
+#define __DBL_EPSILON__ double(2.2204460492503131e-16L)
+#define __ARM_FEATURE_SIMD32 1
+#define __UINT8_C(c) c
+#define __FLT64_MAX_EXP__ 1024
+#define __INT_LEAST32_TYPE__ int
+#define __SIZEOF_WCHAR_T__ 4
+#define __ARM_NEON 1
+#define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR
+#define __TQ_FBIT__ 127
+#define __INT_FAST8_TYPE__ signed char
+#define __ULLACCUM_EPSILON__ 0x1P-32ULLK
+#define __UHQ_IBIT__ 0
+#define __LLACCUM_IBIT__ 32
+#define __FLT64_HAS_DENORM__ 1
+#define __FLT32_EPSILON__ 1.1920928955078125e-7F32
+#define __DBL_DECIMAL_DIG__ 17
+#define __STDC_UTF_32__ 1
+#define __INT_FAST8_WIDTH__ 8
+#define __DEC_EVAL_METHOD__ 2
+#define __FLT32X_MAX__ 1.7976931348623157e+308F32x
+#define __TA_FBIT__ 63
+#define __UDQ_IBIT__ 0
+#define __ORDER_BIG_ENDIAN__ 4321
+#define __cpp_runtime_arrays 198712
+#define __UINT64_TYPE__ long long unsigned int
+#define __ACCUM_EPSILON__ 0x1P-15K
+#define __UINT32_C(c) c ## U
+#define __INTMAX_MAX__ 0x7fffffffffffffffLL
+#define __cpp_alias_templates 200704
+#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
+#define __LLFRACT_IBIT__ 0
+#define __INT8_MAX__ 0x7f
+#define __LONG_WIDTH__ 32
+#define __UINT_FAST32_TYPE__ unsigned int
+#define __CHAR32_TYPE__ unsigned int
+#define __FLT_MAX__ 3.4028234663852886e+38F
+#define __FP_FAST_FMA 1
+#define __cpp_constexpr 201304
+#define __USACCUM_FBIT__ 8
+#define __ARM_FEATURE_NUMERIC_MAXMIN 1
+#define __INT32_TYPE__ int
+#define __SIZEOF_DOUBLE__ 8
+#define __cpp_exceptions 199711
+#define __FLT_MIN_10_EXP__ (-37)
+#define __UFRACT_EPSILON__ 0x1P-16UR
+#define __FLT64_MIN__ 2.2250738585072014e-308F64
+#define __INT_LEAST32_WIDTH__ 32
+#define __INTMAX_TYPE__ long long int
+#define __DEC128_MAX_EXP__ 6145
+#define __FLT32X_HAS_QUIET_NAN__ 1
+#define __ATOMIC_CONSUME 1
+#define __GNUC_MINOR__ 4
+#define __INT_FAST16_WIDTH__ 32
+#define __UINTMAX_MAX__ 0xffffffffffffffffULL
+#define __DEC32_MANT_DIG__ 7
+#define __FLT32X_DENORM_MIN__ 4.9406564584124654e-324F32x
+#define __HA_FBIT__ 7
+#define __DBL_MAX_10_EXP__ 308
+#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+#define __INT16_C(c) c
+#define __cpp_generic_lambdas 201304
+#define __STDC__ 1
+#define __FLT32X_DIG__ 15
+#define __PTRDIFF_TYPE__ int
+#define __LLFRACT_MIN__ (-0.5LLR-0.5LLR)
+#define __ATOMIC_SEQ_CST 5
+#define __DA_FBIT__ 31
+#define __UINT32_TYPE__ unsigned int
+#define __FLT32X_MIN_10_EXP__ (-307)
+#define __ARM_ARCH_EXT_IDIV__ 1
+#define __UINTPTR_TYPE__ unsigned int
+#define __USA_IBIT__ 16
+#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
+#define __ARM_EABI__ 1
+#define __DEC128_MANT_DIG__ 34
+#define __LDBL_MIN_10_EXP__ (-307)
+#define __SIZEOF_LONG_LONG__ 8
+#define __ULACCUM_EPSILON__ 0x1P-32ULK
+#define __cpp_user_defined_literals 200809
+#define __SACCUM_IBIT__ 8
+#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
+#define __FLT32X_MIN__ 2.2250738585072014e-308F32x
+#define __LDBL_DIG__ 15
+#define __FLT_DECIMAL_DIG__ 9
+#define __UINT_FAST16_MAX__ 0xffffffffU
+#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
+#define __INT_LEAST64_WIDTH__ 64
+#define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR
+#define __UINT_FAST8_TYPE__ unsigned char
+#define _GNU_SOURCE 1
+#define __USFRACT_EPSILON__ 0x1P-8UHR
+#define __ULACCUM_FBIT__ 32
+#define __ARM_FEATURE_DSP 1
+#define __QQ_IBIT__ 0
+#define __cpp_init_captures 201304
+#define __ATOMIC_ACQ_REL 4
+#define __ATOMIC_RELEASE 3
diff --git a/Project4/camera/qrc_camera.cpp b/Project4/camera/qrc_camera.cpp
new file mode 100644
index 00000000..338fb880
--- /dev/null
+++ b/Project4/camera/qrc_camera.cpp
@@ -0,0 +1,183 @@
+/****************************************************************************
+** Resource object code
+**
+** Created by: The Resource Compiler for Qt version 5.15.0
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+static const unsigned char qt_resource_data[] = {
+ // /home/seame-fablab/camera/images/shutter.svg
+ 0x0,0x0,0x5,0xd3,
+ 0x3c,
+ 0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e,
+ 0x30,0x22,0x20,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3d,0x22,0x75,0x74,0x66,
+ 0x2d,0x38,0x22,0x3f,0x3e,0xd,0xa,0x3c,0x21,0x2d,0x2d,0x20,0x47,0x65,0x6e,0x65,
+ 0x72,0x61,0x74,0x6f,0x72,0x3a,0x20,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6c,0x6c,
+ 0x75,0x73,0x74,0x72,0x61,0x74,0x6f,0x72,0x20,0x32,0x30,0x2e,0x31,0x2e,0x30,0x2c,
+ 0x20,0x53,0x56,0x47,0x20,0x45,0x78,0x70,0x6f,0x72,0x74,0x20,0x50,0x6c,0x75,0x67,
+ 0x2d,0x49,0x6e,0x20,0x2e,0x20,0x53,0x56,0x47,0x20,0x56,0x65,0x72,0x73,0x69,0x6f,
+ 0x6e,0x3a,0x20,0x36,0x2e,0x30,0x30,0x20,0x42,0x75,0x69,0x6c,0x64,0x20,0x30,0x29,
+ 0x20,0x20,0x2d,0x2d,0x3e,0xd,0xa,0x3c,0x73,0x76,0x67,0x20,0x76,0x65,0x72,0x73,
+ 0x69,0x6f,0x6e,0x3d,0x22,0x31,0x2e,0x31,0x22,0x20,0x69,0x64,0x3d,0x22,0x4c,0x61,
+ 0x79,0x65,0x72,0x5f,0x31,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73,0x3d,0x22,0x68,0x74,
+ 0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,0x77,0x2e,0x77,0x33,0x2e,0x6f,0x72,0x67,0x2f,
+ 0x32,0x30,0x30,0x30,0x2f,0x73,0x76,0x67,0x22,0x20,0x78,0x6d,0x6c,0x6e,0x73,0x3a,
+ 0x78,0x6c,0x69,0x6e,0x6b,0x3d,0x22,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x77,0x77,
+ 0x77,0x2e,0x77,0x33,0x2e,0x6f,0x72,0x67,0x2f,0x31,0x39,0x39,0x39,0x2f,0x78,0x6c,
+ 0x69,0x6e,0x6b,0x22,0x20,0x78,0x3d,0x22,0x30,0x70,0x78,0x22,0x20,0x79,0x3d,0x22,
+ 0x30,0x70,0x78,0x22,0xd,0xa,0x9,0x20,0x76,0x69,0x65,0x77,0x42,0x6f,0x78,0x3d,
+ 0x22,0x30,0x20,0x30,0x20,0x32,0x33,0x2e,0x33,0x20,0x31,0x39,0x2e,0x34,0x22,0x20,
+ 0x73,0x74,0x79,0x6c,0x65,0x3d,0x22,0x65,0x6e,0x61,0x62,0x6c,0x65,0x2d,0x62,0x61,
+ 0x63,0x6b,0x67,0x72,0x6f,0x75,0x6e,0x64,0x3a,0x6e,0x65,0x77,0x20,0x30,0x20,0x30,
+ 0x20,0x32,0x33,0x2e,0x33,0x20,0x31,0x39,0x2e,0x34,0x3b,0x22,0x20,0x78,0x6d,0x6c,
+ 0x3a,0x73,0x70,0x61,0x63,0x65,0x3d,0x22,0x70,0x72,0x65,0x73,0x65,0x72,0x76,0x65,
+ 0x22,0x3e,0xd,0xa,0x3c,0x73,0x74,0x79,0x6c,0x65,0x20,0x74,0x79,0x70,0x65,0x3d,
+ 0x22,0x74,0x65,0x78,0x74,0x2f,0x63,0x73,0x73,0x22,0x3e,0xd,0xa,0x9,0x2e,0x73,
+ 0x74,0x30,0x7b,0x66,0x69,0x6c,0x6c,0x3a,0x6e,0x6f,0x6e,0x65,0x3b,0x7d,0xd,0xa,
+ 0x3c,0x2f,0x73,0x74,0x79,0x6c,0x65,0x3e,0xd,0xa,0x3c,0x67,0x3e,0xd,0xa,0x9,
+ 0x3c,0x70,0x61,0x74,0x68,0x20,0x63,0x6c,0x61,0x73,0x73,0x3d,0x22,0x73,0x74,0x30,
+ 0x22,0x20,0x64,0x3d,0x22,0x4d,0x36,0x2e,0x32,0x2c,0x34,0x2e,0x38,0x48,0x32,0x2e,
+ 0x34,0x63,0x2d,0x30,0x2e,0x32,0x2c,0x30,0x2d,0x30,0x2e,0x31,0x2d,0x30,0x2e,0x31,
+ 0x2d,0x30,0x2e,0x31,0x2c,0x30,0x2e,0x31,0x56,0x31,0x37,0x63,0x30,0x2c,0x30,0x2e,
+ 0x32,0x2d,0x30,0x2e,0x31,0x2c,0x30,0x2e,0x38,0x2c,0x30,0x2e,0x31,0x2c,0x30,0x2e,
+ 0x38,0x68,0x33,0x2e,0x39,0x56,0x34,0x2e,0x38,0x7a,0x22,0x2f,0x3e,0xd,0xa,0x9,
+ 0x3c,0x63,0x69,0x72,0x63,0x6c,0x65,0x20,0x63,0x6c,0x61,0x73,0x73,0x3d,0x22,0x73,
+ 0x74,0x30,0x22,0x20,0x63,0x78,0x3d,0x22,0x31,0x34,0x22,0x20,0x63,0x79,0x3d,0x22,
+ 0x31,0x31,0x22,0x20,0x72,0x3d,0x22,0x34,0x2e,0x35,0x22,0x2f,0x3e,0xd,0xa,0x9,
+ 0x3c,0x70,0x61,0x74,0x68,0x20,0x63,0x6c,0x61,0x73,0x73,0x3d,0x22,0x73,0x74,0x30,
+ 0x22,0x20,0x64,0x3d,0x22,0x4d,0x32,0x30,0x2e,0x39,0x2c,0x34,0x2e,0x38,0x68,0x2d,
+ 0x31,0x2e,0x38,0x63,0x2d,0x30,0x2e,0x33,0x2c,0x30,0x2d,0x30,0x2e,0x36,0x2d,0x30,
+ 0x2e,0x34,0x2d,0x30,0x2e,0x38,0x2d,0x30,0x2e,0x36,0x6c,0x2d,0x31,0x2e,0x37,0x2d,
+ 0x32,0x2e,0x34,0x68,0x2d,0x35,0x2e,0x33,0x4c,0x39,0x2e,0x37,0x2c,0x34,0x2e,0x32,
+ 0x43,0x39,0x2e,0x35,0x2c,0x34,0x2e,0x34,0x2c,0x39,0x2e,0x32,0x2c,0x34,0x2e,0x38,
+ 0x2c,0x38,0x2e,0x39,0x2c,0x34,0x2e,0x38,0x48,0x37,0x2e,0x32,0x76,0x31,0x33,0x68,
+ 0x31,0x33,0x2e,0x37,0xd,0xa,0x9,0x9,0x63,0x30,0x2e,0x32,0x2c,0x30,0x2c,0x30,
+ 0x2e,0x33,0x2d,0x30,0x2e,0x36,0x2c,0x30,0x2e,0x33,0x2d,0x30,0x2e,0x38,0x56,0x34,
+ 0x2e,0x39,0x43,0x32,0x31,0x2e,0x32,0x2c,0x34,0x2e,0x37,0x2c,0x32,0x31,0x2e,0x31,
+ 0x2c,0x34,0x2e,0x38,0x2c,0x32,0x30,0x2e,0x39,0x2c,0x34,0x2e,0x38,0x7a,0x20,0x4d,
+ 0x31,0x34,0x2c,0x31,0x36,0x2e,0x34,0x63,0x2d,0x33,0x2c,0x30,0x2d,0x35,0x2e,0x35,
+ 0x2d,0x32,0x2e,0x34,0x2d,0x35,0x2e,0x35,0x2d,0x35,0x2e,0x35,0x63,0x30,0x2d,0x33,
+ 0x2c,0x32,0x2e,0x34,0x2d,0x35,0x2e,0x35,0x2c,0x35,0x2e,0x35,0x2d,0x35,0x2e,0x35,
+ 0x63,0x33,0x2c,0x30,0x2c,0x35,0x2e,0x35,0x2c,0x32,0x2e,0x34,0x2c,0x35,0x2e,0x35,
+ 0x2c,0x35,0x2e,0x35,0xd,0xa,0x9,0x9,0x43,0x31,0x39,0x2e,0x35,0x2c,0x31,0x34,
+ 0x2c,0x31,0x37,0x2c,0x31,0x36,0x2e,0x34,0x2c,0x31,0x34,0x2c,0x31,0x36,0x2e,0x34,
+ 0x7a,0x22,0x2f,0x3e,0xd,0xa,0x9,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,
+ 0x4d,0x31,0x34,0x2c,0x35,0x2e,0x35,0x43,0x31,0x31,0x2c,0x35,0x2e,0x35,0x2c,0x38,
+ 0x2e,0x36,0x2c,0x38,0x2c,0x38,0x2e,0x36,0x2c,0x31,0x31,0x63,0x30,0x2c,0x33,0x2c,
+ 0x32,0x2e,0x34,0x2c,0x35,0x2e,0x35,0x2c,0x35,0x2e,0x35,0x2c,0x35,0x2e,0x35,0x63,
+ 0x33,0x2c,0x30,0x2c,0x35,0x2e,0x35,0x2d,0x32,0x2e,0x34,0x2c,0x35,0x2e,0x35,0x2d,
+ 0x35,0x2e,0x35,0x43,0x31,0x39,0x2e,0x35,0x2c,0x38,0x2c,0x31,0x37,0x2c,0x35,0x2e,
+ 0x35,0x2c,0x31,0x34,0x2c,0x35,0x2e,0x35,0x7a,0x20,0x4d,0x31,0x34,0x2c,0x31,0x35,
+ 0x2e,0x34,0xd,0xa,0x9,0x9,0x63,0x2d,0x32,0x2e,0x35,0x2c,0x30,0x2d,0x34,0x2e,
+ 0x35,0x2d,0x32,0x2d,0x34,0x2e,0x35,0x2d,0x34,0x2e,0x35,0x63,0x30,0x2d,0x32,0x2e,
+ 0x35,0x2c,0x32,0x2d,0x34,0x2e,0x35,0x2c,0x34,0x2e,0x35,0x2d,0x34,0x2e,0x35,0x63,
+ 0x32,0x2e,0x35,0x2c,0x30,0x2c,0x34,0x2e,0x35,0x2c,0x32,0x2c,0x34,0x2e,0x35,0x2c,
+ 0x34,0x2e,0x35,0x43,0x31,0x38,0x2e,0x35,0x2c,0x31,0x33,0x2e,0x34,0x2c,0x31,0x36,
+ 0x2e,0x35,0x2c,0x31,0x35,0x2e,0x34,0x2c,0x31,0x34,0x2c,0x31,0x35,0x2e,0x34,0x7a,
+ 0x22,0x2f,0x3e,0xd,0xa,0x9,0x3c,0x70,0x61,0x74,0x68,0x20,0x64,0x3d,0x22,0x4d,
+ 0x32,0x30,0x2e,0x39,0x2c,0x32,0x2e,0x38,0x68,0x2d,0x31,0x2e,0x33,0x6c,0x2d,0x31,
+ 0x2e,0x37,0x2d,0x32,0x2e,0x34,0x63,0x2d,0x30,0x2e,0x32,0x2d,0x30,0x2e,0x32,0x2d,
+ 0x30,0x2e,0x35,0x2d,0x30,0x2e,0x36,0x2d,0x30,0x2e,0x38,0x2d,0x30,0x2e,0x36,0x68,
+ 0x2d,0x36,0x2e,0x33,0x63,0x2d,0x30,0x2e,0x33,0x2c,0x30,0x2d,0x30,0x2e,0x36,0x2c,
+ 0x30,0x2e,0x34,0x2d,0x30,0x2e,0x38,0x2c,0x30,0x2e,0x36,0x4c,0x38,0x2e,0x34,0x2c,
+ 0x32,0x2e,0x38,0x68,0x2d,0x36,0x63,0x2d,0x31,0x2e,0x33,0x2c,0x30,0x2d,0x32,0x2e,
+ 0x31,0x2c,0x30,0x2e,0x38,0x2d,0x32,0x2e,0x31,0x2c,0x32,0x2e,0x31,0x56,0x31,0x37,
+ 0xd,0xa,0x9,0x9,0x63,0x30,0x2c,0x31,0x2e,0x33,0x2c,0x30,0x2e,0x38,0x2c,0x32,
+ 0x2e,0x38,0x2c,0x32,0x2e,0x31,0x2c,0x32,0x2e,0x38,0x68,0x31,0x38,0x2e,0x35,0x63,
+ 0x31,0x2e,0x33,0x2c,0x30,0x2c,0x32,0x2e,0x33,0x2d,0x31,0x2e,0x35,0x2c,0x32,0x2e,
+ 0x33,0x2d,0x32,0x2e,0x38,0x56,0x34,0x2e,0x39,0x43,0x32,0x33,0x2e,0x32,0x2c,0x33,
+ 0x2e,0x36,0x2c,0x32,0x32,0x2e,0x32,0x2c,0x32,0x2e,0x38,0x2c,0x32,0x30,0x2e,0x39,
+ 0x2c,0x32,0x2e,0x38,0x7a,0x20,0x4d,0x32,0x2e,0x32,0x2c,0x31,0x37,0x56,0x34,0x2e,
+ 0x39,0x63,0x30,0x2d,0x30,0x2e,0x32,0x2d,0x30,0x2e,0x31,0x2d,0x30,0x2e,0x31,0x2c,
+ 0x30,0x2e,0x31,0x2d,0x30,0x2e,0x31,0x68,0x33,0x2e,0x39,0x76,0x31,0x33,0x48,0x32,
+ 0x2e,0x34,0xd,0xa,0x9,0x9,0x43,0x32,0x2e,0x32,0x2c,0x31,0x37,0x2e,0x38,0x2c,
+ 0x32,0x2e,0x32,0x2c,0x31,0x37,0x2e,0x32,0x2c,0x32,0x2e,0x32,0x2c,0x31,0x37,0x7a,
+ 0x20,0x4d,0x32,0x31,0x2e,0x32,0x2c,0x31,0x37,0x63,0x30,0x2c,0x30,0x2e,0x32,0x2d,
+ 0x30,0x2e,0x31,0x2c,0x30,0x2e,0x38,0x2d,0x30,0x2e,0x33,0x2c,0x30,0x2e,0x38,0x48,
+ 0x37,0x2e,0x32,0x76,0x2d,0x31,0x33,0x68,0x31,0x2e,0x37,0x63,0x30,0x2e,0x33,0x2c,
+ 0x30,0x2c,0x30,0x2e,0x36,0x2d,0x30,0x2e,0x34,0x2c,0x30,0x2e,0x38,0x2d,0x30,0x2e,
+ 0x36,0x6c,0x31,0x2e,0x37,0x2d,0x32,0x2e,0x34,0x68,0x35,0x2e,0x33,0x6c,0x31,0x2e,
+ 0x37,0x2c,0x32,0x2e,0x34,0xd,0xa,0x9,0x9,0x63,0x30,0x2e,0x32,0x2c,0x30,0x2e,
+ 0x32,0x2c,0x30,0x2e,0x35,0x2c,0x30,0x2e,0x36,0x2c,0x30,0x2e,0x38,0x2c,0x30,0x2e,
+ 0x36,0x68,0x31,0x2e,0x38,0x63,0x30,0x2e,0x32,0x2c,0x30,0x2c,0x30,0x2e,0x33,0x2d,
+ 0x30,0x2e,0x31,0x2c,0x30,0x2e,0x33,0x2c,0x30,0x2e,0x31,0x56,0x31,0x37,0x7a,0x22,
+ 0x2f,0x3e,0xd,0xa,0x3c,0x2f,0x67,0x3e,0xd,0xa,0x3c,0x2f,0x73,0x76,0x67,0x3e,
+ 0xd,0xa,
+
+};
+
+static const unsigned char qt_resource_name[] = {
+ // images
+ 0x0,0x6,
+ 0x7,0x3,0x7d,0xc3,
+ 0x0,0x69,
+ 0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73,
+ // shutter.svg
+ 0x0,0xb,
+ 0xa,0x36,0xa3,0xa7,
+ 0x0,0x73,
+ 0x0,0x68,0x0,0x75,0x0,0x74,0x0,0x74,0x0,0x65,0x0,0x72,0x0,0x2e,0x0,0x73,0x0,0x76,0x0,0x67,
+
+};
+
+static const unsigned char qt_resource_struct[] = {
+ // :
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ // :/images
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ // :/images/shutter.svg
+ 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+0x0,0x0,0x1,0x75,0x69,0x14,0x2f,0xa0,
+
+};
+
+#ifdef QT_NAMESPACE
+# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
+# define QT_RCC_MANGLE_NAMESPACE0(x) x
+# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
+# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
+# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
+ QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
+#else
+# define QT_RCC_PREPEND_NAMESPACE(name) name
+# define QT_RCC_MANGLE_NAMESPACE(name) name
+#endif
+
+#ifdef QT_NAMESPACE
+namespace QT_NAMESPACE {
+#endif
+
+bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+#ifdef QT_NAMESPACE
+}
+#endif
+
+int QT_RCC_MANGLE_NAMESPACE(qInitResources_camera)();
+int QT_RCC_MANGLE_NAMESPACE(qInitResources_camera)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_camera)();
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_camera)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+namespace {
+ struct initializer {
+ initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_camera)(); }
+ ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_camera)(); }
+ } dummy;
+}
diff --git a/Project4/camera/ui_camera.h b/Project4/camera/ui_camera.h
new file mode 100644
index 00000000..5a85dffc
--- /dev/null
+++ b/Project4/camera/ui_camera.h
@@ -0,0 +1,289 @@
+/********************************************************************************
+** Form generated from reading UI file 'camera.ui'
+**
+** Created by: Qt User Interface Compiler version 5.15.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_CAMERA_H
+#define UI_CAMERA_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "qcameraviewfinder.h"
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Camera
+{
+public:
+ QAction *actionExit;
+ QAction *actionStartCamera;
+ QAction *actionStopCamera;
+ QAction *actionSettings;
+ QWidget *centralwidget;
+ QGridLayout *gridLayout_3;
+ QStackedWidget *stackedWidget;
+ QWidget *viewfinderPage;
+ QGridLayout *gridLayout_5;
+ QCameraViewfinder *viewfinder;
+ QWidget *previewPage;
+ QGridLayout *gridLayout_4;
+ QLabel *lastImagePreviewLabel;
+ QTabWidget *captureWidget;
+ QWidget *tab_2;
+ QGridLayout *gridLayout;
+ QSpacerItem *verticalSpacer_2;
+ QLabel *label;
+ QPushButton *takeImageButton;
+ QSlider *exposureCompensation;
+ QWidget *tab;
+ QGridLayout *gridLayout_2;
+ QPushButton *muteButton;
+ QPushButton *recordButton;
+ QPushButton *stopButton;
+ QSpacerItem *verticalSpacer;
+ QPushButton *pauseButton;
+ QTextBrowser *sonicdata;
+ QPushButton *lockButton;
+ QMenuBar *menubar;
+ QMenu *menuFile;
+ QMenu *menuDevices;
+ QStatusBar *statusbar;
+
+ void setupUi(QMainWindow *Camera)
+ {
+ if (Camera->objectName().isEmpty())
+ Camera->setObjectName(QString::fromUtf8("Camera"));
+ Camera->resize(668, 621);
+ actionExit = new QAction(Camera);
+ actionExit->setObjectName(QString::fromUtf8("actionExit"));
+ actionStartCamera = new QAction(Camera);
+ actionStartCamera->setObjectName(QString::fromUtf8("actionStartCamera"));
+ actionStopCamera = new QAction(Camera);
+ actionStopCamera->setObjectName(QString::fromUtf8("actionStopCamera"));
+ actionSettings = new QAction(Camera);
+ actionSettings->setObjectName(QString::fromUtf8("actionSettings"));
+ centralwidget = new QWidget(Camera);
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
+ gridLayout_3 = new QGridLayout(centralwidget);
+ gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
+ stackedWidget = new QStackedWidget(centralwidget);
+ stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
+ QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+ sizePolicy.setHorizontalStretch(1);
+ sizePolicy.setVerticalStretch(0);
+ sizePolicy.setHeightForWidth(stackedWidget->sizePolicy().hasHeightForWidth());
+ stackedWidget->setSizePolicy(sizePolicy);
+ QPalette palette;
+ QBrush brush(QColor(255, 255, 255, 255));
+ brush.setStyle(Qt::SolidPattern);
+ palette.setBrush(QPalette::Active, QPalette::Base, brush);
+ QBrush brush1(QColor(145, 145, 145, 255));
+ brush1.setStyle(Qt::SolidPattern);
+ palette.setBrush(QPalette::Active, QPalette::Window, brush1);
+ palette.setBrush(QPalette::Inactive, QPalette::Base, brush);
+ palette.setBrush(QPalette::Inactive, QPalette::Window, brush1);
+ palette.setBrush(QPalette::Disabled, QPalette::Base, brush1);
+ palette.setBrush(QPalette::Disabled, QPalette::Window, brush1);
+ stackedWidget->setPalette(palette);
+ viewfinderPage = new QWidget();
+ viewfinderPage->setObjectName(QString::fromUtf8("viewfinderPage"));
+ gridLayout_5 = new QGridLayout(viewfinderPage);
+ gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5"));
+ viewfinder = new QCameraViewfinder(viewfinderPage);
+ viewfinder->setObjectName(QString::fromUtf8("viewfinder"));
+
+ gridLayout_5->addWidget(viewfinder, 0, 0, 1, 1);
+
+ stackedWidget->addWidget(viewfinderPage);
+ previewPage = new QWidget();
+ previewPage->setObjectName(QString::fromUtf8("previewPage"));
+ gridLayout_4 = new QGridLayout(previewPage);
+ gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
+ lastImagePreviewLabel = new QLabel(previewPage);
+ lastImagePreviewLabel->setObjectName(QString::fromUtf8("lastImagePreviewLabel"));
+ QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
+ sizePolicy1.setHorizontalStretch(0);
+ sizePolicy1.setVerticalStretch(0);
+ sizePolicy1.setHeightForWidth(lastImagePreviewLabel->sizePolicy().hasHeightForWidth());
+ lastImagePreviewLabel->setSizePolicy(sizePolicy1);
+ lastImagePreviewLabel->setFrameShape(QFrame::Box);
+
+ gridLayout_4->addWidget(lastImagePreviewLabel, 0, 0, 1, 1);
+
+ stackedWidget->addWidget(previewPage);
+
+ gridLayout_3->addWidget(stackedWidget, 0, 0, 3, 1);
+
+ captureWidget = new QTabWidget(centralwidget);
+ captureWidget->setObjectName(QString::fromUtf8("captureWidget"));
+ captureWidget->setMaximumSize(QSize(0, 0));
+ captureWidget->setIconSize(QSize(0, 0));
+ tab_2 = new QWidget();
+ tab_2->setObjectName(QString::fromUtf8("tab_2"));
+ gridLayout = new QGridLayout(tab_2);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ verticalSpacer_2 = new QSpacerItem(20, 161, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ gridLayout->addItem(verticalSpacer_2, 1, 0, 1, 1);
+
+ label = new QLabel(tab_2);
+ label->setObjectName(QString::fromUtf8("label"));
+
+ gridLayout->addWidget(label, 2, 0, 1, 1);
+
+ takeImageButton = new QPushButton(tab_2);
+ takeImageButton->setObjectName(QString::fromUtf8("takeImageButton"));
+ takeImageButton->setEnabled(false);
+ QIcon icon;
+ icon.addFile(QString::fromUtf8(":/images/shutter.svg"), QSize(), QIcon::Normal, QIcon::Off);
+ takeImageButton->setIcon(icon);
+
+ gridLayout->addWidget(takeImageButton, 0, 0, 1, 1);
+
+ exposureCompensation = new QSlider(tab_2);
+ exposureCompensation->setObjectName(QString::fromUtf8("exposureCompensation"));
+ exposureCompensation->setMinimum(-4);
+ exposureCompensation->setMaximum(4);
+ exposureCompensation->setPageStep(2);
+ exposureCompensation->setOrientation(Qt::Horizontal);
+ exposureCompensation->setTickPosition(QSlider::TicksAbove);
+
+ gridLayout->addWidget(exposureCompensation, 3, 0, 1, 1);
+
+ captureWidget->addTab(tab_2, QString());
+ tab = new QWidget();
+ tab->setObjectName(QString::fromUtf8("tab"));
+ gridLayout_2 = new QGridLayout(tab);
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
+ muteButton = new QPushButton(tab);
+ muteButton->setObjectName(QString::fromUtf8("muteButton"));
+ muteButton->setCheckable(true);
+
+ gridLayout_2->addWidget(muteButton, 4, 0, 1, 1);
+
+ recordButton = new QPushButton(tab);
+ recordButton->setObjectName(QString::fromUtf8("recordButton"));
+
+ gridLayout_2->addWidget(recordButton, 0, 0, 1, 1);
+
+ stopButton = new QPushButton(tab);
+ stopButton->setObjectName(QString::fromUtf8("stopButton"));
+
+ gridLayout_2->addWidget(stopButton, 2, 0, 1, 1);
+
+ verticalSpacer = new QSpacerItem(20, 76, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ gridLayout_2->addItem(verticalSpacer, 3, 0, 1, 1);
+
+ pauseButton = new QPushButton(tab);
+ pauseButton->setObjectName(QString::fromUtf8("pauseButton"));
+
+ gridLayout_2->addWidget(pauseButton, 1, 0, 1, 1);
+
+ captureWidget->addTab(tab, QString());
+
+ gridLayout_3->addWidget(captureWidget, 2, 1, 1, 2);
+
+ sonicdata = new QTextBrowser(centralwidget);
+ sonicdata->setObjectName(QString::fromUtf8("sonicdata"));
+ sonicdata->setMaximumSize(QSize(16777215, 50));
+
+ gridLayout_3->addWidget(sonicdata, 3, 0, 1, 1);
+
+ lockButton = new QPushButton(centralwidget);
+ lockButton->setObjectName(QString::fromUtf8("lockButton"));
+ lockButton->setMaximumSize(QSize(0, 0));
+ lockButton->setIconSize(QSize(0, 0));
+
+ gridLayout_3->addWidget(lockButton, 1, 1, 1, 2);
+
+ Camera->setCentralWidget(centralwidget);
+ menubar = new QMenuBar(Camera);
+ menubar->setObjectName(QString::fromUtf8("menubar"));
+ menubar->setGeometry(QRect(0, 0, 668, 22));
+ menuFile = new QMenu(menubar);
+ menuFile->setObjectName(QString::fromUtf8("menuFile"));
+ menuDevices = new QMenu(menubar);
+ menuDevices->setObjectName(QString::fromUtf8("menuDevices"));
+ Camera->setMenuBar(menubar);
+ statusbar = new QStatusBar(Camera);
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
+ Camera->setStatusBar(statusbar);
+
+ menubar->addAction(menuFile->menuAction());
+ menubar->addAction(menuDevices->menuAction());
+ menuFile->addAction(actionStartCamera);
+ menuFile->addAction(actionStopCamera);
+ menuFile->addSeparator();
+ menuFile->addAction(actionSettings);
+ menuFile->addSeparator();
+ menuFile->addAction(actionExit);
+
+ retranslateUi(Camera);
+ QObject::connect(actionExit, SIGNAL(triggered()), Camera, SLOT(close()));
+ QObject::connect(actionSettings, SIGNAL(triggered()), Camera, SLOT(configureCaptureSettings()));
+ QObject::connect(actionStartCamera, SIGNAL(triggered()), Camera, SLOT(startCamera()));
+ QObject::connect(actionStopCamera, SIGNAL(triggered()), Camera, SLOT(stopCamera()));
+ QObject::connect(takeImageButton, SIGNAL(clicked()), Camera, SLOT(takeImage()));
+ QObject::connect(exposureCompensation, SIGNAL(valueChanged(int)), Camera, SLOT(setExposureCompensation(int)));
+ QObject::connect(stopButton, SIGNAL(clicked()), Camera, SLOT(stop()));
+ QObject::connect(muteButton, SIGNAL(toggled(bool)), Camera, SLOT(setMuted(bool)));
+ QObject::connect(recordButton, SIGNAL(clicked()), Camera, SLOT(record()));
+ QObject::connect(pauseButton, SIGNAL(clicked()), Camera, SLOT(pause()));
+ QObject::connect(lockButton, SIGNAL(clicked()), Camera, SLOT(toggleLock()));
+
+ stackedWidget->setCurrentIndex(0);
+ captureWidget->setCurrentIndex(1);
+
+
+ QMetaObject::connectSlotsByName(Camera);
+ } // setupUi
+
+ void retranslateUi(QMainWindow *Camera)
+ {
+ Camera->setWindowTitle(QCoreApplication::translate("Camera", "Camera", nullptr));
+ actionExit->setText(QCoreApplication::translate("Camera", "Exit", nullptr));
+ actionStartCamera->setText(QCoreApplication::translate("Camera", "Start Camera", nullptr));
+ actionStopCamera->setText(QCoreApplication::translate("Camera", "Stop Camera", nullptr));
+ actionSettings->setText(QCoreApplication::translate("Camera", "Settings", nullptr));
+ lastImagePreviewLabel->setText(QString());
+ label->setText(QCoreApplication::translate("Camera", "Exposure Compensation:", nullptr));
+ takeImageButton->setText(QCoreApplication::translate("Camera", "Capture Photo", nullptr));
+ captureWidget->setTabText(captureWidget->indexOf(tab_2), QCoreApplication::translate("Camera", "Image", nullptr));
+ muteButton->setText(QCoreApplication::translate("Camera", "Mute", nullptr));
+ recordButton->setText(QCoreApplication::translate("Camera", "Record", nullptr));
+ stopButton->setText(QCoreApplication::translate("Camera", "Stop", nullptr));
+ pauseButton->setText(QCoreApplication::translate("Camera", "Pause", nullptr));
+ captureWidget->setTabText(captureWidget->indexOf(tab), QCoreApplication::translate("Camera", "Video", nullptr));
+ lockButton->setText(QCoreApplication::translate("Camera", "Focus", nullptr));
+ menuFile->setTitle(QCoreApplication::translate("Camera", "File", nullptr));
+ menuDevices->setTitle(QCoreApplication::translate("Camera", "Devices", nullptr));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Camera: public Ui_Camera {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_CAMERA_H
diff --git a/Project4/camera/ui_imagesettings.h b/Project4/camera/ui_imagesettings.h
new file mode 100644
index 00000000..e9c467aa
--- /dev/null
+++ b/Project4/camera/ui_imagesettings.h
@@ -0,0 +1,122 @@
+/********************************************************************************
+** Form generated from reading UI file 'imagesettings.ui'
+**
+** Created by: Qt User Interface Compiler version 5.15.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_IMAGESETTINGS_H
+#define UI_IMAGESETTINGS_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+
+class Ui_ImageSettingsUi
+{
+public:
+ QGridLayout *gridLayout;
+ QGroupBox *groupBox_2;
+ QGridLayout *gridLayout_2;
+ QLabel *label_8;
+ QComboBox *imageResolutionBox;
+ QLabel *label_6;
+ QComboBox *imageCodecBox;
+ QLabel *label_7;
+ QSlider *imageQualitySlider;
+ QSpacerItem *verticalSpacer;
+ QDialogButtonBox *buttonBox;
+
+ void setupUi(QDialog *ImageSettingsUi)
+ {
+ if (ImageSettingsUi->objectName().isEmpty())
+ ImageSettingsUi->setObjectName(QString::fromUtf8("ImageSettingsUi"));
+ ImageSettingsUi->resize(332, 270);
+ gridLayout = new QGridLayout(ImageSettingsUi);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ groupBox_2 = new QGroupBox(ImageSettingsUi);
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
+ gridLayout_2 = new QGridLayout(groupBox_2);
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
+ label_8 = new QLabel(groupBox_2);
+ label_8->setObjectName(QString::fromUtf8("label_8"));
+
+ gridLayout_2->addWidget(label_8, 0, 0, 1, 2);
+
+ imageResolutionBox = new QComboBox(groupBox_2);
+ imageResolutionBox->setObjectName(QString::fromUtf8("imageResolutionBox"));
+
+ gridLayout_2->addWidget(imageResolutionBox, 1, 0, 1, 2);
+
+ label_6 = new QLabel(groupBox_2);
+ label_6->setObjectName(QString::fromUtf8("label_6"));
+
+ gridLayout_2->addWidget(label_6, 2, 0, 1, 2);
+
+ imageCodecBox = new QComboBox(groupBox_2);
+ imageCodecBox->setObjectName(QString::fromUtf8("imageCodecBox"));
+
+ gridLayout_2->addWidget(imageCodecBox, 3, 0, 1, 2);
+
+ label_7 = new QLabel(groupBox_2);
+ label_7->setObjectName(QString::fromUtf8("label_7"));
+
+ gridLayout_2->addWidget(label_7, 4, 0, 1, 1);
+
+ imageQualitySlider = new QSlider(groupBox_2);
+ imageQualitySlider->setObjectName(QString::fromUtf8("imageQualitySlider"));
+ imageQualitySlider->setMaximum(4);
+ imageQualitySlider->setOrientation(Qt::Horizontal);
+
+ gridLayout_2->addWidget(imageQualitySlider, 4, 1, 1, 1);
+
+
+ gridLayout->addWidget(groupBox_2, 0, 0, 1, 1);
+
+ verticalSpacer = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ gridLayout->addItem(verticalSpacer, 1, 0, 1, 1);
+
+ buttonBox = new QDialogButtonBox(ImageSettingsUi);
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
+ buttonBox->setOrientation(Qt::Horizontal);
+ buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
+
+ gridLayout->addWidget(buttonBox, 2, 0, 1, 1);
+
+
+ retranslateUi(ImageSettingsUi);
+ QObject::connect(buttonBox, SIGNAL(accepted()), ImageSettingsUi, SLOT(accept()));
+ QObject::connect(buttonBox, SIGNAL(rejected()), ImageSettingsUi, SLOT(reject()));
+
+ QMetaObject::connectSlotsByName(ImageSettingsUi);
+ } // setupUi
+
+ void retranslateUi(QDialog *ImageSettingsUi)
+ {
+ ImageSettingsUi->setWindowTitle(QCoreApplication::translate("ImageSettingsUi", "Image Settings", nullptr));
+ groupBox_2->setTitle(QCoreApplication::translate("ImageSettingsUi", "Image", nullptr));
+ label_8->setText(QCoreApplication::translate("ImageSettingsUi", "Resolution:", nullptr));
+ label_6->setText(QCoreApplication::translate("ImageSettingsUi", "Image Format:", nullptr));
+ label_7->setText(QCoreApplication::translate("ImageSettingsUi", "Quality:", nullptr));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class ImageSettingsUi: public Ui_ImageSettingsUi {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_IMAGESETTINGS_H
diff --git a/Project4/camera/ui_videosettings.h b/Project4/camera/ui_videosettings.h
new file mode 100644
index 00000000..61888181
--- /dev/null
+++ b/Project4/camera/ui_videosettings.h
@@ -0,0 +1,217 @@
+/********************************************************************************
+** Form generated from reading UI file 'videosettings.ui'
+**
+** Created by: Qt User Interface Compiler version 5.15.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_VIDEOSETTINGS_H
+#define UI_VIDEOSETTINGS_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+
+class Ui_VideoSettingsUi
+{
+public:
+ QGridLayout *gridLayout_4;
+ QScrollArea *scrollArea;
+ QWidget *scrollAreaWidgetContents;
+ QGridLayout *gridLayout_3;
+ QGroupBox *groupBox;
+ QGridLayout *gridLayout;
+ QLabel *label_2;
+ QComboBox *audioCodecBox;
+ QLabel *label_5;
+ QComboBox *audioSampleRateBox;
+ QLabel *label_3;
+ QSlider *audioQualitySlider;
+ QGroupBox *groupBox_2;
+ QGridLayout *gridLayout_2;
+ QLabel *label_8;
+ QComboBox *videoResolutionBox;
+ QLabel *label_9;
+ QComboBox *videoFramerateBox;
+ QLabel *label_6;
+ QComboBox *videoCodecBox;
+ QLabel *label_7;
+ QSlider *videoQualitySlider;
+ QLabel *label_4;
+ QComboBox *containerFormatBox;
+ QSpacerItem *verticalSpacer;
+ QDialogButtonBox *buttonBox;
+
+ void setupUi(QDialog *VideoSettingsUi)
+ {
+ if (VideoSettingsUi->objectName().isEmpty())
+ VideoSettingsUi->setObjectName(QString::fromUtf8("VideoSettingsUi"));
+ VideoSettingsUi->resize(561, 369);
+ gridLayout_4 = new QGridLayout(VideoSettingsUi);
+ gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
+ scrollArea = new QScrollArea(VideoSettingsUi);
+ scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
+ scrollArea->setFrameShape(QFrame::NoFrame);
+ scrollArea->setWidgetResizable(true);
+ scrollAreaWidgetContents = new QWidget();
+ scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
+ scrollAreaWidgetContents->setGeometry(QRect(0, 0, 543, 250));
+ gridLayout_3 = new QGridLayout(scrollAreaWidgetContents);
+ gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
+ groupBox = new QGroupBox(scrollAreaWidgetContents);
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
+ gridLayout = new QGridLayout(groupBox);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ label_2 = new QLabel(groupBox);
+ label_2->setObjectName(QString::fromUtf8("label_2"));
+
+ gridLayout->addWidget(label_2, 0, 0, 1, 2);
+
+ audioCodecBox = new QComboBox(groupBox);
+ audioCodecBox->setObjectName(QString::fromUtf8("audioCodecBox"));
+
+ gridLayout->addWidget(audioCodecBox, 1, 0, 1, 2);
+
+ label_5 = new QLabel(groupBox);
+ label_5->setObjectName(QString::fromUtf8("label_5"));
+
+ gridLayout->addWidget(label_5, 2, 0, 1, 2);
+
+ audioSampleRateBox = new QComboBox(groupBox);
+ audioSampleRateBox->setObjectName(QString::fromUtf8("audioSampleRateBox"));
+
+ gridLayout->addWidget(audioSampleRateBox, 3, 0, 1, 2);
+
+ label_3 = new QLabel(groupBox);
+ label_3->setObjectName(QString::fromUtf8("label_3"));
+
+ gridLayout->addWidget(label_3, 4, 0, 1, 1);
+
+ audioQualitySlider = new QSlider(groupBox);
+ audioQualitySlider->setObjectName(QString::fromUtf8("audioQualitySlider"));
+ audioQualitySlider->setMaximum(4);
+ audioQualitySlider->setOrientation(Qt::Horizontal);
+
+ gridLayout->addWidget(audioQualitySlider, 4, 1, 1, 1);
+
+
+ gridLayout_3->addWidget(groupBox, 0, 0, 1, 1);
+
+ groupBox_2 = new QGroupBox(scrollAreaWidgetContents);
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
+ gridLayout_2 = new QGridLayout(groupBox_2);
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
+ label_8 = new QLabel(groupBox_2);
+ label_8->setObjectName(QString::fromUtf8("label_8"));
+
+ gridLayout_2->addWidget(label_8, 0, 0, 1, 2);
+
+ videoResolutionBox = new QComboBox(groupBox_2);
+ videoResolutionBox->setObjectName(QString::fromUtf8("videoResolutionBox"));
+
+ gridLayout_2->addWidget(videoResolutionBox, 1, 0, 1, 2);
+
+ label_9 = new QLabel(groupBox_2);
+ label_9->setObjectName(QString::fromUtf8("label_9"));
+
+ gridLayout_2->addWidget(label_9, 2, 0, 1, 2);
+
+ videoFramerateBox = new QComboBox(groupBox_2);
+ videoFramerateBox->setObjectName(QString::fromUtf8("videoFramerateBox"));
+
+ gridLayout_2->addWidget(videoFramerateBox, 3, 0, 1, 2);
+
+ label_6 = new QLabel(groupBox_2);
+ label_6->setObjectName(QString::fromUtf8("label_6"));
+
+ gridLayout_2->addWidget(label_6, 4, 0, 1, 2);
+
+ videoCodecBox = new QComboBox(groupBox_2);
+ videoCodecBox->setObjectName(QString::fromUtf8("videoCodecBox"));
+
+ gridLayout_2->addWidget(videoCodecBox, 5, 0, 1, 2);
+
+ label_7 = new QLabel(groupBox_2);
+ label_7->setObjectName(QString::fromUtf8("label_7"));
+
+ gridLayout_2->addWidget(label_7, 6, 0, 1, 1);
+
+ videoQualitySlider = new QSlider(groupBox_2);
+ videoQualitySlider->setObjectName(QString::fromUtf8("videoQualitySlider"));
+ videoQualitySlider->setMaximum(4);
+ videoQualitySlider->setOrientation(Qt::Horizontal);
+
+ gridLayout_2->addWidget(videoQualitySlider, 6, 1, 1, 1);
+
+
+ gridLayout_3->addWidget(groupBox_2, 0, 1, 3, 1);
+
+ label_4 = new QLabel(scrollAreaWidgetContents);
+ label_4->setObjectName(QString::fromUtf8("label_4"));
+
+ gridLayout_3->addWidget(label_4, 1, 0, 1, 1);
+
+ containerFormatBox = new QComboBox(scrollAreaWidgetContents);
+ containerFormatBox->setObjectName(QString::fromUtf8("containerFormatBox"));
+
+ gridLayout_3->addWidget(containerFormatBox, 2, 0, 1, 1);
+
+ scrollArea->setWidget(scrollAreaWidgetContents);
+
+ gridLayout_4->addWidget(scrollArea, 0, 0, 1, 1);
+
+ verticalSpacer = new QSpacerItem(20, 14, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+ gridLayout_4->addItem(verticalSpacer, 1, 0, 1, 1);
+
+ buttonBox = new QDialogButtonBox(VideoSettingsUi);
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
+ buttonBox->setOrientation(Qt::Horizontal);
+ buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
+
+ gridLayout_4->addWidget(buttonBox, 2, 0, 1, 1);
+
+
+ retranslateUi(VideoSettingsUi);
+ QObject::connect(buttonBox, SIGNAL(accepted()), VideoSettingsUi, SLOT(accept()));
+ QObject::connect(buttonBox, SIGNAL(rejected()), VideoSettingsUi, SLOT(reject()));
+
+ QMetaObject::connectSlotsByName(VideoSettingsUi);
+ } // setupUi
+
+ void retranslateUi(QDialog *VideoSettingsUi)
+ {
+ VideoSettingsUi->setWindowTitle(QCoreApplication::translate("VideoSettingsUi", "Video Settings", nullptr));
+ groupBox->setTitle(QCoreApplication::translate("VideoSettingsUi", "Audio", nullptr));
+ label_2->setText(QCoreApplication::translate("VideoSettingsUi", "Audio Codec:", nullptr));
+ label_5->setText(QCoreApplication::translate("VideoSettingsUi", "Sample Rate:", nullptr));
+ label_3->setText(QCoreApplication::translate("VideoSettingsUi", "Quality:", nullptr));
+ groupBox_2->setTitle(QCoreApplication::translate("VideoSettingsUi", "Video", nullptr));
+ label_8->setText(QCoreApplication::translate("VideoSettingsUi", "Resolution:", nullptr));
+ label_9->setText(QCoreApplication::translate("VideoSettingsUi", "Framerate:", nullptr));
+ label_6->setText(QCoreApplication::translate("VideoSettingsUi", "Video Codec:", nullptr));
+ label_7->setText(QCoreApplication::translate("VideoSettingsUi", "Quality:", nullptr));
+ label_4->setText(QCoreApplication::translate("VideoSettingsUi", "Container Format:", nullptr));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class VideoSettingsUi: public Ui_VideoSettingsUi {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_VIDEOSETTINGS_H
diff --git a/Project4/camera/videosettings.cpp b/Project4/camera/videosettings.cpp
new file mode 100644
index 00000000..284e427f
--- /dev/null
+++ b/Project4/camera/videosettings.cpp
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "videosettings.h"
+#include "ui_videosettings.h"
+
+#include
+#include
+#include
+#include
+
+
+VideoSettings::VideoSettings(QMediaRecorder *mediaRecorder, QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::VideoSettingsUi),
+ mediaRecorder(mediaRecorder)
+{
+ ui->setupUi(this);
+
+ //audio codecs
+ ui->audioCodecBox->addItem(tr("Default audio codec"), QVariant(QString()));
+ const QStringList supportedAudioCodecs = mediaRecorder->supportedAudioCodecs();
+ for (const QString &codecName : supportedAudioCodecs) {
+ QString description = mediaRecorder->audioCodecDescription(codecName);
+ ui->audioCodecBox->addItem(codecName + ": " + description, QVariant(codecName));
+ }
+
+ //sample rate:
+ const QListsupportedAudioSampleRates = mediaRecorder->supportedAudioSampleRates();
+ for (int sampleRate : supportedAudioSampleRates)
+ ui->audioSampleRateBox->addItem(QString::number(sampleRate), QVariant(sampleRate));
+
+ ui->audioQualitySlider->setRange(0, int(QMultimedia::VeryHighQuality));
+
+ //video codecs
+ ui->videoCodecBox->addItem(tr("Default video codec"), QVariant(QString()));
+ const QStringList supportedVideoCodecs = mediaRecorder->supportedVideoCodecs();
+ for (const QString &codecName : supportedVideoCodecs) {
+ QString description = mediaRecorder->videoCodecDescription(codecName);
+ ui->videoCodecBox->addItem(codecName + ": " + description, QVariant(codecName));
+ }
+
+ ui->videoQualitySlider->setRange(0, int(QMultimedia::VeryHighQuality));
+
+
+ ui->videoResolutionBox->addItem(tr("Default"));
+ const QList supportedResolutions = mediaRecorder->supportedResolutions();
+ for (const QSize &resolution : supportedResolutions) {
+ ui->videoResolutionBox->addItem(QString("%1x%2").arg(resolution.width()).arg(resolution.height()),
+ QVariant(resolution));
+ }
+
+ ui->videoFramerateBox->addItem(tr("Default"));
+ const QList supportedFrameRates = mediaRecorder->supportedFrameRates();
+ for (qreal rate : supportedFrameRates) {
+ QString rateString = QString("%1").arg(rate, 0, 'f', 2);
+ ui->videoFramerateBox->addItem(rateString, QVariant(rate));
+ }
+
+ //containers
+ ui->containerFormatBox->addItem(tr("Default container"), QVariant(QString()));
+ const QStringList formats = mediaRecorder->supportedContainers();
+ for (const QString &format : formats) {
+ ui->containerFormatBox->addItem(format + ": " + mediaRecorder->containerDescription(format),
+ QVariant(format));
+ }
+}
+
+VideoSettings::~VideoSettings()
+{
+ delete ui;
+}
+
+void VideoSettings::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+QAudioEncoderSettings VideoSettings::audioSettings() const
+{
+ QAudioEncoderSettings settings = mediaRecorder->audioSettings();
+ settings.setCodec(boxValue(ui->audioCodecBox).toString());
+ settings.setQuality(QMultimedia::EncodingQuality(ui->audioQualitySlider->value()));
+ settings.setSampleRate(boxValue(ui->audioSampleRateBox).toInt());
+ return settings;
+}
+
+void VideoSettings::setAudioSettings(const QAudioEncoderSettings &audioSettings)
+{
+ selectComboBoxItem(ui->audioCodecBox, QVariant(audioSettings.codec()));
+ selectComboBoxItem(ui->audioSampleRateBox, QVariant(audioSettings.sampleRate()));
+ ui->audioQualitySlider->setValue(audioSettings.quality());
+}
+
+QVideoEncoderSettings VideoSettings::videoSettings() const
+{
+ QVideoEncoderSettings settings = mediaRecorder->videoSettings();
+ settings.setCodec(boxValue(ui->videoCodecBox).toString());
+ settings.setQuality(QMultimedia::EncodingQuality(ui->videoQualitySlider->value()));
+ settings.setResolution(boxValue(ui->videoResolutionBox).toSize());
+ settings.setFrameRate(boxValue(ui->videoFramerateBox).value());
+
+ return settings;
+}
+
+void VideoSettings::setVideoSettings(const QVideoEncoderSettings &videoSettings)
+{
+ selectComboBoxItem(ui->videoCodecBox, QVariant(videoSettings.codec()));
+ selectComboBoxItem(ui->videoResolutionBox, QVariant(videoSettings.resolution()));
+ ui->videoQualitySlider->setValue(videoSettings.quality());
+
+ //special case for frame rate
+ for (int i = 0; i < ui->videoFramerateBox->count(); ++i) {
+ qreal itemRate = ui->videoFramerateBox->itemData(i).value();
+ if (qFuzzyCompare(itemRate, videoSettings.frameRate())) {
+ ui->videoFramerateBox->setCurrentIndex(i);
+ break;
+ }
+ }
+}
+
+QString VideoSettings::format() const
+{
+ return boxValue(ui->containerFormatBox).toString();
+}
+
+void VideoSettings::setFormat(const QString &format)
+{
+ selectComboBoxItem(ui->containerFormatBox, QVariant(format));
+}
+
+QVariant VideoSettings::boxValue(const QComboBox *box) const
+{
+ int idx = box->currentIndex();
+ if (idx == -1)
+ return QVariant();
+
+ return box->itemData(idx);
+}
+
+void VideoSettings::selectComboBoxItem(QComboBox *box, const QVariant &value)
+{
+ for (int i = 0; i < box->count(); ++i) {
+ if (box->itemData(i) == value) {
+ box->setCurrentIndex(i);
+ break;
+ }
+ }
+}
diff --git a/Project4/camera/videosettings.h b/Project4/camera/videosettings.h
new file mode 100644
index 00000000..a5f0ec43
--- /dev/null
+++ b/Project4/camera/videosettings.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef VIDEOSETTINGS_H
+#define VIDEOSETTINGS_H
+
+#include
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+class QComboBox;
+class QMediaRecorder;
+namespace Ui { class VideoSettingsUi; }
+QT_END_NAMESPACE
+
+class VideoSettings : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit VideoSettings(QMediaRecorder *mediaRecorder, QWidget *parent = nullptr);
+ ~VideoSettings();
+
+ QAudioEncoderSettings audioSettings() const;
+ void setAudioSettings(const QAudioEncoderSettings&);
+
+ QVideoEncoderSettings videoSettings() const;
+ void setVideoSettings(const QVideoEncoderSettings&);
+
+ QString format() const;
+ void setFormat(const QString &format);
+
+protected:
+ void changeEvent(QEvent *e) override;
+
+private:
+ QVariant boxValue(const QComboBox*) const;
+ void selectComboBoxItem(QComboBox *box, const QVariant &value);
+
+ Ui::VideoSettingsUi *ui;
+ QMediaRecorder *mediaRecorder;
+};
+
+#endif // VIDEOSETTINGS_H
diff --git a/Project4/camera/videosettings.ui b/Project4/camera/videosettings.ui
new file mode 100644
index 00000000..876326f5
--- /dev/null
+++ b/Project4/camera/videosettings.ui
@@ -0,0 +1,211 @@
+
+
+ VideoSettingsUi
+
+
+
+ 0
+ 0
+ 561
+ 369
+
+
+
+ Video Settings
+
+
+
+
+
+ QFrame::NoFrame
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 543
+ 250
+
+
+
+
+
+
+ Audio
+
+
+
+
+
+ Audio Codec:
+
+
+
+
+
+
+
+
+
+ Sample Rate:
+
+
+
+
+
+
+
+
+
+ Quality:
+
+
+
+
+
+
+ 4
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+
+
+ Video
+
+
+
+
+
+ Resolution:
+
+
+
+
+
+
+
+
+
+ Framerate:
+
+
+
+
+
+
+
+
+
+ Video Codec:
+
+
+
+
+
+
+
+
+
+ Quality:
+
+
+
+
+
+
+ 4
+
+
+ Qt::Horizontal
+
+
+
+
+
+
+
+
+
+ Container Format:
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 14
+
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ VideoSettingsUi
+ accept()
+
+
+ 322
+ 272
+
+
+ 44
+ 230
+
+
+
+
+ buttonBox
+ rejected()
+ VideoSettingsUi
+ reject()
+
+
+ 405
+ 262
+
+
+ 364
+ 227
+
+
+
+
+
diff --git a/Project4/image/SRF08.jpg b/Project4/image/SRF08.jpg
new file mode 100644
index 00000000..9909b2e2
Binary files /dev/null and b/Project4/image/SRF08.jpg differ
diff --git a/Project4/image/rp2_pinout.png b/Project4/image/rp2_pinout.png
new file mode 100644
index 00000000..c9126c14
Binary files /dev/null and b/Project4/image/rp2_pinout.png differ
diff --git a/Project4/sonic sensor/Readme.md b/Project4/sonic sensor/Readme.md
new file mode 100644
index 00000000..8c9e85fe
--- /dev/null
+++ b/Project4/sonic sensor/Readme.md
@@ -0,0 +1,11 @@
+How to operate in RPI?
+
+1. make mysonic.cpp file using something like "VIM"
+
+2. Type g++ mysonic.cpp -o sonic
+
+3. Type ./sonic
+
+
+I2C address
+https://learn.adafruit.com/i2c-addresses/the-list
diff --git a/Project4/sonic sensor/mysonic.cpp b/Project4/sonic sensor/mysonic.cpp
new file mode 100644
index 00000000..4ab8d07a
--- /dev/null
+++ b/Project4/sonic sensor/mysonic.cpp
@@ -0,0 +1,59 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+using namespace std;
+
+void Mysleep(int a)
+{
+ clock_t start_clk = clock();
+
+ a--;
+ while(1) {
+ if ((clock() - start_clk) / CLOCKS_PER_SEC > a) break;
+ }
+
+}
+
+int main(int argc, char **argv)
+{
+ cout <<"초음파 센서 프로그램 가동" << endl;
+
+ while(1){
+
+ int address = 0x70;
+ unsigned char buf[10];
+ int fd = open("/dev/i2c-1", O_RDWR); // O_RDWR = open for reading and writing
+ ioctl(fd, I2C_SLAVE, address);
+
+ buf[0] = 0;
+ buf[1] = 81;
+
+ write(fd, buf, 2);
+
+ usleep(750000);
+
+ write(fd, buf, 1);
+
+ read(fd, buf, 4);
+
+
+ buf[0] = 0;
+
+ unsigned char highByte = buf[2];
+ unsigned char lowByte = buf[3];
+ unsigned int result = (highByte <<8) + lowByte; // Calculate range
+ cout <<"Range was: " << result << endl;
+
+
+ Mysleep(0.1);
+ }
+
+}
diff --git a/README.md b/README.md
index 90e26804..61f8a967 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,38 @@
-# SEA-ME
+
+
+
+Hello. I’m participating in ‘SEA:ME pilot program’ in wolfsburg, Germany.
+
+I’m currently structing mobility embedded system in this program.
+
+In SEA:ME, we use the technology which can apply in real mobility software system like CAN, D-Bus, QT, Embedded Linux.
+
+You can simply find out what I’m doing.
+
+[Project 1 : Struct environment](https://github.com/jun-yub-kim/Team-Pilot/tree/main/Project1)
+
+[Project 2 : Digital Instrument Cluster](https://github.com/jun-yub-kim/Team-Pilot/tree/main/Project2)
+
+[Project 3 : Embedded Linux / Develop Custom OS](https://github.com/jun-yub-kim/Team-Pilot/tree/main/Project3)
+
+[Project 4 : Develop PDC(Park Distance Control)](https://github.com/jun-yub-kim/Team-Pilot/tree/main/Project4)
+
+
\ No newline at end of file
diff --git a/design concept.jpg b/design concept.jpg
new file mode 100644
index 00000000..54264e1c
Binary files /dev/null and b/design concept.jpg differ
diff --git a/logo.png b/logo.png
new file mode 100644
index 00000000..0f38ba93
Binary files /dev/null and b/logo.png differ