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
ad885796
Commit
ad885796
authored
Sep 10, 2021
by
SHINDAESUB
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1차 완료
parent
5dd66520
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
170 additions
and
51 deletions
+170
-51
app.js
backend/app.js
+13
-4
project.json
backend/json/project.json
+0
-0
capture.jpg
frontend/public/image/capture.jpg
+0
-0
Alert.vue
frontend/src/components/Alert.vue
+1
-1
Home.vue
frontend/src/views/Home.vue
+23
-5
Card.vue
frontend/src/views/main/Card.vue
+106
-8
Chart.vue
frontend/src/views/main/Chart.vue
+8
-23
List.vue
frontend/src/views/main/List.vue
+13
-5
Stepper.vue
frontend/src/views/main/Stepper.vue
+6
-5
No files found.
backend/app.js
View file @
ad885796
...
@@ -10,9 +10,6 @@ const bodyParser = require('body-parser'); //
...
@@ -10,9 +10,6 @@ const bodyParser = require('body-parser'); //
app
.
use
(
express
.
json
({
limit
:
"50mb"
}));
app
.
use
(
express
.
json
({
limit
:
"50mb"
}));
app
.
use
(
express
.
urlencoded
({
limit
:
"50mb"
,
extended
:
false
}));
app
.
use
(
express
.
urlencoded
({
limit
:
"50mb"
,
extended
:
false
}));
let
infoMsg
=
''
dotenv
.
config
({
dotenv
.
config
({
path
:
path
.
resolve
(
path
:
path
.
resolve
(
process
.
cwd
(),
process
.
cwd
(),
...
@@ -140,6 +137,10 @@ app.get('/api/requestManager',wrapper(async (req,res)=>{
...
@@ -140,6 +137,10 @@ app.get('/api/requestManager',wrapper(async (req,res)=>{
case
"neuro_check"
:
case
"neuro_check"
:
requestMsg
=
'neuro_result'
requestMsg
=
'neuro_result'
break
break
// case "neuro_replay" :
// requestMsg = 'neuro_result'
// break
default
:
default
:
res
.
status
(
404
)
res
.
status
(
404
)
}
}
...
@@ -170,7 +171,15 @@ function responseManager (requestMsg) {
...
@@ -170,7 +171,15 @@ function responseManager (requestMsg) {
let
timer
=
setInterval
(()
=>
{
let
timer
=
setInterval
(()
=>
{
if
(
requestMsg
===
JSON
.
parse
(
udpResultMsg
).
cmd
){
if
(
requestMsg
===
JSON
.
parse
(
udpResultMsg
).
cmd
){
if
(
requestMsg
===
'capture_done'
)
infoMsg
=
JSON
.
parse
(
udpResultMsg
).
msg
if
(
requestMsg
===
'capture_done'
){
let
base64
=
fs
.
readFileSync
(
'./public/image/capture.jpg'
,
'base64'
)
let
msg
=
JSON
.
parse
(
udpResultMsg
)
msg
.
imageBase64
=
base64
udpResultMsg
=
JSON
.
stringify
(
msg
)
// console.log("야이 씨벌 :", JSON.parse(udpResultMsg))
// console.log("base64 :",base64)
}
resolve
(
udpResultMsg
)
resolve
(
udpResultMsg
)
clearInterval
(
timer
)
clearInterval
(
timer
)
}
else
if
(
waitingTime
===
500000
){
}
else
if
(
waitingTime
===
500000
){
...
...
backend/json/project.json
View file @
ad885796
This source diff could not be displayed because it is too large. You can
view the blob
instead.
frontend/public/image/capture.jpg
0 → 100644
View file @
ad885796
7.58 KB
frontend/src/components/Alert.vue
View file @
ad885796
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
EventBus
}
from
'
@
/event-bus'
import
{
EventBus
}
from
'
..
/event-bus'
export
default
{
export
default
{
...
...
frontend/src/views/Home.vue
View file @
ad885796
...
@@ -9,16 +9,18 @@
...
@@ -9,16 +9,18 @@
:project=
"project"
:project=
"project"
/>
/>
</v-col>
</v-col>
<v-col
cols=
7
class=
"mx-auto"
>
<v-col
cols=
"7"
>
<Card
<Card
:wpo=
"wpo"
:wpo=
"wpo"
:step=
"step"
:step=
"step"
:infos=
"infos"
:infos=
"infos"
:project=
"project"
:project=
"project"
:counter=
"counter"
:counter=
"counter"
:result=
"resultRect"
:captureImage=
"captureImage"
/>
/>
</v-col>
</v-col>
<v-col>
<v-col
col=
"3"
>
<Chart
<Chart
:wpo=
"wpo"
:wpo=
"wpo"
:step=
"step"
:step=
"step"
...
@@ -70,6 +72,10 @@ export default {
...
@@ -70,6 +72,10 @@ export default {
counter
:
0
,
counter
:
0
,
result
:[],
result
:[],
resultRect
:[],
captureImage
:
null
}
}
},
},
...
@@ -92,6 +98,7 @@ export default {
...
@@ -92,6 +98,7 @@ export default {
this
.
infos
=
[],
this
.
infos
=
[],
this
.
counter
=
0
,
this
.
counter
=
0
,
this
.
result
=
[]
this
.
result
=
[]
this
.
captureImage
=
null
},
},
async
getAoi
(){
async
getAoi
(){
...
@@ -268,7 +275,8 @@ export default {
...
@@ -268,7 +275,8 @@ export default {
msg
.
cmd
=
"neuro_capture"
msg
.
cmd
=
"neuro_capture"
let
response
=
await
teachingService
.
requestManager
(
msg
)
let
response
=
await
teachingService
.
requestManager
(
msg
)
console
.
log
(
'캡처 ㅇ데이터 '
,
response
)
let
data
=
JSON
.
parse
(
response
.
data
)
this
.
captureImage
=
data
.
imageBase64
if
(
typeof
response
===
'undefined'
)
throw
new
Error
(
'서버와 연결 되지 않았습니다.'
)
if
(
typeof
response
===
'undefined'
)
throw
new
Error
(
'서버와 연결 되지 않았습니다.'
)
if
(
response
.
status
!==
200
)
throw
new
Error
(
'옳지 않은 응답입니다.'
)
if
(
response
.
status
!==
200
)
throw
new
Error
(
'옳지 않은 응답입니다.'
)
...
@@ -293,10 +301,20 @@ export default {
...
@@ -293,10 +301,20 @@ export default {
msg
.
teaching_info
=
teachingInfo
msg
.
teaching_info
=
teachingInfo
let
response
=
await
teachingService
.
requestManager
(
msg
)
let
response
=
await
teachingService
.
requestManager
(
msg
)
console
.
log
(
'검수 데이터 '
,
JSON
.
parse
(
response
.
data
))
let
data
=
JSON
.
parse
(
response
.
data
)
console
.
log
(
'검수 데이터 '
,
data
)
this
.
resultRect
=
[]
let
order
=
new
Object
()
order
.
counter
=
this
.
counter
order
.
time
=
Number
(
data
[
'proc_time'
])
order
.
result
=
data
[
'result'
]
this
.
result
.
push
(
JSON
.
parse
(
response
.
data
))
this
.
result
Rect
=
data
[
'check_box'
]
this
.
result
.
push
(
order
)
if
(
typeof
response
===
'undefined'
)
throw
new
Error
(
'서버와 연결 되지 않았습니다.'
)
if
(
typeof
response
===
'undefined'
)
throw
new
Error
(
'서버와 연결 되지 않았습니다.'
)
if
(
response
.
status
!==
200
)
throw
new
Error
(
'옳지 않은 응답입니다.'
)
if
(
response
.
status
!==
200
)
throw
new
Error
(
'옳지 않은 응답입니다.'
)
...
...
frontend/src/views/main/Card.vue
View file @
ad885796
<
template
>
<
template
>
<v-card
<v-card
:disabled=
"this.step
<
3
"
:disabled=
"this.step
<
=
4
"
width=
"
100%
"
width=
"
960
"
max-width=
"
100%
"
max-width=
"
960
"
height=
"846"
height=
"846"
max-height=
"846"
max-height=
"846"
class=
"elevation-0"
class=
"elevation-0 mx-auto"
>
>
<v-img
<v-img
:disabled=
"this.step
<
4
"
v-if=
"captureImage === null
"
height=
"540"
height=
"540"
max-height=
"540"
max-height=
"540"
width=
"100%"
width=
"100%"
max-width=
"100%"
max-width=
"100%"
src=
"
https://bad.src/not/valid
"
src=
"
../../../public/image/lazy.png
"
lazy-src=
"../../../public/image/lazy.png"
lazy-src=
"../../../public/image/lazy.png"
contain
contain
class=
"grey darken-4"
class=
"grey darken-4"
>
>
</v-img>
</v-img>
<v-stage
v-else
class=
"ma-0 pa-0 "
ref=
"stage"
:config=
"stageSize"
>
<v-layer
ref=
"layer"
:config=
"stageSize"
>
<v-image
:config=
"
{
image: image,
width: 960,
height: 540,
}"/>
<v-rect
v-for=
"(rec, index) in rect"
:key=
"index"
:config=
"
{
x: Math.min(rec.startX /1.33, rec.lastX /1.33 ),
y: Math.min(rec.startY /1.33, rec.lastY /1.33),
width: Math.abs(rec.width / 1.33 ),
height: Math.abs(rec.height /1.33),
fill: rec.stroke+'4D',
stroke: rec.stroke,
dash:[8,8],
strokeWidth: 3,
}"
>
<!-- height: Math.abs(rec.height /1.33),
fill: '#2196F34D',
stroke: '#2196F3', -->
</v-rect>
</v-layer>
</v-stage>
<div
v-if=
"Object.keys(project).length !== 0"
>
<div
v-if=
"Object.keys(project).length !== 0"
>
<v-card-title>
{{
project
.
name
}}
</v-card-title>
<v-card-title>
{{
project
.
name
}}
</v-card-title>
<v-card-subtitle>
{{
project
.
createDate
}}
-
{{
project
.
successDate
}}
</v-card-subtitle>
<v-card-subtitle>
{{
project
.
createDate
}}
-
{{
project
.
successDate
}}
</v-card-subtitle>
...
@@ -30,7 +69,8 @@
...
@@ -30,7 +69,8 @@
<v-divider
class=
"mx-4"
></v-divider>
<v-divider
class=
"mx-4"
></v-divider>
<v-card-title>
진행률
</v-card-title>
<v-card-title>
검수 진행률
</v-card-title>
<v-card-subtitle>
{{
counter
}}
/
{{
project
.
counter
}}
</v-card-subtitle>
<v-card-text>
<v-card-text>
<v-progress-linear
<v-progress-linear
v-model=
"progressbar"
v-model=
"progressbar"
...
@@ -48,25 +88,83 @@
...
@@ -48,25 +88,83 @@
</
template
>
</
template
>
<
script
>
<
script
>
// const test = require("../../../public/image/lazy.png");
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
loading
:
true
,
loading
:
true
,
progressbar
:
0
,
progressbar
:
0
,
image
:
null
,
rect
:[],
check
:[],
stageSize
:
{
width
:
960
,
height
:
540
,
},
drwingColor
:
'#2196F3'
,
// 선 색
thickness
:
3
,
//선 굵기
}
}
},
},
created
()
{
},
props
:
{
props
:
{
step
:
Number
,
step
:
Number
,
wpo
:
String
,
wpo
:
String
,
infos
:
Array
,
infos
:
Array
,
project
:
Object
,
project
:
Object
,
counter
:
Number
counter
:
Number
,
result
:
Array
,
captureImage
:
String
},
},
watch
:
{
watch
:
{
counter
(
current
){
counter
(
current
){
this
.
progressbar
=
Math
.
round
((
100
*
current
)
/
this
.
project
.
counter
);
this
.
progressbar
=
Math
.
round
((
100
*
current
)
/
this
.
project
.
counter
);
},
result
(
current
){
if
(
current
.
length
!==
0
){
this
.
rect
=
[]
this
.
rect
=
[...
this
.
infos
]
for
(
let
i
=
0
;
i
<
current
.
length
;
i
++
){
Number
(
current
[
i
])
===
0
?
(
this
.
rect
[
i
].
fill
=
'#2196F3'
,
this
.
rect
[
i
].
stroke
=
'#2196F3'
)
:
(
this
.
rect
[
i
].
fill
=
'#F44336'
,
this
.
rect
[
i
].
stroke
=
'#F44336'
)
}
}
},
step
(
current
){
if
(
current
===
5
){
let
image
=
new
Image
();
image
.
src
=
'data:image/jpeg;base64,'
+
this
.
captureImage
image
.
onload
=
()
=>
{
this
.
image
=
image
};
// const image = new window.Image();
// image.src = require("../../../public/image/capture.jpg");
// // image.src = require("@/public/image/lazy.png");
// console.log("이미지:", image)
// image.onload = () => {
// // set image only when it is loaded
// this.image = image;
// };
}
if
(
current
===
6
){
this
.
rect
=
[]
}
}
}
}
}
}
}
...
...
frontend/src/views/main/Chart.vue
View file @
ad885796
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
<v-card
<v-card
dense
dense
height=
"400"
height=
"400"
class=
"elevation-0"
class=
"elevation-0"
:disabled=
"step
<
5
"
:disabled=
"step
<
4
"
>
>
<v-toolbar
<v-toolbar
class=
"elevation-0 "
class=
"elevation-0 "
...
@@ -13,22 +12,22 @@
...
@@ -13,22 +12,22 @@
<v-toolbar-title>
통계
</v-toolbar-title>
<v-toolbar-title>
통계
</v-toolbar-title>
<v-spacer></v-spacer>
<v-spacer></v-spacer>
</v-toolbar>
</v-toolbar>
<div
v-if=
"result.length !== 0"
class=
"
mt-3
pa-0 ma-0"
>
<div
v-if=
"result.length !== 0"
class=
" pa-0 ma-0"
>
<DoughnutChart
<DoughnutChart
class=
"mt-3 pa-0 ma-0"
class=
"mt-3 pa-0 ma-0"
:chart-data=
"totalColl"
:chart-data=
"totalColl"
:height=
"
15
0"
:height=
"
22
0"
:percent=
"percent"
:percent=
"percent"
/>
/>
<v-card-text>
<v-card-text>
<v-list-item>
<v-list-item>
<v-list-item-subtitle>
응답 속도 합계
</v-list-item-subtitle>
<v-list-item-subtitle>
응답 속도 합계
</v-list-item-subtitle>
<v-list-item-title>
{{
total
}}
</v-list-item-title>
<v-list-item-title>
{{
total
===
0
?
0
+
' sec'
:
total
.
toFixed
(
2
)
+
' sec'
}}
</v-list-item-title>
</v-list-item>
</v-list-item>
<v-list-item>
<v-list-item>
<v-list-item-subtitle>
응답 속도 평균
</v-list-item-subtitle>
<v-list-item-subtitle>
응답 속도 평균
</v-list-item-subtitle>
<v-list-item-title>
{{
total
/
counter
}}
</v-list-item-title>
<v-list-item-title>
{{
total
/
counter
===
0
?
0
+
' sec'
:
(
total
/
counter
).
toFixed
(
2
)
+
' sec'
}}
</v-list-item-title>
</v-list-item>
</v-list-item>
</v-card-text>
</v-card-text>
</div>
</div>
...
@@ -42,7 +41,6 @@ export default {
...
@@ -42,7 +41,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
total
:
0
,
total
:
0
,
avg
:
0
,
totalColl
:{},
totalColl
:{},
success
:
0
,
success
:
0
,
fail
:
0
,
fail
:
0
,
...
@@ -80,23 +78,10 @@ export default {
...
@@ -80,23 +78,10 @@ export default {
if
(
current
.
length
!==
0
){
if
(
current
.
length
!==
0
){
console
.
log
(
"Tl;qkfg :"
,
current
)
this
.
total
=
this
.
total
+
current
[
current
.
length
-
1
][
'time'
]
current
[
current
.
length
-
1
][
'result'
]
===
0
?
++
this
.
fail
:
++
this
.
success
current
.
forEach
(
result
=>
{
this
.
total
=
this
.
total
+
Number
(
result
[
'proc_time'
])
result
.
result
===
0
?
++
this
.
success
:
++
this
.
fail
});
console
.
log
(
this
.
counter
)
console
.
log
(
this
.
total
)
this
.
avg
=
this
.
total
/
this
.
counter
this
.
percent
=
Math
.
round
((
100
*
this
.
success
)
/
Number
(
this
.
counter
))
console
.
log
(
"평균 :"
,
this
.
avg
)
console
.
log
(
"퍼센트 :"
,
this
.
percent
)
this
.
percent
=
Math
.
round
((
100
*
this
.
success
)
/
this
.
counter
)
this
.
totalColl
=
{
this
.
totalColl
=
{
labels
:
[
'성공'
,
'실패'
],
labels
:
[
'성공'
,
'실패'
],
...
...
frontend/src/views/main/List.vue
View file @
ad885796
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
:disabled=
"loading"
:disabled=
"loading"
height=
"422"
height=
"422"
max-height=
"422"
max-height=
"422"
width=
"100%"
max-width=
"100%"
dense
dense
:headers=
"headers"
:headers=
"headers"
:items=
"result"
:items=
"result"
...
@@ -12,16 +14,22 @@
...
@@ -12,16 +14,22 @@
:sort-desc=
"[true]"
:sort-desc=
"[true]"
class=
"elevation-0 mt-6"
class=
"elevation-0 mt-6"
hide-default-footer
hide-default-footer
>
>
<template
v-slot:
[`
item
.
counter
`]="
{ item }">
{{
item
.
counter
}}
</
template
>
<
template
v-slot:
[`
item
.
state
`]="{
item
}"
>
<
template
v-slot:
[`
item
.
state
`]="{
item
}"
>
<v-chip
<v-chip
:color=
"item.state === 0 ? 'error' : 'success'"
:color=
"item.result === 0 ? 'error' : 'success'"
small
dark
dark
>
>
{{
item
.
state
===
0
?
'Fail'
:
'Success'
}}
{{
item
.
result
===
0
?
'실패'
:
'성공'
}}
</v-chip>
</v-chip>
</
template
>
</
template
>
<
template
v-slot:
[`
item
.
time
`]="{
item
}"
>
{{
item
.
time
.
toFixed
(
2
)
}}
</
template
>
</v-data-table>
</v-data-table>
</template>
</template>
...
@@ -32,8 +40,8 @@ export default {
...
@@ -32,8 +40,8 @@ export default {
loading
:
true
,
loading
:
true
,
headers
:
[
headers
:
[
{
text
:
'횟수'
,
align
:
'start'
,
sortable
:
false
,
value
:
'counter'
,},
{
text
:
'횟수'
,
align
:
'start'
,
sortable
:
false
,
value
:
'counter'
,},
{
text
:
'
상태
'
,
value
:
'state'
},
{
text
:
'
검수 결과'
,
align
:
'center
'
,
value
:
'state'
},
{
text
:
'응답 속도
'
,
value
:
'respons
e'
},
{
text
:
'응답 속도
(sec)'
,
align
:
'center'
,
value
:
'tim
e'
},
],
],
}
}
},
},
...
...
frontend/src/views/main/Stepper.vue
View file @
ad885796
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
vertical
vertical
style=
"height:100%"
style=
"height:100%"
class=
"font-weight-black"
class=
"font-weight-black"
width=
"100%"
max-width=
"100%"
>
>
<v-toolbar
<v-toolbar
color=
"blue darken-1"
color=
"blue darken-1"
...
@@ -29,7 +30,7 @@
...
@@ -29,7 +30,7 @@
<v-stepper-content
step=
"1"
>
<v-stepper-content
step=
"1"
>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<v-progress-circular
<v-progress-circular
:size=
"1
5
0"
:size=
"1
0
0"
color=
"primary"
color=
"primary"
indeterminate
indeterminate
></v-progress-circular>
></v-progress-circular>
...
@@ -112,7 +113,7 @@
...
@@ -112,7 +113,7 @@
<v-stepper-content
step=
"3"
>
<v-stepper-content
step=
"3"
>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<v-progress-circular
<v-progress-circular
:size=
"1
5
0"
:size=
"1
0
0"
color=
"primary"
color=
"primary"
indeterminate
indeterminate
></v-progress-circular>
></v-progress-circular>
...
@@ -131,7 +132,7 @@
...
@@ -131,7 +132,7 @@
<v-stepper-content
step=
"4"
>
<v-stepper-content
step=
"4"
>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<v-progress-circular
<v-progress-circular
:size=
"1
5
0"
:size=
"1
0
0"
color=
"primary"
color=
"primary"
indeterminate
indeterminate
></v-progress-circular>
></v-progress-circular>
...
@@ -150,7 +151,7 @@
...
@@ -150,7 +151,7 @@
<v-stepper-content
step=
"5"
>
<v-stepper-content
step=
"5"
>
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<v-progress-circular
<v-progress-circular
:size=
"1
5
0"
:size=
"1
0
0"
color=
"primary"
color=
"primary"
indeterminate
indeterminate
></v-progress-circular>
></v-progress-circular>
...
...
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