43 branch =
"/instrumentation/" + _name;
45 SGPropertyNode *node =
fgGetNode(branch, _num,
true );
46 _serviceable_node = node->getChild(
"serviceable", 0,
true);
47 _offset_node = node->getChild(
"offset-sec", 0,
true);
48 _sec_node = node->getChild(
"indicated-sec", 0,
true);
49 _min_node = node->getChild(
"indicated-min", 0,
true);
50 _hour_node = node->getChild(
"indicated-hour", 0,
true);
51 _lhour_node = node->getChild(
"local-hour", 0,
true);
52 _string_node = node->getChild(
"indicated-string", 0,
true);
53 _string_node1 = node->getChild(
"indicated-short-string", 0,
true);
54 _string_node2 = node->getChild(
"local-short-string", 0,
true);
60 if (!_serviceable_node->getBoolValue()) {
61 if (_is_serviceable) {
62 _string_node->setStringValue(
"");
63 _is_serviceable =
false;
68 struct tm *t =
globals->get_time_params()->getGmt();
69 short hour = t->tm_hour;
70 short min = t->tm_min;
71 short sec = t->tm_sec;
74 short tzoffset_hours =
globals->get_time_params()->get_local_offset() / 3600;
75 short lhour = hour + tzoffset_hours;
81 long gmt = (hour * 60 +
min) * 60 + sec;
82 int offset = _offset_node->getLongValue();
84 if (!_is_serviceable) {
85 _standstill_offset -= gmt - _gmt_time_sec;
86 }
else if (_gmt_time_sec == gmt && _offset_sec == offset)
92 _indicated_sec = _gmt_time_sec + offset + _standstill_offset;
93 _sec_node->setLongValue(_indicated_sec);
117 snprintf(_indicated_string,
sizeof(_indicated_string),
"%02d:%02d:%02d", hour,
min, sec);
118 _string_node->setStringValue(_indicated_string);
119 snprintf(_indicated_short_string,
sizeof(_indicated_short_string),
"%02d:%02d", hour,
min);
120 _string_node1->setStringValue(_indicated_short_string);
121 snprintf(_local_short_string,
sizeof(_local_short_string),
"%02d:%02d", lhour,
min);
122 _string_node2->setStringValue(_local_short_string);
123 _is_serviceable =
true;
125 _indicated_min =
min;
126 _min_node->setLongValue(_indicated_min);
127 _indicated_hour = hour;
128 _hour_node->setLongValue(_indicated_hour);
130 _lhour_node->setLongValue(_local_hour);