|
CLAM-Development
1.3
|
00001 #include "ControlSum.hxx" 00002 #include "ProcessingFactory.hxx" 00003 00004 namespace CLAM 00005 { 00006 namespace Hidden 00007 { 00008 static const char * metadata[] = { 00009 "key", "ControlSum", 00010 "category", "Controls", 00011 "description", "ControlSum", 00012 0 00013 }; 00014 static FactoryRegistrator<ProcessingFactory, ControlSum> reg = metadata; 00015 } 00016 00017 void ControlSumConfig::DefaultInit() 00018 { 00019 AddAll(); 00020 UpdateData(); 00021 SetRightTerm( 0.0 ); 00022 } 00023 00024 ControlSum::ControlSum() 00025 : mInOperator1( "Operator 1", this , &ControlSum::InControlCallback ) 00026 , mInOperator2( "Operator 2", this , &ControlSum::InControlCallback ) 00027 , mOutControl( "Sum", this ) 00028 { 00029 Configure( mConfig ); 00030 } 00031 00032 ControlSum::ControlSum( const ControlSumConfig& cfg ) 00033 : mInOperator1( "Operator 1", this , &ControlSum::InControlCallback ) 00034 , mInOperator2( "Operator 2", this , &ControlSum::InControlCallback ) 00035 , mOutControl( "Sum", this ) 00036 { 00037 Configure( cfg ); 00038 } 00039 00040 bool ControlSum::ConcreteConfigure( const ProcessingConfig& cfg ) 00041 { 00042 CopyAsConcreteConfig( mConfig, cfg ); 00043 mInOperator2.DoControl(mConfig.GetRightTerm()); 00044 return true; 00045 } 00046 00047 void ControlSum::InControlCallback(const TControlData & value) 00048 { 00049 TControlData op1 = mInOperator1.GetLastValue(); 00050 TControlData op2 = mInOperator2.GetLastValue(); 00051 mOutControl.SendControl(op1+op2); 00052 } 00053 00054 bool ControlSum::Do() 00055 { 00056 return true; 00057 } 00058 } 00059
1.7.6.1