Serial/src/models/serial.js
/**
     * Adds a port to be read by the data event
     * @param comName
     */
Adds a port to be read by the data event
@param comName
Adds a port to be read by the data event @param comName
readPort(comName) {
        for(let i=0; i<this.parsers.length; i++) {
            if(this.parsers[i].comName !== comName) continue;
            let parser = this.parsers[i];
            parser.on('data', (data) => {
                console.log(data);
            });
            parser.once('data', (data) => {
            })
        }
    }
readPort ( comName ) { for ( let i = 0 ; i < this . parsers . length ; i ++ ) { if ( this . parsers [ i ] . comName !== comName ) continue ; let parser = this . parsers [ i ] ; parser . on ( 'data' , ( data ) => { console . log ( data ) ; } ) ; parser . once ( 'data' , ( data ) => { } ) } }
Adds a port to be read by the data event
 @param comName
Adds a port to be read by the data event @param comName
/*
                let dataPoints = data.split(',');
                let packet = {};
                for(let j=0; j<dataPoints.length; j++) {
                    packet[this.packetStructure[j]] = dataPoints[j];
                }
                this.emit('data', packet);
                */ /*
                let dataPoints = data.split(',');
                let packet = {};
                for(let j=0; j<dataPoints.length; j++) {
                    packet[this.packetStructure[j]] = dataPoints[j];
                }
                for(let j=0; j<this.loadedPorts.length; j++) {
                    if(this.loadedPorts[j].path !== this.parsers[i].comName) continue;
                    this.loadedPorts[j].chipId = packet.chipId;
                }
                this.parsers[i].chipId = packet.chipId;
                */