Beispiel #1
0
        static string BuildArgumentValues(
            IFunctionInstance function,
            NamedCollection <IArgumentDeclaration> arguments,
            INamedExpressionTuple expressions,
            ICppScope scope,
            string kind)
        {
            if (arguments.IsEmpty())
            {
                return(string.Empty);
            }
            var name     = scope.MakeLocalName();
            var typeName = GetFunctionTypeName(function.Name, kind);

            scope.Runtime.AddLine($"{typeName} {name};");
            var argN = 0;

            foreach (var expression in expressions.Tuple)
            {
                var argument = arguments[argN];
                argN++;
                var value = Dynamic((dynamic)expression.Expression, scope);
                if (argument.IsAssignable)
                {
                    scope.Runtime.AddLine($"{name}.{CppEscape(argument.Name)} = &{value};");
                }
                else
                {
                    scope.Runtime.AddLine($"{name}.{CppEscape(argument.Name)} = {value};");
                }
            }
            return(name);
        }
        private FunctionStartedMessage CreateStartedMessageWithoutArguments(IFunctionInstance instance)
        {
            FunctionStartedMessage message = new FunctionStartedMessage
            {
                HostInstanceId      = _hostOutputMessage.HostInstanceId,
                HostDisplayName     = _hostOutputMessage.HostDisplayName,
                SharedQueueName     = _hostOutputMessage.SharedQueueName,
                InstanceQueueName   = _hostOutputMessage.InstanceQueueName,
                Heartbeat           = _hostOutputMessage.Heartbeat,
                WebJobRunIdentifier = _hostOutputMessage.WebJobRunIdentifier,
                FunctionInstanceId  = instance.Id,
                Function            = instance.FunctionDescriptor,
                ParentId            = instance.ParentId,
                Reason    = instance.Reason,
                StartTime = DateTimeOffset.UtcNow
            };

            // It's important that the host formats the reason before sending the message.
            // This enables extensibility scenarios. For the built in types, the Host and Dashboard
            // share types so it's possible (in the case of triggered functions) for the formatting
            // to require a call to TriggerParameterDescriptor.GetTriggerReason and that can only
            // be done on the Host side in the case of extensions (since the dashboard doesn't
            // know about extension types).
            message.ReasonDetails = message.FormatReason();

            return(message);
        }
        public ApplicationInsightsLoggerTests()
        {
            _functionCategoryName = LogCategories.CreateFunctionUserCategory(_functionShortName);
            _endTime   = _startTime.AddMilliseconds(_durationMs);
            _arguments = new Dictionary <string, string>
            {
                ["queueMessage"] = "my message",
                ["anotherParam"] = "some value"
            };

            TelemetryConfiguration config = new TelemetryConfiguration
            {
                TelemetryChannel   = _channel,
                InstrumentationKey = "some key"
            };

            // Add the same initializers that we use in the product code
            DefaultTelemetryClientFactory.AddInitializers(config);

            _client = new TelemetryClient(config);

            var descriptor = new FunctionDescriptor
            {
                FullName  = _functionFullName,
                ShortName = _functionShortName
            };

            _functionInstance = new FunctionInstance(_invocationId, null, ExecutionReason.AutomaticTrigger, null, null, descriptor);
        }
 public FunctionInstanceTraceWriter(IFunctionInstance instance, Guid hostInstanceId, TraceWriter innerWriter, TraceLevel level)
     : base(level)
 {
     _innerWriter    = innerWriter;
     _instance       = instance;
     _hostInstanceId = hostInstanceId;
 }
        public ApplicationInsightsLoggerTests()
        {
            _functionCategoryName = LogCategories.CreateFunctionUserCategory(_functionShortName);
            _endTime   = _startTime.AddMilliseconds(_durationMs);
            _arguments = new Dictionary <string, string>
            {
                ["queueMessage"] = "my message",
                ["anotherParam"] = "some value"
            };

            _host = new HostBuilder()
                    .ConfigureLogging(b =>
            {
                b.SetMinimumLevel(LogLevel.Trace);
                b.AddApplicationInsights(o =>
                {
                    o.InstrumentationKey = "some key";
                });
            }).Build();

            TelemetryConfiguration telemteryConfiguration = _host.Services.GetService <TelemetryConfiguration>();

            telemteryConfiguration.TelemetryChannel = _channel;

            _client = _host.Services.GetService <TelemetryClient>();

            var descriptor = new FunctionDescriptor
            {
                FullName  = _functionFullName,
                ShortName = _functionShortName
            };

            _functionInstance = new FunctionInstance(_invocationId, new Dictionary <string, string>(), null, ExecutionReason.AutomaticTrigger, null, null, descriptor);
        }
        public async Task <IDelayedException> TryExecuteAsync(IFunctionInstance instance, CancellationToken cancellationToken)
        {
            FunctionStartedMessage             startedMessage        = CreateStartedMessageWithoutArguments(instance);
            IDictionary <string, ParameterLog> parameterLogCollector = new Dictionary <string, ParameterLog>();
            FunctionCompletedMessage           completedMessage      = null;

            ExceptionDispatchInfo exceptionInfo = null;

            string startedMessageId = null;

            try
            {
                startedMessageId = await ExecuteWithLogMessageAsync(instance, startedMessage, parameterLogCollector, cancellationToken);

                completedMessage = CreateCompletedMessage(startedMessage);
            }
            catch (Exception exception)
            {
                if (completedMessage == null)
                {
                    completedMessage = CreateCompletedMessage(startedMessage);
                }

                completedMessage.Failure = new FunctionFailure
                {
                    Exception        = exception,
                    ExceptionType    = exception.GetType().FullName,
                    ExceptionDetails = exception.ToDetails(),
                };

                exceptionInfo = ExceptionDispatchInfo.Capture(exception);
            }

            completedMessage.ParameterLogs = parameterLogCollector;
            completedMessage.EndTime       = DateTimeOffset.UtcNow;

            bool loggedStartedEvent = startedMessageId != null;

            CancellationToken logCompletedCancellationToken;

            if (loggedStartedEvent)
            {
                // If function started was logged, don't cancel calls to log function completed.
                logCompletedCancellationToken = CancellationToken.None;
            }
            else
            {
                logCompletedCancellationToken = cancellationToken;
            }

            await _functionInstanceLogger.LogFunctionCompletedAsync(completedMessage,
                                                                    logCompletedCancellationToken);

            if (loggedStartedEvent)
            {
                await _functionInstanceLogger.DeleteLogFunctionStartedAsync(startedMessageId, cancellationToken);
            }

            return(exceptionInfo != null ? new ExceptionDispatchInfoDelayedException(exceptionInfo) : null);
        }
 public ShapeRegularPolygonObject(IFunctionInstance name, int nbOfEdges, double sizeOfEdges, double alpha = 0.0d)
     : base(name)
 {
     this.NumberOfEdges = nbOfEdges;
     this.SizeOfEdges = sizeOfEdges;
     this.alpha = alpha;
 }
        private async Task ExecuteWithOutputLogsAsync(IFunctionInstance instance,
                                                      IReadOnlyDictionary <string, IValueProvider> parameters,
                                                      TextWriter consoleOutput,
                                                      IFunctionOutputDefinition outputDefinition,
                                                      IDictionary <string, ParameterLog> parameterLogCollector,
                                                      CancellationToken cancellationToken)
        {
            IFunctionInvoker invoker = instance.Invoker;
            IReadOnlyDictionary <string, IWatcher> watches = CreateWatches(parameters);
            IRecurrentCommand updateParameterLogCommand    =
                outputDefinition.CreateParameterLogUpdateCommand(watches, consoleOutput);

            using (ITaskSeriesTimer updateParameterLogTimer = StartParameterLogTimer(updateParameterLogCommand,
                                                                                     _backgroundExceptionDispatcher))
            {
                try
                {
                    await ExecuteWithWatchersAsync(invoker, parameters, cancellationToken);

                    if (updateParameterLogTimer != null)
                    {
                        // Stop the watches after calling IValueBinder.SetValue (it may do things that should show up in
                        // the watches).
                        // Also, IValueBinder.SetValue could also take a long time (flushing large caches), and so it's
                        // useful to have watches still running.
                        await updateParameterLogTimer.StopAsync(cancellationToken);
                    }
                }
                finally
                {
                    ValueWatcher.AddLogs(watches, parameterLogCollector);
                }
            }
        }
            public Task <IFunctionOutputDefinition> CreateAsync(IFunctionInstance instance,
                                                                CancellationToken cancellationToken)
            {
                IFunctionOutputDefinition outputDefinition = new NullFunctionOutputDefinition();

                return(Task.FromResult(outputDefinition));
            }
