Categories
linux Uncategorized

树莓派 book worm 安装记录

3B插上网线

sudo raspian-config //开启ssh


sudo apt install python3-pip
sudo apt install python3-opencv
sudo apt install python3-dbus
sudo apt install python3-bluetooth
sudo apt install python3-serial

sudo apt install vim

sudo apt install lrzsz


pip install wiringpi --break-system-wide

开启orthocone 自启动

sudo chmod 777 /etc/init.d/orthocone
sudo update-rc.d orthocone defaults
sudo systemctl enable orthocone.service

sudo chmod 777 recon.out

还需要重新安装opencv_core opencv_imgproc  opencv_highgui

用opencv4  重新编译 recon   
超级辛苦

多余service 取消自启动

sudo update-rc.d xxx remove

或者

sudo systemctl disable xxx.service

移除windows 字符
vim
:set ff=unix

修改i2c 波特率
config.txt
dtparam=i2c_arm=on,i2c_arm_baudrate=100000

python3.9 后 timer.isAlive() 改为 timer.is_live()

树莓派系统

虚拟键盘

https://blog.csdn.net/weixin_37613240/article/details/131095728

https://blog.csdn.net/weixin_46235937/article/details/128966933

https://blog.csdn.net/qq_27865227/article/details/127394944

https://blog.csdn.net/m0_46324847/article/details/128962898

新版树莓派摄像头驱动

Categories
c

JSON-C

Categories
C#

C# winform 自定义 UserControl 生命周期

UserControl 类 是C# winform 中自定义控件的基类

所有自定义控件都要继承UserControl

自定义组件结构分为

组件属性 组件事件 和 组件方法

一般来说 在无参构造方法中 调用 InitializeComponent后 就可以执行 自己的初始化(InitializeComponent 后可认为组件已经渲染完毕)

之后一般是执行属性设置和事件绑定

Categories
linux

树莓派5 双触摸屏

第一禁用Wayland 用回x11设置

raspi-config 里设置后 重启

xinput查看当前当前触摸屏与设备 xrandr也可查看当前屏幕

xinput map-to-output 7 HDMI-1

xinput map-to-output 8 HDMI-2

Categories
python

pyqt5 pyside6 切换

pyside6 导入文件

from PySide6.QtCore import *
from PySide6.QtGui import *
from PySide6.QtWidgets import *

pyqt5 导入文件

from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

切记pyqt5 与 pyside6 不能混用

Categories
python

PyQt5 QStackedWidget 使用方法

initialize sub component

self.Stack = QStackedWidget (self)
self.Stack.addWidget (self.stack1)
self.Stack.addWidget (self.stack2)
self.Stack.addWidget (self.stack3)

事件触发关联

self.leftlist.currentRowChanged.connect(self.display)

切换页面

def display(self,i):
    self.Stack.setCurrentIndex(i)
Categories
python

QT 使用图片作为背景

convertToQtFormat = QtGui.QImage(rgbImage.data, rgbImage.shape[1], rgbImage.shape[0], QImage.Format_RGB888)
									#在这里可以对每帧图像进行处理,
									image = convertToQtFormat.scaled(440, 330, Qt.KeepAspectRatio)
									self.video.setPixmap(QPixmap.fromImage(image))

rgbImage.data 是 python图片数组数据

所有组件都可以通过 setPixmap(QPixmap.fromImage(image)) 设置背景图像

import sysfrom PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow

class Ui_MainWindow(object):

def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(270, 180, 241, 101))
self.label.setText("")
self.label.setPixmap(QtGui.QPixmap(":/img/logo.png"))
self.label.setObjectName("label")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))

if __name__ == '__main__':import resource  
# 导入添加的资源(根据实际情况填写文件名)
app = QApplication(sys.argv)
MainWindow = QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

设置icon

        self.pushButton_9.setIcon(QtGui.QIcon(QtGui.QPixmap("./resources/setting.png")))
self.pushButton_9.setIconSize(QtCore.QSize(30,30))
Categories
python

QT designer 使用

使用QT designer会生成一系列ui后缀文件

通过pyuic可以将ui文件转化为py文件

python -m PyQt5.uic.pyuic 1.ui -o 1.py
pyuic5 1.ui -o 1.py
pyside6-uic form.ui -o ui_form.py

把1.ui 转换为 1.py

class MainForm(QtWidgets.QMainWindow):
	def __init__(self,parent=None):
		super(MainForm,self).__init__(parent)
		__content = Ui_MainWindow.Ui_MainWindow()
		__content.setupUi(self)
		
	

if  __name__ == "__main__" :
	try: 
		print('start')
		__app = QtWidgets.QApplication(sys.argv) 
		__win = MainForm()
		__win .show()
		sys.exit(__app.exec_())
	except KeyboardInterrupt :
		print('destroy')

__content = Ui_MainWindow.Ui_MainWindow()

这段代码可以换成不同的UI generate的代码 就可以 切换ui文件 看效果

Categories
python

Pyqt 组件说明

Categories
objective-c

object-c UIImageView

UIImageView 是IOS图片控件。点击右上角 加号。可以打开控件窗口

绑定图片到UIImageView

点击UIImageView。右上角image选择图片绑定