public static object InsightFormula(Cell cell, object[] args) { if (args.Length >= 2) { InsightSensor iss = VisionSystem.Project.Devices.FirstOrDefault(device => device.Name == args[0].ToString()) as InsightSensor; if (iss != null) { try { string arg = args[1].ToString(); switch (iss.GetCellType(arg)) { case InsightSensor.CellType.Numeric: return(iss.GetFloatCell(arg)); case InsightSensor.CellType.String: case InsightSensor.CellType.Other: return(iss.GetStringCell(arg)); } } catch (Exception) { return(null); } } } return(null); }
public InSightEditor(InsightSensor device) { InitializeComponent(); this.pnlDisplayContainer.Controls.Add(device.InSightDisplay); device.InSightDisplay.Dock = DockStyle.Fill; device.InSightDisplay.ShowGrid = true; }