Beispiel #10
0
        public void TestCase()
        {
            Function          teleport = new Function("teleport", 0x02);
            Function          wall     = new Function("wall", 0x03);
            Function          l        = new Function("l", 0x00);
            IFunctionInstance fiaa     = (IFunctionInstance)teleport.CreateInstance(new FunctionIntegerInstance("3"), new FunctionIntegerInstance("3"));
            IFunctionInstance fiab     = (IFunctionInstance)teleport.CreateInstance(new FunctionIntegerInstance("3"), new FunctionIntegerInstance("3"));

            Assert.IsTrue(fiaa.Equals(fiab));
            Assert.IsTrue(fiab.Equals(fiaa));
            Assert.AreEqual(fiaa.GetHashCode(), fiaa.GetHashCode());
            Assert.AreEqual(fiaa.GetHashCode(), fiab.GetHashCode());
            IFunctionInstance fiba = (IFunctionInstance)wall.CreateInstance(new FunctionIntegerInstance("3"), new FunctionIntegerInstance("3"), (IFunctionInstance)l.CreateInstance());
            IFunctionInstance fibb = (IFunctionInstance)wall.CreateInstance(new FunctionIntegerInstance("3"), new FunctionIntegerInstance("3"), (IFunctionInstance)l.CreateInstance());

            Assert.IsTrue(fiba.Equals(fibb));
            Assert.IsTrue(fibb.Equals(fiba));
            Assert.AreEqual(fiba.GetHashCode(), fiba.GetHashCode());
            Assert.AreEqual(fiba.GetHashCode(), fibb.GetHashCode());
            Assert.IsFalse(fiaa.Equals(fiba));
            Assert.IsFalse(fiaa.Equals(fibb));
            Assert.IsFalse(fiab.Equals(fiba));
            Assert.IsFalse(fiab.Equals(fibb));
            Assert.IsFalse(fiba.Equals(fiaa));
            Assert.IsFalse(fiba.Equals(fiab));
            Assert.IsFalse(fibb.Equals(fiaa));
            Assert.IsFalse(fibb.Equals(fiab));
        }
