private string GenerateToolTipString(ManagedPGRGuid guid) { if (guid.Equals(m_lastTooltipGuid)) { return(m_tooltipString); } m_lastTooltipGuid = guid; if (guid.Equals(m_currCameraGuid)) { StringBuilder tooltipStr = new StringBuilder(); tooltipStr.AppendFormat("Camera: {0} {1} ({2})", m_camInfo.vendorName, m_camInfo.modelName, m_camInfo.serialNumber).AppendLine(); tooltipStr.AppendFormat("Sensor: {0}", m_camInfo.sensorInfo).AppendLine(); tooltipStr.AppendFormat("Firmware: {0} Built: {1}", m_camInfo.firmwareVersion, m_camInfo.firmwareBuildTime).AppendLine(); tooltipStr.AppendFormat("Driver: {0}", m_camInfo.driverName).AppendLine(); m_tooltipString = tooltipStr.ToString(); return(m_tooltipString); } ManagedCameraBase tempCamera = null; if (m_busMgr.GetInterfaceTypeFromGuid(guid) == InterfaceType.GigE) { tempCamera = new ManagedGigECamera(); } else { tempCamera = new ManagedCamera(); } using (tempCamera) { tempCamera.Connect(guid); CameraInfo camInfo = tempCamera.GetCameraInfo(); StringBuilder tooltipStr = new StringBuilder(); tooltipStr.AppendFormat("Camera: {0} {1} ({2})", camInfo.vendorName, camInfo.modelName, camInfo.serialNumber).AppendLine(); tooltipStr.AppendFormat("Sensor: {0}", camInfo.sensorInfo).AppendLine(); tooltipStr.AppendFormat("Firmware: {0} Built: {1}", camInfo.firmwareVersion, camInfo.firmwareBuildTime).AppendLine(); tooltipStr.AppendFormat("Driver: {0}", camInfo.driverName).AppendLine(); m_tooltipString = tooltipStr.ToString(); return(m_tooltipString); } }
private static bool IsGuidValid(ManagedPGRGuid guid) { if (guid.Equals(new ManagedPGRGuid()) == false) { return(true); } else { return(false); } }
private void OnRefreshTopology() { try { m_baseNode = m_busMgr.GetTopology(); m_redrawTree = true; } catch (FC2Exception ex) { // Error Debug.WriteLine("Error getting topology." + ex.Message); } m_drawingArea.Refresh(); if (m_selectedGuid.Equals(new ManagedPGRGuid()) == false) { // If current selected node is not a null node, // We need to update node information as well UpdateNodeInformation(m_selectedGuid); } }
private void UpdateNodeInformation(ManagedPGRGuid guidToUse) { // Fix for Bug 22724 if (guidToUse.Equals(m_currCameraGuid)) { UpdateNodeModelInformation(m_camInfo); UpdateNodeProductIDInformation(); UpdateNodeVoltageInformation(m_camera); UpdateNodeCurrentInformation(m_camera, m_camInfo); UpdatePhyRegisters(); } else { using (ManagedCamera camera = new ManagedCamera()) { CameraInfo camInfo; try { camera.Connect(guidToUse); camInfo = camera.GetCameraInfo(); } catch (FC2Exception ex) { UpdatePhyRegisters(); ex.Dispose(); return; } UpdateNodeModelInformation(camInfo); UpdateNodeProductIDInformation(); UpdateNodeVoltageInformation(camera); UpdateNodeCurrentInformation(camera, camInfo); UpdatePhyRegisters(); } } }