コード例 #1
0
ファイル: Routing_Form.cs プロジェクト: rahulbishnoi/LabM
        private void c1FlexGrid_Conditions_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (!ribbonCheckBox_CheckCondition.Checked)
               {
               C1FlexGrid grid = sender as C1FlexGrid;
               if (grid.RowSel > 0)
               {

                   Point pt = new Point(e.X, e.Y);
                   Point FormLocation = this.Location;

                   // Point groupLocation = groupBox2.Location;
                   // Point groupLocation = splitContainer2.Panel1.Location;
                   Point groupLocationSplitter = splitContainer1.Panel2.Location;
                   Point groupLocation = grid.Location;

                   Point PopupLocation = new Point(FormLocation.X + groupLocation.X + e.X + groupLocationSplitter.X - 40, FormLocation.Y + 145 + groupLocation.Y + e.Y);
                   int nCondition_ID = (int)grid[grid.RowSel, "Condition"];

                   if (nCondition_ID == (int)Definition.RoutingConditions.SAMPLEONPOS || // sample on pos
                       nCondition_ID == (int)Definition.RoutingConditions.SAMPLEPRIORITY || // sample priority
                       nCondition_ID == (int)Definition.RoutingConditions.SAMPLETYPE) // sample type
                   {
                       if (grid.ColSel == 3)
                       {
                           Select_Form select_Form = new Select_Form(this, PopupLocation, nCondition_ID, grid, true);
                           select_Form.ShowDialog();
                       }
                   }
               }
               }
        }
コード例 #2
0
ファイル: Routing_Form.cs プロジェクト: rahulbishnoi/LabM
        private void c1FlexGrid_Commands_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (ribbonCheckBox_CheckCondition.Checked) { ShowEditInfo(); return; }

               C1FlexGrid grid = sender as C1FlexGrid;
               Point pt = new Point(e.X, e.Y);
               Point FormLocation = this.Location;

               Point groupLocation = grid.Location;
               Point groupLocationSplitter = splitContainer1.Panel2.Location;
               Point PopupLocation = new Point(FormLocation.X + groupLocation.X + e.X + groupLocationSplitter.X-70, FormLocation.Y + 90 + groupLocation.Y + e.Y);

               // Rectangle rc = grid.GetCellRect(row,col);
               // idrouting_commands,RoutingPositionEntry_ID
               if (grid.Row != -1)
               {
               int nCommandType_ID = (int)grid[grid.RowSel, "Command"];

               if (nCommandType_ID == (int)Definition.RoutingCommands.SHIFTSAMPLE) // shift sample
               {
                   if (grid.ColSel == 2)
                   {
                       Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                       select_Form.ShowDialog();
                   }
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.CREATESAMPLE) // create sample
               {
                   if (grid.ColSel == 2 || grid.ColSel == 3)
                   {
                       Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                       select_Form.ShowDialog();
                   }
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.DELETESAMPLE) // delete sample
               {
                   // no edit needed
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.CHANGESAMPLETYPE) // change sample type
               {
                   // done with a combobox
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.CHANGEPRIORITY) // change sample priority
               {
                   // done with a numeric box
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.WRITEGLOBALTAG) // write WinCC global tag
               {
                   if (grid.ColSel == 4)
                   {
                       Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                       select_Form.ShowDialog();
                   }
               }
               if (nCommandType_ID == (int)Definition.RoutingCommands.WRITEMACHINETAG) // write WinCC machine tag
               {
                   if (grid.ColSel == 4)
                   {
                       Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                       select_Form.ShowDialog();
                   }

               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.INSERTWSENTRY) // write WS entry
               {
                   // both Name and Value must be free discribable
                   if (grid.ColSel == 3)
                   {
                       int nPositionType = -1;
                       Int32.TryParse(grid.GetData(grid.RowSel, 2).ToString(), out nPositionType);
                       if (nPositionType == (int)Definition.WSInsertLocation.SAMPLEONPOS)
                       {
                           Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                           select_Form.ShowDialog();
                       }
                   }
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.DELETEWSENTRY) // delete WS entry
               {
                   // both Name must be free discribable
               }

               if (nCommandType_ID == (int)Definition.RoutingCommands.SENDINGCOMMANDTOMACHINE) // sending command to machine
               {
                   if (grid.ColSel == 2 || grid.ColSel == 3)
                   {
                       Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                       select_Form.ShowDialog();
                   }
               }
               if (nCommandType_ID == (int)Definition.RoutingCommands.CREATERESERVATION
                   || nCommandType_ID == (int)Definition.RoutingCommands.DELETERESERVATION) // create/delete reservation
               {
                   if (grid.ColSel == 2)
                   {
                       Select_Form select_Form = new Select_Form(this, PopupLocation, nCommandType_ID, grid);
                       select_Form.ShowDialog();
                   }
               }
               }
        }