Ejemplo n.º 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));
                }
            }

        }
Ejemplo n.º 2
0
        internal static void ConstrainTipInfo(Layout layout)
        {
            if (layout.DitiInfo != null 
                && layout.DitiInfo.DitiBoxInfos != null
                && layout.DitiInfo.DitiBoxInfos.Count != 0)
                return;

            DitiInfo ditiInfo = new DitiInfo();
            Dictionary<DitiType, string> currentDitis = new Dictionary<DitiType, string>();
            foreach (Carrier carrier in layout.Carriers )
            {
                if (carrier.TypeName == BuildInCarrierType.Diti.ToString())
                {

                    foreach (Labware labware in carrier.Labwares)
                    {
                        //LabwareTraits.Add(new LabwareTrait(labware));
                        DitiType ditiType = DitiBox.Parse(labware.TypeName); 
                        DitiBoxInfo ditiBoxInfo = new DitiBoxInfo(ditiType, labware.Label,96);
                        if (ditiInfo.GetCurrentLabel(ditiType) == "")
                        {
                            ditiBoxInfo.isUsing = true;
                        }
                        ditiInfo.DitiBoxInfos.Add(ditiBoxInfo);
                    }
                }
            }
            layout.DitiInfo = ditiInfo;
        }