From f13e02c4c2278f7b725dfe75065bd1518f6f345a Mon Sep 17 00:00:00 2001 From: Neythen Date: Wed, 5 May 2021 15:44:43 +0100 Subject: [PATCH] local caching implemented and smooth image transition --- __pycache__/stockTicker.cpython-37.pyc | Bin 8984 -> 8075 bytes csv/tickers.csv | 23 ++--- final.ppm | Bin 253839 -> 271887 bytes server.py | 3 + stockTicker.py | 123 +++++++++++++------------ 5 files changed, 77 insertions(+), 72 deletions(-) diff --git a/__pycache__/stockTicker.cpython-37.pyc b/__pycache__/stockTicker.cpython-37.pyc index 71a15fd0c9124605963124314dfdbeb34669285f..5fe368aa8cfe32e7f193322aaf07dbefaf314cdf 100644 GIT binary patch delta 2845 zcmY*b>u(%a6~A|0J3G5OUhjHsCwBaZAI-9c; zXW}^NtX9Q|070z8S1Kh^(He<<0Mx2PLgfPp_<#@}`ju*h5LFQpjl|vA3y83 z1+P*acfCrskoNM~g2TnAbdGL`qSTujW+A5EqqfRMSeO|gX>3%yD=jMX#Ck?Vr{E1t^BMtd{l-YG3sims?D55>6pTz@ZyThib%sfL#vU`wW&sH-b9lLmpU%KOMR zt!d>>uq$AHX~#}mc3)ee*QHvhrmz3em;6wK6qJXQM}3LW2~vaDu1LNHBQjGT$dq_; zL#cyN-KLb>;hqLT4*OxIf$O)ybqH&Ug=*?$Qoam!9qjM1u&1Zh@~fa@4gQiv0{t-P zQPBUuVu3yYx(Su_4=>ExJi`w|WyPVg+Oe`AUy*BMbw(jxJz6l}8+8h=f-j1#n2k1k z?dvf74Y;onA0oj!FOya*KptgEO(~nL7=V5(h?rcHR-;g?SO$q%9)fVra0n;iT>zG} zmy{;Gw9uq(?xVi@Proky6uFYxOXn0WID;@PjzukcRJ;*AIc0FntsTi@+R{t;qT}wl zvm@DCoI7PNoiF8@N+Dk?emU*v%f#G^&!U|d98ld007OzGg({Lx<5Z`nWJsp0OK}>N zC8$XquGT0@UtGO%oEmUxM0#>Ec7(=8(K%M2rSM^~W*(=H#m~*((d(kzc5&hcj=q7A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zrx*x;@{mG2r}I#DmvVhKh! -img_width: offset_x -= 1 - - self.setImage(image, offset_x = offset_x, offset_y = offset_y) + + self.setImage(image1, offset_x = offset_x, offset_y = offset_y) + + if offset_x + img_width < self.matrix.width: # if the image is ending + self.setImage(image2, offset_x = offset_x + img_width, offset_y = offset_y) + + time.sleep(self.delay) @@ -126,6 +133,7 @@ class StockTicker(): msg = getInput() if msg == 'K': self.resetMatrix() + kill = True break elif msg == 's': @@ -141,6 +149,9 @@ class StockTicker(): except KeyboardInterrupt: sys.stdout.flush() pass + + + if kill: break if current_img == 1: @@ -223,26 +234,6 @@ class StockTicker(): print('width:', im.size[0]) return new_im - - #Get current prices and day prices for the ticker then format the response into an array - def getStockPrices(self, symbols): - apiCalledError = False - stock_info = [] - try: - quotes = [self.finnhubClient.quote(symbol) for symbol in symbols] - current_prices = [quote['c'] for quote in quotes] - opening_prices = [quote['o'] for quote in quotes] - - for i, symbol in enumerate(symbols): - stock_info.append([symbol, current_prices[i], opening_prices[i]]) - - - except Exception as e: - print("Could not fetch data - API CALLS REACHED? - Will display old image") - print(e) - apiCalledError = True - return stock_info, apiCalledError - def resetMatrix(self): for x in range(self.matrix.width): for y in range(self.matrix.height): @@ -256,45 +247,53 @@ class StockTicker(): image_list = [] start = time.time() - stock_info, apiCalledError = self.getStockPrices(self.symbols) + self.readCSV() - if (apiCalledError == False): - for i in range(len(stock_info)): - change = float(stock_info[i][1])-float(stock_info[i][2]) #TEXT - ticker = stock_info[i][0] #TEXT - current = '%.2f' % float(stock_info[i][1]) #TEXT + + for i, symbol in enumerate(self.symbols): + info = self.stock_info[symbol] + + change = float(info[0])-float(info[1]) #TEXT + ticker = symbol #TEXT + current = '%.2f' % float(info[0]) #TEXT - logo = self.getLogo(stock_info[i][0]) - arrow, change = self.getArrow(change) - change = '%.2f' % change - midFrame = self.textToImage(ticker, current, change, arrow) #IMAGE THE TEXT + logo = self.getLogo(symbol) + arrow, change = self.getArrow(change) + change = '%.2f' % change + midFrame = self.textToImage(ticker, current, change, arrow) #IMAGE THE TEXT - stitchedStock = self.stitchImage([logo,midFrame]) - image_list.append(self.blank) - image_list.append(stitchedStock) + stitchedStock = self.stitchImage([logo,midFrame]) + image_list.append(self.blank) + image_list.append(stitchedStock) - - print('elapsed time loop ended: ' + str((time.time()-start))) - if (apiCalledError == False): - finalDisplayImage = self.stitchImage(image_list) - finalDisplayImage.save('final.ppm') - - + finalDisplayImage = self.stitchImage(image_list) + finalDisplayImage.save('final.ppm') + #Send the final stitched image to the display for set amount of time def displayMatrix(self): #os.system("sudo ./demo -D1 final.ppm -t " + str(displayTime) +" -m "+ str(speedDisplay) +" --led-gpio-mapping=adafruit-hat --led-rows=32 --led-cols=256") #os.system("sudo ./demo -D1 final.ppm -t " + str(self.displayTime) +" -m "+ str(self.speedDisplay) +" --led-gpio-mapping=adafruit-hat --led-rows=64 --led-cols=64 --led-slowdown-gpio=4 ") self.scrollImageTransition(['final.ppm', 'final.ppm'], offset_x = 0, offset_y = 0) - #Retrieve symbols from the CSV file - def getSymbols(self): + #Retrieve symbols and stock info from the csv file + def readCSV(self): self.symbols = [] - CSV = csv.reader(open('csv/tickers.csv', 'r')) + self.stock_info = {} + f = open('csv/tickers.csv', 'r') + CSV = csv.reader(f) for row in CSV: print(row) - self.symbols.append(row[0]) - + try: + symbol, current_price, opening_price = row + self.symbols.append(symbol) + self.stock_info[symbol] = [current_price, opening_price] + except: + symbol = row[0] + self.symbols.append(symbol) + self.stock_info[symbol] = [] + + f.close() print(self.symbols) @@ -337,9 +336,11 @@ if __name__ == '__main__': #print(sys.stdin.readlines()) stock_ticker = StockTicker() - stock_ticker.getSymbols() - #stock_ticker.getFullStockImage() - #stock_ticker.displayMatrix() + #t = time.time() + #api_caller = pexpect.spawn("sudo -E python3 api_caller.py") + #print('time to call api', time.time()-t) + stock_ticker.getFullStockImage() + stock_ticker.displayMatrix() while True: