Commit b1c05e4f0c835db75aa7b8b69075264d5552566d

Authored by BrunoMaire
Committed by David Gräff
1 parent 66dcfc43

Update control.cpp

openhantek/src/hantek/control.cpp
... ... @@ -757,6 +757,7 @@ namespace Hantek {
757 757  
758 758 // Determine the command version we need for this model
759 759 bool unsupported = false;
  760 + int lastControlIndex = 0;
760 761 switch(this->device->getModel()) {
761 762 case MODEL_DSO2150:
762 763 unsupported = true;
... ... @@ -769,6 +770,7 @@ namespace Hantek {
769 770 this->specification.command.bulk.setSamplerate = BULK_SETTRIGGERANDSAMPLERATE;
770 771 this->specification.command.bulk.setTrigger = BULK_SETTRIGGERANDSAMPLERATE;
771 772 this->specification.command.bulk.setPretrigger = BULK_SETTRIGGERANDSAMPLERATE;
  773 + lastControlIndex = CONTROLINDEX_SETRELAYS;
772 774 // Initialize those as pending
773 775 this->commandPending[BULK_SETTRIGGERANDSAMPLERATE] = true;
774 776 break;
... ... @@ -785,6 +787,8 @@ namespace Hantek {
785 787 this->specification.command.bulk.setSamplerate = BULK_ESETTRIGGERORSAMPLERATE;
786 788 this->specification.command.bulk.setTrigger = BULK_CSETTRIGGERORSAMPLERATE;
787 789 this->specification.command.bulk.setPretrigger = BULK_FSETBUFFER;
  790 + /// \todo Test if lastControlIndex is correct
  791 + lastControlIndex = CONTROLINDEX_SETRELAYS;
788 792  
789 793 this->commandPending[BULK_BSETCHANNELS] = true;
790 794 this->commandPending[BULK_CSETTRIGGERORSAMPLERATE] = true;
... ... @@ -808,6 +812,8 @@ namespace Hantek {
808 812 this->specification.command.bulk.setTrigger = BULK_ESETTRIGGERORSAMPLERATE;
809 813 this->specification.command.bulk.setPretrigger = BULK_ESETTRIGGERORSAMPLERATE;
810 814 //this->specification.command.values.voltageLimits = VALUE_ETSCORRECTION;
  815 + /// \todo Test if lastControlIndex is correct
  816 + lastControlIndex = CONTROLINDEX_SETRELAYS;
811 817  
812 818 this->commandPending[BULK_CSETTRIGGERORSAMPLERATE] = true;
813 819 this->commandPending[BULK_DSETBUFFER] = true;
... ... @@ -832,6 +838,8 @@ namespace Hantek {
832 838 this->control[CONTROLINDEX_ACQUIIRE_HARD_DATA] = new ControlAcquireHardData();
833 839 this->controlCode[CONTROLINDEX_ACQUIIRE_HARD_DATA] = CONTROL_ACQUIIRE_HARD_DATA;
834 840 this->controlPending[CONTROLINDEX_ACQUIIRE_HARD_DATA] = true;
  841 + /// \todo Test if lastControlIndex is correct
  842 + lastControlIndex = CONTROLINDEX_ACQUIIRE_HARD_DATA;
835 843 break;
836 844  
837 845 default:
... ... @@ -843,7 +851,7 @@ namespace Hantek {
843 851 if(unsupported)
844 852 qWarning("Warning: This Hantek DSO model isn't supported officially, so it may not be working as expected. Reports about your experiences are very welcome though (Please open a feature request in the tracker at https://sf.net/projects/openhantek/ or email me directly to oliver.haag@gmail.com). If it's working perfectly I can remove this warning, if not it should be possible to get it working with your help soon.");
845 853  
846   - for(int control = 0; control < CONTROLINDEX_COUNT; ++control)
  854 + for(int control = 0; control <= lastControlIndex; ++control)
847 855 this->controlPending[control] = true;
848 856  
849 857 // Disable controls not supported by 6022BE
... ...