资源简介
基于Python的跨平台GUI开发框架kivy搭建了燃料电池远程监控系统。可运行于Windows, Linux, Android, IOS等平台。

代码片段和文件信息
# -*- coding: utf-8 -*-
#qpy:kivy
from kivy import require
require(‘1.9.0‘) # replace with your current kivy version !
from kivy.properties import StringProperty objectProperty ListProperty NumericProperty
from kivy.uix.screenmanager import ScreenManager Screen FadeTransition
from kivy.clock import Clock
from kivy.app import App
from kivy.lang import Builder
from kivy.garden.graph import Graph MeshLinePlot
from kivy.uix.boxlayout import BoxLayout
import mysql.connector
import threading
import datetime
import time
# GLOBAL VARIABLES HERE:
localhost = ‘fuelcelldb.mysqldb.chinacloudapi.cn‘ # Server eg: localhost
dbname = ‘fuelcelldb‘ # SQL Database Name.
dbuser = ‘fuelcelldb%junge8830‘ # SQL Database Username.
dbpw = ‘junGE8830‘ # SQL Database Password.
tablename = ‘parameters‘ # SQL Table name here.
ConnFlag = 0
descripID = {‘ID‘:0 ‘voltage‘:1 ‘current‘:2 ‘temperature‘:3 ‘timestamp‘:4}
RASPBERRYPI_NAME = ‘raspberrypi‘
global realtimegraph rtgraphupdate MeasureRTPlot Outdata
realtimegraph = None
rtgraphupdate = None
global MeasureRTPlotValue # for realtimegraph measurement line value
MeasureRTPlotValue = None
Outdata = []
# for offline graph measurement line value
global offlinegraph MeasurePlotValue
offlinegraph = None
MeasurePlotValue = None
class ConnThreading(threading.Thread):
“““
Thread to connection to database in the background without
disturbing user interface.
“““
def __init__(self threadID name):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
def run(self):
print (“Starting “ + self.name)
global conn cursor ConnFlag
try:
conn = mysql.connector.connect(host=localhost
database=dbname
user=dbuser
password=dbpw)
cursor = conn.cursor()
ConnFlag = 1 # Set Connection Flag to 1 succeed so other function can be alerted.
print (“DB connected successfully! Exiting “ + self.name)
except mysql.connector.Error as e:
print(“Connection fail Error Code: \n“e)
# quit()
# Codes to save to log file here
class PromptSuccess(threading.Thread):
“““
Thread to check the ConnThreading for connection completeness
and to give return message to the displaytext input argument.
“““
def __init__(self threadID name threadtojoin displaytext):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.displaytext = displaytext
self.threadtojoin = threadtojoin
def run(self):
print (“Starting “ + self.name)
self.threadtojoin.join()
self.displaytext.text = “If there is no dataplease contact the author‘s mailbox zejunwen@qq.com!“
#### Individual
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-09 06:27 detection-and-control-system-for-fuel-cells-master\
文件 14319 2017-11-09 06:27 detection-and-control-system-for-fuel-cells-master\KivyDesignFile.kv
文件 161 2017-11-09 06:27 detection-and-control-system-for-fuel-cells-master\README.md
文件 25933 2017-11-09 06:27 detection-and-control-system-for-fuel-cells-master\main.py
- 上一篇:jsp《计算机组成原理》精品课程建设java毕业设计
- 下一篇:外文翻译-B/S结构
相关资源
- 双鱼林Python基于Django图书管理系统
- Python基于Django图书管理系统课程设计
- Selenium2+Python自动化测试实战
- .proto 各种语言转换
- tensorflow 1.3 arm
- 《Hadoop with Python》 pdf
- Python RocketMQ
- 用Kivy开发手机APP
- kivy-文档中文翻译
- android python解释器
- VISSIM二次开发案例与框架VBA,C++,M
- Data Structures and Algorithms in Python
- 算法与数据结构之LeetCode题目详解PD
- python客户端启动出现错误无法运行的
- 最新Tmsvm基于SVM的文本挖掘系统 包含
- 尚硅谷1024专用全套视频打包
- 尚硅谷全套视频打包地址不对外最新
- 谷歌浏览器selenium-ide插件,录制脚本
- 通用复杂图片验证码识别程序深度机
- 廖雪峰Python完整电子版.pdf 免费
- Mastering_OpenCV_4_with_Python.pdf
- jython-standalone-2.7.1.jar
- tesseract-OCR GUI版本-Mac版本
- Java 调用Python的jar包
- Android平台的Python3.5.so
- cc++python源代码生成流程图
- PyCharm 2019 汉化补丁
- zw_tets_java-10322540-Python入门教程完整版
- opencv-4.2.0-vc14_vc15.7z
- GRPC简单应用Java+Python
评论
共有 条评论