Esempio n. 1
0
        public frmSensorOptions(IFormOptions opts)
        {
            options = opts as SensorOptions;
            InitializeComponent();
            _tpy = new sensorType(options.thisSensorType);
            List<Node> allNodes = FrmMain.getAllConnectedNodes();
            foreach (Node node in allNodes)
            {

                if (node.hasSensorOf(_tpy))
                {
                    cboNodes.Items.Add(node);
                }
            }
            if (cboNodes.Items.Count == 0)
            {
                lblError.Text = "No nodes of this type are connected";
                btnOK.Enabled = false;
                cboNodes.Enabled = false;
            }
            else
            {
                lblError.Text = "";
                cboNodes.SelectedIndex = 0;
            }
            if (options.thisSensor != null)
                cboNodes.SelectedItem = options.thisSensor;
        }
Esempio n. 2
0
 public override IFormOptions setupOptions()
 {
     SensorOptions options = new SensorOptions(sensorTypeEnum.generic_digital_out, this.selectedSensor);
     return options;
 }