Beispiel #11
0
        public async Task <FunctionResult> TryExecuteAsync(TriggeredFunctionData input, CancellationToken cancellationToken)
        {
            var context = new FunctionInstanceFactoryContext <TTriggerValue>()
            {
                TriggerValue   = (TTriggerValue)input.TriggerValue,
                ParentId       = input.ParentId,
                TriggerDetails = input.TriggerDetails
            };

            if (input.InvokeHandler != null)
            {
                context.InvokeHandler = async next =>
                {
                    await input.InvokeHandler(next);

                    // NOTE: The InvokeHandler code path currently does not support flowing the return
                    // value back to the trigger.
                    return(null);
                };
            }

            IFunctionInstance instance  = _instanceFactory.Create(context);
            IDelayedException exception = await _executor.TryExecuteAsync(instance, cancellationToken);

            FunctionResult result = exception != null ?
                                    new FunctionResult(exception.Exception)
                : new FunctionResult(true);

            return(result);
        }
 public async Task <IDelayedException> TryExecuteAsync(IFunctionInstance instance, CancellationToken cancellationToken)
 {
     using (CancellationTokenSource callCancellationSource = CancellationTokenSource.CreateLinkedTokenSource(
                _shutdownToken, cancellationToken))
     {
         return(await _innerExecutor.TryExecuteAsync(instance, callCancellationSource.Token));
     }
 }
        public async Task <bool> ExecuteAsync(BrokeredMessage value, CancellationToken cancellationToken)
        {
            Guid?parentId = ServiceBusCausalityHelper.GetOwner(value);
            IFunctionInstance instance  = _instanceFactory.Create(value, parentId);
            IDelayedException exception = await _innerExecutor.TryExecuteAsync(instance, cancellationToken);

            return(exception == null);
        }
 public async Task<IDelayedException> TryExecuteAsync(IFunctionInstance instance, CancellationToken cancellationToken)
 {
     using (CancellationTokenSource callCancellationSource = CancellationTokenSource.CreateLinkedTokenSource(
         _shutdownToken, cancellationToken))
     {
         return await _innerExecutor.TryExecuteAsync(instance, callCancellationSource.Token);
     }
 }
