Changeset 10489 for trunk/FACT++/src/dataLogger.cc
- Timestamp:
- 04/29/11 10:19:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dataLogger.cc
r10488 r10489 85 85 int numOpenFits; 86 86 }; 87 87 //For debugging DIM's services 88 class MyService 89 { 90 public: 91 MyService(){}; 92 MyService(std::string, std::string, void*, int){}; 93 MyService(std::string, const char*){}; 94 void updateService(){}; 95 void updateService(void*, int){}; 96 void setQuality(int){}; 97 }; 88 98 class DataLogger : public StateMachineDim, DimInfoHandler 89 99 { … … 136 146 static const char* fTransWait; 137 147 static const char* fRunNumberInfo; ///< This is the name of the dimInfo received to specify the run number. It must be updated once the final name will be defined 138 ///Inherited from state machine impl139 //int Execute();140 141 ///Inherited from state machine impl142 //int Transition(const Event& evt);143 144 ///Inherited from state machine impl145 //int Configure(const Event& evt);146 148 147 149 //overloading of DIM's infoHandler function … … 293 295 long long fBaseSizeRun; 294 296 ///Service for opened files 295 Dim Service* fOpenedDailyFiles;296 Dim Service* fOpenedRunFiles;297 Dim Service* fNumSubAndFits;297 DimDescribedService* fOpenedDailyFiles; 298 DimDescribedService* fOpenedRunFiles; 299 DimDescribedService* fNumSubAndFits; 298 300 NumSubAndFitsType fNumSubAndFitsData; 299 301 // char* fDimBuffer; 300 302 inline void NotifyOpenedFile(std::string name, int type, DimService* service); 303 inline void NotifyOpenedFile(std::string , int , MyService* ){} 301 304 302 305 }; //DataLogger … … 334 337 // DimDescribedService srvc((GetName()+"/STATS").c_str(), "x:2;l:1", &statVar, dataSize,//static_cast<void*>(data), dataSize, 335 338 // "Add description here"); 336 Dim Service srvc ("DATA_LOGGER/STATS", "x:2;l:1", &statVar, dataSize);339 DimDescribedService srvc ("DATA_LOGGER/STATS", "X:2;L:1", &statVar, dataSize, "Add description here"); 337 340 double deltaT = 1; 338 341 fPreviousSize = 0; 342 bool statWarning = false; 339 343 //loop-wait for broadcast 340 344 while (fContinueMonitoring) … … 384 388 385 389 if (!statvfs(fDailyFileName.c_str(), &vfs)) 390 { 386 391 statVar.freeSpace = vfs.f_bsize*vfs.f_bavail; 392 statWarning = false; 393 } 387 394 else 395 { 396 std::stringstream str; 397 str << "Unable to retrieve stats for " << fDailyFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 398 if (!statWarning) 399 Error(str); 400 statWarning = true; 388 401 statVar.freeSpace = -1; 402 } 389 403 390 404 //sum up all the file sizes. past and present … … 416 430 { 417 431 //initialize member data 418 fDailyFileName = " /home/lyard/log";//".";419 fRunFileName = " /home/lyard/log";//".";432 fDailyFileName = ".";//"/home/lyard/log";// 433 fRunFileName = ".";//"/home/lyard/log"; 420 434 fRunNumber = 12345; 421 435 #ifdef HAS_FITS … … 433 447 /*Add the possible transitions for this machine*/ 434 448 AddTransition(kSM_DailyOpen, fTransStart, kSM_Ready, kSM_BadDailyConfig) 435 (boost::bind(&DataLogger::StartPlease, this)) ;436 //("start the daily logging. daily file location must be specified already");449 (boost::bind(&DataLogger::StartPlease, this)) 450 ("start the daily logging. daily file location must be specified already"); 437 451 438 452 AddTransition(kSM_Ready, fTransStop, kSM_DailyOpen, kSM_WaitingRun, kSM_Logging) 439 (boost::bind(&DataLogger::GoToReadyPlease, this)) ;440 //("stop the data logging");453 (boost::bind(&DataLogger::GoToReadyPlease, this)) 454 ("stop the data logging"); 441 455 442 456 AddTransition(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig) 443 (boost::bind(&DataLogger::StartRunPlease, this)) ;444 //("start the run logging. run file location must be specified already.");457 (boost::bind(&DataLogger::StartRunPlease, this)) 458 ("start the run logging. run file location must be specified already."); 445 459 446 460 AddTransition(kSM_WaitingRun, fTransStopRun, kSM_Logging) 447 (boost::bind(&DataLogger::StopRunPlease, this)) ;448 //("");461 (boost::bind(&DataLogger::StopRunPlease, this)) 462 (""); 449 463 450 464 AddTransition(kSM_Ready, fTransReset, kSM_Error, kSM_BadDailyConfig, kSM_BadRunConfig, kSM_Error) 451 (boost::bind(&DataLogger::GoToReadyPlease, this)) ;452 //("transition to exit error states. dunno if required or not, would close the daily file if already openned.");465 (boost::bind(&DataLogger::GoToReadyPlease, this)) 466 ("transition to exit error states. dunno if required or not, would close the daily file if already openned."); 453 467 454 468 AddTransition(kSM_WaitingRun, fTransWait, kSM_DailyOpen) … … 458 472 459 473 AddConfiguration(fConfigDay, "C", kSM_Ready, kSM_BadDailyConfig) 460 (boost::bind(&DataLogger::ConfigureDailyFileName, this, _1)) ;;461 //("configure the daily file location. cannot be done before the file is actually opened");474 (boost::bind(&DataLogger::ConfigureDailyFileName, this, _1)) 475 ("configure the daily file location. cannot be done before the file is actually opened"); 462 476 463 477 AddConfiguration(fConfigRun, "C", kSM_Ready, kSM_BadDailyConfig, kSM_DailyOpen, kSM_WaitingRun, kSM_BadRunConfig) 464 (boost::bind(&DataLogger::ConfigureRunFileName, this, _1)) ;465 //("configure the run file location. cannot be done before the file is actually opened, and not in a dailly related error.");478 (boost::bind(&DataLogger::ConfigureRunFileName, this, _1)) 479 ("configure the run file location. cannot be done before the file is actually opened, and not in a dailly related error."); 466 480 467 481 //Provide a logging command … … 481 495 fBaseSizeDaily = 0; 482 496 fBaseSizeRun = 0; 483 //start the open files service484 // fDimBuffer = new char[256];485 // memset(fDimBuffer, 0, sizeof(int));486 // fDimBuffer[sizeof(int)] = '\0';487 497 488 498 //gives the entire buffer size. Otherwise, dim overwrites memory at bizarre locations if smaller size is given at creation time. 489 499 // fOpenedFiles = new DimDescribedService((GetName()+"/FILENAME").c_str(), "i:1;C", static_cast<void*>(fDimBuffer), 256, "Add description here"); 490 fOpenedDailyFiles = new Dim Service((GetName() + "/FILENAME_DAILY").c_str(), const_cast<char*>(""));//"i:1;C", static_cast<void*>(fDimBuffer), 256);491 fOpenedRunFiles = new Dim Service((GetName() + "/FILENAME_RUN").c_str(), const_cast<char*>(""));500 fOpenedDailyFiles = new DimDescribedService((GetName() + "/FILENAME_DAILY").c_str(), const_cast<char*>(""), "Add description here");//"i:1;C", static_cast<void*>(fDimBuffer), 256); 501 fOpenedRunFiles = new DimDescribedService((GetName() + "/FILENAME_RUN").c_str(), const_cast<char*>(""), "Add description here"); 492 502 fOpenedDailyFiles->setQuality(0); 493 503 fOpenedRunFiles->setQuality(0); … … 496 506 fNumSubAndFitsData.numSubscriptions = 0; 497 507 fNumSubAndFitsData.numOpenFits = 0; 498 fNumSubAndFits = new Dim Service((GetName() + "/NUM_SUBS").c_str(), "i:2", &fNumSubAndFitsData, sizeof(NumSubAndFitsType));508 fNumSubAndFits = new DimDescribedService((GetName() + "/NUM_SUBS").c_str(), "I:2", &fNumSubAndFitsData, sizeof(NumSubAndFitsType), "Add description here"); 499 509 500 510 } … … 527 537 } 528 538 529 } 539 } 530 540 for (std::vector<std::string>::const_iterator it = toBeDeleted.begin(); it != toBeDeleted.end(); it++) 531 541 fServiceSubscriptions.erase(*it); … … 620 630 #endif 621 631 } 622 /* 623 // -------------------------------------------------------------------------- 624 // 625 //! Execute 626 //! Shouldn't be run as we use callbacks instead 627 // 628 int DataLogger::Execute() 629 { 630 //due to the callback mecanism, this function should never be called 631 return kSM_FatalError; 632 633 switch (GetCurrentState()) 634 { 635 case kSM_Error: 636 case kSM_Ready: 637 case kSM_DailyOpen: 638 case kSM_WaitingRun: 639 case kSM_Logging: 640 case kSM_BadDailyConfig: 641 case kSM_BadRunConfig: 642 return GetCurrentState(); 643 } 644 //this line below should never be hit. It here mainly to remove warnings at compilation 645 return kSM_FatalError; 646 } 647 // -------------------------------------------------------------------------- 648 // 649 //! Shouldn't be run as we use callbacks instead 650 // 651 int DataLogger::Transition(const Event& evt) 652 { 653 //due to the callback mecanism, this function should never be called 654 return kSM_FatalError; 655 656 switch (evt.GetTargetState()) 657 { 658 case kSM_Ready: 659 //here we must figure out whether the STOP or RESET command was sent 660 //close opened files and go back to ready state 661 switch (GetCurrentState()) 662 { 663 case kSM_BadDailyConfig: 664 case kSM_BadRunConfig: 665 case kSM_Error: 666 return GoToReadyPlease(); 667 668 case kSM_Logging: 669 case kSM_WaitingRun: 670 case kSM_DailyOpen: 671 return GoToReadyPlease(); 672 } 673 break; 674 675 case kSM_DailyOpen: 676 //Attempt to open the daily file 677 switch (GetCurrentState()) 678 { 679 case kSM_Ready: 680 case kSM_BadDailyConfig: 681 return StartPlease(); 682 } 683 break; 684 685 case kSM_WaitingRun: 686 //either close the run file, or just go to the waitingrun state (if coming from daily open 687 switch (GetCurrentState()) 688 { 689 case kSM_DailyOpen: 690 return kSM_WaitingRun; 691 692 case kSM_Logging: 693 return StopRunPlease(); 694 } 695 break; 696 697 case kSM_Logging: 698 //Attempt to open run file 699 switch (GetCurrentState()) 700 { 701 case kSM_WaitingRun: 702 case kSM_BadRunConfig: 703 return StartRunPlease(); 704 } 705 break; 706 } 707 //Getting here means that an invalid transition has been asked. 708 //TODO Log an error message 709 //and return the fatal error state 710 return kSM_FatalError; 711 } 712 // -------------------------------------------------------------------------- 713 // 714 //! Shouldn't be run as we use callbacks instead 715 // 716 int DataLogger::Configure(const Event& evt) 717 { 718 //due to the callback mecanism, this function should never be called 719 return kSM_FatalError; 720 721 switch (evt.GetTargetState()) 722 { 723 case kSM_Ready: 724 case kSM_BadDailyConfig: 725 return ConfigureDailyFileName(evt); 726 break; 727 728 case kSM_WaitingRun: 729 case kSM_BadRunConfig: 730 return ConfigureRunFileName(evt); 731 break; 732 733 case kSM_Logging: 734 case kSM_DailyOpen: 735 return 0; 736 break; 737 738 } 739 740 return kSM_FatalError; 741 } 742 */ 632 743 633 // -------------------------------------------------------------------------- 744 634 // … … 827 717 if (!sub.fConv) 828 718 { 829 Error("Couldn't properly parse the format... service ignored."); 719 std::stringstream str; 720 str << "Couldn't properly parse the format... service " << sub.dimInfo->getName() << " ignored."; 721 Error(str); 830 722 return; 831 723 } … … 854 746 { 855 747 Out() << kRed << e.what() << endl; 856 Error("Couldn't properly parse the data... ignored."); 748 std::stringstream str; 749 str << "Could not properly parse the data for service " << sub.dimInfo->getName(); 750 str << " reason: " << e.what() << ". Entry ignored"; 751 Error(str); 857 752 return; 858 753 } 859 754 860 755 if (text.empty()) 756 { 757 std::stringstream str; 758 str << "Service " << sub.dimInfo->getName() << " sent an empty string"; 759 Info(str); 861 760 return; 862 761 } 863 762 //replace bizarre characters by white space 864 763 replace(text.begin(), text.end(), '\n', '\\'); 865 764 replace_if(text.begin(), text.end(), std::ptr_fun<int, int>(&std::iscntrl), ' '); 866 867 if (fDailyReportFile.is_open()) 868 fDailyReportFile << header.str(); 869 if (fRunReportFile.is_open()) 870 fRunReportFile << header.str(); 871 872 if (fDailyReportFile.is_open()) 873 fDailyReportFile << text << std::endl; 874 if (fRunReportFile.is_open()) 875 fRunReportFile << text << std::endl; 765 766 //write entry to daily report 767 try 768 { 769 if (fDailyReportFile.is_open()) 770 fDailyReportFile << header.str() << text << std::endl; 771 } 772 catch (std::exception e) 773 { 774 std::stringstream str; 775 str << "Error while writing to daily report file: " << e.what(); 776 Error(str); 777 } 778 //write entry to run-report 779 try 780 { 781 if (fRunReportFile.is_open()) 782 fRunReportFile << header.str() << text << std::endl; 783 } 784 catch (std::exception e) 785 { 786 std::stringstream str; 787 str << "Error while writing to run report file: " << e.what(); 788 Error(str); 789 } 876 790 } 877 791 else 878 { 792 {//write entry to both daily and run logs 879 793 std::string n = I->getName(); 880 794 std::stringstream msg; 881 795 msg << n.substr(0, n.find_first_of('/')) << ": " << I->getString(); 882 MessageImp dailyMess(fDailyLogFile); 883 dailyMess.Write(cTime, msg.str().c_str(), fQuality); 796 try 797 { 798 MessageImp dailyMess(fDailyLogFile); 799 dailyMess.Write(cTime, msg.str().c_str(), fQuality); 800 } 801 catch (std::exception e) 802 { 803 std::stringstream str; 804 str << "Error while writing to daily log file: " << e.what(); 805 Error(str); 806 } 884 807 if (fRunLogFile.is_open()) 885 808 { 886 MessageImp runMess(fRunLogFile); 887 runMess.Write(cTime, msg.str().c_str(), fQuality); 809 try 810 { 811 MessageImp runMess(fRunLogFile); 812 runMess.Write(cTime, msg.str().c_str(), fQuality); 813 } 814 catch (std::exception e) 815 { 816 std::stringstream str; 817 str << "Error while writing to run log file: " << e.what(); 818 Error(str); 819 } 888 820 } 889 821 } … … 910 842 // 911 843 //TODO isn't that function not used any longer ? If so I guess that we should get rid of it... 844 //Otherwise re-write it properly with the MessageImp class 912 845 int DataLogger::LogMessagePlease(const Event& evt) 913 846 { … … 969 902 int DataLogger::ConfigureDailyFileName(const Event& evt) 970 903 { 971 std::cout << "Configure Daily File Name" << std::endl;972 904 if (evt.GetText() != NULL) 905 { 973 906 fDailyFileName = std::string(evt.GetText()); 907 Message("New daily folder specified: " + fDailyFileName); 908 } 974 909 else 975 Error("Empty daily folder ");910 Error("Empty daily folder given. Please specify a valid path."); 976 911 977 912 return GetCurrentState(); … … 986 921 int DataLogger::ConfigureRunFileName(const Event& evt) 987 922 { 988 std::cout << "Configure Run File Name" << std::endl;989 923 if (evt.GetText() != NULL) 924 { 990 925 fRunFileName = std::string(evt.GetText()); 926 Message("New Run folder specified: " + fRunFileName); 927 } 991 928 else 992 Error("Empty daily folder ");929 Error("Empty daily folder given. Please specify a valid path"); 993 930 994 931 return GetCurrentState(); … … 1001 938 //! @returns 1002 939 //! currently only the current state 940 //TODO remove this function as the run numbers will be distributed through a dedicated service 1003 941 int DataLogger::ConfigureRunNumber(const Event& evt) 1004 942 { 1005 943 fRunNumber = evt.GetInt(); 1006 1007 944 return GetCurrentState(); 1008 945 } … … 1016 953 inline void DataLogger::NotifyOpenedFile(std::string name, int type, DimService* service) 1017 954 { 1018 //std::cout << "name: " << name << " size: " << name.size() << std::endl;1019 // reinterpret_cast<int*>(fDimBuffer)[0] = type;1020 // strcpy(&fDimBuffer[sizeof(int)], name.c_str());1021 955 service->setQuality(type); 1022 956 service->updateService(const_cast<char*>(name.c_str())); 1023 // fOpenedFiles->updateService(static_cast<void*>(fDimBuffer), name.size() + 1 + sizeof(int));1024 957 } 1025 958 // -------------------------------------------------------------------------- … … 1033 966 { 1034 967 //TODO concatenate the dailyFileName and the formatted date and extension to obtain the full file name 1035 Time time; //(Time::utc);968 Time time; 1036 969 std::stringstream sTime; 1037 970 sTime << time.Y() << "_" << time.M() << "_" << time.D(); 971 1038 972 fFullDailyLogFileName = fDailyFileName + '/' + sTime.str() + ".log"; 1039 1040 fDailyLogFile.open(fFullDailyLogFileName.c_str(), std::ios_base::out | std::ios_base::app); //maybe should be "app" instead of "ate" ?? 973 fDailyLogFile.open(fFullDailyLogFileName.c_str(), std::ios_base::out | std::ios_base::app); 974 if (errno != 0) 975 { 976 std::stringstream str; 977 str << "Unable to open daily Log " << fFullDailyLogFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 978 Error(str); 979 } 1041 980 fFullDailyReportFileName = fDailyFileName + '/' + sTime.str() + ".rep"; 1042 981 fDailyReportFile.open(fFullDailyReportFileName.c_str(), std::ios_base::out | std::ios_base::app); 1043 982 if (errno != 0) 983 { 984 std::stringstream str; 985 str << "Unable to open daily Report " << fFullDailyReportFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 986 Error(str); 987 } 988 1044 989 if (!fDailyLogFile.is_open() || !fDailyReportFile.is_open()) 1045 990 { … … 1062 1007 char currentPath[FILENAME_MAX]; 1063 1008 getcwd(currentPath, sizeof(currentPath)); 1009 if (errno != 0) 1010 { 1011 std::stringstream str; 1012 str << "Unable retrieve current path" << ". Reason: " << strerror(errno) << " [" << errno << "]"; 1013 Error(str); 1014 } 1064 1015 actualTargetDir = currentPath; 1065 1016 } … … 1068 1019 actualTargetDir = fDailyFileName; 1069 1020 } 1070 std::cout << actualTargetDir << '/' << sTime.str() << std::endl; 1021 1071 1022 NotifyOpenedFile(actualTargetDir + '/' + sTime.str(), 3, fOpenedDailyFiles); 1072 1023 … … 1108 1059 fFileSizesMap[partialName] = 0; 1109 1060 } 1110 sub.dailyFile.Open(partialName, serviceName, NULL, &fNumSubAndFitsData.numOpenFits );1061 sub.dailyFile.Open(partialName, serviceName, NULL, &fNumSubAndFitsData.numOpenFits, Out()); 1111 1062 //notify the opening 1112 1063 std::string actualTargetDir; … … 1153 1104 catch (CCfits::FitsError e) 1154 1105 { 1155 std::ostringstream err; 1156 err << "Could not open run file " << partialName; 1157 throw runtime_error(err.str()); 1106 std::stringstream str; 1107 str << "Could not open FITS Run file " << partialName << " reason: " << e.message(); 1108 Error(str); 1109 fRunFitsFile = NULL; 1158 1110 } 1159 1111 #endif … … 1172 1124 #ifdef ONE_RUN_FITS_ONLY 1173 1125 } 1174 sub.runFile.Open(partialName, serviceName, fRunFitsFile, &fNumSubAndFitsData.numOpenFits );1126 sub.runFile.Open(partialName, serviceName, fRunFitsFile, &fNumSubAndFitsData.numOpenFits, Out()); 1175 1127 #else 1176 sub.runFile.Open(partialName, serviceName, NULL, &fNumSubAndFitsData.numOpenFits );1128 sub.runFile.Open(partialName, serviceName, NULL, &fNumSubAndFitsData.numOpenFits, Out()); 1177 1129 #endif //one_run_fits_only 1178 1130 fNumSubAndFits->updateService(); … … 1281 1233 fFullRunLogFileName = fRunFileName + '/' + sRun.str() + ".log"; 1282 1234 fRunLogFile.open(fFullRunLogFileName.c_str(), std::ios_base::out | std::ios_base::app); //maybe should be app instead of ate 1283 1235 if (errno != 0) 1236 { 1237 std::stringstream str; 1238 str << "Unable to open run Log " << fFullRunLogFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 1239 Error(str); 1240 } 1284 1241 fFullRunReportFileName = fRunFileName + '/' + sRun.str() + ".rep"; 1285 1242 fRunReportFile.open(fFullRunReportFileName.c_str(), std::ios_base::out | std::ios_base::app); 1243 if (errno != 0) 1244 { 1245 std::stringstream str; 1246 str << "Unable to open run report " << fFullRunReportFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 1247 Error(str); 1248 } 1286 1249 1287 1250 if (!fRunLogFile.is_open() || !fRunReportFile.is_open()) … … 1296 1259 { 1297 1260 stat(fFullRunLogFileName.c_str(), &st); 1298 fBaseSizeRun += st.st_size; 1261 if (errno != 0) 1262 { 1263 std::stringstream str; 1264 str << "Unable to stat " << fFullRunLogFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 1265 Error(str); 1266 } 1267 else 1268 fBaseSizeRun += st.st_size; 1299 1269 fFileSizesMap[fFullRunLogFileName] = 0; 1300 1270 } … … 1302 1272 { 1303 1273 stat(fFullRunReportFileName.c_str(), &st); 1304 fBaseSizeRun += st.st_size; 1274 if (errno != 0) 1275 { 1276 std::stringstream str; 1277 str << "Unable to stat " << fFullRunReportFileName << ". Reason: " << strerror(errno) << " [" << errno << "]"; 1278 Error(str); 1279 } 1280 else 1281 fBaseSizeRun += st.st_size; 1305 1282 fFileSizesMap[fFullRunReportFileName] = 0; 1306 1283 } … … 1310 1287 char currentPath[FILENAME_MAX]; 1311 1288 getcwd(currentPath, sizeof(currentPath)); 1289 if (errno != 0) 1290 { 1291 std::stringstream str; 1292 str << "Unable to retrieve the current path" << ". Reason: " << strerror(errno) << " [" << errno << "]"; 1293 Error(str); 1294 } 1312 1295 actualTargetDir = currentPath; 1313 1296 } … … 1345 1328 delete fRunFitsFile; 1346 1329 fRunFitsFile = NULL; 1347 std::cout << "FNumSub2: " << fNumSubAndFitsData.numOpenFits << std::endl;1348 1330 (fNumSubAndFitsData.numOpenFits)--; 1349 std::cout << "FNumSub3: " << fNumSubAndFitsData.numOpenFits << std::endl;1350 1331 } 1351 1332 #endif … … 1433 1414 } 1434 1415 1435 void RunThread(DataLogger *logger)1436 { 1437 // This is necessary so that the StateMachien Thread can signal the 1438 1439 1440 Readline::Stop(); 1416 void RunThread(DataLogger* logger) 1417 { 1418 // This is necessary so that the StateMachine Thread can signal the 1419 // Readline thread to exit 1420 logger->Run(true); 1421 Readline::Stop(); 1441 1422 } 1442 1423 … … 1454 1435 1455 1436 DataLogger logger(wout); 1437 1438 // if (conf.Has("black-list")) 1439 // logger.setBlackList(conf.Get<std::string>("black-list")); 1440 // else if (conf.Has("white-list")) 1441 // logger.setWhiteList(conf.Get<std::string>("white-list")); 1442 1456 1443 shell.SetReceiver(logger); 1457 1444 1458 1459 1460 shell.Run();// Run the shell1461 1462 logger.Stop(); // Signal Loop-thread to stop 1463 1464 //Wait until the StateMachine has finished its thread1465 // before returning and destroying the dim objects which might 1466 //still be in use.1467 1445 boost::thread t(boost::bind(RunThread, &logger)); 1446 1447 shell.Run(); // Run the shell 1448 1449 logger.Stop(); 1450 1451 //Wait until the StateMachine has finished its thread 1452 //before returning and destroyinng the dim objects which might 1453 //still be in use. 1454 t.join(); 1468 1455 1469 1456 return 0; … … 1505 1492 "help message about the usuage can be brought to the screen." 1506 1493 << endl; 1507 1508 /*1509 cout << "bla bla bla" << endl << endl;1510 cout << endl;1511 cout << "Environment:" << endl;1512 cout << "environment" << endl;1513 cout << endl;1514 cout << "Examples:" << endl;1515 cout << "test exam" << endl;1516 cout << endl;1517 cout << "Files:" << endl;1518 cout << "files" << endl;1519 cout << endl;1520 */1521 1494 } 1522 1495 … … 1564 1537 ("log,l", var<string>(n), "Write log-file") 1565 1538 ("console,c", var<int>(), "Use console (0=shell, 1=simple buffered, X=simple unbuffered)") 1539 ("black-list,b", var<string>(""), "Black-list of services") 1540 ("white-list,w", var<string>(""), "White-list of services") 1566 1541 ; 1567 1542
Note:
See TracChangeset
for help on using the changeset viewer.