[Frage] Windstärkedaten von km/h in Bft ummwandeln und visualisieren

Diskussionen über Zeitserien, Logging und Auswertung mit Grafana

Ersteller
adimaster
Reactions:
Beiträge: 54
Registriert: So Apr 14, 2019 11:12 am
Hat sich bedankt: 35 Mal
Danksagung erhalten: 33 Mal

#11

Beitrag von adimaster »

Also, ich habe es mittels LUT erst mal gelöst und das funktioniert schon mal ganz gut :dance:.

KmhToBft_Example.PNG
Heute ist es eher windstill ;).

Anbei findet Ihr den Code für die Custom Logik --> evtl. sollte dieser Thread verschoben werden...

Code: Alles auswählen

/**
 * km/h to Bft calculation via Look-Up Table
 *
 * Input: Value in [km/h]
 * Output: Value in [Bft]
 * 
 * uses Multiplexer-Function
 */

{
  "_Meta": { // Optional
    "Description": "kmh to Bft calculation",
    "Version": "1.00",
    "Icon": "" // format: "data:image/svg+xml;base64,ENCODED_FILE"
  },
  "Input": [
      ["v_Wind_kmh","wind force in km/h","$wind_force_kmh_In","c"]
  ],
  "Output": [
      ["v_Wind_Bft","wind force in Bft","$wind_force_bft_Out","c"]
  ],
  "Level": [
      ["$wind_force_kmh_In","float",0.0],
	  ["$0kmh","integer",0],
      ["$1kmh","integer",0],
      ["$2kmh","integer",1],
      ["$3kmh","integer",1],
      ["$4kmh","integer",1],
      ["$5kmh","integer",1],
      ["$6kmh","integer",2],
      ["$7kmh","integer",2],
      ["$8kmh","integer",2],
      ["$9kmh","integer",2],
      ["$10kmh","integer",2],
      ["$11kmh","integer",2],
      ["$12kmh","integer",3],
      ["$13kmh","integer",3],
      ["$14kmh","integer",3],
      ["$15kmh","integer",3],
      ["$16kmh","integer",3],
      ["$17kmh","integer",3],
      ["$18kmh","integer",3],
      ["$19kmh","integer",3],
      ["$20kmh","integer",4],
      ["$21kmh","integer",4],
      ["$22kmh","integer",4],
      ["$23kmh","integer",4],
      ["$24kmh","integer",4],
      ["$25kmh","integer",4],
      ["$26kmh","integer",4],
      ["$27kmh","integer",4],
      ["$28kmh","integer",4],
      ["$29kmh","integer",5],
      ["$30kmh","integer",5],
      ["$31kmh","integer",5],
      ["$32kmh","integer",5],
      ["$33kmh","integer",5],
      ["$34kmh","integer",5],
      ["$35kmh","integer",5],
      ["$36kmh","integer",5],
      ["$37kmh","integer",5],
      ["$38kmh","integer",5],
      ["$39kmh","integer",6],
      ["$40kmh","integer",6],
      ["$41kmh","integer",6],
      ["$42kmh","integer",6],
      ["$43kmh","integer",6],
      ["$44kmh","integer",6],
      ["$45kmh","integer",6],
      ["$46kmh","integer",6],
      ["$47kmh","integer",6],
      ["$48kmh","integer",6],
      ["$49kmh","integer",6],
      ["$50kmh","integer",7],
      ["$51kmh","integer",7],
      ["$52kmh","integer",7],
      ["$53kmh","integer",7],
      ["$54kmh","integer",7],
      ["$55kmh","integer",7],
      ["$56kmh","integer",7],
      ["$57kmh","integer",7],
      ["$58kmh","integer",7],
      ["$59kmh","integer",7],
      ["$60kmh","integer",7],
      ["$61kmh","integer",7],
      ["$62kmh","integer",8],
      ["$63kmh","integer",8],
      ["$64kmh","integer",8],
      ["$65kmh","integer",8],
      ["$66kmh","integer",8],
      ["$67kmh","integer",8],
      ["$68kmh","integer",8],
      ["$69kmh","integer",8],
      ["$70kmh","integer",8],
      ["$71kmh","integer",8],
      ["$72kmh","integer",8],
      ["$73kmh","integer",8],
      ["$74kmh","integer",8],
      ["$75kmh","integer",9],
      ["$76kmh","integer",9],
      ["$77kmh","integer",9],
      ["$78kmh","integer",9],
      ["$79kmh","integer",9],
      ["$80kmh","integer",9],
      ["$81kmh","integer",9],
      ["$82kmh","integer",9],
      ["$83kmh","integer",9],
      ["$84kmh","integer",9],
      ["$85kmh","integer",9],
      ["$86kmh","integer",9],
      ["$87kmh","integer",9],
      ["$88kmh","integer",9],
      ["$89kmh","integer",10],
      ["$90kmh","integer",10],
      ["$91kmh","integer",10],
      ["$92kmh","integer",10],
      ["$93kmh","integer",10],
      ["$94kmh","integer",10],
      ["$95kmh","integer",10],
      ["$96kmh","integer",10],
      ["$97kmh","integer",10],
      ["$98kmh","integer",10],
      ["$99kmh","integer",10],
      ["$100kmh","integer",10],
      ["$101kmh","integer",10],
      ["$102kmh","integer",10],
      ["$103kmh","integer",11],
      ["$104kmh","integer",11],
      ["$105kmh","integer",11],
      ["$106kmh","integer",11],
      ["$107kmh","integer",11],
      ["$108kmh","integer",11],
      ["$109kmh","integer",11],
      ["$110kmh","integer",11],
      ["$111kmh","integer",11],
      ["$112kmh","integer",11],
      ["$113kmh","integer",11],
      ["$114kmh","integer",11],
      ["$115kmh","integer",11],
      ["$116kmh","integer",11],
      ["$117kmh","integer",11],
      ["$118kmh","integer",12],
      ["$wind_force_bft_Out","integer",0]
  ],
  "Module": [
      ["Multiplexer",
        [
            "$0kmh", "$1kmh", "$2kmh", "$3kmh", "$4kmh", "$5kmh", "$6kmh", "$7kmh", "$8kmh", "$9kmh", "$10kmh", "$11kmh", "$12kmh", "$13kmh", "$14kmh", "$15kmh", "$16kmh", "$17kmh", "$18kmh", "$19kmh", "$20kmh", "$21kmh", "$22kmh", "$23kmh", "$24kmh", "$25kmh", "$26kmh", "$27kmh", "$28kmh", "$29kmh", "$30kmh", "$31kmh", "$32kmh", "$33kmh", "$34kmh", "$35kmh", "$36kmh", "$37kmh", "$38kmh", "$39kmh", "$40kmh", "$41kmh", "$42kmh", "$43kmh", "$44kmh", "$45kmh", "$46kmh", "$47kmh", "$48kmh", "$49kmh", "$50kmh", "$51kmh", "$52kmh", "$53kmh", "$54kmh", "$55kmh", "$56kmh", "$57kmh", "$58kmh", "$59kmh", "$60kmh", "$61kmh", "$62kmh", "$63kmh", "$64kmh", "$65kmh", "$66kmh", "$67kmh", "$68kmh", "$69kmh", "$70kmh", "$71kmh", "$72kmh", "$73kmh", "$74kmh", "$75kmh", "$76kmh", "$77kmh", "$78kmh", "$79kmh", "$80kmh", "$81kmh", "$82kmh", "$83kmh", "$84kmh", "$85kmh", "$86kmh", "$87kmh", "$88kmh", "$89kmh", "$90kmh", "$91kmh", "$92kmh", "$93kmh", "$94kmh", "$95kmh", "$96kmh", "$97kmh", "$98kmh", "$99kmh", "$100kmh", "$101kmh", "$102kmh", "$103kmh", "$104kmh", "$105kmh", "$106kmh", "$107kmh", "$108kmh", "$109kmh", "$110kmh", "$111kmh", "$112kmh", "$113kmh", "$114kmh", "$115kmh", "$116kmh", "$117kmh", "$118kmh"
        ],
      "$wind_force_bft_Out",
      "$wind_force_kmh_In"]
  ]
}
StefanW hat geschrieben:
Mo Jun 01, 2020 10:03 am
adimaster hat geschrieben:
Mo Jun 01, 2020 12:32 am
Sind die Mathe-Operationen bereits zeitlich eingeplant?
Ja. Mit der geplanten Version V 2.0 (Sommer 2020)
Sobald diese verfügbar sind, werde ich den Code mal entschlacken :).

