/// <summary> /// Retrieves a plate description from the web service. /// </summary> /// <param name="robot">The robot to find the plate type for.</param> /// <param name="plateID">The <c>plateID</c> of the plate.</param> /// <returns>The <c>IPlateInfo</c> describing the plate.</returns> public IPlateInfo FetchPlateInfo(IRobot robot, string plateID) { // Check arguments - do it up front to avoid possible inconsistencies later if (robot == null) { throw new System.NullReferenceException("robot must not be null"); } if (plateID == null) { throw new System.NullReferenceException("plateID must not be null"); } // Log the call if (_log.IsDebugEnabled) { string msg = "Called " + this + ".FetchPlateInfo(robot=" + robot.ToString() + ", plateID=\"" + plateID + "\")"; _log.Debug(msg); } // Special case for ReliabilityTestPlate if ("ReliabilityTestPlate".Equals(plateID)) { OPPF.Integrations.ImagerLink.PlateInfo dummy = new OPPF.Integrations.ImagerLink.PlateInfo(); dummy.SetDateDispensed(DateTime.Now); dummy.SetExperimentName("Dummy Expt Name"); dummy.SetPlateNumber(1); dummy.SetPlateTypeID("1"); dummy.SetProjectName("Dummy Project Name"); dummy.SetUserEmail("DummyEmailAddress"); dummy.SetUserName("Dummy UserName"); return(dummy); } // Declare the return variable OPPF.Integrations.ImagerLink.PlateInfo pi = null; try { // Create and populate the request object getPlateInfo request = new getPlateInfo(); request.robot = OPPF.Utilities.Robot2Utils.createProxy(robot); request.plateID = plateID; // Make the web service call WSPlate wsPlate = WSPlateFactory.getWSPlate2(); _log.Info("Calling WSPlate.getPlateInfo()"); getPlateInfoResponse response = wsPlate.getPlateInfo(request); // Get the webservice proxy PlateInfo OPPF.Proxies2.PlateInfo ppi = response.getPlateInfoReturn; // Map it into an IPlateInfo pi = new OPPF.Integrations.ImagerLink.PlateInfo(); pi.SetDateDispensed(ppi.dateDispensed); pi.SetExperimentName(ppi.experimentName); pi.SetPlateNumber(ppi.plateNumber); // TODO Figure out how to get pims to tell us the right answer //pi.SetPlateTypeID(ppi.plateTypeID); pi.SetPlateTypeID(PlateInfoProviderNew.getIDForName(ppi.plateTypeID)); pi.SetProjectName(ppi.projectName); pi.SetUserEmail(ppi.userEmail); pi.SetUserName(ppi.userName); } catch (Exception e) { string msg = "WSPlate.getPlateInfo threw " + e.GetType() + ":\n" + e.Message + "\nfor plate \"" + plateID + "\" in robot \"" + robot.Name + "\"\n - probably not in LIMS - not fatal."; if (e is System.Web.Services.Protocols.SoapException) { System.Web.Services.Protocols.SoapException ee = (System.Web.Services.Protocols.SoapException)e; msg = msg + "\n\n" + ee.Detail.InnerXml; } // Log it _log.Error(msg, e); // Don't rethrow - return null - don't want to stop imaging } // Return the IPlateInfo return(pi); }
/// <summary> /// Retrieves a dummy plate description. /// </summary> /// <param name="robot">The robot to find the plate type for.</param> /// <param name="plateID">The <c>plateID</c> of the plate.</param> /// <returns>The <c>IPlateInfo</c> describing the plate.</returns> public IPlateInfo FetchPlateInfo(IRobot robot, string plateID) { // Check arguments - do it up front to avoid possible inconsistencies later if (robot == null) { throw new System.NullReferenceException("robot must not be null"); } if (plateID == null) { throw new System.NullReferenceException("plateID must not be null"); } // Log the call if (_log.IsDebugEnabled) { string msg = "Called " + this + ".DummyFetchPlateInfo(robot=" + robot.ToString() + ", plateID=\"" + plateID + "\")"; _log.Debug(msg); } OPPF.Integrations.ImagerLink.PlateInfo dummy = new OPPF.Integrations.ImagerLink.PlateInfo(); dummy.SetDateDispensed(DateTime.Now); dummy.SetExperimentName("Dummy Expt for " + plateID); Regex numberregex = new Regex("^\\d+$"); if (numberregex.IsMatch(plateID)) { int start = plateID.Length - 8; if (start < 0) { start = 0; } dummy.SetPlateNumber(Convert.ToInt32(plateID.Substring(start))); } else { dummy.SetPlateNumber(1); } /* * platetypeid | strplatetype | intcolumns | introws | intsubpositions | intsubpositionheight | strbarcodepattern | intdefaultscheduleplan * -------------+--------------------------------------+------------+---------+-----------------+----------------------+-------------------+------------------------ * 1 | Greiner, central shelf only | 12 | 8 | 1 | 2107 | 4413xxxxxxxx | 1 * 2 | OPPF Full Greiner, all three shelves | 12 | 8 | 3 | 2107 | 3313xxxxxxxx | 1 * 3 | Fluidigm 1.96 | 12 | 8 | 1 | 100 | 109xxxxxxx | 2 * 4 | Fluidigm 4.96 | 12 | 8 | 4 | 100 | 110xxxxxxx | 2 * 5 | Fluidigm 8.96 | 12 | 8 | 8 | 100 | 112xxxxxxx | 2 * 6 | Fluidigm DC10 1.96 | 12 | 8 | 1 | 100 | 122xxxxxxx | 2 * 7 | Greiner DC | 12 | 8 | 1 | 2107 | 441310xxxxxx | 1 * 8 | STRUBI Capillary Plates | 12 | 8 | 1 | 100 | 441311xxxxxx | 1 * 9 | Zurich Capillary Plates | 3 | 16 | 19 | 100 | 441312xxxxxx | 2 */ if (plateID.StartsWith("109")) { dummy.SetPlateTypeID("3"); } else if (plateID.StartsWith("110")) { dummy.SetPlateTypeID("4"); } else if (plateID.StartsWith("112")) { dummy.SetPlateTypeID("5"); } else if (plateID.StartsWith("122")) { dummy.SetPlateTypeID("6"); } else if (plateID.StartsWith("441310")) { dummy.SetPlateTypeID("7"); } else if (plateID.StartsWith("441311")) { dummy.SetPlateTypeID("8"); } else if (plateID.StartsWith("441312")) { dummy.SetPlateTypeID("9"); } else { dummy.SetPlateTypeID("1"); } dummy.SetProjectName("Dummy Project for " + plateID); dummy.SetUserEmail("DummyEmailAddress"); dummy.SetUserName("Dummy UserName"); // Return the IPlateInfo return(dummy); }