Index: /trunk/FACT++/src/dataLogger.cc
===================================================================
--- /trunk/FACT++/src/dataLogger.cc	(revision 10452)
+++ /trunk/FACT++/src/dataLogger.cc	(revision 10453)
@@ -51,4 +51,5 @@
 #include "MessageImp.h"
 #include "LocalControl.h"
+#include "DimDescriptionService.h"
 
 #include "Description.h"
@@ -138,11 +139,11 @@
 	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
 	///Inherited from state machine impl
-	int Execute(); 
+	//int Execute();
 	
 	///Inherited from state machine impl
-	int Transition(const Event& evt); 
+	//int Transition(const Event& evt);
 	
 	///Inherited from state machine impl
-	int Configure(const Event& evt); 
+	//int Configure(const Event& evt);
 	
 	//overloading of DIM's infoHandler function
@@ -317,5 +318,6 @@
 		char* data = new char[dataSize];
 		memset(data, 0, dataSize);
-		DimService srvc((GetName()+"/STATS").c_str(), "x:2;l:1", static_cast<void*>(data), dataSize);
+                DimDescribedService srvc((GetName()+"/STATS").c_str(), "x:2;l:1", static_cast<void*>(data), dataSize,
+                                        "Add description here");
 		double deltaT = 1;
 		fPreviousSize = 0;
@@ -384,5 +386,5 @@
 			targetRate = (targetSize - fPreviousSize)/deltaT;  
 			fPreviousSize = targetSize;
