Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
B
Backpack-gui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sarvin Taba
Backpack-gui
Commits
0fa8f5e2
Commit
0fa8f5e2
authored
Nov 12, 2021
by
Sarvin Taba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api zip file added
parent
b5b455db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
23 deletions
+42
-23
api.zip
api.zip
+0
-0
GeneralStatus.js
src/components/GeneralStatus.js
+39
-2
Gps.js
src/components/UIElements/Gps.js
+2
-14
Imu.js
src/components/UIElements/Imu.js
+1
-1
index.css
src/index.css
+0
-6
No files found.
api.zip
0 → 100644
View file @
0fa8f5e2
File added
src/components/GeneralStatus.js
View file @
0fa8f5e2
import
React
,
{
useState
}
from
"
react
"
;
import
Axios
from
"
axios
"
;
const
GeneralStatus
=
()
=>
{
const
[
newDatasetBtn
,
setNewDatasetBtn
]
=
useState
(
true
);
const
[
captueBtn
,
setCaptureBtn
]
=
useState
(
"
Start Capture
"
);
const
[
gpsBtn
,
setGpsBtn
]
=
useState
(
"
Start Gps
"
);
const
[
imuBtn
,
setImuBtn
]
=
useState
(
"
Start Imu
"
);
const
[
datasetName
,
setDatasetName
]
=
useState
(
"
dataset 1
"
);
const
onNewDataSet
=
()
=>
{
Axios
({
method
:
"
GET
"
,
withCredentials
:
true
,
url
:
process
.
env
.
REACT_APP_BACKEND_URL
+
"
/dataset/start
"
,
}).
then
(
async
(
res
)
=>
{
console
.
log
(
"
********************
"
);
// update dataset name
setDatasetName
(
res
)
});
setNewDatasetBtn
(
false
);
};
const
onCaptureBtnClick
=
()
=>
{
Axios
({
method
:
"
GET
"
,
withCredentials
:
true
,
url
:
process
.
env
.
REACT_APP_BACKEND_URL
+
"
/camera/start
"
,
}).
then
(
async
(
res
)
=>
{
console
.
log
(
"
********************
"
);
});
if
(
captueBtn
===
"
Start Capture
"
)
{
setCaptureBtn
(
"
End Capture
"
);
}
...
...
@@ -20,6 +41,14 @@ const GeneralStatus = () => {
};
const
onGpsBtnClick
=
()
=>
{
Axios
({
method
:
"
GET
"
,
withCredentials
:
true
,
url
:
process
.
env
.
REACT_APP_BACKEND_URL
+
"
/gps/start
"
,
}).
then
(
async
(
res
)
=>
{
console
.
log
(
"
********************
"
);
});
if
(
gpsBtn
===
"
Start Gps
"
){
setGpsBtn
(
"
End Gps
"
);
}
...
...
@@ -30,6 +59,14 @@ const GeneralStatus = () => {
const
onImuBtnClick
=
()
=>
{
Axios
({
method
:
"
GET
"
,
withCredentials
:
true
,
url
:
process
.
env
.
REACT_APP_BACKEND_URL
+
"
/imu/start
"
,
}).
then
(
async
(
res
)
=>
{
console
.
log
(
"
********************
"
);
});
if
(
imuBtn
===
"
Start Imu
"
)
{
setImuBtn
(
"
End Imu
"
);
...
...
@@ -49,10 +86,10 @@ const GeneralStatus = () => {
className
=
"
btn btn-primary btn-block
"
onClick
=
{
onNewDataSet
}
>
New
Dataset
a
New
Dataset
<
/button
>
<
/div
>
<
div
className
=
"
col-6 px-1 my-1
"
>
DataSetName
<
/div
>
<
div
className
=
"
col-6 px-1 my-1
"
>
{
datasetName
}
<
/div
>
<
div
className
=
"
col-6 px-1 my-1
"
>
<
button
className
=
"
btn btn-primary btn-block
"
...
...
src/components/UIElements/Gps.js
View file @
0fa8f5e2
import
Axios
from
"
axios
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useState
}
from
"
react
"
;
const
lockDic
=
[{
key
:
1
,
value
:
"
value1
"
},
{
key
:
2
,
value
:
"
value2
"
}];
const
Gps
=
({
socket
})
=>
{
...
...
@@ -11,21 +11,9 @@ const Gps = ({socket}) => {
setGpsData
(
res
);
})
// useEffect(() => {
// Axios({
// method: "GET",
// withCredentials: true,
// url: process.env.REACT_APP_BACKEND_URL + "/gpsInfo",
// }).then(async (res) => {
// console.log("********************");
// setGpsData(res.data);
// console.log(res.data);
// // console.log(lockDic.find((x)=> x.key === gpsData.lock ).value)
// });
// }, [newGpsData]);
return
(
<
div
className
=
{
"
border
p-1 rounded pb-3 border-thicker
"
+
(
gpsData
.
connection
?
"
border-success
"
:
"
border-danger
"
)
}
>
<
div
className
=
{
"
border
border-2 p-1 rounded pb-3
"
+
(
gpsData
.
connection
?
"
border-success
"
:
"
border-danger
"
)
}
>
<
h6
>
GPS
<
/h6
>
<
div
>
<
div
className
=
"
col-6 float-left text-right bold
"
>
Status
:
<
/div
>
...
...
src/components/UIElements/Imu.js
View file @
0fa8f5e2
...
...
@@ -23,7 +23,7 @@ const Imu = ({socket}) => {
// }, [newImuData]);
return
(
<
div
className
=
{
"
border p-1 rounded pb-3 border-
thicker
"
+
(
imuData
.
connection
?
"
border-success
"
:
"
border-danger
"
)
}
>
<
div
className
=
{
"
border p-1 rounded pb-3 border-
2
"
+
(
imuData
.
connection
?
"
border-success
"
:
"
border-danger
"
)
}
>
<
h6
>
IMU
<
/h6
>
<
div
>
<
div
className
=
"
col-4 float-left text-right bold
"
>
X
:
<
/div
>
...
...
src/index.css
View file @
0fa8f5e2
...
...
@@ -15,9 +15,3 @@ code {
font-weight
:
bold
;
}
.border
{
overflow
:
auto
!important
;}
.border-thick
{
border-width
:
2px
!important
;
}
.border-thicker
{
border-width
:
3px
!important
;
}
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