Example #1
0
 public void CreateInputs()
 {
     Sinks.Add("AngleSetpoint", new InputSignalViewModel("AngleSetpoint", FriendlyName));
     Sinks.Add("JogForward", new InputSignalViewModel("JogForward", FriendlyName));
     Sinks.Add("JogReverse", new InputSignalViewModel("JogReverse", FriendlyName));
     Sinks.Add("JogSpeed", new InputSignalViewModel("JogSpeed", FriendlyName));
 }
Example #2
0
 public bool RegisterMessageSink(IMessageSink sink)
 {
     if (Sinks.Contains(sink))
     {
         return(true);
     }
     Sinks.Add(new MessageSink(sink, Messages));
     FlushMessages();
     return(true);
 }
Example #3
0
        public Log SinkTo <T>() where T : Sink, new()
        {
            EnsureNotClosed();

            if (SinkExists <T>())
            {
                throw new DuplicateSinkException(typeof(T));
            }

            Sinks.Add(new T());
            return(this);
        }
Example #4
0
        public Log SinkTo(Sink sink)
        {
            EnsureNotClosed();

            var sinkType = sink.GetType();

            if (SinkExists(sinkType))
            {
                throw new DuplicateSinkException(sinkType);
            }

            Sinks.Add(sink);

            return(this);
        }
 /// <summary>
 /// Sets write function that will be used for logging messages
 /// </summary>
 /// <param name="writeFunction">Function receiving <see cref="string"/> message parameter</param>
 public static void WriteTo(Action <string> writeFunction)
 {
     Sinks.Add(writeFunction);
 }
Example #6
0
 public void AddSink(SinkFunction sf)
 {
     Sinks.Add(sf);
 }