Changeset 10536 for trunk/FACT++
- Timestamp:
- 05/03/11 18:23:25 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r10528 r10536 683 683 return; 684 684 685 const vector<boost::any> any = d.any(); 686 687 const size_t rate = boost::any_cast<int>(any[2]); 688 const size_t space = boost::any_cast<long long>(any[1]); 689 const size_t written = boost::any_cast<long long>(any[0]); 685 const uint64_t *vals = reinterpret_cast<const uint64_t*>(d.ptr()); 686 687 const size_t written = vals[0]; 688 const size_t space = vals[1]; 689 const size_t rate = vals[2]; 690 691 cout << written << " " << space << " " << rate << endl; 690 692 691 693 fLoggerFreeSpace->setSuffix(" MB"); … … 762 764 fLoggerFilenameNight->setEnabled(connected); 763 765 if (connected) 764 fLoggerFilenameNight->setText(d.c_str()); 765 766 if (d.qos&1) 766 fLoggerFilenameNight->setText(d.c_str()+4); 767 768 const uint32_t files = d.get<uint32_t>(); 769 770 if (files&1) 771 fLoggerLedLog->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 772 else 767 773 fLoggerLedLog->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 774 775 if (files&2) 776 fLoggerLedRep->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 768 777 else 769 fLoggerLedLog->setIcon(QIcon(":/Resources/icons/green circle 1.png"));770 771 if (d.qos&2)772 778 fLoggerLedRep->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 779 780 if (files&4) 781 fLoggerLedFits->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 773 782 else 774 fLoggerLedRep->setIcon(QIcon(":/Resources/icons/green circle 1.png"));775 776 if (d.qos&4)777 783 fLoggerLedFits->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 778 else779 fLoggerLedFits->setIcon(QIcon(":/Resources/icons/green circle 1.png"));780 784 } 781 785 … … 786 790 fLoggerFilenameRun->setEnabled(connected); 787 791 if (connected) 788 fLoggerFilenameRun->setText(d.c_str()); 789 790 if (d.qos&1) 792 fLoggerFilenameRun->setText(d.c_str()+4); 793 794 const uint32_t files = d.get<uint32_t>(); 795 796 if (files&1) 797 fLoggerLedLog->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 798 else 791 799 fLoggerLedLog->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 800 801 if (files&2) 802 fLoggerLedRep->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 792 803 else 793 fLoggerLedLog->setIcon(QIcon(":/Resources/icons/green circle 1.png"));794 795 if (d.qos&2)796 804 fLoggerLedRep->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 805 806 if (files&4) 807 fLoggerLedFits->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 797 808 else 798 fLoggerLedRep->setIcon(QIcon(":/Resources/icons/green circle 1.png"));799 800 if (d.qos&4)801 809 fLoggerLedFits->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 802 else803 fLoggerLedFits->setIcon(QIcon(":/Resources/icons/green circle 1.png"));804 810 } 805 811 … … 813 819 return; 814 820 815 const vector<boost::any> any = d.any();816 817 fLoggerSubscriptions->setValue( boost::any_cast<int>(any[0]));818 fLoggerOpenFiles->setValue( boost::any_cast<int>(any[1]));821 const uint32_t *vals = reinterpret_cast<const uint32_t*>(d.ptr()); 822 823 fLoggerSubscriptions->setValue(vals[0]); 824 fLoggerOpenFiles->setValue(vals[1]); 819 825 } 820 826 … … 896 902 897 903 FTM::DimStaticData fFtmStaticData; 904 905 void SetFtuLed(int idx, int counter) 906 { 907 if (counter<0) 908 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 909 910 if (counter==0) 911 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/red circle 1.png")); 912 913 if (counter==1) 914 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 915 916 if (counter>1) 917 fFtuLED[idx]->setIcon(QIcon(":/Resources/icons/orange circle 1.png")); 918 919 } 920 898 921 899 922 void handleFtmStaticData(const DimData &d) … … 946 969 if (!sdata.IsActive(i)) 947 970 { 948 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/gray circle 1.png"));971 SetFtuLed(i, -1); 949 972 fFtuDisabled[i] = true; 950 973 } … … 953 976 if (fFtuDisabled[i]) 954 977 { 955 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png"));978 SetFtuLed(i, 1); 956 979 fFtuDisabled[i] = false; 957 980 } … … 1035 1058 for (int i=0; i<40; i++) 1036 1059 { 1037 if (sdata.IsActive(i)) 1038 { 1039 if (sdata.fPing[i]==0) 1040 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/red circle 1.png")); 1041 1042 if (sdata.fPing[i]==1) 1043 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/green circle 1.png")); 1044 1045 if (sdata.fPing[i]>1) 1046 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/orange circle 1.png")); 1047 1048 fFtuDisabled[i] = false; 1049 } 1050 else 1051 { 1052 fFtuLED[i]->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 1053 fFtuDisabled[i] = true; 1054 } 1055 1060 const bool active = sdata.IsActive(i); 1061 1062 cout << i << ": " << active << " " << (int)sdata.fPing[i] << endl; 1063 1064 SetFtuLed(i, active ? sdata.fPing[i] : -1); 1065 fFtuDisabled[i] = !active; 1056 1066 } 1057 1067 } … … 1062 1072 return; 1063 1073 1064 const Converter conv(d.format); 1065 cout << "Error:" << endl; 1066 cout << conv.GetString(&d.data[0], d.size()) << endl; 1074 const FTM::DimError &sdata = *reinterpret_cast<const FTM::DimError*>(d.ptr()); 1075 1076 SetFtuLed(sdata.fError.fDestAddress , sdata.fError.fNumCalls); 1077 1078 // Write to special window! 1079 Out() << "Error:" << endl; 1080 Out() << sdata.fError << endl; 1067 1081 } 1068 1082 … … 1142 1156 else 1143 1157 fStatusChatLed->setIcon(QIcon(":/Resources/icons/gray circle 1.png")); 1158 1159 fChatSend->setEnabled(fChatOnline); 1160 fChatMessage->setEnabled(fChatOnline); 1144 1161 } 1145 1162 } … … 1522 1539 1523 1540 fDimLoggerStats ("DATA_LOGGER/STATS", (void*)NULL, 0, this), 1524 fDimLoggerFilenameNight("DATA_LOGGER/FILENAME_NIGHT ", const_cast<char*>(""), 0, this),1525 fDimLoggerFilenameRun ("DATA_LOGGER/FILENAME_RUN", const_cast<char*>(""), 0, this),1526 fDimLoggerNumSubs ("DATA_LOGGER/NUM_SUBS", const_cast<char*>(""), 0, this),1541 fDimLoggerFilenameNight("DATA_LOGGER/FILENAME_NIGHTLY", const_cast<char*>(""), 0, this), 1542 fDimLoggerFilenameRun ("DATA_LOGGER/FILENAME_RUN", const_cast<char*>(""), 0, this), 1543 fDimLoggerNumSubs ("DATA_LOGGER/NUM_SUBS", const_cast<char*>(""), 0, this), 1527 1544 1528 1545 fDimFtmPassport ("FTM_CONTROL/PASSPORT", (void*)NULL, 0, this),
Note:
See TracChangeset
for help on using the changeset viewer.