コード例 #1
0
 void cmbCalibCarrier_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (cmbCalibCarrier.SelectedIndex == -1)
     {
         return;
     }
     if (labware.ParentCarrier == null)
     {
         labware.TempParentCarrier = cmbCalibCarrier.SelectedItem as Carrier;
     }
     labware.CalculatePositionInLayout();
 }
コード例 #2
0
        private void EditLabware_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Labware selectedLabware = e.Parameter != null? (Labware)e.Parameter: (Labware)this.lb_labwares.SelectedItem;

            if (selectedLabware == null || this.ActivateEditingTab(selectedLabware.TypeName))
            {
                return;
            }

            LabwareEditor editor = new LabwareEditor(AddInfo, this);

            selectedLabware.CalculatePositionInLayout();
            editor.DataContext = selectedLabware;
            this.AddTabItem(editor);
        }
コード例 #3
0
        /// <summary>
        /// Draw the worktable with pins, and the current DitiBox
        /// </summary>
        /// <param name="drawingContext"></param>
        public void Draw(DrawingContext drawingContext)
        {
            for (int i = 0; i < worktable.GridCount; i++)
            {
                DrawPinsSameGrid(i, drawingContext);
            }
            DrawBorder(worktable.Size, drawingContext);

            //if(layout.DitiInfo.DitiInfoItems.Count !=)
            foreach (var ditiBoxInfo in layout.DitiInfo.DitiBoxInfos)
            {
                Labware labware = layout.FindLabware(ditiBoxInfo.label);
                if (labware != null)
                {
                    labware.CalculatePositionInLayout();
                    var position = labware.GetAbsPosition(96);
                    position.X += 18;
                    VisualCommon.DrawCircle(position, 6, drawingContext, Colors.Red, true);
                }
            }
        }
コード例 #4
0
        void LabwareEditor_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                TeachingControllerDelegate.Instance.Controller.Init();
            }
            catch (CriticalException ex)
            {
                if (ex.Message == "Send_fail")
                {
                    MessageBox.Show("初始化失败,可能是机器未通电");
                }
            }

            labware = this.DataContext as Labware;
            int index = -1;

            if (labware.ParentCarrier != null)
            {
                int tempIndex = 0;
                foreach (var carrier in labware.AllCarriers)
                {
                    if (carrier.TypeName == labware.ParentCarrier.TypeName)
                    {
                        index = tempIndex;
                        break;
                    }
                }
                if (index != -1)
                {
                    cmbCalibCarrier.SelectedIndex = index;
                }
            }
            labware.CalculatePositionInLayout();
            GetCurrentPositon();
            curPositionPanel.DataContext = xyz;
            StartCheckingInput();
        }