Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
2001_0033_neuromorphic_user
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SHINDAESUB
2001_0033_neuromorphic_user
Commits
3c6f2a7c
Commit
3c6f2a7c
authored
Aug 19, 2021
by
SHINDAESUB
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teaching info update
parent
9ed3eb2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
app.js
backend/app.js
+8
-6
TeachingModal.vue
frontend/src/modal/TeachingModal.vue
+8
-1
No files found.
backend/app.js
View file @
3c6f2a7c
...
@@ -7,7 +7,7 @@ const dotenv = require('dotenv');
...
@@ -7,7 +7,7 @@ const dotenv = require('dotenv');
const
app
=
express
()
const
app
=
express
()
const
bodyParser
=
require
(
'body-parser'
);
//
const
bodyParser
=
require
(
'body-parser'
);
//
let
infoMsg
=
''
dotenv
.
config
({
dotenv
.
config
({
path
:
path
.
resolve
(
path
:
path
.
resolve
(
...
@@ -50,7 +50,7 @@ const jsonFile = fs.readFileSync('./json/projects.json', 'utf8');
...
@@ -50,7 +50,7 @@ const jsonFile = fs.readFileSync('./json/projects.json', 'utf8');
const
jsonData
=
JSON
.
parse
(
jsonFile
);
const
jsonData
=
JSON
.
parse
(
jsonFile
);
console
.
log
(
jsonData
);
console
.
table
(
jsonData
);
//Post 방식은 Get 과 다르기 때문에 body-parser 를 설치해서 사용해야한다.
//Post 방식은 Get 과 다르기 때문에 body-parser 를 설치해서 사용해야한다.
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
json
());
...
@@ -205,10 +205,11 @@ const wrapper = asyncFn => { return (async (req, res, next) => { try { return aw
...
@@ -205,10 +205,11 @@ const wrapper = asyncFn => { return (async (req, res, next) => { try { return aw
app
.
get
(
'/api/requestManager'
,
wrapper
(
async
(
req
,
res
)
=>
{
app
.
get
(
'/api/requestManager'
,
wrapper
(
async
(
req
,
res
)
=>
{
req
.
query
.
image_path
=
process
.
env
.
TEACHING_IMAGE_PATH
req
.
query
.
image_path
=
process
.
env
.
TEACHING_IMAGE_PATH
if
(
req
.
query
.
cmd
===
"neuro_check"
)
req
.
query
.
teaching
=
`
${
process
.
env
.
TEACHING_IMAGE_PATH
}
-test-2-
${
process
.
env
.
TEACHING_RESOLUTION
}
-
${
req
.
query
.
teaching_info
}
`
//req.query.project_num
if
(
req
.
query
.
cmd
===
"neuro_check"
){
req
.
query
.
teaching
=
`
${
process
.
env
.
TEACHING_IMAGE_PATH
}
-
${
req
.
query
.
project_num
}
-2-
${
process
.
env
.
TEACHING_RESOLUTION
}${
req
.
query
.
teaching_info
}
`
}
console
.
log
(
"param :"
,
JSON
.
stringify
(
req
.
query
)
)
console
.
log
(
"param :"
,
JSON
.
stringify
(
req
.
query
)
)
sendToManager
(
JSON
.
stringify
(
req
.
query
))
sendToManager
(
JSON
.
stringify
(
req
.
query
))
...
@@ -258,9 +259,10 @@ function responseManager (requestMsg) {
...
@@ -258,9 +259,10 @@ function responseManager (requestMsg) {
let
timer
=
setInterval
(()
=>
{
let
timer
=
setInterval
(()
=>
{
if
(
requestMsg
===
JSON
.
parse
(
udpResultMsg
).
cmd
){
if
(
requestMsg
===
JSON
.
parse
(
udpResultMsg
).
cmd
){
console
.
log
(
`json 데이터는 ?
${
JSON
.
parse
(
udpResultMsg
).
cmd
}
`
)
console
.
log
(
`json 데이터는 ?
${
JSON
.
parse
(
udpResultMsg
).
cmd
}
`
)
if
(
requestMsg
===
'capture_done'
)
infoMsg
=
JSON
.
parse
(
udpResultMsg
).
msg
resolve
(
udpResultMsg
)
resolve
(
udpResultMsg
)
clearInterval
(
timer
)
clearInterval
(
timer
)
}
else
if
(
waitingTime
===
5000
){
}
else
if
(
waitingTime
===
5000
00
){
reject
(
'No response from Manager'
)
reject
(
'No response from Manager'
)
clearInterval
(
timer
)
clearInterval
(
timer
)
}
else
{
}
else
{
...
...
frontend/src/modal/TeachingModal.vue
View file @
3c6f2a7c
...
@@ -178,10 +178,17 @@ export default {
...
@@ -178,10 +178,17 @@ export default {
},
},
async
neuroCheck
(){
async
neuroCheck
(){
let
teachingInfo
=
''
this
.
info
.
info
.
forEach
((
rect
)
=>
{
let
str
=
`(
${
Math
.
ceil
(
rect
.
startX
*
1.5
)}
,
${
Math
.
ceil
(
rect
.
startY
*
1.5
)}
,
${
Math
.
ceil
(
rect
.
lastX
*
1.5
)}
,
${
Math
.
ceil
(
rect
.
lastY
*
1.5
)
}
)`
teachingInfo
=
teachingInfo
+
"-"
+
str
})
let
msg
=
new
Object
()
let
msg
=
new
Object
()
msg
.
cmd
=
"neuro_check"
msg
.
cmd
=
"neuro_check"
msg
.
project_num
=
this
.
info
.
uid
msg
.
project_num
=
this
.
info
.
uid
msg
.
teaching_info
=
'(1113,720,1329,840)-(1626,504,1788,651)-(1953,816,2049,978)'
msg
.
teaching_info
=
teachingInfo
await
teachingService
.
requestManager
(
msg
)
await
teachingService
.
requestManager
(
msg
)
.
then
(
data
=>
{
.
then
(
data
=>
{
...
...
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