Real Time data and Json File
-
@JonB actually, ı know, i created it with hand, but my question is we have something like
#define TM_AP_ID 0 #define TM_AP_durum 1 #define TM_AP_hava_hizi 2 #define TM_AP_IMU_pitch 3 #define TM_AP_IMU_roll 4 #define TM_AP_IMU_yaw 5 #define TM_AP_IMU_barometre 6 #define TM_AP_rpm 7
and in my code, i will do some operations like
imu[TM_IMU_pitch].f
The issue is, that definitions should be in json, and i will call them from my json
@suslucoder said in Real Time data and Json File:
The issue is, that definitions should be in json, and i will call them from my json
What definitions? You can't call anything from JSON. JSON is just a data format. Please be more precise when asking...
-
@suslucoder said in Real Time data and Json File:
The issue is, that definitions should be in json, and i will call them from my json
What definitions? You can't call anything from JSON. JSON is just a data format. Please be more precise when asking...
im talking about them
#define TM_AP_ID 0 #define TM_AP_durum 1 #define TM_AP_hava_hizi 2 #define TM_AP_IMU_pitch 3 #define TM_AP_IMU_roll 4 #define TM_AP_IMU_yaw 5 #define TM_AP_IMU_barometre 6 #define TM_AP_rpm 7
-
@suslucoder said in Real Time data and Json File:
The issue is, that definitions should be in json, and i will call them from my json
What definitions? You can't call anything from JSON. JSON is just a data format. Please be more precise when asking...
@jsulm said in Real Time data and Json File:
You can't call anything from JSON. JSON is just a data format.
Hmm, so im just read json and write json. I cant do anything apart from these
-
@jsulm said in Real Time data and Json File:
You can't call anything from JSON. JSON is just a data format.
Hmm, so im just read json and write json. I cant do anything apart from these
@suslucoder said in Real Time data and Json File:
I cant do anything apart from these
I can not follow you, what did you expect to do?
Do you know what JSON is? ==> https://en.wikipedia.org/wiki/JSON -
im talking about them
#define TM_AP_ID 0 #define TM_AP_durum 1 #define TM_AP_hava_hizi 2 #define TM_AP_IMU_pitch 3 #define TM_AP_IMU_roll 4 #define TM_AP_IMU_yaw 5 #define TM_AP_IMU_barometre 6 #define TM_AP_rpm 7
@suslucoder said in Real Time data and Json File:
im talking about them
So, all these definitions should be defined in your JSON? Then do so. Define them there, read and use the values.
-
@suslucoder said in Real Time data and Json File:
im talking about them
So, all these definitions should be defined in your JSON? Then do so. Define them there, read and use the values.
@jsulm I defined it in json.
I want to do that: Here is an example of my json{ "GPS":[ { "GPS ID":[ "integer", "0" ], "GPS Mod":[ "integer", "1" ], "GPS Utc":[ "float", "2" ], "GPS Latitude":[ "float", "3" ] }
If, Gps id has integer, assign gps[TM_GPS_ID].i
if Gps latitude has float assign gps[TM_GPS_lat].f
-
@jsulm I defined it in json.
I want to do that: Here is an example of my json{ "GPS":[ { "GPS ID":[ "integer", "0" ], "GPS Mod":[ "integer", "1" ], "GPS Utc":[ "float", "2" ], "GPS Latitude":[ "float", "3" ] }
If, Gps id has integer, assign gps[TM_GPS_ID].i
if Gps latitude has float assign gps[TM_GPS_lat].f
@suslucoder
So algorithmically you will want something like:if "GPS" object has "GPS ID" array if "GPS ID" array[0] == "integer" gps[TM_GPS_ID].i = "GPS ID" array[1].toInt() if "GPS" object has "GPS Latitude" array if "GPS Latitude" array[0] == "float" gps[TM_GPS_lat].f = "GPS Latitude" array[1].toFloat()
-
@suslucoder
So algorithmically you will want something like:if "GPS" object has "GPS ID" array if "GPS ID" array[0] == "integer" gps[TM_GPS_ID].i = "GPS ID" array[1].toInt() if "GPS" object has "GPS Latitude" array if "GPS Latitude" array[0] == "float" gps[TM_GPS_lat].f = "GPS Latitude" array[1].toFloat()
@JonB Let me edit it like
if "GPS" object has arrays contains "float" gps[TM_GPS_lat].f == "GPS ID" array[1].toInt() gps[TM_GPS_lat].f == "GPS ID" array[1].toInt() if "GPS " object has arrays contains "integer" gps[TM_GPS_ID].i = "GPS ID" array[1].toInt()
gps[TM_GPS_lat].f ``` this f refers to float
gps[TM_GPS_ID].i ``` this i refers to int
-
@JonB Let me edit it like
if "GPS" object has arrays contains "float" gps[TM_GPS_lat].f == "GPS ID" array[1].toInt() gps[TM_GPS_lat].f == "GPS ID" array[1].toInt() if "GPS " object has arrays contains "integer" gps[TM_GPS_ID].i = "GPS ID" array[1].toInt()
gps[TM_GPS_lat].f ``` this f refers to float
gps[TM_GPS_ID].i ``` this i refers to int
@suslucoder said in Real Time data and Json File:
if "GPS" object has arrays contains "float"
if "GPS " object has arrays contains "integer"
So implement exactly these tests. Someone has even typed in code for you in your stackoverflow post. I don't know what else to say.
-
@suslucoder said in Real Time data and Json File:
if "GPS" object has arrays contains "float"
if "GPS " object has arrays contains "integer"
So implement exactly these tests. Someone has even typed in code for you in your stackoverflow post. I don't know what else to say.
@JonB okey thank you. And you found me in every where...