private void Set(int startColIndex, int startRowIndex, int endColIndex, int endRowIndex) { if (!Vals.ContainsKey(GlobalVars.Instance.CurrentPlateID)) Vals.Add(GlobalVars.Instance.CurrentPlateID, new Dictionary<POSITION, string>()); Dictionary<POSITION, string> curPlatePosVals = Vals[GlobalVars.Instance.CurrentPlateID]; for( int x = startColIndex; x< endColIndex; x++) { for( int y = startRowIndex; y < endRowIndex; y++) { POSITION pos = new POSITION(x,y); if (curPlatePosVals.ContainsKey(pos)) curPlatePosVals[pos] = GlobalVars.Instance.PCRType; else curPlatePosVals.Add(pos, GlobalVars.Instance.PCRType); } } }
private void AdjustStartEndPosition(out POSITION start, out POSITION end) { Point ptDownRight = new Point(Math.Max(ptStart.X, ptEnd.X), Math.Max(ptStart.Y, ptEnd.Y)); Point ptUpLeft = new Point(Math.Min(ptStart.X, ptEnd.X), Math.Min(ptStart.Y, ptEnd.Y)); ptStart = ptUpLeft; ptEnd = ptDownRight; int colStart = (int)((ptStart.X - _szMargin.Width) / GetWellWidth()); ptStart.X = colStart * GetWellWidth() + _szMargin.Width; int rowStart = (int)((ptStart.Y - _szMargin.Height) / GetWellHeight()); ptStart.Y = rowStart * GetWellHeight() + _szMargin.Height; int colEnd = (int)Math.Ceiling(((ptEnd.X - _szMargin.Width) / GetWellWidth())); ptEnd.X = colEnd * GetWellWidth() + _szMargin.Width; int rowEnd = (int)Math.Ceiling(((ptEnd.Y - _szMargin.Height) / GetWellHeight())); ptEnd.Y = rowEnd * GetWellHeight() + _szMargin.Height; start.x = colStart; start.y = rowStart; end.x = colEnd; end.y = rowEnd; }
internal void Set(POSITION start, POSITION end) { Set(start.x, start.y, end.x, end.y); }