From fef5220d3b574c72c1f05183365cd83bac80d0a6 Mon Sep 17 00:00:00 2001 From: Stefan Kinzel Date: Fri, 17 Feb 2017 01:43:34 +0100 Subject: [PATCH 1/3] remove gitlab-ci --- .gitlab-ci.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 8d9b3cc..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,6 +0,0 @@ -job_deploy: - stage: deploy - script: - - scp ./ pi@flipdot.raum.ctdo.de:/home/pi/mqtt-to-flipdot -i /var/opt/gitlab/.ssh/deploy_flipdot - only: - - deploy \ No newline at end of file From 049efaa26fce32cf025f6cac9a072d94b5d21c99 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 18 Feb 2017 19:33:51 +0100 Subject: [PATCH 2/3] default value for slow change animation increased --- mqtt-to-flipdot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mqtt-to-flipdot.py b/mqtt-to-flipdot.py index ca35a23..34b7c67 100644 --- a/mqtt-to-flipdot.py +++ b/mqtt-to-flipdot.py @@ -57,7 +57,7 @@ def on_message(client, userdata, msg): if len(payload)>0 and payload[0]=='~': payload=payload[1:] #remove first char #flipdot.send_text(payload,25) #send_text with animation - flipthread=Thread(target=flipdot.send_text, args=(payload,25)) + flipthread=Thread(target=flipdot.send_text, args=(payload,64)) else: #flipdot.send_text(payload) #without animation flipthread=Thread(target=flipdot.send_text, args=(payload,)) From c2804d8ac183832a0907886abc2be719a40cdca4 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 18 Feb 2017 19:56:48 +0100 Subject: [PATCH 3/3] thread buxfix, attempt #1 --- FlipdotSender.py | 6 +++--- hangman.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FlipdotSender.py b/FlipdotSender.py index d85cbd8..51ae798 100644 --- a/FlipdotSender.py +++ b/FlipdotSender.py @@ -106,11 +106,12 @@ class FlipdotSender(object): packet = self._array2packet(imgmaptmp) self._sock.sendto(bytes(packet), (self._udphost, self._udpport)) time.sleep(0.2) - if threadrunning==True: #if animation wasnt cancelled + if threadrunning==True: #if animation hasnt been cancelled self.sendPacket(imgmap) #send packet and save last-imagemap threadrunning=False else: self.sendPacket(imgmap) #send packet and save last-imagemap + def sendPacket(self, imgmap): packet = self._array2packet(imgmap) @@ -176,8 +177,7 @@ class FlipdotSender(object): else: draw.text((0,-1), text[0:splitpoint], font=font, fill=FlipdotSender.C_WHITE) draw.text((0,-1+currentfontsize), text[splitpoint:], font=font, fill=FlipdotSender.C_WHITE) - - + self._send(image,fadespeed) diff --git a/hangman.py b/hangman.py index 8c34fd7..50306df 100644 --- a/hangman.py +++ b/hangman.py @@ -49,12 +49,14 @@ class Hangman(object): #self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nomenliste_de.txt" #self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/crodict_nomen.txt" self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nerdwords.txt" + #self._wordlist="./hangman/wordlists/nerdwords.txt" #<- use for local testing self._gamestate=0# 0=start 1=ingame 2=lose 3=win self._g_word="test" #word self._g_displword="" #display word self._g_chars="" #used characters self._hmdir="/home/pi/mqtt-to-flipdot/hangman/stdhm/" + #self._hmdir="./hangman/stdhm/" #<- use for local testing self._hmimg=[] self._maxfails=len( os.listdir(self._hmdir))-1 -1 #maxfails defined by files in directory, -1 -1 because win image