Beispiel #15
0
        public async Task <bool> ExecuteAsync(IStorageQueueMessage value, CancellationToken cancellationToken)
        {
            Guid?parentId = QueueCausalityManager.GetOwner(value);
            IFunctionInstance instance  = _instanceFactory.Create(value, parentId);
            IDelayedException exception = await _innerExecutor.TryExecuteAsync(instance, cancellationToken);

            return(exception == null);
        }
Beispiel #16
0
        public static IServiceProvider GetInstanceServices(this IFunctionInstance instance)
        {
            if (instance is IFunctionInstanceEx functionInstance)
            {
                return(functionInstance.InstanceServices);
            }

            return(null);
        }
 internal static IDisposable BeginFunctionScope(this ILogger logger, IFunctionInstance functionInstance)
 {
     return(logger?.BeginScope(
                new Dictionary <string, object>
     {
         [ScopeKeys.FunctionInvocationId] = functionInstance?.Id,
         [ScopeKeys.FunctionName] = functionInstance?.FunctionDescriptor?.Method?.Name
     }));
 }
Beispiel #18
0
 public override bool Equals(object obj)
 {
     if (obj is IFunctionInstance)
     {
         IFunctionInstance ifi = (IFunctionInstance)obj;
         return(Object.Equals(this.Function, ifi.Function) && this.Terms.AllDual(ifi.Terms, (x, y) => x.Equals(y)));
     }
     return(false);
 }
Beispiel #19
0
        public async Task <IFunctionOutputDefinition> CreateAsync(IFunctionInstance instance, CancellationToken cancellationToken)
        {
            await _outputLogDirectory.Container.CreateIfNotExistsAsync(cancellationToken);

            string namePrefix = instance.Id.ToString("N");
            LocalBlobDescriptor outputBlob       = CreateDescriptor(_outputLogDirectory, namePrefix + ".txt");
            LocalBlobDescriptor parameterLogBlob = CreateDescriptor(_outputLogDirectory, namePrefix + ".params.txt");

            return(new BlobFunctionOutputDefinition(_outputLogDirectory.ServiceClient, outputBlob, parameterLogBlob));
        }
Beispiel #20
0
 internal static IDisposable BeginFunctionScope(this ILogger logger, IFunctionInstance functionInstance)
 {
     return(logger?.BeginScope(
                new Dictionary <string, object>
     {
         [ScopeKeys.FunctionInvocationId] = functionInstance?.Id.ToString(),
         [ScopeKeys.FunctionName] = functionInstance?.FunctionDescriptor?.LogName,
         [ScopeKeys.Event] = LogConstants.FunctionStartEvent
     }));
 }
        public async Task<IFunctionOutputDefinition> CreateAsync(IFunctionInstance instance, CancellationToken cancellationToken)
        {
            await _outputLogDirectory.Container.CreateIfNotExistsAsync(cancellationToken);

            string namePrefix = instance.Id.ToString("N");
            LocalBlobDescriptor outputBlob = CreateDescriptor(_outputLogDirectory, namePrefix + ".txt");
            LocalBlobDescriptor parameterLogBlob = CreateDescriptor(_outputLogDirectory, namePrefix + ".params.txt");

            return new BlobFunctionOutputDefinition(_outputLogDirectory.ServiceClient, outputBlob, parameterLogBlob);
        }
