/// <summary> /// Configures a <see cref="Switch"/> instance /// </summary> /// <param name="device">The instance to configure</param> public static void InitialConfigure(Switch device) { if (Instance == null) { throw new InvalidOperationException("Configuration has not been loaded yet."); } SwitchSettings.ConfigureSettings(Instance); Logger.AddTarget(new AsyncLogTargetWrapper( new ConsoleLogTarget(), 1000, AsyncLogTargetOverflowAction.Block )); if (Instance.EnableFileLog) { Logger.AddTarget(new AsyncLogTargetWrapper( new FileLogTarget(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ryujinx.log")), 1000, AsyncLogTargetOverflowAction.Block )); } Configure(device, Instance); }
public Switch(SwitchSettings settings) : base(settings) { activated = false; var channelName = string.Format("{0}, Switch", name); Driver.DigitalInput.AddChannel(channel, channelName); Subscribe(Driver.DigitalInput.GetChannelEventPublisherKey(channelName)); Bit.Instance.Set(name, activated); }