This page will describe a Qt5 programming procedure, and show how to use the Qt5 API during making the little project “Temperature Test for Android”
please refer to here here
Anaconda python 3.5 will have it already.
C:\>pip install PyQt5
Collecting PyQt5
Downloading PyQt5-5.7-cp35-none-win_amd64.whl (68.1MB)
100% |################################| 68.1MB 13kB/s
Collecting sip (from PyQt5)
Downloading sip-4.18.1-cp35-none-win_amd64.whl (46kB)
100% |################################| 51kB 1.7MB/s
Installing collected packages: sip, PyQt5
Successfully installed PyQt5-5.7 sip-4.18.1
please refer to PyQt5 Reference Guide
import and main
from PyQt5.QtWidgets import QDialog, QMessageBox
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtCore import *
if __name__ == "__main__":
app = QApplication(sys.argv)
myapp = GUIForm()
myapp.show()
app.exec()
#sys.exit(app.exec_())
myapp.Update_data()
GUIForm class, QThread, QTimer, click.connect
class GUIForm(QDialog):
def __init__(self, parent=None):
QWidget.__init__(self,parent)
self.ui = Ui_Dialog()
self.ui.setupUi(self)
self.first_draw_flag = False
# directory name to read temperature
self.path_battery_temp = "/sys/class/power_supply/battery/temp"
self.path_cpu_temp = "/sys/class/thermal/thermal_zone12/temp"
self.path_battery_capacity = "/sys/class/power_supply/battery/capacity"
self.art_script_thread = QThread()
self.get_temp_thread = QThread()
self.myTimer1 = QTimer()
self.myTimer2 = QTimer()
self.myTimer3 = QTimer()
self.myTimer4 = QTimer()
# bind widgets to relative call-back functions
self.ui.pushButton_run_1.clicked.connect(self.Run1)
self.ui.pushButton_run_2.clicked.connect(self.Run2)
self.ui.pushButton_run_3.clicked.connect(self.Run3)
self.ui.pushButton_run_4.clicked.connect(self.Run4)
self.ui.pushButton_copy_script_1.clicked.connect(self.Copy_script_to_Phone1)
self.ui.pushButton_copy_script_2.clicked.connect(self.Copy_script_to_Phone2)
self.ui.pushButton_copy_script_3.clicked.connect(self.Copy_script_to_Phone3)
self.ui.pushButton_copy_script_4.clicked.connect(self.Copy_script_to_Phone4)
self.ui.pushButton_init_1.clicked.connect(self.Init_Totcnt1)
self.ui.pushButton_init_2.clicked.connect(self.Init_Totcnt2)
self.ui.pushButton_init_3.clicked.connect(self.Init_Totcnt3)
self.ui.pushButton_init_4.clicked.connect(self.Init_Totcnt4)
self.ui.Ball_Crack.toggled.connect(self.btnstate1)
# load icon to label
myPixmap = QtGui.QPixmap(os.getcwd() + "/phone.png")
myScaledPixmap = myPixmap.scaled(self.ui.label_9.size(), Qt.KeepAspectRatio)
self.ui.label_9.setPixmap(myScaledPixmap)
font change
def btnstate1(self):
font = QtGui.QFont()
font.setBold(True)
clicking the run button and timer call-back functions
def Run1(self):
if self.equipped[0] == False:
return
myInitParams = 0
timerCallback = functools.partial(self.RunTempTest, myInitParams)
if self.myTimer1.isActive():
print("Timer1 Already Active")
#self.myTimer1.stop()
else:
self.myTimer1.timeout.connect(timerCallback)
self.myTimer1.start(self.periodic_time*1000)
# thread to run the art scripts
self.art_script_thread = ART_Scrtipt(self.device[0], "ART_Temp_Test_Script.py")
self.art_script_thread.start()
call the plot function triggered by timer
def RunTempTest(self, idx):
global g_read_temp_flag
if self.test_result[idx] == False: # Test Error
return
if g_read_temp_flag == True:
self.PlotFunc(idx)
if self.CpuTemp[idx] == 0:
return
QThread running for transfer a ART script
class ART_Scrtipt(QThread): # Power On/Off Thread
def __init__(self, device_id, test_script):
QThread.__init__(self)
self.device_id = device_id
self.test_script = test_script
def run(self):
timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
str1 = '[' + timestring + '] '
print("%s Enter Test Script %s !!!" % (str1, self.device_id))
adbcmd.adbcmd(self.device_id, 'am broadcast -a "com.lge.art.ACTION_START_SCRIPT" --es "files" %s ' %(self.test_script))
self.quit()
QThread running for reading temperature from phone
class Get_Temp_from_Phone(QThread): # Power On/Off Thread
def __init__(self, path_battery_temp, path_cpu_temp):
QThread.__init__(self)
self.path_battery_temp = path_battery_temp
self.path_cpu_temp = path_cpu_temp # XO_THERM
def run(self):
global g_device
global g_Cpu_Temp
global g_Bat_Temp
global g_read_temp_flag
# read temperature of a phone
g_Bat_Temp[count] <= value
g_Cpu_Temp[count] <= value
def stop(self):
self.exit_thread = 1
self.quit()
plot the graph with temperature
def PlotFunc(self, idx):
global g_Temp
self.init_data()
if idx == 0:
pointer = self.ui.widget_1.canvas
X_data = self.lstX1
Y_data = self.lstY1
X1_data = self.lstX1_1
Y1_data = self.lstY1_1
pointer.axes.clear()
pointer.axes.set_xlabel('Time(sec)')
pointer.axes.set_ylabel('Temperature($^{\circ}$C)')
pointer.axes.xaxis.set_ticks_position('bottom')
pointer.axes.yaxis.set_ticks_position('left')
#pointer.axes.spines['top'].set_color('red')
pointer.axes.grid(color='b', linewidth=1)
if self.ball_crack_flag == False:
pointer.axes.plot(self.X_upper_limit, self.Y_upper_limit, 'r-', linestyle = '--')
pointer.axes.plot(self.X_center_limit, self.Y_center_limit, 'c', linestyle = '-', label='baseline')
pointer.axes.plot(self.X_bottom_limit, self.Y_bottom_limit, 'r-', linestyle = '--')
else:
pointer.axes.set_ylim(int(self.save_low_temp[idx]-2), int(self.save_high_temp[idx]+2))
pointer.axes.plot(X1_data, Y1_data, 'b-', label='Temp', linewidth=1) # , 'b-', , 'g-' , marker='o'
pointer.draw()
Site_Name_title | Purpose |
---|---|
20 Newsgroups | The text from 20000 messages taken from 20 Usenet newsgroups for text analysis, classification, etc. |
Amazon Reviews | Over 142 million product reviews for sentiment analysis, recommender systems, and more. |
Football Strategy | Thousands of scenarios to make the best coaching decisions. |
Horses for Courses | Horse-racing data for predicting race results. |
Human Activity Recognition with Smartphones | Sensor data for recognizing the human activity - walking, sitting, etc. |
Labeled Faces in the Wild | 13,000 named faces for facial recognition. Multiple training and test sets |
National Survey on Drug Use and Health | |
NORB 3D Object Recognition | Binocular images of 50 toy figurines for 3D object recognition from image. |
One Million Songs | Audio features and metadata for a subset (10,000) of the one million popular songs dataset for recognition/classification. |
SMS Spam Collection | A collection of 5,574 SMS (text) messages, some spam, some normal, for spam filtering. |
Hate Speech Identification | A sampling of Twitter posts that have been judged based on whether they are offensive or contain hate speech, as a training set for text analysis. |
Hidden Beauty of Flickr Pictures | 15,000 Flickr photo IDs that have received ratings based on aesthetics, for image analysis. |
Yahoo Instant Messenger Friends Connectivity Graph | Connections between Yahoo users who communicate with each other using Yahoo messenger, can be used to identify key social contacts/influencers. Add dataset to cart to access. |
Record of Heart Sound | Recordings of normal and abnormal heartbeats, used to recognize heart murmur, etc. |
Prostate Cancer | Tumor and nontumor samples, used to recognize prostate cancer. |
Wine Quality | Chemical properties of red and white wines (separately) and quality, for classification. |
Mushroom Identification | For hypothetically classifying mushrooms as edible or poisonous based on its characteristics. |
UFO Reports | 80,000 historic reports for classification or regression. This dataset has been standardized from the source data at nuforc.org. |
Militarized Interstate Disputes | Nearly 200 years of international threats, conflicts, etc. for modelling or prediction. Includes action taken, level of hostility, fatalities, and outcomes. |
NBA & MLB Stats | Current and past season stats for teams and players for fantasy sports predictions. |
Sign Language | |
MusicNet | MusicNet is a collection of 330 freely-licensed classical music recordings, together with over 1 million annotated labels indicating the precise time of each note every recording, the instrument that plays each note, and the note’s position in the metrical structure of the composition. The labels are acquired from musical scores aligned to recordings by dynamic time warping. The labels are verified by trained musicians; we estimate a labeling error rate of 4%. We offer the MusicNet labels to the machine learning and music communities as a resource for training models and a common benchmark for comparing results. |
ProductHunt | |
1.7 billion Reddit comments | |
VQA2 | visual question answering dataset, now 2X larger |
UCI ML Repo | 351 datasets |
Hacker News | Full comment dump of HN |
FIRE | Fundus Image Registration Dataset |
LASIESTA | Labeled and Annotated Sequences for Integral Evaluation of SegmenTation Algorithms |
LAKH MIDI Dataset | Its goal is to facilitate large-scale music information retrieval, both symbolic (using the MIDI files alone) and audio content-based (using information extracted from the MIDI files as annotations for the matched audio files). |
Lamem | Large-scale Image Memorability |
Pratheepan dataset | Human Skin Detection dataset |
COCO-Stuff dataset | COCO-Stuff semantic segmentation dataset |
NewsQA | Maluuba’s News QA is a new machine reading comprehension dataset for developing algorithms capable of answering questions requiring human-level comprehension and reasoning skills. This dataset of CNN news articles has over 110K Q&A pairs. Questions are written by humans in natural language. Questions may not have answers and answers may be multiword passages. |
Awesome Public Datasets | A massive Github repo of accessible, public datasets. The datasets are not, by nature, completely clean and purpose-built for ML. |
ImageNet | The ImageNet project is a large visual database designed for use in visual object recognition software research |
Element List Scientific Data Directory | An online repository of links to free, publicaly available scientific datasets, mostly from university, industry, and government research programs. |
IMDB dataset | |
MSCOCO | Image segmentation and object recognition |
Google Books Ngrams | |
OpenML repository | Almost 20k datasets |
Enron Email Corpus | The Enron Corpus is a large database of over 600,000 emails generated by 158 employees of the Enron Corporation and acquired by the Federal Energy Regulatory Commission during its investigation after the company’s collapse. |
German Traffic Signs | German Traffic Sign Detection Benchmark (GTSDB). The first was used in a competition at IJCNN 2011. |
SYNTHIA | 500.000 frames of annotated vídeo from a virtualcity. labels for stereo, optical flow, semántica segmentación, odometry… |
Elektra | over 20 different autonomous driving datasets: pedestrians, semantic segmentation, stereo… |
Cornell Movie–Dialogs Corpus | This corpus contains a large metadata-rich collection of fictional conversations extracted from raw movie scripts: |
Web Markdown editor은 이 site 을 참조하자: here
혹은 한글설명은 여기에서 참조하자
별표 두 개를 사용해 글자를 굵게 할 수 있습니다.
언더바를 사용해 글자를 기울일 수 있습니다.
혹은 별표 하나만 사용해도 글자를 기울일 수 있습니다.
쿠키 한 입 베어 물고 녹차. 녹차 한 입 마시고 쿠키. 바사삭 바사삭 느낌도 좋지만 촉촉한 느낌도 좋아. 컵 케이크 마카롱 젤리 먹고 후식으로는 티라미수. 연하고 부드러운 수플레 치즈 케이크에 초콜릿 푸딩.
마크다운(Markdown)은 일반 텍스트 문서의 양식을 편집하는 문법이다. README 파일이나 온라인 문서, 혹은 일반 텍스트 편집기로 문서 양식을 편집할 때 쓰인다. 마크다운을 이용해 작성된 문서는 쉽게 HTML 등 다른 문서형태로 변환이 가능하다.
아래 이메일 주소를 입력하거나 여러분만의 주소를 넣은 뒤, 꺾쇠 괄호 기호 (<>)로 감싸보세요. 아래 쪽의 주소 링크 스크린샷에서 결과를 볼 수 있습니다
주소가 보이는 링크입니다. https://jaehyek.github.io
주소 대신 단어가 보이는 링크입니다. 링크
만일 Youtube 주소가 https://www.youtube.com/watch?v=GDsmyigv9tw 이면
구글 로고입니다:
참고: 참조 문자는 이미지를 구분할 수 있도록 돕는 이름이면 어떤 것이든 쓸 수 있습니다.
##가로 선 넣기
가로 선은 문서에서 내용을 구분 지어 나눌 때 유용합니다. 마크다운에서 가로 선을 추가하려면, 선을 표시해야 할 곳에 세 개나 혹은 그 이상의 중간 선(대시) 기호를 입력하기만 하면 됩니다.
쿠키 한 입 베어 물고 녹차. 녹차 한 입 마시고 쿠키. 바사삭 바사삭 느낌도 좋지만 촉촉한 느낌도 좋아. 컵 케이크 마카롱 젤리 먹고 후식으로는 티라미수. 연하고 부드러운 수플레 치즈 케이크에 초콜릿 푸딩.
마크다운(Markdown)은 일반 텍스트 문서의 양식을 편집하는 문법이다. README 파일이나 온라인 문서, 혹은 일반 텍스트 편집기로 문서 양식을 편집할 때 쓰인다. 마크다운을 이용해 작성된 문서는 쉽게 HTML 등 다른 문서형태로 변환이 가능하다
##강제 개행
마크다운에서 강제로 줄 바꿈 하고 싶을 경우 일부 편집기에서는 줄 끝에 둘 이상의 공백을 넣으면 줄 바꿈으로 적용됩니다. HTML을 사용할 경우, 여백 사이에
</br>을 넣으면 됩니다
#멀티마크다운 사용 방법
##취소선 넣기
취소선이라는 단어의 양쪽 끝에 물결 모양 기호를 두 개씩 추가하세요(취소선). 이 방법은 HTML 태그의 취소선을 사용하는 것 보다 훨씬 더 쉽습니다
다음 사이트를 참조하자
Run Jekyll on Windows http://jekyll-windows.juthilo.com/
Jekyll Docments http://jekyllrb.com/
Jekyll 한글 문서 http://jekyllrb-ko.github.io/docs/usage/
Liquid tag 설명 https://github.com/Shopify/liquid/wiki/Liquid-for-Designers
Multiple _posts directories https://github.com/jekyll/jekyll/issues/2440
Jekull Themes http://themes.jekyllrc.org/
Jekull Themes http://jekyllthemes.org/
다음 사이트를 참조하자
HTML 태그소스 명령어 정리표 http://tip.daum.net/openknow/63622006
알레폰드의 IT 이모저모 http://202psj.tistory.com/575
이글루의 HTML 태그 정리표 http://egloos.zum.com/fundoodle/v/3131696
이글루의 HTML 태그 정리 http://egloos.zum.com/woong/v/2537395
HTML5〃기본 구조/시맨틱 태그(HEAD/BODY) http://hunit.tistory.com/172
HTML5〃텍스트(TEXT) 태그 정리 http://hunit.tistory.com/173
HTML5〃목록 태그(UL / OL / DL ) http://hunit.tistory.com/175