32 {
Std_TraceMsg(0,
"Caught Error in desctructor of HiSpike2\r\n",
"", -1,
false,
true);}
35 void HiSpike2::PortNumber(
int iPort)
38 m_iPortNumber = iPort;
41 int HiSpike2::PortNumber() {
return m_iPortNumber;}
43 #pragma region DataAccesMethods
52 return RemoteControl::GetDataPointer(strDataType);
55 bool HiSpike2::SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError)
59 if(RemoteControl::SetData(strDataType, strValue,
false))
62 if(strType ==
"PORTNUMBER")
64 PortNumber((
int) atoi(strValue.c_str()));
70 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
75 void HiSpike2::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
77 RemoteControl::QueryProperties(aryProperties);
79 aryProperties.Add(
new TypeProperty(
"Data", AnimatPropertyType::Integer, AnimatPropertyDirection::Get));
81 aryProperties.Add(
new TypeProperty(
"PortNumber", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
92 RemoteControl::Initialize();
97 RemoteControl::ResetSimulation();
104 bool HiSpike2::OpenIO()
110 void HiSpike2::CloseIO()
130 m_fltData = (float) m_iInternalData;
134 if(m_iInternalData == 10)
139 boost::this_thread::sleep(boost::posix_time::microseconds(1000));
141 RemoteControl::StepIO();
146 RemoteControl::Load(oXml);
149 PortNumber(oXml.
GetChildInt(
"PortNumber", m_iPortNumber));
virtual void StepIO()
This method is called from within the IO thread. It calls StepIO for each part.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
Simulator * m_lpSim
The pointer to a Simulation.
virtual bool Paused()
Gets whether the Simulation is paused.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
virtual void Load(StdUtils::CStdXml &oXml)
Loads the item using an XML data packet.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
virtual int GetChildInt(std::string strElementName)
Gets an integer value from the element with the specified name.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
A standard xml manipulation class.
virtual void Initialize()
Initializes this object.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
virtual void ResetSimulation()
Resets the simulation back to time 0.