SwegonVentilationConnector connector;
if (simulator == true)
connector = new SwegonVentilationSimulator();
else if (serialPort != null)
connector = new SwegonVentilationSerialConnector(serialPort);
else
connector = new SwegonVentilationUDPConnector(udpPort);
try {
connector.connect();