summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-14 12:58:23 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-14 12:58:23 +0200
commitd1435a137bb50c514de8a79fa0c80264dfbb9f35 (patch)
tree5522289f5ff44436bf9179cb70ea7c23875012b6 /app
parent9b55cce94742b698b55db76b5139556ee454c483 (diff)
deploy bundle
Diffstat (limited to 'app')
-rw-r--r--app/client/live/player.js11
-rw-r--r--app/client/modules/pix2pix/views/pix2pix.live.js5
-rw-r--r--app/client/socket/socket.live.js1
-rw-r--r--app/relay/runner.js6
4 files changed, 12 insertions, 11 deletions
diff --git a/app/client/live/player.js b/app/client/live/player.js
index 3fd33e8..2fafb5c 100644
--- a/app/client/live/player.js
+++ b/app/client/live/player.js
@@ -79,10 +79,8 @@ export function onFrame (data) {
}
let previousValue, currentValue
-function handleChange() {
- let previousValue = currentValue
- currentValue = store.getState().live.playing
-
+export function toggleFPS(state) {
+ currentValue = typeof state !== 'undefined' ? state : store.getState().live.playing
if (previousValue !== currentValue) {
if (currentValue) {
startWatchingFPS()
@@ -90,11 +88,12 @@ function handleChange() {
stopWatchingFPS()
}
}
+ previousValue = currentValue
}
let fpsInterval;
-function startWatchingFPS(){
+export function startWatchingFPS(){
clearInterval(fpsInterval)
fpsInterval = setInterval(() => {
store.dispatch({
@@ -108,6 +107,6 @@ function startWatchingFPS(){
fps = 0
}, 1000)
}
-function stopWatchingFPS(){
+export function stopWatchingFPS(){
clearInterval(fpsInterval)
} \ No newline at end of file
diff --git a/app/client/modules/pix2pix/views/pix2pix.live.js b/app/client/modules/pix2pix/views/pix2pix.live.js
index 26ad3ce..be19d15 100644
--- a/app/client/modules/pix2pix/views/pix2pix.live.js
+++ b/app/client/modules/pix2pix/views/pix2pix.live.js
@@ -7,7 +7,7 @@ import {
Slider, Select, Button, Loading
} from '../../../common/'
-import { startRecording, stopRecording, saveFrame } from '../../../live/player'
+import { startRecording, stopRecording, saveFrame, toggleFPS } from '../../../live/player'
import * as liveActions from '../../../live/live.actions'
import * as queueActions from '../../../queue/queue.actions'
@@ -47,6 +47,7 @@ class Pix2PixLive extends Component {
}
seek(percentage){
const frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1)
+ console.log("seek to frame", percentage, frame)
this.props.actions.live.seek(frame)
}
start(){
@@ -112,7 +113,7 @@ class Pix2PixLive extends Component {
options={this.props.epochs}
onChange={this.changeEpoch}
/>
- <Slider live
+ <Slider
name='position'
min={0.0} max={1.0} type='float'
value={(this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1)}
diff --git a/app/client/socket/socket.live.js b/app/client/socket/socket.live.js
index ab5878e..3780ba6 100644
--- a/app/client/socket/socket.live.js
+++ b/app/client/socket/socket.live.js
@@ -19,6 +19,7 @@ socket.on('res', (data) => {
type: types.socket.load_params,
opt: data.res,
})
+ player.toggleFPS(data.res.processing)
break
case 'list_checkpoints':
dispatch({
diff --git a/app/relay/runner.js b/app/relay/runner.js
index 85f08ca..a449a6c 100644
--- a/app/relay/runner.js
+++ b/app/relay/runner.js
@@ -347,11 +347,11 @@ export function run_next_task(){
}
export function stop_task(task, sigkill){
- if (!task) return
- if (task === 'cpu' || state.current_cpu_task.task.uuid === task.uuid) {
+ if (!task) return { error: 'no such task' }
+ if (task.processor === 'cpu' || state.current_cpu_task.task.uuid === task.uuid) {
terminate(state.current_cpu_task, sigkill)
return { status: 'ok' }
- } else if (task === 'gpu' || state.current_gpu_task.task.uuid === task.uuid) {
+ } else if (task.processor === 'gpu' || state.current_gpu_task.task.uuid === task.uuid) {
terminate(state.current_gpu_task, sigkill)
return { status: 'ok' }
}