public MainScreenViewModel(string comPortName, ViewModelDataPointReceivedCallback viewModelDataPointReceivedCallback1) { if (dataPointReceiverCallback == null) { dataPointReceiverCallback = new DataPointReceivedCallback(dataPointReceived); } if (dataReceiver == null) { dataReceiver = new DataReceiver(comPortName, dataPointReceiverCallback); } if (viewModelDataPointReceivedCallback == null) { viewModelDataPointReceivedCallback = viewModelDataPointReceivedCallback1; } this.comPortName = comPortName; }
public DataReceiver(string comPortName, DataPointReceivedCallback dataPointReceivedCallback1) { // Delegate for callback from SerialPortHelper class -- triggered when data is received from serial port if (dataReceivedCallBack == null) { dataReceivedCallBack = new SerialPortDataReceivedCallBack(dataReceived); } if (dataPointReceivedCallback == null) { dataPointReceivedCallback = dataPointReceivedCallback1; } // Instantiate a SerialPortHelper object if (serialPortHelper == null) { serialPortHelper = new SerialPortHelper(comPortName, dataReceivedCallBack); } // Testing DELETE LATER // sendSampleSpeedData(); }