Ejemplo n.º 1
0
        public virtualNodeBase(int newId, string newName, virtualNodeSensor newSensor)
        {
            id = newId;
            name = newName;

            sensors.Add(newSensor.id, newSensor);
        }
Ejemplo n.º 2
0
        private void onChangeSensor(virtualNodeBase senderNode, virtualNodeSensor changingSensor, int newValue)
        {
            if (senderNode.id != ourNode.id)
                return;

            sensorCtlsByID[changingSensor.id].updateValue(newValue);
        }
Ejemplo n.º 3
0
        public void loadSensor(virtualNodeSensor sensor)
        {
            parentSensor = sensor;
            lblSensorID.Text = sensor.id.ToString();
            lblSensorType.Text = sensor.type.ToString();

            switch (sensor.type)
            {
                case sensorTypeEnum.generic_digital_out:
                    sensorVis = new ctlNodeSensorGenericDigitalOut();
                    break;
                case sensorTypeEnum.generic_digital_in:
                    sensorVis = new ctlNodeSensorGenericDigitalIn();
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            sensorVis.onInputChanged += inputChanged;

            sensorVis.Top = lblSensorType.Top + lblSensorType.Height;
            Controls.Add(sensorVis);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Fire the onChangeSensor event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="newVal"></param>
 protected void changeSensor(virtualNodeSensor sender, int newVal)
 {
     if (onChangeSensor != null)
         onChangeSensor.Invoke(this, sender, newVal);
 }