00001 #include "ArchivingWorkerGroup.h"
00002 #include "archiving/ArchRawScanResult.h"
00003 #include "archiving/ArchFitScanResult.h"
00004 #include "archiving/ArchNPtGainTestResult.h"
00005 #include "archiving/ArchNoiseOccupancyTestResult.h"
00006 #include "archiving/ArchStrobeDelayTestResult.h"
00007 #include "archiving/ArchTrimRangeTestResult.h"
00008 #include "archiving/ArchTimeWalkTestResult.h"
00009 #include "archiving/ArchPipelineTestResult.h"
00010 #include "archiving/ArchFullBypassTestResult.h"
00011 #include "archiving/ArchNMaskTestResult.h"
00012
00013
00014 #include "Sct/LogicErrors.h"
00015
00016 using namespace Sct;
00017 using namespace SctData;
00018 using namespace boost;
00019
00020 namespace SctArchivingService {
00021
00022 void ArchivingWorkerGroup::work(shared_ptr<Serializable> ob) throw() {
00023 try {
00024 if (!ob) throw InvalidArgumentError("Failed to get object from IS", __FILE__, __LINE__);
00025
00026 shared_ptr<NoiseOccupancyTestResult> NOResult = dynamic_pointer_cast<NoiseOccupancyTestResult>(ob);
00027 if(NOResult) {
00028 cout<<" The Test Obj is NoiseOccupancyTestResult "<<endl;
00029 ArchNoiseOccupancyTestResult archnotest(*NOResult);
00030 archnotest.SetUNIXDir();
00031 archnotest.SaveNoiseOccupancy();
00032 cout<< "Noise Occupancy Test Correctly Saved " << endl;
00033 return;
00034 }
00035
00036 shared_ptr<NPtGainTestResult> NPtResult = dynamic_pointer_cast<NPtGainTestResult>(ob);
00037 if(NPtResult) {
00038 cout<<" The Test Obj is NPtGainTestResult "<<endl;
00039 ArchNPtGainTestResult archNPtGtest(*NPtResult);
00040 archNPtGtest.SetUNIXDir();
00041 archNPtGtest.SaveNPtGain();
00042 cout<< "NPt Gain Test Correctly Saved " << endl;
00043 return;
00044 }
00045
00046 shared_ptr<StrobeDelayTestResult> SDResult = dynamic_pointer_cast<StrobeDelayTestResult>(ob);
00047 if(SDResult) {
00048 cout<<" The Test Obj is StrobeDelayTestResult "<<endl;
00049 ArchStrobeDelayTestResult archSDtest(*SDResult);
00050 archSDtest.SetUNIXDir();
00051 archSDtest.SaveStrobeDelay();
00052 cout<< "Strobe Delay Test Correctly Saved " << endl;
00053 return;
00054 }
00055
00056 shared_ptr<TrimRangeTestResult> TRResult = dynamic_pointer_cast<TrimRangeTestResult>(ob);
00057 if(TRResult) {
00058 cout<<" The Test Obj is TrimRangeTestResult "<<endl;
00059 ArchTrimRangeTestResult archTRtest(*TRResult);
00060 archTRtest.SetUNIXDir();
00061 archTRtest.SaveTrimRange();
00062 cout<< "Trim Range Test Correctly Saved " << endl;
00063 return;
00064 }
00065
00066 shared_ptr<TimeWalkTestResult> TWResult = dynamic_pointer_cast<TimeWalkTestResult>(ob);
00067 if(TWResult) {
00068 cout<<" The Test Obj is TimeWalkTestResult "<<endl;
00069 ArchTimeWalkTestResult archTWtest(*TWResult);
00070 archTWtest.SetUNIXDir();
00071 archTWtest.SaveTimeWalk();
00072 cout<< "TimeWalk Test Correctly Saved " << endl;
00073 return;
00074 }
00075
00076 shared_ptr<FullBypassTestResult> FBResult = dynamic_pointer_cast<FullBypassTestResult>(ob);
00077 if(FBResult) {
00078 cout<<" The Test Obj is FullBypassTestResult "<<endl;
00079 ArchFullBypassTestResult archFBtest(*FBResult);
00080 archFBtest.SetUNIXDir();
00081 archFBtest.SaveFullBypass();
00082 cout<< "FullBypass Test Correctly Saved " << endl;
00083 return;
00084 }
00085
00086
00087 shared_ptr<PipelineTestResult> PResult = dynamic_pointer_cast<PipelineTestResult>(ob);
00088 if(PResult) {
00089 cout<<" The Test Obj is PipelineTestResult "<<endl;
00090 ArchPipelineTestResult archPtest(*PResult);
00091 archPtest.SetUNIXDir();
00092 archPtest.SavePipeline();
00093 cout<< "Pipeline Test Correctly Saved " << endl;
00094 return;
00095 }
00096
00097
00098 shared_ptr<NMaskTestResult> NMResult = dynamic_pointer_cast<NMaskTestResult>(ob);
00099 if(NMResult) {
00100 cout<<" The Test Obj is NMaskTestResult "<<endl;
00101 ArchNMaskTestResult archNMtest(*NMResult);
00102 archNMtest.SetUNIXDir();
00103 archNMtest.SaveNMask();
00104 cout<< "NMask Test Correctly Saved " << endl;
00105 return;
00106 }
00107
00108 throw InvalidArgumentError("The object on IS is an unknown Test type: " + ob->getClassName(), __FILE__, __LINE__);
00109 } catch(Throwable& e) {
00110 e.sendToMrs(MRS_ERROR);
00111 }
00112 }
00113
00114 }