Пример #1
0
        static void CreateDynamic(Model.Node router, int nodeNumber, Dispatcher dispatcher)
        {
            var dyna = new Model.Node(nodeNumber, router, "dynamic")
            {
                Description = "Linear N:N with Dynamic Parameters",
            };

            var labels       = new Model.Node(1, dyna, "labels");
            var targetLabels = new Model.Node(1, labels, "targets");
            var sourceLabels = new Model.Node(2, labels, "sources");

            var targets = new List <Model.Signal>();
            var sources = new List <Model.Signal>();

            for (int index = 0; index < 1000; index++)
            {
                var targetLabel = new Model.StringParameter(index, targetLabels, IdentOf("t", index), dispatcher, isWriteable: true)
                {
                    Value = IdentOf("DYN-T", index)
                };
                targets.Add(new Model.Signal(index, targetLabel));

                var sourceLabel = new Model.StringParameter(index, sourceLabels, IdentOf("s", index), dispatcher, isWriteable: true)
                {
                    Value = IdentOf("DYN-S", index)
                };
                sources.Add(new Model.Signal(index, sourceLabel));
            }

            var matrix = new Model.DynamicMatrix(
                3,
                dyna,
                "matrix",
                dispatcher,
                targets,
                sources,
                labels);

            foreach (var target in matrix.Targets)
            {
                matrix.Connect(target, new[] { matrix.GetSource(target.Number) }, null);
            }
            //matrix.Connect(target, matrix.Sources, null);
        }
Пример #2
0
        GlowContainer Model.IElementVisitor <ElementToGlowOptions, GlowContainer> .Visit(Model.DynamicMatrix element, ElementToGlowOptions state)
        {
            var glow = MatrixToGlow(element, state);

            if (state.DirFieldMask == GlowFieldFlags.All)
            {
                glow.MatrixType          = GlowMatrixType.NToN;
                glow.ParametersLocation  = new GlowParametersLocation(element.ParametersSubIdentifier);
                glow.GainParameterNumber = 1;
            }

            return(glow);
        }