TimePeriod::TimePeriod(const Dictionary::Ptr& serializedUpdate)
: DynamicObject(serializedUpdate)
{
+ RegisterAttribute("display_name", Attribute_Config, &m_DisplayName);
RegisterAttribute("valid_begin", Attribute_Replicated, &m_ValidBegin);
RegisterAttribute("valid_end", Attribute_Replicated, &m_ValidEnd);
RegisterAttribute("segments", Attribute_Replicated, &m_Segments);
Dump();
}
+String TimePeriod::GetDisplayName(void) const
+{
+ if (!m_DisplayName.IsEmpty())
+ return m_DisplayName;
+ else
+ return GetName();
+}
+
TimePeriod::Ptr TimePeriod::GetByName(const String& name)
{
DynamicObject::Ptr configObject = DynamicObject::GetObject("TimePeriod", name);
static TimePeriod::Ptr GetByName(const String& name);
+ String GetDisplayName(void) const;
+
virtual void Start(void);
void UpdateRegion(double begin, double end, bool clearExisting);
static Array::Ptr EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr& tp, double begin, double end);
private:
+ Attribute<String> m_DisplayName;
Attribute<double> m_ValidBegin;
Attribute<double> m_ValidEnd;
Attribute<Array::Ptr> m_Segments;