-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5.4.0 Raw Restriction Setting, Apply Offsets (#577)
* Crash Recovery Defaults to Off, add option to use space drag w/ uncalibrated playspace * increment version 5.3.3 * Feat/apply offsets binding (#576) * add apply offsets steamvr input * add new binding to Readme Co-authored-by: TheMrGong <gongora656@gmail.com> * increment version 5.4.0 * added LH Console Interface class, WIP TX/RX list via lh console * switch over to property based dongle information * add ovr system wrapper * add use of parameter to avoid warning as error * openXR fix, and Change Display State of Chaperone Disabled * update text * format files * clang 9.0.0 format * add documentation update * remove windows header include * remove filesystem header * fix uncal motion switching issue Co-authored-by: TheMrGong <gongora656@gmail.com>
- Loading branch information
Showing
24 changed files
with
991 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.3.2-release | ||
5.4.0-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
#include "lh_console_util.h" | ||
|
||
namespace lh_con_util | ||
{ | ||
bool LHCUtil::FindAll() | ||
{ | ||
if ( !FindAllRX() ) | ||
{ | ||
LOG( ERROR ) << "Find All Recievers Failed"; | ||
return false; | ||
} | ||
if ( !FindAllTX() ) | ||
{ | ||
LOG( ERROR ) << "Find All Transmitters Failed"; | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
bool LHCUtil::FindAllRX() | ||
{ | ||
QProcess* lhProcess = new QProcess(); | ||
QString program = "lighthouse_console.exe"; | ||
lhProcess->start( path_, QStringList() << "" ); | ||
lhProcess->waitForFinished(); | ||
|
||
QString output = QString( lhProcess->readAllStandardOutput() ); | ||
QStringList outputLines | ||
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts ); | ||
bool RecieverStart = false; | ||
|
||
for ( auto OutputLine : outputLines ) | ||
{ | ||
if ( OutputLine.contains( "Attached lighthouse receiver devices:" ) ) | ||
{ | ||
RecieverStart = true; | ||
continue; | ||
} | ||
if ( RecieverStart ) | ||
{ | ||
if ( OutputLine.contains( "lighthouse_console" ) ) | ||
{ | ||
break; | ||
} | ||
OutputLine.simplified().remove( " " ); | ||
OutputLine.remove( 0, 1 ); | ||
// LOG( WARNING ) << OutputLine << std::endl; | ||
RXTX_Pairs_.push_back( RXTX_Pair{ OutputLine, " ", true, false } ); | ||
} | ||
} | ||
return !RXTX_Pairs_.empty(); | ||
} | ||
|
||
bool LHCUtil::FindConnectedTX( QString RXSerial ) | ||
{ | ||
LOG( WARNING ) << RXSerial; | ||
QProcess* lhProcess = new QProcess(); | ||
lhProcess->start( path_, QStringList() << "/serial" << RXSerial << "exit" ); | ||
lhProcess->waitForFinished(); | ||
|
||
QString output = QString( lhProcess->readAllStandardOutput() ); | ||
QStringList outputLines | ||
= output.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts ); | ||
// std::vector<std::string> OutputLines | ||
// = exec( ( "\"" + path_ + "\" /serial " + RXSerial + " exit" ).c_str() | ||
// ); | ||
bool lhConFound = false; | ||
for ( auto outputLine : outputLines ) | ||
{ | ||
// LOG( WARNING ) << outputLine; | ||
if ( outputLine.contains( "Connected to receiver" ) ) | ||
{ | ||
auto splitList = outputLine.split( ":" ); | ||
QString TXSerial = splitList[0]; | ||
if ( TXSerial == "lighthouse_console" ) | ||
{ | ||
lhConFound = true; | ||
continue; | ||
} | ||
for ( auto& rxtx : RXTX_Pairs_ ) | ||
{ | ||
if ( rxtx.RX_Serial == RXSerial ) | ||
{ | ||
rxtx.TX_Serial = TXSerial; | ||
rxtx.Is_Paired = true; | ||
rxtx.Is_Init = true; | ||
LOG( WARNING ) | ||
<< "tx serial stored: " << TXSerial.toStdString(); | ||
return true; | ||
} | ||
} | ||
// TODO error handling | ||
return false; | ||
} | ||
} | ||
if ( lhConFound ) | ||
{ | ||
for ( auto rxtx : RXTX_Pairs_ ) | ||
{ | ||
if ( rxtx.RX_Serial == RXSerial ) | ||
{ | ||
rxtx.TX_Serial = ""; | ||
rxtx.Is_Paired = false; | ||
rxtx.Is_Init = true; | ||
LOG( WARNING ) << "tx oops"; | ||
return true; | ||
} | ||
} | ||
} | ||
// TODO error handling | ||
return false; | ||
} | ||
|
||
bool LHCUtil::FindAllTX() | ||
{ | ||
bool NoError = true; | ||
for ( auto rxtx : RXTX_Pairs_ ) | ||
{ | ||
if ( !FindConnectedTX( rxtx.RX_Serial ) ) | ||
{ | ||
NoError = false; | ||
} | ||
} | ||
return NoError; | ||
} | ||
|
||
QString LHCUtil::GetLinkedTX( QString RXSerial ) | ||
{ | ||
for ( auto rxtx : RXTX_Pairs_ ) | ||
{ | ||
if ( rxtx.RX_Serial == RXSerial ) | ||
{ | ||
return rxtx.TX_Serial; | ||
} | ||
} | ||
return ""; | ||
} | ||
|
||
QString LHCUtil::GetLinkedRX( QString TXSerial ) | ||
{ | ||
for ( auto rxtx : RXTX_Pairs_ ) | ||
{ | ||
if ( rxtx.TX_Serial == TXSerial ) | ||
{ | ||
return rxtx.RX_Serial; | ||
} | ||
} | ||
return ""; | ||
} | ||
|
||
} // namespace lh_con_util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
#include "openvr.h" | ||
#include <vector> | ||
#include <utility> | ||
#include <cstdio> | ||
#include <iostream> | ||
#include <memory> | ||
#include <stdexcept> | ||
#include <string> | ||
#include <array> | ||
#include <QProcess> | ||
#include <QString> | ||
#include <QStringList> | ||
#include <QRegularExpression> | ||
#include <easylogging++.h> | ||
|
||
namespace lh_con_util | ||
{ | ||
struct RXTX_Pair | ||
{ | ||
QString RX_Serial = ""; | ||
QString TX_Serial = ""; | ||
bool Is_Init = false; | ||
bool Is_Paired = false; | ||
}; | ||
class LHCUtil | ||
{ | ||
private: | ||
QString path_; | ||
bool InPairs( std::string RXSerial ); | ||
bool FindAllRX(); | ||
bool FindAllTX(); | ||
bool path_Init = false; | ||
|
||
public: | ||
explicit LHCUtil( QString path ) | ||
{ | ||
path_ = path; | ||
} | ||
std::vector<RXTX_Pair> RXTX_Pairs_; | ||
bool FindAll(); | ||
bool FindConnectedTX( QString RXSerial ); | ||
QString GetLinkedTX( QString RXSerial ); | ||
QString GetLinkedRX( QString TXSerial ); | ||
RXTX_Pair GetConnectedTXRXPair(); | ||
bool pairDevice( QString RXSerial ); | ||
}; | ||
} // namespace lh_con_util |
Oops, something went wrong.