-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreader.js
More file actions
executable file
·26 lines (26 loc) · 949 Bytes
/
reader.js
File metadata and controls
executable file
·26 lines (26 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var pvProto=require('./EPICSEvent_pb.js');
var fs=require('fs');
var readline=require('readline');
var information;
//var readerstream=fs.createReadStream('./archiver/test.pb','UTF-8');
//var RealData=[];
//readerstream.on('open',function(fd){
// console.log('begin to read.');
//});
//readerstream.on('data',function(data){
//RealData=data.split(',');
//console.log(RealData);
//var message=pvProto.FieldValue.deserializeBinary(new Uint8Array(RealData));
//console.log(pvProto.FieldValue.getName());
//console.log(message.getName(),message.getVal(),message.getTime());
//console.log(message);
//});
var rl=readline.createInterface({
input:fs.createReadStream('./archiver/test.pb','UTF-8')
});
rl.on('line',(line)=>{
EachLine=line.split(',');
// console.log(EachLine);
information=pvProto.FieldValue.deserializeBinary(new Uint8Array(EachLine));
console.log(information.getName(),information.getVal(),information.getTime());
});