Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qjs-wrapper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
qjs-wrapper
Commits
2a2d821d
Commit
2a2d821d
authored
Mar 07, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename x, y, z into latitude, longitude, altitude
parent
1a387ecc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
include/pubsub.h
include/pubsub.h
+3
-3
qjs_wrapper.c
qjs_wrapper.c
+10
-10
No files found.
include/pubsub.h
View file @
2a2d821d
...
@@ -32,9 +32,9 @@ typedef struct {
...
@@ -32,9 +32,9 @@ typedef struct {
}
JSDroneData
;
}
JSDroneData
;
typedef
struct
{
typedef
struct
{
UA_Double
x
;
UA_Double
latitude
;
UA_Double
y
;
UA_Double
longitude
;
UA_Double
z
;
UA_Double
altitude
;
UA_Int64
timestamp
;
UA_Int64
timestamp
;
}
JSPositionData
;
}
JSPositionData
;
...
...
qjs_wrapper.c
View file @
2a2d821d
...
@@ -158,10 +158,10 @@ static JSValue js_new_position(JSContext *ctx, JSValueConst thisVal,
...
@@ -158,10 +158,10 @@ static JSValue js_new_position(JSContext *ctx, JSValueConst thisVal,
return
JS_EXCEPTION
;
return
JS_EXCEPTION
;
}
}
newPositionArray
=
getPositionArray
();
newPositionArray
=
getPositionArray
();
s
->
x
=
(
double
)
newP
ositionArray
[
LATITUDE
]
/
1e7
;
s
->
latitude
=
(
double
)
p
ositionArray
[
LATITUDE
]
/
1e7
;
s
->
y
=
(
double
)
newP
ositionArray
[
LONGITUDE
]
/
1e7
;
s
->
longitude
=
(
double
)
p
ositionArray
[
LONGITUDE
]
/
1e7
;
s
->
z
=
(
UA_Double
)(
newP
ositionArray
[
REL_ALTITUDE
]
/
1000
);
s
->
altitude
=
(
UA_Double
)(
p
ositionArray
[
REL_ALTITUDE
]
/
1000
);
s
->
timestamp
=
newP
ositionArray
[
TIMESTAMP
];
s
->
timestamp
=
p
ositionArray
[
TIMESTAMP
];
JS_SetOpaque
(
obj
,
s
);
JS_SetOpaque
(
obj
,
s
);
free
(
newPositionArray
);
free
(
newPositionArray
);
return
obj
;
return
obj
;
...
@@ -175,11 +175,11 @@ static JSValue js_position_get(JSContext *ctx, JSValueConst thisVal, int magic)
...
@@ -175,11 +175,11 @@ static JSValue js_position_get(JSContext *ctx, JSValueConst thisVal, int magic)
return
JS_EXCEPTION
;
return
JS_EXCEPTION
;
switch
(
magic
)
{
switch
(
magic
)
{
case
0
:
case
0
:
return
JS_NewFloat64
(
ctx
,
s
->
x
);
return
JS_NewFloat64
(
ctx
,
s
->
latitude
);
case
1
:
case
1
:
return
JS_NewFloat64
(
ctx
,
s
->
y
);
return
JS_NewFloat64
(
ctx
,
s
->
longitude
);
case
2
:
case
2
:
return
JS_NewFloat64
(
ctx
,
s
->
z
);
return
JS_NewFloat64
(
ctx
,
s
->
altitude
);
case
3
:
case
3
:
return
JS_NewInt64
(
ctx
,
s
->
timestamp
);
return
JS_NewInt64
(
ctx
,
s
->
timestamp
);
default:
default:
...
@@ -193,9 +193,9 @@ static JSClassDef jsPositionClass = {
...
@@ -193,9 +193,9 @@ static JSClassDef jsPositionClass = {
};
};
static
const
JSCFunctionListEntry
js_position_proto_funcs
[]
=
{
static
const
JSCFunctionListEntry
js_position_proto_funcs
[]
=
{
JS_CGETSET_MAGIC_DEF
(
"
x
"
,
js_position_get
,
NULL
,
0
),
JS_CGETSET_MAGIC_DEF
(
"
latitude
"
,
js_position_get
,
NULL
,
0
),
JS_CGETSET_MAGIC_DEF
(
"
y
"
,
js_position_get
,
NULL
,
1
),
JS_CGETSET_MAGIC_DEF
(
"
longitude
"
,
js_position_get
,
NULL
,
1
),
JS_CGETSET_MAGIC_DEF
(
"
z
"
,
js_position_get
,
NULL
,
2
),
JS_CGETSET_MAGIC_DEF
(
"
altitude
"
,
js_position_get
,
NULL
,
2
),
JS_CGETSET_MAGIC_DEF
(
"timestamp"
,
js_position_get
,
NULL
,
3
),
JS_CGETSET_MAGIC_DEF
(
"timestamp"
,
js_position_get
,
NULL
,
3
),
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment