function myReadExecuter(pathFileName,currentData, index, visWindow) { 
    return new Promise(function (resolve, reject) {
        let options = { 
            mode: 'json',
            args: [pathFileName,index,visWindow] 
        };    
        let readerShell = new PythonShell('/backend/pythonscripts/edfReader.py',options);
        let results={};
        readerShell.on('message', function (message) { 
            results = message      
        });
        readerShell.end(function (err,code,signal) {
            if (err) reject(err);
            results['debug'].command = currentData.debug.command;
            results['debug'].fileName = currentData.debug.fileName;
            results.debug.time.index=results.debug.time.samplefrequency*visWindow;
            results.debug.time.currentTime=results.debug.time.startTime+visWindow;
            console.log("readerShell",results.debug.time);
            resolve ({r: results, c: code, s: signal});
        });
    });
}
/**  
 * read Script V2 full error handling and async await
 * @param {currentData}   
 */
read Script V2 full error handling and async await
@param {currentData}
read Script V2 full error handling and async await @param { currentData }
function myReadExecuter(pathFileName,currentData, index, visWindow) { 
    return new Promise(function (resolve, reject) {
        let options = { 
            mode: 'json',
            args: [pathFileName,index,visWindow] 
        };    
        let readerShell = new PythonShell('/backend/pythonscripts/edfReader.py',options);
        let results={};
        readerShell.on('message', function (message) { 
            results = message      
        });
        readerShell.end(function (err,code,signal) {
            if (err) reject(err);
            results['debug'].command = currentData.debug.command;
            results['debug'].fileName = currentData.debug.fileName;
            results.debug.time.index=results.debug.time.samplefrequency*visWindow;
            results.debug.time.currentTime=results.debug.time.startTime+visWindow;
            console.log("readerShell",results.debug.time);
            resolve ({r: results, c: code, s: signal});
        });
    });
}
function myReadExecuter ( pathFileName , currentData , index , visWindow ) { return new Promise ( function ( resolve , reject ) { let options = { mode : 'json' , args : [ pathFileName , index , visWindow ] } ; let readerShell = new PythonShell ( '/backend/pythonscripts/edfReader.py' , options ) ; let results = { } ; readerShell . on ( 'message' , function ( message ) { results = message } ) ; readerShell . end ( function ( err , code , signal ) { if ( err ) reject ( err ) ; results [ 'debug' ] . command = currentData . debug . command ; results [ 'debug' ] . fileName = currentData . debug . fileName ; results . debug . time . index = results . debug . time . samplefrequency * visWindow ; results . debug . time . currentTime = results . debug . time . startTime + visWindow ; console . log ( "readerShell" , results . debug . time ) ; resolve ( { r : results , c : code , s : signal } ) ; } ) ; } ) ; }
read Script V2 full error handling and async await
 @param {currentData}
read Script V2 full error handling and async await @param { currentData }