Changeset 16692 for trunk/FACT++/gui
- Timestamp:
- 06/04/13 16:52:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r16616 r16692 811 811 } 812 812 813 if (!CheckSize(d, 82*sizeof(float)))814 return; 815 816 const float *ptr = d.ptr<float>( );813 if (!CheckSize(d, sizeof(uint16_t)+40*sizeof(float))) 814 return; 815 816 const float *ptr = d.ptr<float>(2); 817 817 818 818 fFadTempMin->setEnabled(true); 819 819 fFadTempMax->setEnabled(true); 820 820 821 fFadTempMin->setValue(ptr[0]); 822 fFadTempMax->setValue(ptr[41]); 823 824 handleFadToolTip(d.time, fFadTempMin, ptr+1); 825 handleFadToolTip(d.time, fFadTempMax, ptr+42); 821 float min = FLT_MAX; 822 float max = -FLT_MAX; 823 824 vector<float> mn(40, FLT_MAX); 825 vector<float> mx(40, -FLT_MAX); 826 for (int i=0; i<160; i++) 827 { 828 if (ptr[i]<min) 829 min = ptr[i]; 830 if (ptr[i]>max) 831 max = ptr[i]; 832 833 if (ptr[i]<mn[i/4]) 834 mn[i/4] = ptr[i]; 835 if (ptr[i]>mx[i/4]) 836 mx[i/4] = ptr[i]; 837 } 838 839 fFadTempMin->setValue(min); 840 fFadTempMax->setValue(max); 841 842 handleFadToolTip(d.time, fFadTempMin, mn.data()); 843 handleFadToolTip(d.time, fFadTempMax, mx.data()); 826 844 } 827 845 … … 836 854 } 837 855 838 if (!CheckSize(d, 42*sizeof(uint32_t)))839 return; 840 841 const uint32_t *ptr = d.ptr<uint32_t>();856 if (!CheckSize(d, sizeof(uint16_t)+160*sizeof(float))) 857 return; 858 859 const float *ptr = d.ptr<float>(2); 842 860 843 861 fFadRefClockMin->setEnabled(true); 844 862 fFadRefClockMax->setEnabled(true); 845 863 846 fFadRefClockMin->setValue(ptr[40]*2.048); 847 fFadRefClockMax->setValue(ptr[41]*2.048); 848 849 const int64_t diff = int64_t(ptr[41]) - int64_t(ptr[40]); 864 float min = FLT_MAX; 865 float max = -FLT_MAX; 866 for (int i=0; i<40; i++) 867 { 868 if (ptr[i]<min) 869 min = ptr[i]; 870 if (ptr[i]>max) 871 max = ptr[i]; 872 } 873 874 fFadRefClockMin->setValue(min); 875 fFadRefClockMax->setValue(max); 876 877 const int64_t diff = int64_t(max) - int64_t(min); 850 878 851 879 SetLedColor(fFadLedRefClock, abs(diff)>3?kLedRed:kLedGreen, d.time);
Note:
See TracChangeset
for help on using the changeset viewer.