Beispiel #22
0
        public async Task <FunctionResult> TryExecuteAsync(TriggeredFunctionData input, CancellationToken cancellationToken)
        {
            IFunctionInstance instance  = _instanceFactory.Create((TTriggerValue)input.TriggerValue, input.ParentId);
            IDelayedException exception = await _executor.TryExecuteAsync(instance, cancellationToken);

            FunctionResult result = exception != null ?
                                    new FunctionResult(exception.Exception)
                : new FunctionResult(true);

            return(result);
        }
 public ShapeIrregularPolygonObject(IFunctionInstance name, IEnumerable<IdpGie.Geometry.Point3> points)
     : base(name)
 {
     this.points = points.ToList ();
     double minx = double.PositiveInfinity, miny = double.PositiveInfinity, maxx = double.NegativeInfinity, maxy = double.NegativeInfinity;
     foreach (IdpGie.Geometry.Point3 p in this.points) {
         minx = Math.Min (minx, p.X);
         miny = Math.Min (miny, p.Y);
         maxx = Math.Max (maxx, p.X);
         maxy = Math.Max (maxy, p.Y);
     }
     this.TextOffset = new IdpGie.Geometry.Point3 (0.5d * (minx + maxx), 0.5d * (miny + maxy));
 }
Beispiel #24
0
        static string BuildResultValues(IFunctionInstance function, ICppScope scope, ref string name)
        {
            var argumentDeclarations = function.Declaration.Results;

            if (argumentDeclarations.IsEmpty())
            {
                return(string.Empty);
            }
            name = scope.MakeLocalName();
            var typeName = GetFunctionTypeName(function.Name, kind: "Result");

            return($"{typeName} {name} = ");
        }
Beispiel #25
0
        /// <summary>
        /// Generate an <see cref="IShape"/> hierarchy by stating that the <paramref name="parent"/> is the parent of the <paramref name="child"/>.
        /// </summary>
        /// <param name='parent'>
        /// The associated name of the <see cref="IShape"/> that will become a parent of the <paramref name="child"/>.
        /// </param>
        /// <param name='child'>
        /// The associated name of the <see cref="IShape"/> that will become a child of the <paramref name="parent"/>.
        /// </param>
        public void BuildHierarchy(IFunctionInstance parent, IFunctionInstance child)
        {
            IShapeHierarchical schild = this.GetShape <IShapeHierarchical> (child);

            if (schild != null)
            {
                IShapeHierarchical sparnt = this.GetShape <IShapeHierarchical> (parent);
                if (sparnt != null)
                {
                    schild.Parent = sparnt;
                }
            }
        }
Beispiel #26
0
        static IExpression ParseResolved(
            IFunctionInstance function,
            INamedExpressionTuple leftArguments,
            IEnumerator <TokenData> tokens,
            IContext context,
            ref bool done)
        {
            var pool = new List <IFunctionInstance> {
                function
            };

            return(ParseFunctionOverloads(pool, leftArguments, tokens, context, ref done));
        }
Beispiel #27
0
        /// <summary>
        /// Gets the shape associated with the given name if the shape is of the type <typeparamref name="TShape"/>, otherwise the default value associated with <typeparamref name="TShape"/> is returned.
        /// </summary>
        /// <returns>
        /// The shape associated with the given name if the shape is of the type <typeparamref name="TShape"/>, otherwise the default value associated with <typeparamref name="TShape"/> is returned.
        /// </returns>
        /// <param name='key'>
        /// The name of the shape to look for.
        /// </param>
        /// <typeparam name='TShape'>
        /// The type of the shape to look for, needs to be a subtype of <see cref="IShape"/>.
        /// </typeparam>
        public TShape GetShape <TShape> (IFunctionInstance key) where TShape : IShape
        {
            IShape shp = this.objects [key];

            if (shp is TShape)
            {
                return((TShape)shp);
            }
            else
            {
                return(default(TShape));
            }
        }
        internal static TraceLevel GetFunctionTraceLevel(IFunctionInstance functionInstance)
        {
            TraceLevel functionTraceLevel = TraceLevel.Verbose;

            // Determine the TraceLevel for this function (affecting both Console as well as Dashboard logging)
            TraceLevelAttribute attribute = TypeUtility.GetHierarchicalAttributeOrNull <TraceLevelAttribute>(functionInstance.FunctionDescriptor.Method);

            if (attribute != null)
            {
                functionTraceLevel = attribute.Level;
            }

            return(functionTraceLevel);
        }
        public ShapeIrregularPolygonObject(IFunctionInstance name, IEnumerable <IdpGie.Geometry.Point3> points) : base(name)
        {
            this.points = points.ToList();
            double minx = double.PositiveInfinity, miny = double.PositiveInfinity, maxx = double.NegativeInfinity, maxy = double.NegativeInfinity;

            foreach (IdpGie.Geometry.Point3 p in this.points)
            {
                minx = Math.Min(minx, p.X);
                miny = Math.Min(miny, p.Y);
                maxx = Math.Max(maxx, p.X);
                maxy = Math.Max(maxy, p.Y);
            }
            this.TextOffset = new IdpGie.Geometry.Point3(0.5d * (minx + maxx), 0.5d * (miny + maxy));
        }
