File: WORKFLOW\TChooseDetectorCmd.cpp

    1 #include "workflow\TChooseDetectorCmd.h"
    2 
    3 TChooseDetectorCmd::TChooseDetectorCmd ( TCmdTag ct ) : TCmd(ct)
    4 {
    5         float time, fl;
    6         DWORD counts;
    7 
    8         bNoMeasure = TRUE;
    9         if ( TDetectorManager::DetectorManager().SetDetector( ct.P1 ) )
   10         {
   11                 TExposureSettings exposure = TDetectorManager::DetectorManager().GetDetector()->GetExposureSettings();
   12                 sscanf(ct.P3, "%f %ld %f", &time, &counts, &fl);
   13                 //JP new algorithm
   14                 if ( time != 0 )
   15                         exposure.SetExposureTime(time);
   16                 if ( counts != 0 )
   17                         exposure.SetExposureCounts(counts);
   18                 TDetectorManager::DetectorManager().GetDetector()->SetExposureSettings(exposure);
   19         }
   20         else
   21                 nFailureId= 1;
   22 
   23         eStep = CReady;
   24 };
   25 
   26 void TChooseDetectorCmd::GetName ( LPSTR aName )
   27 {
   28         strcpy( aName, "ChooseDetector" );
   29 };
   30 
   31 bool TChooseDetectorCmd::GetShowData ( LPSTR buffer )
   32 {
   33         buffer[0] = 0;
   34         if ( eStep == CReady )
   35         {
   36                 if (nFailureId)
   37                 {
   38                         #ifdef GermanVersion
   39                                 sprintf(buffer, "\"ChooseDetector\"-Kommando fehlgeschlagen.");
40 #else 41 sprintf(buffer, "\"ChooseDetector\"-Command failed.");
42 #endif 43 } 44 else 45 { 46 #ifdef GermanVersion 47 sprintf(buffer, "\"ChooseDetector\"-Kommando erfolgreich.");
48 #else 49 sprintf(buffer, "\"ChooseDetector\"-Command ready.");
50 #endif 51 } 52 } 53 return true; 54 }; 55