Added Ansitex Data transport

This commit is contained in:
Deon George
2019-10-22 21:57:25 +11:00
parent a5231cb7ff
commit 31bf9b9dd7
3 changed files with 263 additions and 11 deletions

View File

@@ -108,6 +108,8 @@ function getFrame(page) {
get: function() {return this.frame+this.index}
});
x = null;
} catch (error) {
log(LOG_ERROR,error);
return null;
@@ -155,6 +157,25 @@ function pageStr(page) {
return page.frame+page.index;
}
/**
* Save the frame
*
* @param frame
*/
function saveFrame(frame) {
file = system.text_dir+'ansitex/'+frame.page+'.tex';
w = new File(file);
if (! w.open('w')) {
log(LOG_ERROR,'! ERROR: Unable to create TEX file for '+frame.page);
exit(1);
}
w.write(JSON.stringify(frame));
w.close();
log(LOG_DEBUG,'Saved file: '+frame.page+'.tex');
}
function sendBaseline(text,reposition) {
console.pushxy();
console.gotoxy(0,24);