From 2920bdb51617139552986157aee44b3c6d5926f7 Mon Sep 17 00:00:00 2001 From: qdxkrs Date: Tue, 15 Feb 2022 15:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0UDP=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 296 ++++++++++++++++++++++++++++++++++++ dms_client.db | Bin 0 -> 36864 bytes scan_data/receive_queue.py | 95 ++++++++++++ util/UDP_Receive.py | 46 ++++++ util/UDP_Sender.py | 32 ++++ util/find_GPS_image.py | 81 ++++++++++ util/simple_sqlite3_tool.py | 91 +++++++++++ 7 files changed, 641 insertions(+) create mode 100644 .gitignore create mode 100644 dms_client.db create mode 100644 scan_data/receive_queue.py create mode 100644 util/UDP_Receive.py create mode 100644 util/UDP_Sender.py create mode 100644 util/find_GPS_image.py create mode 100644 util/simple_sqlite3_tool.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76a17c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,296 @@ +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# spec +manage.spec + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +staticfiles/ + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# pyenv +.python-version + + + +# Environments +.venv +venv/ +ENV/ +.vscode + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + + +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + + +### Linux template +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + + +### VisualStudioCode template +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + + + + + +### Windows template +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### macOS template +# General +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### SublimeText template +# Cache files for Sublime Text +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache + +# Workspace files are user-specific +*.sublime-workspace + +# Project files should be checked into the repository, unless a significant +# proportion of contributors will probably not be using Sublime Text +# *.sublime-project + +# SFTP configuration file +sftp-config.json + +# Package control specific files +Package Control.last-run +Package Control.ca-list +Package Control.ca-bundle +Package Control.system-ca-bundle +Package Control.cache/ +Package Control.ca-certs/ +Package Control.merged-ca-bundle +Package Control.user-ca-bundle +oscrypto-ca-bundle.crt +bh_unicode_properties.cache + +# Sublime-github package stores a github token in this file +# https://packagecontrol.io/packages/sublime-github +GitHub.sublime-settings + + +### Vim template +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-v][a-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist + +# Auto-generated tag files +tags + + +### VirtualEnv template +# Virtualenv +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ss]cripts +pyvenv.cfg +pip-selfcheck.json +.env + + +### Project template + +izan/media/ + +.pytest_cache/ + + diff --git a/dms_client.db b/dms_client.db new file mode 100644 index 0000000000000000000000000000000000000000..cd1ede49e893376e1dc1ee4d94f3e0a8d89c2fcf GIT binary patch literal 36864 zcmeI*Z*SU090%|-1Pn>Zkxh}CN>gq;0yWLBDV4fBXtNeg(NdZ}ATh@%Vyn?-gXm217_OLIZ>Z3jCgK7`=aMIqv&W31s*UDxNw5rw6Gb5p86!l_5)zf4%VAm0%v~3NNt6*)D_jarSDh1IB= zR=wIV8?}mQqzyUhSyP{6o8Y6p+-4!i3Y%YS=U8HrT@oxAn`bOxRT69~U&wu#+haR> zTTeFk4%k<@1GZT#Jl)F6<37pd3v14%u6&jo6`o*)+_T=Q>S?`OfO_fJv!cRV<)-z# zmlm5(wU6gjZFN;SOF04#K+S52{!GMMmVUZlhVxGgEMMH-zAEQcOIm+h5=RLp_zTf3 zj+5BU?;vrgjDuCBX8Fkaj+-q}5~nSeU{+o5L*DG+GChd{vOUa&Z0bsdFnlNx1fU<>7GE=e&g+6|VZYl8y~m zUNisMPHS|yw!aUl+Qx=*7Iii5VS|2`?djse6T!>^i*HvYBcSMwf+;NRM8n$c+sc8% z**dAoOLw!yPfmHg%->m5J$&!1Oxi7CP41bB$z09RmxTUFU(=WL_bFr&hkyVCAOHaf zKmY;|fB*y_009UKKSL!$Rv-WY2tWV=5P$##AOHafKmY;|n67|*|6if6i5xLN00Izz00bZa0SG_< z0uX=z1R(GM2pEb=K3(}Fk~#W}f3vQyix)yp<+pBR?q=7^RU@6ge 0: + return True + else: + return False + + def query(self, sql, param=None): + """ + 查询语句 + sql:sql语句 + param:参数,可为None + retutn:成功返回True + """ + if param is None: + self.c.execute(sql) + else: + self.c.execute(sql, param) + return self.c.fetchall() + + # def set(self,table,field=" * ",where="",isWhere=False): + # self.table = table + # self.filed = field + # if where != "" : + # self.where = where + # self.isWhere = True + # return True + + +if __name__ == "__main__": + # 数据库文件位置 + sql = SimpleSQLite3Tool("../dms_client.db") + # f = sql.execute("create table test (id int not null,name text not null,age int);") + # print("ok") + # sql.execute("insert into test (id,name,age) values (?,?,?);", [(1, 'abc', 15), (2, 'bca', 16)]) + # res = sql.query("select * from test;") + # print(res) + # sql.execute("insert into test (id,name) values (?,?);", (3, 'bac')) + # res = sql.query("select * from test where id=?;", (3,)) + res = sql.query("select * from data_collection_info;") + print(res) + sql.close()