-			if (targetRate != 0) //if data has been written
+//			if (targetRate != 0) //if data has been written
 			{
 std::cout << "fBaseSizeDaily: " << fBaseSizeDaily << " fBaseSizeRun: " << fBaseSizeRun << std::endl;
@@ -413,51 +415,52 @@
 #endif
 		//Give a name to this machine's specific states
-		AddStateName(kSM_DailyOpen,      "DailyFileOpen");
-		AddStateName(kSM_WaitingRun,     "WaitForRun");
-		AddStateName(kSM_Logging,        "Logging");
-		AddStateName(kSM_BadDailyConfig, "ErrDailyFolder");
-		AddStateName(kSM_BadRunConfig,   "ErrRunFolder");
+		AddStateName(kSM_DailyOpen,      "DailyFileOpen",  "Add description here");
+		AddStateName(kSM_WaitingRun,     "WaitForRun",     "Add description here");
+		AddStateName(kSM_Logging,        "Logging",        "Add description here");
+		AddStateName(kSM_BadDailyConfig, "ErrDailyFolder", "Add description here");
+		AddStateName(kSM_BadRunConfig,   "ErrRunFolder",   "Add description here");
 
         /*Add the possible transitions for this machine*/
 
-        //start the daily logging. daily file location must be specified already
-		AddTransition(kSM_DailyOpen, fTransStart, kSM_Ready, kSM_BadDailyConfig). 
-                    AssignFunction(boost::bind(&DataLogger::StartPlease, this));
-
-        //stop the data logging
-		AddTransition(kSM_Ready, fTransStop, kSM_DailyOpen, kSM_WaitingRun, kSM_Logging). 
-                    AssignFunction(boost::bind(&DataLogger::GoToReadyPlease, this));
-
-        //start the run logging. run file location must be specified already.
-        AddTransition(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig).
-                    AssignFunction(boost::bind(&DataLogger::StartRunPlease, this));
-
-        AddTransition(kSM_WaitingRun, fTransStopRun, kSM_Logging).
-                    AssignFunction(boost::bind(&DataLogger::StopRunPlease, this));
-
-        //transition to exit error states. dunno if required or not, would close the daily file if already openned.
-		AddTransition(kSM_Ready, fTransReset, kSM_Error, kSM_BadDailyConfig, kSM_BadRunConfig, kSM_Error).
-                    AssignFunction(boost::bind(&DataLogger::GoToReadyPlease, this));
-
-        AddTransition(kSM_WaitingRun, fTransWait, kSM_DailyOpen).
-                    AssignFunction(boost::bind(&DataLogger::DailyToWaitRunPlease, this));
+                AddTransition(kSM_DailyOpen, fTransStart, kSM_Ready, kSM_BadDailyConfig)
+                    (boost::bind(&DataLogger::StartPlease, this))
+                    ("start the daily logging. daily file location must be specified already");
+
+		AddTransition(kSM_Ready, fTransStop, kSM_DailyOpen, kSM_WaitingRun, kSM_Logging)
+                    (boost::bind(&DataLogger::GoToReadyPlease, this))
+                    ("stop the data logging");
+
+                AddTransition(kSM_Logging, fTransStartRun, kSM_WaitingRun, kSM_BadRunConfig)
+                    (boost::bind(&DataLogger::StartRunPlease, this))
+                    ("start the run logging. run file location must be specified already.");
+
+                AddTransition(kSM_WaitingRun, fTransStopRun, kSM_Logging)
+                    (boost::bind(&DataLogger::StopRunPlease, this))
+                    ("");
+
+                AddTransition(kSM_Ready, fTransReset, kSM_Error, kSM_BadDailyConfig, kSM_BadRunConfig, kSM_Error)
+                    (boost::bind(&DataLogger::GoToReadyPlease, this))
+                    ("transition to exit error states. dunno if required or not, would close the daily file if already openned.");
+
+                AddTransition(kSM_WaitingRun, fTransWait, kSM_DailyOpen)
+                    (boost::bind(&DataLogger::DailyToWaitRunPlease, this));
 
         /*Add the possible configurations for this machine*/
         
-        //configure the daily file location. cannot be done before the file is actually opened
-		AddConfiguration(fConfigDay, "C", kSM_Ready, kSM_BadDailyConfig).
-                    AssignFunction(boost::bind(&DataLogger::ConfigureDailyFileName, this, _1));
-
-        //configure the run file location. cannot be done before the file is actually opened, and not in a dailly related error.
-		AddConfiguration(fConfigRun, "C", kSM_Ready, kSM_BadDailyConfig, kSM_DailyOpen, kSM_WaitingRun, kSM_BadRunConfig).
-                    AssignFunction(boost::bind(&DataLogger::ConfigureRunFileName, this, _1));
+                AddConfiguration(fConfigDay, "C", kSM_Ready, kSM_BadDailyConfig)
+                    (boost::bind(&DataLogger::ConfigureDailyFileName, this, _1))
+                    ("configure the daily file location. cannot be done before the file is actually opened");
+
+                AddConfiguration(fConfigRun, "C", kSM_Ready, kSM_BadDailyConfig, kSM_DailyOpen, kSM_WaitingRun, kSM_BadRunConfig)
+                    (boost::bind(&DataLogger::ConfigureRunFileName, this, _1))
+                    ("configure the run file location. cannot be done before the file is actually opened, and not in a dailly related error.");
 
 		//Provide a logging command
 		//I get the feeling that I should be going through the EventImp 
-		//instead of DimCommand directly, mainly because the commandHandler 
-		//is already done in StateMachineImp.cc
-		//Thus I'll simply add a configuration, which I will treat as the logging command
-		AddConfiguration(fConfigLog, "C", kSM_DailyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadRunConfig).
-                    AssignFunction(boost::bind(&DataLogger::LogMessagePlease, this, _1));
+                //instead of DimCommand directly, mainly because the commandHandler
+                //is already done in StateMachineImp.cc
+                //Thus I'll simply add a configuration, which I will treat as the logging command
+                AddConfiguration(fConfigLog, "C", kSM_DailyOpen, kSM_Logging, kSM_WaitingRun, kSM_BadRunConfig)
+                    (boost::bind(&DataLogger::LogMessagePlease, this, _1));
 
 		fServiceList.SetHandler(this);
@@ -474,5 +477,6 @@
 		fDimBuffer[sizeof(int)] = '\0';
 		//gives the entire buffer size. Otherwise, dim overwrites memory at bizarre locations if smaller size is given at creation time.
-		fOpenedFiles = 	new DimService((GetName()+"/FILENAME").c_str(), "i:1;C", static_cast<void*>(fDimBuffer), 256);
+                fOpenedFiles = 	new DimDescribedService((GetName()+"/FILENAME").c_str(), "i:1;C", static_cast<void*>(fDimBuffer), 256,
+                                                        "Add description here");
 		
 		
@@ -587,4 +591,5 @@
 #endif
 }
+/*
 // --------------------------------------------------------------------------
 //
@@ -623,6 +628,6 @@
 	{
 		case kSM_Ready:
-		/*here we must figure out whether the STOP or RESET command was sent*/
-		/*close opened files and go back to ready state*/
+		//here we must figure out whether the STOP or RESET command was sent
+		//close opened files and go back to ready state
 			switch (GetCurrentState())
 			{
@@ -640,5 +645,5 @@
 		
 		case kSM_DailyOpen:
-			/*Attempt to open the daily file */
+			//Attempt to open the daily file
 			switch (GetCurrentState())
 			{
@@ -650,5 +655,5 @@
 		
 		case kSM_WaitingRun:
-			/*either close the run file, or just go to the waitingrun state (if coming from daily open*/
+			//either close the run file, or just go to the waitingrun state (if coming from daily open
 			switch (GetCurrentState())
 			{
@@ -662,5 +667,5 @@
 		
 		case kSM_Logging:
-			/*Attempt to open run file */
+			//Attempt to open run file
 			switch (GetCurrentState())
 			{
@@ -706,4 +711,5 @@
 	return kSM_FatalError;
 }
+*/
 // --------------------------------------------------------------------------
 //
@@ -855,4 +861,5 @@
 
 }
+
 // --------------------------------------------------------------------------
 //
