예제 #1
0
        public PidTunerViewModel(IMessageLink messageLink, IScheduler dispatcherScheduler)
        {
            this.Points = new ObservableCollection <DataPoint>();

            messageLink.IncomingMessages
            .ObserveOn(dispatcherScheduler)
            .OfType <PidMeasureMessage>()
            .Subscribe(OnNewMessage);
        }
예제 #2
0
 public static string GetMessageTypeName(this IMessageLink messagelink)
 {
     if (messagelink is IProcessedCommandLink)
     {
         return((messagelink as IProcessedCommandLink).CommandReference.Value.CodeIdentifier);
     }
     else if (messagelink is ISubscribedEventLink)
     {
         var el = messagelink as ISubscribedEventLink;
         return((el == null || el.EventReference == null || el.EventReference.Value == null) ? "object" : el.EventReference.Value.CodeIdentifier);
     }
     else
     {
         return(null);
     }
 }
예제 #3
0
        public SettingsModel(IMessageLink messageLink)
        {
            this.messageLink = messageLink;
            this.eeprom      = new Eeprom <MulticopterEeprom>();

            messageLink.IncomingMessages
            .OfType <FloatValueMessage>()
            .Subscribe(OnFloatValueMessage);

            messageLink.IncomingMessages
            .OfType <ShortValueMessage>()
            .Subscribe(OnShortValueMessage);

            this.eepromFields = typeof(MulticopterEeprom)
                                .GetFieldsAttributes <EepromFieldAttribute>()
                                .Select(f => new EepromField(f))
                                .ToList();
        }