Commit b1c05e4f0c835db75aa7b8b69075264d5552566d
Committed by
David Gräff
1 parent
66dcfc43
Update control.cpp
Showing
1 changed file
with
9 additions
and
1 deletions
openhantek/src/hantek/control.cpp
| @@ -757,6 +757,7 @@ namespace Hantek { | @@ -757,6 +757,7 @@ namespace Hantek { | ||
| 757 | 757 | ||
| 758 | // Determine the command version we need for this model | 758 | // Determine the command version we need for this model |
| 759 | bool unsupported = false; | 759 | bool unsupported = false; |
| 760 | + int lastControlIndex = 0; | ||
| 760 | switch(this->device->getModel()) { | 761 | switch(this->device->getModel()) { |
| 761 | case MODEL_DSO2150: | 762 | case MODEL_DSO2150: |
| 762 | unsupported = true; | 763 | unsupported = true; |
| @@ -769,6 +770,7 @@ namespace Hantek { | @@ -769,6 +770,7 @@ namespace Hantek { | ||
| 769 | this->specification.command.bulk.setSamplerate = BULK_SETTRIGGERANDSAMPLERATE; | 770 | this->specification.command.bulk.setSamplerate = BULK_SETTRIGGERANDSAMPLERATE; |
| 770 | this->specification.command.bulk.setTrigger = BULK_SETTRIGGERANDSAMPLERATE; | 771 | this->specification.command.bulk.setTrigger = BULK_SETTRIGGERANDSAMPLERATE; |
| 771 | this->specification.command.bulk.setPretrigger = BULK_SETTRIGGERANDSAMPLERATE; | 772 | this->specification.command.bulk.setPretrigger = BULK_SETTRIGGERANDSAMPLERATE; |
| 773 | + lastControlIndex = CONTROLINDEX_SETRELAYS; | ||
| 772 | // Initialize those as pending | 774 | // Initialize those as pending |
| 773 | this->commandPending[BULK_SETTRIGGERANDSAMPLERATE] = true; | 775 | this->commandPending[BULK_SETTRIGGERANDSAMPLERATE] = true; |
| 774 | break; | 776 | break; |
| @@ -785,6 +787,8 @@ namespace Hantek { | @@ -785,6 +787,8 @@ namespace Hantek { | ||
| 785 | this->specification.command.bulk.setSamplerate = BULK_ESETTRIGGERORSAMPLERATE; | 787 | this->specification.command.bulk.setSamplerate = BULK_ESETTRIGGERORSAMPLERATE; |
| 786 | this->specification.command.bulk.setTrigger = BULK_CSETTRIGGERORSAMPLERATE; | 788 | this->specification.command.bulk.setTrigger = BULK_CSETTRIGGERORSAMPLERATE; |
| 787 | this->specification.command.bulk.setPretrigger = BULK_FSETBUFFER; | 789 | this->specification.command.bulk.setPretrigger = BULK_FSETBUFFER; |
| 790 | + /// \todo Test if lastControlIndex is correct | ||
| 791 | + lastControlIndex = CONTROLINDEX_SETRELAYS; | ||
| 788 | 792 | ||
| 789 | this->commandPending[BULK_BSETCHANNELS] = true; | 793 | this->commandPending[BULK_BSETCHANNELS] = true; |
| 790 | this->commandPending[BULK_CSETTRIGGERORSAMPLERATE] = true; | 794 | this->commandPending[BULK_CSETTRIGGERORSAMPLERATE] = true; |
| @@ -808,6 +812,8 @@ namespace Hantek { | @@ -808,6 +812,8 @@ namespace Hantek { | ||
| 808 | this->specification.command.bulk.setTrigger = BULK_ESETTRIGGERORSAMPLERATE; | 812 | this->specification.command.bulk.setTrigger = BULK_ESETTRIGGERORSAMPLERATE; |
| 809 | this->specification.command.bulk.setPretrigger = BULK_ESETTRIGGERORSAMPLERATE; | 813 | this->specification.command.bulk.setPretrigger = BULK_ESETTRIGGERORSAMPLERATE; |
| 810 | //this->specification.command.values.voltageLimits = VALUE_ETSCORRECTION; | 814 | //this->specification.command.values.voltageLimits = VALUE_ETSCORRECTION; |
| 815 | + /// \todo Test if lastControlIndex is correct | ||
| 816 | + lastControlIndex = CONTROLINDEX_SETRELAYS; | ||
| 811 | 817 | ||
| 812 | this->commandPending[BULK_CSETTRIGGERORSAMPLERATE] = true; | 818 | this->commandPending[BULK_CSETTRIGGERORSAMPLERATE] = true; |
| 813 | this->commandPending[BULK_DSETBUFFER] = true; | 819 | this->commandPending[BULK_DSETBUFFER] = true; |
| @@ -832,6 +838,8 @@ namespace Hantek { | @@ -832,6 +838,8 @@ namespace Hantek { | ||
| 832 | this->control[CONTROLINDEX_ACQUIIRE_HARD_DATA] = new ControlAcquireHardData(); | 838 | this->control[CONTROLINDEX_ACQUIIRE_HARD_DATA] = new ControlAcquireHardData(); |
| 833 | this->controlCode[CONTROLINDEX_ACQUIIRE_HARD_DATA] = CONTROL_ACQUIIRE_HARD_DATA; | 839 | this->controlCode[CONTROLINDEX_ACQUIIRE_HARD_DATA] = CONTROL_ACQUIIRE_HARD_DATA; |
| 834 | this->controlPending[CONTROLINDEX_ACQUIIRE_HARD_DATA] = true; | 840 | this->controlPending[CONTROLINDEX_ACQUIIRE_HARD_DATA] = true; |
| 841 | + /// \todo Test if lastControlIndex is correct | ||
| 842 | + lastControlIndex = CONTROLINDEX_ACQUIIRE_HARD_DATA; | ||
| 835 | break; | 843 | break; |
| 836 | 844 | ||
| 837 | default: | 845 | default: |
| @@ -843,7 +851,7 @@ namespace Hantek { | @@ -843,7 +851,7 @@ namespace Hantek { | ||
| 843 | if(unsupported) | 851 | if(unsupported) |
| 844 | 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."); | 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 | this->controlPending[control] = true; | 855 | this->controlPending[control] = true; |
| 848 | 856 | ||
| 849 | // Disable controls not supported by 6022BE | 857 | // Disable controls not supported by 6022BE |