public PidTunerViewModel(IMessageLink messageLink, IScheduler dispatcherScheduler) { this.Points = new ObservableCollection <DataPoint>(); messageLink.IncomingMessages .ObserveOn(dispatcherScheduler) .OfType <PidMeasureMessage>() .Subscribe(OnNewMessage); }
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); } }
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(); }