Skip to content

Commit

Permalink
Merge branch 'sipeed:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SinKy-Yan committed Apr 26, 2024
2 parents d95ff84 + f995cc1 commit 696d817
Show file tree
Hide file tree
Showing 23 changed files with 463 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build_maixcam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,22 @@ jobs:
whereis python3
# export PATH=~/.local/bin/:$PATH
# pull sipeed/MaixCDK repo here first
pwd_path=$(pwd)
cd ~
git clone https://github.com/sipeed/MaixCDK --depth=1
export MAIXCDK_PATH=`pwd`/MaixCDK
cd $pwd_path
python -m pip install -U pip setuptools
python -m pip install -r MaixCDK/requirments.txt
echo "----------------------"
echo "-- Build MaixPy now --"
echo "----------------------"
python -m pip install -r $MAIXCDK_PATH/requirements.txt
echo "--------------------------------"
echo "-- Build MaixPy for Linux now --"
echo "--------------------------------"
sudo apt update -y
sudo apt install -y libopencv-dev libopencv-contrib-dev
python setup.py bdist_wheel linux
echo "----------------------------------"
echo "-- Build MaixPy for MaixCAM now --"
echo "----------------------------------"
python setup.py bdist_wheel maixcam
# Runs a set of commands using the runners shell
Expand Down
2 changes: 1 addition & 1 deletion maix/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

version_major = 4
version_minor = 0
version_patch = 10
version_patch = 11

__version__ = "{}.{}.{}".format(version_major, version_minor, version_patch)
3 changes: 3 additions & 0 deletions projects/app_desktop_monitor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data
__pycache__
dist
10 changes: 10 additions & 0 deletions projects/app_desktop_monitor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Monitor on desktop
=====


## Description

Monitoring PC's CPU/GPU/Temperature and more info.
And monitoring other info like your Bilibili.com account's follower number, or whether etc.


13 changes: 13 additions & 0 deletions projects/app_desktop_monitor/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id: desktop_monitor
name: Desktop Monitor
name[zh]: 桌面监视器
version: 1.0.1
icon: assets/desktop_monitor.json
author: neucrack@Sipeed Ltd
desc: Monitoring PC info, or other info from internet or local.
desc[zh]: 监控电脑性能参数,或者其它来自互联网或者本地的数据。
exclude:
- data
- dist
- .gitignore

Binary file not shown.
Binary file added projects/app_desktop_monitor/assets/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions projects/app_desktop_monitor/assets/chars.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
`1234567890-=~!@#$%^&*()_+qwertyuiop[]\asdfghjkl;'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?
℃!。,《》【】、
服务器扫描二维码以连接确保设备和电脑在同一个局域网内在电脑执行启动服务器

Binary file added projects/app_desktop_monitor/assets/connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app_desktop_monitor/assets/cpu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions projects/app_desktop_monitor/assets/desktop_monitor.json

Large diffs are not rendered by default.

Binary file added projects/app_desktop_monitor/assets/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app_desktop_monitor/assets/exit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions projects/app_desktop_monitor/assets/extract_font_chars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "Extracting font characters from $1"

fonttools subset --text-file=chars.txt --output-file=my_font.ttf $1


Binary file added projects/app_desktop_monitor/assets/memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app_desktop_monitor/assets/my_font.ttf
Binary file not shown.
Binary file added projects/app_desktop_monitor/assets/net.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app_desktop_monitor/assets/temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/app_desktop_monitor/assets/upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions projects/app_desktop_monitor/desktop_monitor/i18n.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from maix import i18n

lang_dict = {
"zh": {
"Server": "服务器",
"scan_qr_title": "扫描二维码以连接",
"scan_qr_tip1": "1. 确保设备和电脑在同一个局域网内",
"scan_qr_tip2": "2. 在电脑执行'pip install pc-monitor-server'",
"scan_qr_tip3": "3. 在电脑执行'pc-monitor-server'启动服务器",
},
"en": {
"scan_qr_title": "Scan QR code to connect",
"scan_qr_tip1": "1. Make sure device and PC in the same LAN",
"scan_qr_tip2": "2. Execute 'pip install pc-monitor-server' on PC",
"scan_qr_tip3": "3. Execute 'pc-monitor-server' on PC",
}
}

trans = i18n.Trans(lang_dict)
tr = trans.tr

22 changes: 22 additions & 0 deletions projects/app_desktop_monitor/desktop_monitor/scanner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from maix import camera, image

class Scanner:
def __init__(self, w, h):
self.cam = camera.Camera(w, h)

def scan(self):
img = self.cam.read()
if img is None:
return None, None
# scan qrcode
qrs = img.find_qrcodes()
for qr in qrs:
addr = qr.payload()
if addr.startswith("http"):
return addr, img
corners = qr.corners()
for i in range(4):
img.draw_line(corners[i][0], corners[i][1], corners[(i + 1) % 4][0], corners[(i + 1) % 4][1], image.COLOR_RED)
return None, img
# return "http://127.0.0.1:9999", img

15 changes: 15 additions & 0 deletions projects/app_desktop_monitor/desktop_monitor/util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import requests


def get_pc_info(site_addr):
url = site_addr + '/'
try:
res = requests.post(url)
if res.status_code != 200:
print("-- [Error] status code:", res.status_code)
return None
info = res.json()
return info
except Exception as e:
print("-- [Error]", e)
return None
Loading

0 comments on commit 696d817

Please sign in to comment.