Beispiel #1
0
        internal static void ConstrainTipInfo_back(Layout layout)
        {
            var ditiInfos = layout.DitiInfo.DitiBoxInfos;
            List<DitiBoxInfo> constrainedDitiInfos = new List<DitiBoxInfo>();
            if (ditiInfos == null)
                return;
            //add value for the diti labware without this information
            foreach (var labwareTrait in layout._labwareTraits)
            {
                if (!ditiInfos.Exists( x=>x.label ==  labwareTrait.Label))
                {
                    DitiType ditiType = DitiBox.Parse(labwareTrait.TypeName);
                    constrainedDitiInfos.Add(new DitiBoxInfo(ditiType,labwareTrait.Label, 96));
                }
            }
            foreach (var tipInfo in ditiInfos)
            {
                LabwareTrait labwareTrait = layout._labwareTraits.Find(x => x.Label == tipInfo.label);
                if (Labware.IsDiti(labwareTrait.TypeName))
                {
                    constrainedDitiInfos.Add(tipInfo);
                }
            }

            layout.DitiInfo.DitiBoxInfos = constrainedDitiInfos;
            if (layout.DitiInfo.DitiBoxInfos.Count == 0)
            {
                foreach(var ditiInfo in constrainedDitiInfos)
                {
                    if (layout.DitiInfo.GetCurrentLabel(ditiInfo.type) != "")
                        layout.DitiInfo.DitiBoxInfos.Add(new DitiBoxInfo(ditiInfo.type, ditiInfo.label,96));
                }
            }

        }
Beispiel #2
0
 public LabwareTrait(Labware labware)
 {
     // TODO: Complete member initialization
     TypeName = labware.TypeName;
     GridID = labware.ParentCarrier.GridID;
     SiteID = labware.SiteID;
     Label = labware.Label;
 }
Beispiel #3
0
        public System.Windows.Point GetPosition(Carrier carrier, Labware labware, int wellID)
        {
            double dxCarrier = carrier.XOffset;
            double dyCarrier = carrier.YOffset;

            var position = labware.GetAbsPosition(wellID);            
            return position;
        }
Beispiel #4
0
 /// <summary>
 /// update the information which is common, very similar to clone
 /// </summary>
 /// <param name="exampleLabware"></param>
 public void CarryInfo(Labware exampleLabware)
 {
     _typeName        = exampleLabware.TypeName;
     _dimension       = exampleLabware._dimension;
     _backgroundColor = exampleLabware.BackgroundColor;
     _wellsInfo       = (WellsInfo)exampleLabware.WellsInfo.Clone();
     _zValues         = (ZValues)exampleLabware.ZValues.Clone();
 }
Beispiel #5
0
        /// <summary>
        /// Remove a labware from carrier by lable
        /// </summary>
        /// <param name="labwareName">Lable of labware to remove</param>
        public void RemoveLabware(string labwareName)
        {
            Labware labware = this._labwares.Find(l => l.TypeName == labwareName);

            if (labware != null)
            {
                this._labwares.Remove(labware);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Remove a labware from carrier
        /// </summary>
        /// <param name="labware">Instance of labware to remove</param>
        public void RemoveCarrier(Labware labware)
        {
            if (labware == null)
            {
                throw new ArgumentNullException("carrier", "carrier must not be null.");
            }

            this._labwares.Remove(labware);
        }
Beispiel #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="labware"></param>
        public void AddLabware(Labware labware)
        {
            if (labware == null)
            {
                throw new ArgumentNullException("labware", "labware must not be null.");
            }

            if (_labwares.Contains(labware))
            {
                return;
            }
            labware.ParentCarrier = this;
            this._labwares.Add(labware);
        }
Beispiel #8
0
        public override object Clone()
        {
            Labware copy = new Labware();

            copy._label           = "<Need a label>";
            copy._typeName        = this.TypeName;
            copy._dimension       = (Dimension)this.Dimension.Clone();
            copy._backgroundColor = this._backgroundColor;
            copy._parentCarrier   = null;
            copy._siteID          = this._siteID;
            copy._wellsInfo       = (WellsInfo)this._wellsInfo.Clone();
            copy._zValues         = (ZValues)this._zValues.Clone();
            return(copy);
        }
Beispiel #9
0
        protected static void RestoreLabwares(List<Carrier> carriers, List<LabwareTrait> labwareTraits, List<PlateVector> plateVectors)
        {
            foreach (LabwareTrait labwareTrait in labwareTraits)
            {
                var parentCarrier = carriers.Find(x => x.GridID == labwareTrait.GridID);
                if (parentCarrier == null)
                {
                    //warning should be given here
                    continue;
                }
                
                Labware labware = Labware.CreateFromTrait(labwareTrait, parentCarrier);
                if(labware != null)
                {
                    var plateVector = plateVectors.Find(x => x.Name == labwareTrait.Label);
                    labware.PlateVector = plateVector;
                    parentCarrier.Labwares.Add(labware);
                }
                    

            }
        }