if (simulate == true)
connector = new OpenEnergyMonitorSimulator();
else if (serialPort != null)
connector = new OpenEnergyMonitorSerialConnector(serialPort);
else
connector = new OpenEnergyMonitorUDPConnector(udpPort);
try {
connector.connect();
} catch (OpenEnergyMonitorException e) {
logger.error(