Beispiel #30
0
        private async Task CallAsyncCore(IFunctionDefinition function, object functionKey, IDictionary <string, object> arguments, CancellationToken cancellationToken)
        {
            Validate(function, functionKey);

            IFunctionInstance instance = CreateFunctionInstance(function, arguments);

            IDelayedException exception = null;

            exception = await _context.Executor.TryExecuteAsync(instance, cancellationToken);

            if (exception != null)
            {
                exception.Throw();
            }
        }
Beispiel #31
0
        static IExpression CreateFunctionInvocation(
            IFunctionInstance function,
            TextFileRange range,
            INamedExpressionTuple leftArguments,
            INamedExpressionTuple rightArguments)
        {
            var invocation = new FunctionInvocation {
                Function = function,
                Range    = range,
                Left     = AssignArguments(function.LeftArguments, leftArguments),
                Right    = AssignArguments(function.RightArguments, rightArguments)
            };

            return(invocation);
        }
Beispiel #32
0
        private async Task ProcessCallAndOverrideMessage(CallAndOverrideMessage message, CancellationToken cancellationToken)
        {
            IFunctionInstance instance = CreateFunctionInstance(message);

            if (instance != null)
            {
                await _innerExecutor.TryExecuteAsync(instance, cancellationToken);
            }
            else
            {
                // Log that the function failed.
                FunctionCompletedMessage failedMessage = CreateFailedMessage(message);
                await _functionInstanceLogger.LogFunctionCompletedAsync(failedMessage, cancellationToken);
            }
        }
Beispiel #33
0
        internal static IFunctionInvokerEx GetFunctionInvoker(this IFunctionInstance instance)
        {
            if (instance.Invoker == null)
            {
                return(null);
            }

            if (instance.Invoker is IFunctionInvokerEx invoker)
            {
                return(invoker);
            }


            return(new FunctionInvokerWrapper(instance.Invoker));
        }
        public async Task<IDelayedException> TryExecuteAsync(IFunctionInstance instance, CancellationToken cancellationToken)
        {
            IDelayedException result;

            using (IListener listener = await _abortListenerFactory.CreateAsync(cancellationToken))
            {
                await listener.StartAsync(cancellationToken);

                result = await _innerExecutor.TryExecuteAsync(instance, cancellationToken);

                await listener.StopAsync(cancellationToken);
            }

            return result;
        }
Beispiel #35
0
        private async Task CallAsyncCore(MethodInfo method, IDictionary <string, object> arguments,
                                         CancellationToken cancellationToken)
        {
            await EnsureHostStartedAsync(cancellationToken);

            IFunctionDefinition function = ResolveFunctionDefinition(method, _context.FunctionLookup);
            IFunctionInstance   instance = CreateFunctionInstance(function, arguments);

            IDelayedException exception = await _context.Executor.TryExecuteAsync(instance, cancellationToken);

            if (exception != null)
            {
                exception.Throw();
            }
        }
        public async Task<IDelayedException> TryExecuteAsync(IFunctionInstance instance, CancellationToken cancellationToken)
        {
            IDelayedException result;

            using (ITaskSeriesTimer timer = CreateHeartbeatTimer(_backgroundExceptionDispatcher))
            {
                await _heartbeatCommand.TryExecuteAsync(cancellationToken);
                timer.Start();

                result = await _innerExecutor.TryExecuteAsync(instance, cancellationToken);

                await timer.StopAsync(cancellationToken);
            }

            return result;
        }
