„src/TactiloController/ovpCBoxAlgorithmTactiloController.cpp“ ändern
This commit is contained in:
parent
8324315bf2
commit
f36283fc6e
@ -33,8 +33,9 @@ bool CBoxAlgorithmTactiloController::initialize()
|
|||||||
m_NumberofTactilos = 6; //if this value is specified via box settings this line is not needed
|
m_NumberofTactilos = 6; //if this value is specified via box settings this line is not needed
|
||||||
//NumberofTactilos = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 3); //used if this value is set in box settings
|
//NumberofTactilos = FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 3); //used if this value is set in box settings
|
||||||
|
|
||||||
//open serial port
|
//open serial port and set baudrate to 115200
|
||||||
m_Port.open(m_PortName.toASCIIString());
|
m_Port.open(m_PortName.toASCIIString());
|
||||||
|
m_Port.set_option(boost::asio::serial_port::baud_rate(115200));
|
||||||
|
|
||||||
if(m_Port.is_open())
|
if(m_Port.is_open())
|
||||||
{
|
{
|
||||||
@ -99,14 +100,18 @@ bool CBoxAlgorithmTactiloController::process()
|
|||||||
|
|
||||||
if(StimulationID >= m_RowBase && StimulationID < (m_RowBase + m_NumberofTactilos))
|
if(StimulationID >= m_RowBase && StimulationID < (m_RowBase + m_NumberofTactilos))
|
||||||
{
|
{
|
||||||
this->getLogManager() << LogLevel_Debug << "Tactilo Nr. " << (StimulationID-m_RowBase+1) << "\n";
|
|
||||||
TactiloNr = StimulationID-m_RowBase+1;
|
TactiloNr = StimulationID-m_RowBase+1;
|
||||||
}
|
}
|
||||||
if(StimulationID == m_StartStimulation || StimulationID == m_StopStimulation)
|
if(StimulationID == m_StartStimulation || StimulationID == m_StopStimulation)
|
||||||
{
|
{
|
||||||
this->getLogManager() << LogLevel_Debug << "Toggle Tactilo Nr. " << (StimulationID-m_RowBase+1) << "\n";
|
this->getLogManager() << LogLevel_Debug << "Tactilo Nr. " << TactiloNr << " ON\n";
|
||||||
m_Port.write_some(boost::asio::buffer(std::to_string(TactiloNr)));
|
m_Port.write_some(boost::asio::buffer(std::to_string(TactiloNr)));
|
||||||
}
|
}
|
||||||
|
if(StimulationID == m_StopStimulation)
|
||||||
|
{
|
||||||
|
this->getLogManager() << LogLevel_Debug << "Tactilo Nr. " << TactiloNr << " OFF\n";
|
||||||
|
m_Port.write_some(boost::asio::buffer(std::to_string(TactiloNr)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// forward input chunks
|
// forward input chunks
|
||||||
|
Loading…
x
Reference in New Issue
Block a user