Viel Spaß damit!
Bei dem windstillen Wetter gehe ich jetzt mal grillen 8-).

Grüße
Adi
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
TWS 2600 ID: 331, VPN geschlossen, Reboot nach Rücksprache


Robert_Mini
Reactions:
Beiträge: 2369
Registriert: So Aug 12, 2018 8:44 am
Hat sich bedankt: 591 Mal
Danksagung erhalten: 1068 Mal

#12

Beitrag von Robert_Mini »

Hallo Adi!

Du hättest das heute auch schon mit einem Einzeiler haben können!
Schau in der KB mal nach “interpolate” :o ;)

Lg
Robert
Timberwolf Server 2500 / #117 (VPN offen + reboot nach Rückfrage) / Wiregate-Fan


Ersteller
adimaster
Reactions:
Beiträge: 54
Registriert: So Apr 14, 2019 11:12 am
Hat sich bedankt: 35 Mal
Danksagung erhalten: 33 Mal

#13

Beitrag von adimaster »

Danke für den Tipp, @Robert_Mini!

Schaue ich mir später mal an.

Der Mehrzeiler ist quasi automatisch aus Excel entstanden 😅.
Aber je smarter der Code desto besser.
TWS 2600 ID: 331, VPN geschlossen, Reboot nach Rücksprache

Antworten

Zurück zu „Zeitserien, Logging & Grafana“