professional speed fix

This commit is contained in:
Neythen Treloar 2022-03-07 16:47:07 +00:00
parent 34c8cba062
commit f99dbc3824
4 changed files with 46 additions and 21 deletions

View File

@ -562,6 +562,7 @@ def save_trade_settings(input_settings):
f.close()
current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower()
current_settings['animation'] = input_settings['animation'].lower()
current_settings['percent'] = input_settings['percent']
current_settings['point'] = input_settings['point']
@ -599,6 +600,7 @@ def save_weather_settings(input_settings):
current_settings = json.load(open('csv/' + filename, 'r'))
current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower()
current_settings['animation'] = input_settings['animation'].lower()
current_settings['temp'] = input_settings['temp'].lower()
current_settings['wind_speed'] = input_settings['wind_speed'].lower()
@ -638,6 +640,7 @@ def save_news_settings(input_settings):
print(current_settings)
current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower()
current_settings['animation'] = input_settings['animation'].lower()
current_settings['title'] = input_settings['title']
current_settings['category'] = input_settings['category']
@ -678,6 +681,7 @@ def save_sports_settings(input_settings):
current_settings = json.load(open('csv/' + filename, 'r'))
current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower()
current_settings['animation'] = input_settings['animation'].lower()
current_settings['title'] = input_settings['title']
current_settings['feature'] = input_settings['feature']
@ -706,6 +710,7 @@ def save_image_settings(input_settings):
current_settings = input_settings
current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower()
current_settings['animation'] = input_settings['animation'].lower()

File diff suppressed because one or more lines are too long

View File

@ -1002,10 +1002,20 @@ function getFeatureSettings() {
let page = document.getElementById(pageSelector);
// these common to all settings
let speed = getSelected(page.querySelectorAll(".speed-select")[0]);
let speeds = page.querySelectorAll(".speed-select");
var speed;
var speed2;
speed = getSelected(speeds[0]);
if (speeds.length == 2) {
speed2 = getSelected(page.querySelectorAll(".speed-select")[1]);
} else {
speed2 = "Medium";
}
let animation = getSelected(page.querySelectorAll(".animation-select")[0]);
var settings = { feature: feature, speed: speed, animation: animation }; // general settings
var settings = { feature: feature, speed: speed, speed2: speed2, animation: animation }; // general settings
var s;
//function specific settings

View File

@ -470,7 +470,11 @@ class StockTicker():
animation1 = settings1['animation'].lower()
settings2 = json.load(open(self.JSONs[bottom[i2 % len(bottom)] ]))
delay_t2 = self.set_delay(settings2['speed'])
try:
delay_t2 = self.set_delay(settings2['speed2'])
except:
delay_t2 = self.set_delay(settings2['speed'])
animation2 = settings2['animation'].lower()
if animation1 == 'continuous':
@ -524,7 +528,10 @@ class StockTicker():
if offset_x2 < -(img_width2+1):
i2 += 1
settings2 = json.load(open(self.JSONs[bottom[(i2) % len(bottom)]]))
delay_t2 = self.set_delay(settings2['speed'])
try:
delay_t2 = self.set_delay(settings2['speed2'])
except:
delay_t2 = self.set_delay(settings2['speed'])
animation2 = settings2['animation'].lower()
if animation2 == 'continuous':
@ -539,7 +546,7 @@ class StockTicker():
update_process.terminate()
update_process = Process(target = self.updateMultiple, args = ([bottom[i2 % len(bottom)]+ ' Prof'],))
update_process.start()
image2 = self.openImage('./display_images/' + bottom[(i2+1) % len(bottom)] +' Prof.ppm')
image2 = self.openImage('./display_images/' + bottom[i2 % len(bottom)] +' Prof.ppm')
image2 = image2.convert('RGB')
img_width2, img_height2 = image2.size
@ -1130,7 +1137,7 @@ class StockTicker():
return finalDisplayImage
def getForexProfessional(self):
print('forex prof')
self.blank = Image.new('RGB', (0, 16))
f = open('csv/forex_settings.json', 'r')
all_forex_settings = json.load(f)
@ -1201,6 +1208,8 @@ class StockTicker():
image_list.append(self.blank)
except Exception as e:
print(e)
raise e
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
self.logf.write(str(e))
@ -2760,7 +2769,7 @@ if __name__ == '__main__':
#stock_ticker.process_msg('-')
#stock_ticker.process_msg('W')
#stock_ticker.process_msg('A')
stock_ticker.process_msg('A')
@ -2768,7 +2777,8 @@ if __name__ == '__main__':
msg = getInput()
stock_ticker.process_msg(msg)
except Exception as e:
print(e)
raise e
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
log.write(str(e))