Example #1
0
        /// <summary>
        /// Elkéri a cella sztring értékét.
        /// </summary>
        /// <param name="p_Cell">A cella neve, pl. A0, B8, BA25 stb.</param>
        /// <returns>A cella sztring értéke.</returns>
        public string GetStringCell(string p_Cell)
        {
            CvsCell cell = this.InSightConnection.Results.Cells[p_Cell];

            if (cell != null)
            {
                return(cell.ToString());
            }
            return(null);
        }
     void insight_ResultsChanged(object sender, EventArgs e)
     {
         // Here: Consider inserting code to check that this event
         // has been triggered by an image acquisition
 
         CvsResultSet results = insight.Results;
         // Note the reference below to row 10, column 3 (cell D10)
         CvsCell cell = results.Cells.GetCell(10, 3);
         if (cell == null)
         {
             MessageBox.Show("Error: Cell D10 is null");
             return;
         }
         if (cell.DataType != CvsCellDataType.FloatingPoint) {
             MessageBox.Show("Error: Unexpected data type at cell D10");
             return;
         }
         CvsCellFloat floatCell = (CvsCellFloat)cell;
         MessageBox.Show("Floating point value at cell D10 is: " + floatCell.Value.ToString());
     }
Example #3
0
        /// <summary>
        /// Elkéri a cella float értékét. Meghívás előtt mindig nézzük meg a cella típusát a <code>GetCellType</code> metódusal!
        /// </summary>
        /// <param name="p_Cell">A cella neve, pl. A0, B8, BA25 stb.</param>
        /// <returns>A cella integer értéke</returns>
        public float GetFloatCell(string p_Cell)
        {
            CvsCell cell = this.InSightConnection.Results.Cells[p_Cell];

            if (cell != null)
            {
                if (cell.DataType == CvsCellDataType.FloatingPoint)
                {
                    return((cell as CvsCellFloat).Value);
                }
                else if (cell.DataType == CvsCellDataType.Integer)
                {
                    return((cell as CvsCellInt).Value);
                }
                else
                {
                    throw new InvalidCastException("The selected type cannot be returned as type \"float\"");
                }
            }
            throw new InvalidCastException("The selected type cannot be returned as type \"float\"");
        }
Example #4
0
        /// <summary>
        /// Visszaadja a cella értéktípusát.
        /// </summary>
        /// <param name="p_Cell">A cella neve, pl. A0, B8, BA25 stb.</param>
        /// <returns>A cella értéktípusa.</returns>
        public CellType GetCellType(string p_Cell)
        {
            CvsCell cell = this.InSightConnection.Results.Cells[p_Cell];

            if (cell != null)
            {
                switch (cell.DataType)
                {
                case CvsCellDataType.Integer:
                case CvsCellDataType.FloatingPoint:
                    return(CellType.Numeric);

                case CvsCellDataType.String:
                    return(CellType.String);

                default:
                    return(CellType.Other);
                }
            }
            return(CellType.Other);
        }
Example #5
0
        /// <summary>
        /// Elkéri a cella bool értékét. Számok esetében 0 <code>false</code> és minden más <code>true</code>,
        /// sztring esetén az üres sztring <code>false</code> minden és más <code>true</code>, egyéb cella mindig <code>false</code>.
        /// </summary>
        /// <param name="p_Cell">A cella neve, pl. A0, B8, BA25 stb.</param>
        /// <returns>A cella bool értéke.</returns>
        public bool GetBoolCell(string p_Cell)
        {
            CvsCell cell = this.InSightConnection.Results.Cells[p_Cell];

            if (cell != null)
            {
                switch (cell.DataType)
                {
                case CvsCellDataType.Integer:
                    return((cell as CvsCellInt).Value != 0);

                case CvsCellDataType.FloatingPoint:
                    return((cell as CvsCellFloat).Value != 0);

                case CvsCellDataType.String:
                    return(cell.ToString().Length < 1);

                default:
                    return(false);
                }
            }
            return(false);
        }
Example #6
0
        public string GET_STRING()
        {
            CvsCell cell1 = mInSight.Results.Cells[GET_TEXT];

            return(cell1.Text);
        }