public iROBSceneChangerForm() { InitializeComponent(); this.Text = Application.ProductName + " " + Application.ProductVersion; this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); // Create a new instance of the SdkWrapper object wrapper = new SdkWrapper(); // Set some properties wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread; wrapper.TelemetryUpdateFrequency = 1; // Listen for various iRacing events wrapper.Connected += wrapper_Connected; wrapper.Disconnected += wrapper_Disconnected; wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; // Save OnTrack state oldIsOnTrack = false; // Create a new instance of the OBSWebsocket object obs = new OBSWebsocket(); obsWsConnected = false; // Listen for various OBS events obs.OnSceneChange += onSceneChange; wrapper.Start(); StatusChanged(); }
public iRacingSLI() { InitializeComponent(); this.Text = "iRacing SLI v" + Version; cfg = new configHandler(console); connection = new connectionHelper(console); connection.setupConnection(startConnection, cboPorts, cfg); brk = new brakeVibe(); int top = Convert.ToInt16(cfg.readSetting("Top", "100")) > -3000 ? Convert.ToInt16(cfg.readSetting("Top", "100")) : 100; int left = Convert.ToInt16(cfg.readSetting("Left", "100")) > -3000 ? Convert.ToInt16(cfg.readSetting("Left", "100")) : 100; this.SetDesktopLocation(top, left); this.cboSpdUnit.SelectedIndex = Convert.ToInt16(cfg.readSetting("spdUnit", "0")); this.trkIntensity.Value = Convert.ToInt16(cfg.readSetting("intensity", "0")); this.chkTelem.Checked = Convert.ToBoolean(cfg.readSetting("telemEnable", "True")); this.chkBrake.Checked = Convert.ToBoolean(cfg.readSetting("brakeEnable", "False")); this.groupBox1.Enabled = this.chkBrake.Checked; this.trkTol.Value = Convert.ToInt16(cfg.readSetting("brakeTol", "35")); this.trkSens.Value = Convert.ToInt16(cfg.readSetting("brakeSens", "3")); console("Start iRacingSDK Wrapper"); wrapper = new SdkWrapper(); wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread; wrapper.TelemetryUpdateFrequency = 20; wrapper.Connected += wrapper_Connected; wrapper.Disconnected += wrapper_Disconnected; wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; wrapper.Start(); ticker = 39; prevLapTime = 0; }
public Form1() { InitializeComponent(); m_logger.Debug("Initializing iR SDK Wrapper"); m_wrapper = new SdkWrapper(); m_wrapper.SessionInfoUpdated += OnSessionInfoUpdated; m_wrapper.TelemetryUpdated += OnTelemetryUpdated; m_logger.Debug("Starting iR SDK Wrapper"); m_wrapper.Start(); m_logger.Debug("Wrapper Started"); m_tooltip.SetToolTip(nudFuelMult, "Sets the multiplier to the fuel rate used during the calculation for fuel needed."); m_tooltip.SetToolTip(nudLapOffset, "Adds this number of laps to the race length during fuel calculation."); m_tooltip.SetToolTip(cbOnlyGreen, "When enabled, only laps done in a race under green flag conditions are logged. Useful if you expect a lot of cautions."); m_tooltip.SetToolTip(btnEnableAutoFuel, "If enabled, will automatically set the pitstop fuel amount when you cross the yellow cones.\nIf disabled, will only monitor."); m_tooltip.SetToolTip(cbUnits, "Selects which units to use when displaying and calculating fuel. Automatic will try to use what the game does."); OpenConfig(); if (cbUnits.SelectedIndex == -1) { cbUnits.SelectedIndex = 0; } UpdateLabels(); }
private static void Main(string[] args) { var iracing = new SdkWrapper { TelemetryUpdateFrequency = 15 }; iracing.TelemetryUpdated += OnTelemetryUpdated; driver = new ArduinoDriver(ArduinoModel.UnoR3, "COM4", true); Console.CursorVisible = false; const byte DataPin = 12; const byte ClockPin = 11; const byte LatchPin = 10; driver.Send(new PinModeRequest(DataPin, PinMode.Output)); driver.Send(new PinModeRequest(LatchPin, PinMode.Output)); driver.Send(new PinModeRequest(ClockPin, PinMode.Output)); driver.Send(new DigitalWriteRequest(LatchPin, DigitalValue.Low)); var response = driver.Send(new ShiftOutRequest(DataPin, ClockPin, BitOrder.LSBFIRST, 115)); driver.Send(new DigitalWriteRequest(LatchPin, DigitalValue.High)); Console.WriteLine($"{response.Value} = {Convert.ToString(response.Value, 2).PadLeft(8, '0')}"); iracing.Start(); }
public Form1() { InitializeComponent(); wrapper = new SdkWrapper(); wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; wrapper.Start(); }
/// <summary> /// Starts the specified telemetry data. /// </summary> /// <param name="telemetryData">The telemetry data.</param> /// <returns>true !</returns> public override bool Start(TelemetryData telemetryData, TimingData timingData, AnalysisManager analysisData) { _telemetryData = telemetryData; _timingData = timingData; _analysisData = analysisData; _wrapper.Start(); return(true); }
public Form1() { InitializeComponent(); _wrapper = new SdkWrapper(); _wrapper.Start(); LoadDropdowns(); }
public Form1() { InitializeComponent(); wrapper = new SdkWrapper(); wrapper.Start(); wrapper.TelemetryUpdateFrequency = 5; wrapper.TelemetryUpdated += OnTelemetryUpdated; time = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, second); }
public Form1() { InitializeComponent(); wrapper = new SdkWrapper(); wrapper.TelemetryUpdateFrequency = 5; wrapper.SessionInfoUpdated += OnSessionInfoUpdated; wrapper.TelemetryUpdated += OnTelemetryUpdated; wrapper.Start(); }
public MainWindow() { InitializeComponent(); // Create instance wrapper = new SdkWrapper(); // Listen to events wrapper.TelemetryUpdated += OnTelemetryUpdated; wrapper.SessionInfoUpdated += OnSessionInfoUpdated; // Start it! Sim.Instance.Start(); wrapper.Start(); }
private void startButton_Click(object sender, EventArgs e) { // If the wrapper is running, stop it. Otherwise, start it. if (wrapper.IsRunning) { wrapper.Stop(); startButton.Text = "Start"; } else { wrapper.Start(); startButton.Text = "Stop"; } this.StatusChanged(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); wrapper = new SdkWrapper(); wrapper.Connected += wrapper_Connected; wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; wrapper.Disconnected += wrapper_Disconnected; wrapper.Start(); Application.Run(new AppContext()); }
public Form1() { InitializeComponent(); shiftLbl.Text = ""; if (ReadSettings()) { // Create instance wrapper = new SdkWrapper(); wrapper.TelemetryUpdateFrequency = 30; // Listen to events wrapper.TelemetryUpdated += OnTelemetryUpdated; wrapper.SessionInfoUpdated += OnSessionInfoUpdated; // Start it! wrapper.Start(); } }
public Form1() { InitializeComponent(); Init(); if (turnFormEnabled) { turn = new Turn(); turn.Visible = turnFormEnabled; } wrapper = new SdkWrapper(); wrapper.Start(); wrapper.TelemetryUpdateFrequency = 60; wrapper.TelemetryUpdated += OnTelemetryUpdated; wrapper.SessionInfoUpdated += OnSessionInfoUpdated; }
public Form1() { InitializeComponent(); _sdk = new iRacingSDK(); _wrapper = new SdkWrapper(); //_wrapper = new iRacingMock.ClassLibrary.Mock("D:\\_20190810_115035.csv"); //defaultSession = new DefaultSession(); dash = new Dash(this, _wrapper); dash.InitDash(); new Configurator().StartConfig(ref maxRpm, ref location, ref dash.minRpmPercent, ref dash.shiftLight1Percent, ref dash.shiftLight2Percent, ref dash.redLinePercent, ref fps); Location = location; _wrapper.TelemetryUpdateFrequency = fps; SubscribeToEvents(); _wrapper.Start(); }
public iRacingSLI() { try { InitializeComponent(); this.Text = "iRacing SLI v" + Version; cfg = new configHandler(console); connection = new connectionHelper(console); connection.setupConnection(startConnection, cboPorts, cfg); int top = Convert.ToInt16(cfg.readSetting("Top", "100")) > -3000 ? Convert.ToInt16(cfg.readSetting("Top", "100")) : 100; int left = Convert.ToInt16(cfg.readSetting("Left", "100")) > -3000 ? Convert.ToInt16(cfg.readSetting("Left", "100")) : 100; this.SetDesktopLocation(top, left); this.cboSpdUnit.SelectedIndex = Convert.ToInt16(cfg.readSetting("spdUnit", "0")); this.trkIntensity.Value = Convert.ToInt16(cfg.readSetting("intensity", "0")); this.chkTelem.Checked = Convert.ToBoolean(cfg.readSetting("telemEnable", "True")); console("Start iRacingSDK Wrapper"); wrapper = new SdkWrapper(); wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread; wrapper.TelemetryUpdateFrequency = 20; //wrapper.ConnectSleepTime = 1; wrapper.Connected += wrapper_Connected; wrapper.Disconnected += wrapper_Disconnected; wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; wrapper.Start(); ticker = 39; prevLapTime = 0; } catch (Exception exe) { ExceptionHelper.writeToLogFile(exe.Message, exe.ToString(), "Constructor", exe.LineNumber(), this.FindForm().Name); } }
public void Start() { wrapper.Start(); }
public MainForm() { Thread.CurrentThread.Name = "Telemetry Processing Thread"; InitializeComponent(); soundThreadStartup(); // don't progrees till we pick an entry from the dropdown loadLabels(); loadVolumes(); SoundObject.SetMasterVolume(MasterVol); // this has to be seperate due to the order of loading // initialize carstate object CarState = new State(); CarState.Initialize(); PitPosition = 0; SessionType = "Practice"; // Create a new instance of the SdkWrapper object - TODO pass in update freq via GUI later Wrapper = new SdkWrapper(10); // Tell it to raise events on the current thread (don't worry if you don't know what a thread is) Wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread; // Attach some useful events so you can respond when they get raised Wrapper.Connected += wrapper_Connected; Wrapper.Disconnected += wrapper_Disconnected; Wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; Wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; drivers = new List<Driver>(); // auto-start the telemetry wrapper if (!Wrapper.IsRunning) { Wrapper.Start(); StatusChanged(); } }
public void Init() { UpdateSessions(); _synth.SetOutputToDefaultAudioDevice(); _timer.Tick += OnTimerElapsed; _timer.Interval = TimeSpan.FromSeconds(1); _timer.Start(); _bgTextWorker.DoWork += TextWorkerDoWork; _iRacing = new SdkWrapper(); _iRacing.Connected += (o, e) => IsConnected = true; _iRacing.SessionInfoUpdated += OnSessionInfoUpdated; _iRacing.Disconnected += (o, e) => IsConnected = false; _iRacing.Start(); Log.Instance.Trace("iNotifier started."); }
private void MainForm_Load(object sender, EventArgs e) { _wrapper = new SdkWrapper(); _wrapper.SessionInfoUpdated += OnSessionInfoUpdated; _wrapper.Start(); }
protected override void start() { //wrapper.TelemetryUpdateFrequency = 60; // Listen to events wrapper.TelemetryUpdated += OnTelemetryUpdated; wrapper.SessionInfoUpdated += OnSessionInfoUpdated; // Start it if Arduino is Connected wrapper.Start(); StringBuilder msg = new StringBuilder(); bool isConnected = false; NotifyStatusMessage("Waiting for IRacing..."); while (!CancellationPending) { msg.Clear(); if (wrapper.IsConnected) { if (!isConnected) { string s = "Connected to iRacing."; logger.LogMessageToFile(s, true); NotifyStatusMessage(s); } isConnected = true; sendRPMShiftMsg(currentRpm, firstRpm, lastRpm, flag); foreach (SerialManager serialManager in sm) { if (serialManager.deviceContains7Segments()) { send7SegmentMsg(); } } } else { if (isConnected) { string s = "iRacing closed."; logger.LogMessageToFile(s, true); NotifyStatusMessage(s); } isConnected = false; foreach (SerialManager serialManager in sm) { if (serialManager.deviceContains7Segments()) { serialManager.enqueueCommand(Utils.getDisconnectedMsgCmd(), false); serialManager.enqueueCommand(Utils.getBlackRPMCmd(), false); } } } Thread.Sleep(Constants.SharedMemoryReadRate); } wrapper.Stop(); NotifyStatusMessage("iRacing thread stopped."); }