Skip to content

Commit

Permalink
fix cursor tracking string update for pixels == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
schiebel committed Jan 9, 2024
1 parent 79ccd79 commit 56c946e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions casagui/apps/_interactiveclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,17 @@ def __init__( self, vis, imagename, usemask='user', mask='', initial_mask_pixel=
### --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
'update-converge': '''function update_convergence( msg ) {
let convdata
if ( typeof msg === 'undefined' && '_convergence_data' in flux_src ) {
// use complete convergence cache attached to flux_src...
// get the convergence data for channel and stokes
const pos = img_src.cur_chan
convdata = flux_src._convergence_data.chan.get(pos[1]).get(pos[0])
// chan-------------------------------^^^^^^ ^^^^^^----stokes
if ( typeof msg === 'undefined' ) {
if ( '_convergence_data' in flux_src ) {
// use complete convergence cache attached to flux_src...
// get the convergence data for channel and stokes
const pos = img_src.cur_chan
convdata = flux_src._convergence_data.chan.get(pos[1]).get(pos[0])
// chan-------------------------------^^^^^^ ^^^^^^----stokes
} else {
console.log( 'Insert code here to get convergence data when no cache and no update (msg) is available...' )
return
}
} else if ( 'result' in msg ) {
// update based on msg received from convergence update message
convdata = msg.result.converge
Expand Down
4 changes: 2 additions & 2 deletions casagui/toolbox/_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,8 +1856,8 @@ def connect( self ):
movement_code_pixel_update = '''if ( cb_obj.event_type === 'move' ) {
function update_pixel( msg ) {
if ( msg.update &&
msg.update.pixel &&
msg.update.index &&
'pixel' in msg.update &&
'index' in msg.update &&
msg.update.index.length == 2 ) {
const digits = 5
if ( pix_wrld && pix_wrld.label == 'pixel' ) {
Expand Down

0 comments on commit 56c946e

Please sign in to comment.