6 #include "HiClassFactory.h"
9 #include "HiC884Controller.h"
10 #include "HiM110Actuator.h"
13 extern "C" __declspec(dllexport)
IStdClassFactory* __cdecl GetStdClassFactory()
29 HiClassFactory::HiClassFactory()
34 HiClassFactory::~HiClassFactory()
42 RobotIOControl *HiClassFactory::CreateRobotIOControl(std::string strType,
bool bThrowError)
44 RobotIOControl *lpControl=NULL;
50 if(strType ==
"SPIKE2")
54 else if(strType ==
"C884CONTROLLER")
62 THROW_PARAM_ERROR(Al_Err_lInvalidRobotIOControlType, Al_Err_strInvalidRobotIOControlType,
"RobotartIOControl", strType);
67 catch(CStdErrorInfo oError)
69 if(lpControl)
delete lpControl;
75 if(lpControl)
delete lpControl;
76 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
87 RobotPartInterface *HiClassFactory::CreateRobotPartInterface(std::string strType,
bool bThrowError)
89 RobotPartInterface *lpInterface=NULL;
95 if(strType ==
"M110ACTUATOR")
103 THROW_PARAM_ERROR(Al_Err_lInvalidRobotPartInterfaceType, Al_Err_strInvalidRobotPartInterfaceType,
"RobotartInterface", strType);
108 catch(CStdErrorInfo oError)
110 if(lpInterface)
delete lpInterface;
116 if(lpInterface)
delete lpInterface;
117 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
129 CStdSerialize *HiClassFactory::CreateObject(std::string strClassType, std::string strObjectType,
bool bThrowError)
135 if(strClassType ==
"ROBOTIOCONTROL")
136 lpObject = CreateRobotIOControl(strObjectType, bThrowError);
137 else if(strClassType ==
"ROBOTPARTINTERFACE")
138 lpObject = CreateRobotPartInterface(strObjectType, bThrowError);
143 THROW_PARAM_ERROR(Std_Err_lInvalidClassType, Std_Err_strInvalidClassType,
"ClassType", strClassType);
std::string Std_Trim(std::string strVal)
Trims a string.
std::string Std_ToUpper(std::string strVal)
Converts a string to upper case.