您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

30 行
736 B

  1. #include "InputConnector.h"
  2. CInputConnector::CInputConnector()
  3. {
  4. }
  5. QBitArray CInputConnector::GetInputPinsStates()
  6. {
  7. if(!IsConnectorDefined())
  8. return QBitArray();
  9. QBitArray IOStates = mIOInterfaceHandle->GetInputStates();//inputs are active low, need to invert!!!
  10. QBitArray PinsStates(mPinCount);
  11. if(mIOModuleRangeEnd > IOStates.size()) //try not to crash!
  12. {
  13. qDebug("Logic error in CInputConnector::GetInputPinsStates(); mIOModuleRangeEnd greater than IO count");
  14. return QBitArray();
  15. }
  16. int ConnectorPin = 0;
  17. for(int IoPin = mIOModuleRangeBegin; IoPin <= mIOModuleRangeEnd; IoPin++)
  18. {
  19. PinsStates[ConnectorPin++] = IOStates[IoPin];
  20. }
  21. return PinsStates;
  22. }