Beispiel #37
0
 public static void Polygon(DrawTheory dt, IFunctionInstance name, int nbOfEdges, double sizeOfEdges)
 {
     dt.AddShape (new ShapeRegularPolygonObject (name, nbOfEdges, sizeOfEdges));
 }
Beispiel #38
0
 public static void Pos(DrawTheory dt, IFunctionInstance name, double xpos, double ypos, double zpos, double time = double.NaN)
 {
     Xpos (dt, name, xpos, time);
     Ypos (dt, name, ypos, time);
     Zpos (dt, name, zpos, time);
 }
Beispiel #39
0
 public static void RotateZ(DrawTheory dt, IFunctionInstance name, double alpha, double time = double.NaN)
 {
 }
Beispiel #40
0
 public static void Scale(DrawTheory dt, IFunctionInstance name, double xscale, double yscale, double zscale, double time = double.NaN)
 {
     Xscale (dt, name, xscale, time);
     Yscale (dt, name, yscale, time);
     Zscale (dt, name, zscale, time);
 }
Beispiel #41
0
 public static void EdgeColor(DrawTheory dt, IFunctionInstance name, double r, double g, double b, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetElement ("EdgeColor", new Color (r * MathExtra.Inv255, g * MathExtra.Inv255, b * MathExtra.Inv255)));
 }
Beispiel #42
0
 public static void Node(DrawTheory dt, IFunctionInstance name, string graph, double time = double.NaN)
 {
 }
Beispiel #43
0
 public static void Text(DrawTheory dt, IFunctionInstance name, string text, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetElement ("Text", text));
 }
Beispiel #44
0
 public static void Zpos(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetZPos (zpos));
 }
Beispiel #45
0
 public static void Zscale(DrawTheory dt, IFunctionInstance name, double zscale, double time = double.NaN)
 {
 }
Beispiel #46
0
 public static void Zshift(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN)
 {
 }
Beispiel #47
0
 public static void Color(DrawTheory dt, IFunctionInstance name, double r, double g, double b, double time = double.NaN)
 {
     InnerColor (dt, name, r, g, b, time);
 }
Beispiel #48
0
 public static void Depth(DrawTheory dt, IFunctionInstance name, double index, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetZPos (index));
 }
Beispiel #49
0
 public static void Polygon(DrawTheory dt, IFunctionInstance name, IEnhancedTermCollection points)
 {
     dt.AddShape (new ShapeIrregularPolygonObject (name, points.ValueEnumerable<IdpGie.Geometry.Point3> (TermType.Point)));
 }
 Task<IFunctionOutputDefinition> IFunctionOutputLogger.CreateAsync(IFunctionInstance instance, CancellationToken cancellationToken)
 {
     IFunctionOutputDefinition x = new PerFunc();
     return Task.FromResult(x);
 }
 public Task<IDelayedException> TryExecuteAsync(IFunctionInstance instance, CancellationToken cancellationToken)
 {
     throw new NotImplementedException();
 }
Beispiel #52
0
 public static void Shift(DrawTheory dt, IFunctionInstance name, double xpos, double ypos, double zpos, double time = double.NaN)
 {
     Xshift (dt, name, xpos, time);
     Yshift (dt, name, ypos, time);
     Zshift (dt, name, zpos, time);
 }
Beispiel #53
0
 public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
     dt.AddShape (new ShapeEllipse (name, width, height));
 }
Beispiel #54
0
 public static void Image(DrawTheory dt, IFunctionInstance name, string filepath, double width, double height)
 {
     dt.AddShape (new ShapeImage (name, filepath, width, height));
 }
 public Task<IFunctionOutputDefinition> CreateAsync(IFunctionInstance instance,
     CancellationToken cancellationToken)
 {
     IFunctionOutputDefinition outputDefinition = new NullFunctionOutputDefinition();
     return Task.FromResult(outputDefinition);
 }
Beispiel #56
0
 public static void Graph(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
 }
Beispiel #57
0
 public static void Hide(DrawTheory dt, IFunctionInstance name, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetElement ("Visible", false));
 }
 public NodeGraphModifier(double time, IFunctionInstance name)
     : base(time)
 {
 }