From 749509902c7aa391118826adc4f0065dfa5f8d5f Mon Sep 17 00:00:00 2001 From: Fisch Date: Thu, 27 Dec 2018 14:51:09 +0100 Subject: [PATCH] change font and design --- lichtschranke/speedshow/bleeptrackline.png | Bin 0 -> 6140 bytes lichtschranke/speedshow/bleeptrackline.xcf | Bin 0 -> 15485 bytes lichtschranke/speedshow/speedshow.pde | 153 ++++++++++++++------- 3 files changed, 103 insertions(+), 50 deletions(-) create mode 100644 lichtschranke/speedshow/bleeptrackline.png create mode 100644 lichtschranke/speedshow/bleeptrackline.xcf diff --git a/lichtschranke/speedshow/bleeptrackline.png b/lichtschranke/speedshow/bleeptrackline.png new file mode 100644 index 0000000000000000000000000000000000000000..3637bb192bb5e067760be94482bbabe77e7af4a9 GIT binary patch literal 6140 zcmbVQcUTkM(hs3YC-h!Lq)3xDfCz|&E=544hmLd*>0Npk>Cy#h(nFIPKw4;0q=!Ti zA|y01fYdMVd++!Cb)WmkH~Z|)?(Cj3XU@!=J-f5JLa}xI?(N zxIsp^%DcY75Ez-Qjs^s9{r6GQQ<*`KP>>vODYl0R;)i_{f7wMXO^LgO#;kEf!Bch`GEil z6+3(5CsKywHv%ySk&tu-HCq+6+lH?{>n4y;^1er#3)o38&|2GYGGt^)9%fmxG2 zsnEE*j}Z_8nGMcar7dBfEbsUH23td?E|s zWM~Jplou0>_3Iv?CDS}}!7sj7qtmw>g&URbpNmt(Eju*amK{rM{p+LkLQ)XDQfBap9OleiK%NmmT!08}0LK zE_dN~;3QHsuQ z5soYdOvfH5lZ`Q3FFtaizZ20wu1G!eTq^&$YGQmmbw#-VTQxj0C6@OXtMv(F$KX|v z!Zw|8a714Mm=gFNgtka_wr0Sn)1E)^Te;*g%^_NQ01i?ntrhHg@q0D5XRUcHEaXZg z-h-5vyqHWPdPOm^xMngTKK^!9gO%fyD(W#pBR-e7Ak!CqEj8BuX|3X2c6k4O8N$iC zekhmUmKO7<;9#T~9Y*F^=9FCn)cEzoOUw%-r2$56W(8^br$yKvfG3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LsJVNDWSA4DZahCZX4J31;Z>daQ)YGt10p_;V zGI$y8NQN=loBb|+o9?XU+t=BC6|(!W!Ff1GI1C^3lmH5nwW0O3a?PqrAK@Hca(gPI z^<)y{eg=Iy;k$gNc5jpuQ?Ps750$DMSo5BZ_4l^77|{f(CfnHC6W1zaU3>dkN( zcnaG7YQ=&&ea6aEld1->&pr2b=;3FozVQ!O`_J&~zhbxl(jf0wC{hPsr;y!TLx{RjnU1DUK z16F68erOWQ3VLF|3Ief1*bdvEQGIVnUBgN0>j>YtZt;bZhy%lES!lrx(0|OxW?L=} z;qDDT`L%F(s&=|RWoSdFivF8MMYq`Y#`BGO*ZK(k{eLO_>DD!o4&pf{-_Np_ggQMy NOHB__|IqsN{{Vtlye9wv literal 0 HcmV?d00001 diff --git a/lichtschranke/speedshow/bleeptrackline.xcf b/lichtschranke/speedshow/bleeptrackline.xcf new file mode 100644 index 0000000000000000000000000000000000000000..a13e07d40b1f78572fc75ba74bce254e160289fa GIT binary patch literal 15485 zcmeHO34Bw>nVRECIsdV2Hssz5rXYEy)+YE%}X}-u~x3$p;YHZtrdk z^WMCf@0wgB|2y?POgv!uzzXsYh~L6s;WyEy!LBSJuitB5T+~3ky=mFH6V&dqNpeG1X)1mI)w;@ydV_(db)Yp zBgwKP4awkGuuQ3!vYta^j(SC8HOP9r5|z9dC9e!?a0ozN)@xvBgG6K{j0}x`c!M%Q ziN7eAaA-`SN&^y62YAUn3@#}3;s`!Z24qr(20)g|Ha29=i(W)f!N%P$qYdgEQU)Iq z_|U49d(oDF;qYE%f|Q=MvX_b;tO+oM!(?)7GC53UFP7oMOTV+`r3Fk701pL^Y)mw# zno_NAe=iJt>3zmvPS}yKb4Pq)`cEGQMEA1P#2twilOZ+D7@zv~bg=2x41+P=^z)Uo z!XJA%F)2RntsoFOv>|PW>Bo~<_3RzV@z%dV`%~XGB>rqN;W>`G#gj!TJ56s2ge*_n zVg4pCG^B?kZFpHAo)7GFJo^)a;amk6lgcQ_mPfAExh6T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^RNdj7)sv*!hWH>`(qXD*JvD3x9;4Jnl_o&$yST-LN5^!(^EwgGc41lr%8BE8}pepElbQ~w<5BqXG>YxQPWriBqC~z z333m1g`V;qJEc1%9XoX_^qBPFu_M!tNT<%6)}E%PPMgkQ+@=B$reKVv_^|BCyS@5oW%C_QrY$iaKylmMsS zkAtxveouIh9)9oe!NbB~@!;Wu2j4xYIXHCq;DLh&7^DbDG%u8h`%3oh*>_ZP)OQ%2 zNQaLe4m<2Scvy3I=)J@59Db+d9pN3ZzsW#riK#3t~U(fXna+GPL%)&&`^sC2zr}5yzb%aiQBuTyQ9vgR5w9TvU`_#1)CVah)gs zUQmU@Q2V%j?*04r?AceWv_a7Zy9y-YDo|m5Ay+7}D?z(hTbQ-IB_mMz3@X1U9~XqU ze6cWpSN<-XqXEhj*ii2y+F?d$xQXfkJqf>biQ_U!9Bw%Oq0?_<>;FEy6mgmrMCt6; zS*Ymj{|ZvW%vYJz5`Sm+u~m6fsQSMlImfU6=cgvARzhk@!Aq)@fZwq( zsqW#|r@oEbkUHw7x6_-p#T5? literal 0 HcmV?d00001 diff --git a/lichtschranke/speedshow/speedshow.pde b/lichtschranke/speedshow/speedshow.pde index 3d3a242..0b7147f 100644 --- a/lichtschranke/speedshow/speedshow.pde +++ b/lichtschranke/speedshow/speedshow.pde @@ -3,15 +3,21 @@ import java.io.FileWriter; import java.io.*; import java.util.*; +PFont fontregular; + +PImage image_line; + Serial myPort; String val = "0.0"; -int speeds_show=5; +int speeds_show=10; float[] speeds=new float[speeds_show]; int speeds_index=0; //points to next array index float speedfloat=0; +float triggerspeedmin=15; //current triggerspeed + Date d=new Date(); PrintWriter pw; @@ -19,13 +25,36 @@ PrintWriter pw; int unitdisplay=0; int unitdisplay_count=9; //how much different units available + +int xtextstart=10; + void setup() { - size(1500, 1000); + size(800, 600); frameRate(30); - String portName = "COM5"; + + fontregular=createFont("Montserrat-Regular.ttf",32); + textFont(fontregular); + + image_line= loadImage("bleeptrackline.png"); + + //String portName = "COM5"; //String portName = "/dev/ttyUSB0"; + int useportID=-1; + println("Serialports:"); + for(int i=0;i 0) { - val = myPort.readString(); - print("val = " + val); - val = val.substring(0,val.length()-1); + String sread = myPort.readString(); + println("serialRead: " + sread); + if (sread.length()>=7 && sread.substring(0,6).equals("speed=")){ //new speed measurement + val = sread.substring(6,sread.length()-1); - speedfloat=float(val); - - speeds[speeds_index]=speedfloat; - speeds_index++; - speeds_index%=speeds_show; - - - println(d.getTime()+";"+speedfloat); - pw.println(d.getTime()+";"+speedfloat); - pw.flush(); - - unitdisplay=int(random(0,unitdisplay_count)); - unitdisplay=1; - println("unitdisplay: "+unitdisplay); + speedfloat=float(val); + + speeds[speeds_index]=speedfloat; + speeds_index++; + speeds_index%=speeds_show; + + + println(d.getTime()+";"+speedfloat); + pw.println(d.getTime()+";"+speedfloat); + pw.flush(); + + unitdisplay=int(random(0,unitdisplay_count)); + unitdisplay=1; + println("unitdisplay: "+unitdisplay); + + triggerspeedmin=getTimesPercentile(0.8); + //triggerspeedmin=getTimesMax(); + sendSpeedTrapValue(int(triggerspeedmin)); + + } } background(0); - fill(255); + fill(0,132,176); - textSize(150); + textSize(100); + + int xtext=xtextstart; + int ytext=100; switch(unitdisplay){ case 0: - text(nf(speedfloat,1,2) + " km/h" , 100, 200); + text(nf(speedfloat,1,2) + " km/h" , xtext, ytext); break; case 1: - text(nf(speedfloat*0.621371,1,2) + " mph" , 100, 200); + text(nf(speedfloat*0.621371,1,2) + " mph" , xtext, ytext); break; case 2: - text(nf(speedfloat*0.000809848,1,6) + " Mach" , 100, 200); + text(nf(speedfloat*0.000809848,1,6) + " Mach" , xtext, ytext); break; case 3: - text(nf(speedfloat*0.911344,1,2) + " ft/s" , 100, 200); + text(nf(speedfloat*0.911344,1,2) + " ft/s" , xtext, ytext); break; case 4: - text(nf(speedfloat*0.277778,1,2) + " m/s" , 100, 200); + text(nf(speedfloat*0.277778,1,2) + " m/s" , xtext, ytext); break; case 5: - text(nf(speedfloat*0.539957,1,2) + " knots" , 100, 200); + text(nf(speedfloat*0.539957,1,2) + " knots" , xtext, ytext); break; case 6: - text(nf(speedfloat*1079000000,1,0) + " c" , 100, 200); + text(nf(speedfloat*1079000000,1,0) + " c" , xtext, ytext); break; case 7: - text(nf(speedfloat*54.67469,1,0) + " ft/min" , 100, 200); + text(nf(speedfloat*54.67469,1,0) + " ft/min" , xtext, ytext); break; case 8: - text(nf(pow((speedfloat*0.277778/0.836), 2.0/3),1,0) + " Bft" , 100, 200); + text(nf(pow((speedfloat*0.277778/0.836), 2.0/3),1,0) + " Bft" , xtext, ytext); break; - - - - - - - - - - - - } + //Line + image(image_line, 10, 100); - textSize(80); - //println(); - int ipos=1; + + + int reducesizefactor=40; + int lastytextpos=200; for (int i=speeds_show;i>0;i--){ - ipos++; - text( nf(speeds[(speeds_show+speeds_index-1+i)%speeds_show], 1,2) + "km/h", 100, 250+(ipos)*80); + float colorpercentage=i*1.0/speeds_show; + fill(0,132*colorpercentage+163*(1-colorpercentage),176*colorpercentage+86*(1-colorpercentage)); + textSize(50-(1-colorpercentage)*reducesizefactor); + text( nf(speeds[(speeds_show+speeds_index-1+i)%speeds_show], 1,2) + " km/h", xtextstart, lastytextpos); + lastytextpos+=50-(1-colorpercentage)*reducesizefactor; - //print(speeds[i]); - //print(","); } + textSize(40); + text( "speed trap: "+nf(triggerspeedmin,1,1) +" km/h", 10, height-50); + +} + +float getTimesMax(){ + float speedmax=0; + for (int i=0;i