public bool getCamera(rocConstants.CAMS cameraID, out VideoCaptureDevice camera) { try { camera = cameraMap[cameraID.ToString()]; } catch { camera = null; return false; } return true; }
/// <summary> /// Only needs to be called after calling disconnect. Sockets try to connect as soon as the networkManager is online. /// </summary> /// <param name="ID"></param> public void connect(rocConstants.COMID ID) { switch (ID) { case rocConstants.COMID.DRIVECOM: DRIVECOM.beginConnect(rocConstants.MCIP_DRIVE, rocConstants.MCPORT_DRIVE); break; case rocConstants.COMID.ENGCOM: ENGCOM.beginConnect(rocConstants.MCIP_ENG, rocConstants.MCPORT_ENGINEERING); break; case rocConstants.COMID.ARMCOM: ARMCOM.beginConnect(rocConstants.MCIP_ARM, rocConstants.MCPORT_ARM); break; case rocConstants.COMID.LOGISTICSCOM: LOGCOM.beginConnect(rocConstants.MCIP_LOGISTICS, rocConstants.MCPORT_LOGISTICS); break; } }
public void write(rocConstants.COMID ID, string Message) { switch (ID) { case rocConstants.COMID.DRIVECOM: Message = Message.Replace("\n", ""); //Do not allow \n to be transmitted... I think this is dealt with elsewhere, but this is safe... DRIVECOM.sendMessage(Message); break; case rocConstants.COMID.ENGCOM: Message = Message.Replace("\n", ""); //Do not allow \n to be transmitted... I think this is dealt with elsewhere, but this is safe... ENGCOM.sendMessage(Message); break; case rocConstants.COMID.ARMCOM: Message = Message.Replace("\n", ""); //Do not allow \n to be transmitted... I think this is dealt with elsewhere, but this is safe... ARMCOM.sendMessage(Message); break; case rocConstants.COMID.LOGISTICSCOM: Message = Message.Replace("\n", ""); //Do not allow \n to be transmitted... I think this is dealt with elsewhere, but this is safe... LOGCOM.sendMessage(Message); break; } }
public void disconnect(rocConstants.COMID ID) { switch (ID) { case rocConstants.COMID.DRIVECOM: DRIVECOM.disconnect(); break; case rocConstants.COMID.ENGCOM: ENGCOM.disconnect(); break; case rocConstants.COMID.ARMCOM: ARMCOM.disconnect(); break; case rocConstants.COMID.LOGISTICSCOM: LOGCOM.disconnect(); break; } }