Пример #1
0
 private void Port_ConnectionChanged(object sender, ConnectionModifiedEventArgs e)
 {
     if (e.Action == ConnectionModifiedEventArgs.Modifier.Changed && e.Connection == null)
     {
         Parent.Parent.Disconnect(this);
     }
 }
Пример #2
0
        private void Recorder2_PortConnectionChanged(object sender, ConnectionModifiedEventArgs e)
        {
            if (changingConnections)
            {
                return;
            }
            changingConnections = true;

            UpdateInputPorts();

            var dataInputs = InputPorts.OfType <NodeSystemLib2.FormatData1D.InputPortData1D>();

            if (dataInputs.All(d => d.Connection != null))
            {
                var p = new NodeSystemLib2.FormatData1D.InputPortData1D(this, $"DIn {dataInputs.Count() + 1}");
                AddPort(p, EnablePortIndex);
            }

            var valueInputs = InputPorts.OfType <NodeSystemLib2.FormatValue.InputPortValueDouble>().Except(new [] { _portEn });

            if (valueInputs.All(d => d.Connection != null))
            {
                var p = new NodeSystemLib2.FormatValue.InputPortValueDouble(this, $"VIn {valueInputs.Count() + 1}");
                AddPort(p, EnablePortIndex);
            }

            changingConnections = false;
        }
Пример #3
0
 private void OutputPortDataFFT_ConnectionAdded(object sender, ConnectionModifiedEventArgs e)
 {
     if (e.Action == ConnectionModifiedEventArgs.Modifier.Added)
     {
         ((InputPortDataFFT)e.Connection).FFTSize = FFTSize;
     }
 }
Пример #4
0
        private void Port_ConnectionRemoved(object sender, ConnectionModifiedEventArgs e)
        {
            var screen = Parent.Parent;
            var port   = Ports.OfType <InputGraphConnector>().FirstOrDefault(p => p.Port == e.Connection);

            if (port != null)
            {
                port.Connection = null;
                this.RemoveConnection(port);
            }
        }
Пример #5
0
        private async void ConnPane_OnConnectionModified(object sender, ConnectionModifiedEventArgs e)
        {
            bool gotPlugins = await GetPlugins(e.ModifiedConnection.ConnectionString);

            if (!gotPlugins)
            {
                Customizations.IsEnabled = false;
                Solutions.IsEnabled      = false;
                return;
            }

            Customizations.IsEnabled = true;
            Solutions.IsEnabled      = true;
        }
Пример #6
0
        private void MetricDisplay2_PortConnectionChanged(object sender, ConnectionModifiedEventArgs e)
        {
            //var port = (Port)sender;
            //if (port.DataType.Equals(PortDataTypes.TypeIdSignal1D)) {
            //    var dataInputPorts = InputPorts.OfType<InputPortData1D>();
            //    if (e.Connection != null) {
            //        var newPort = new InputPortData1D(this, $"Dinp {dataInputPorts.Count() + 1}");
            //    } else {
            //        if (dataInputPorts.Count() > 1) RemoveLastUnusedInputPortOf<InputPortData1D>();
            //    }

            //} else if (port.DataType.Equals(PortDataTypes.TypeIdValueDouble)) {
            //    var valueInputPorts = InputPorts.OfType<InputPortValueDouble>();
            //    if ((e.Action == ConnectionModifiedEventArgs.Modifier.Added ||
            //        e.Action == ConnectionModifiedEventArgs.Modifier.Changed) &&
            //        e.Connection != null) {

            //        var newPort = new InputPortValueDouble(this, $"Vinp {valueInputPorts.Count() + 1}");
            //    } else {
            //        if (valueInputPorts.Count() > 1) RemoveLastUnusedInputPortOf<InputPortValueDouble>();
            //    }
            //}
        }
Пример #7
0
 private void LineStateChanged(object sender, ConnectionModifiedEventArgs e)
 {
 }