]> git.mxchange.org Git - flightgear.git/blob - src/Main/fg_props.cxx
Progress towards testing
[flightgear.git] / src / Main / fg_props.cxx
1 // fg_props.cxx -- support for FlightGear properties.
2 //
3 // Written by David Megginson, started 2000.
4 //
5 // Copyright (C) 2000, 2001 David Megginson - david@megginson.com
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 // $Id$
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <simgear/compiler.h>
28 #include <simgear/structure/exception.hxx>
29 #include <simgear/props/props_io.hxx>
30
31 #include <simgear/timing/sg_time.hxx>
32 #include <simgear/misc/sg_path.hxx>
33 #include <simgear/scene/model/particles.hxx>
34 #include <simgear/sound/soundmgr_openal.hxx>
35
36 #include <GUI/gui.h>
37
38 #include "globals.hxx"
39 #include "fg_props.hxx"
40
41 static bool frozen = false;     // FIXME: temporary
42
43 using std::string;
44 ////////////////////////////////////////////////////////////////////////
45 // Default property bindings (not yet handled by any module).
46 ////////////////////////////////////////////////////////////////////////
47
48 struct LogClassMapping {
49   sgDebugClass c;
50   string name;
51   LogClassMapping(sgDebugClass cc, string nname) { c = cc; name = nname; }
52 };
53
54 LogClassMapping log_class_mappings [] = {
55   LogClassMapping(SG_NONE, "none"),
56   LogClassMapping(SG_TERRAIN, "terrain"),
57   LogClassMapping(SG_ASTRO, "astro"),
58   LogClassMapping(SG_FLIGHT, "flight"),
59   LogClassMapping(SG_INPUT, "input"),
60   LogClassMapping(SG_GL, "gl"),
61   LogClassMapping(SG_VIEW, "view"),
62   LogClassMapping(SG_COCKPIT, "cockpit"),
63   LogClassMapping(SG_GENERAL, "general"),
64   LogClassMapping(SG_MATH, "math"),
65   LogClassMapping(SG_EVENT, "event"),
66   LogClassMapping(SG_AIRCRAFT, "aircraft"),
67   LogClassMapping(SG_AUTOPILOT, "autopilot"),
68   LogClassMapping(SG_IO, "io"),
69   LogClassMapping(SG_CLIPPER, "clipper"),
70   LogClassMapping(SG_NETWORK, "network"),
71   LogClassMapping(SG_INSTR, "instrumentation"),
72   LogClassMapping(SG_ATC, "atc"),
73   LogClassMapping(SG_NASAL, "nasal"),
74   LogClassMapping(SG_SYSTEMS, "systems"),
75   LogClassMapping(SG_AI, "ai"),
76   LogClassMapping(SG_ENVIRONMENT, "environment"),
77   LogClassMapping(SG_SOUND, "sound"),
78   LogClassMapping(SG_NAVAID, "navaid"),
79   LogClassMapping(SG_GUI, "gui"),
80   LogClassMapping(SG_UNDEFD, "")
81 };
82
83
84 /**
85  * Get the logging classes.
86  */
87 // XXX Making the result buffer be global is a band-aid that hopefully
88 // delays its destruction 'til after its last use.
89 namespace
90 {
91 string loggingResult;
92 }
93
94 static const char *
95 getLoggingClasses ()
96 {
97   sgDebugClass classes = sglog().get_log_classes();
98   loggingResult.clear();
99   for (int i = 0; log_class_mappings[i].c != SG_UNDEFD; i++) {
100     if ((classes&log_class_mappings[i].c) > 0) {
101       if (!loggingResult.empty())
102         loggingResult += '|';
103       loggingResult += log_class_mappings[i].name;
104     }
105   }
106   return loggingResult.c_str();
107 }
108
109
110 static void
111 addLoggingClass (const string &name)
112 {
113   sgDebugClass classes = sglog().get_log_classes();
114   for (int i = 0; log_class_mappings[i].c != SG_UNDEFD; i++) {
115     if (name == log_class_mappings[i].name) {
116       sglog().set_log_classes(sgDebugClass(classes|log_class_mappings[i].c));
117       return;
118     }
119   }
120   SG_LOG(SG_GENERAL, SG_WARN, "Unknown logging class: " << name);
121 }
122
123
124 /**
125  * Set the logging classes.
126  */
127 void
128 setLoggingClasses (const char * c)
129 {
130   string classes = c;
131   sglog().set_log_classes(SG_NONE);
132
133   if (classes == "none") {
134     SG_LOG(SG_GENERAL, SG_INFO, "Disabled all logging classes");
135     return;
136   }
137
138   if (classes.empty() || classes == "all") { // default
139     sglog().set_log_classes(SG_ALL);
140     SG_LOG(SG_GENERAL, SG_INFO, "Enabled all logging classes: "
141            << getLoggingClasses());
142     return;
143   }
144
145   string rest = classes;
146   string name = "";
147   string::size_type sep = rest.find('|');
148   if (sep == string::npos)
149     sep = rest.find(',');
150   while (sep != string::npos) {
151     name = rest.substr(0, sep);
152     rest = rest.substr(sep+1);
153     addLoggingClass(name);
154     sep = rest.find('|');
155     if (sep == string::npos)
156       sep = rest.find(',');
157   }
158   addLoggingClass(rest);
159   SG_LOG(SG_GENERAL, SG_INFO, "Set logging classes to "
160          << getLoggingClasses());
161 }
162
163
164 /**
165  * Get the logging priority.
166  */
167 static const char *
168 getLoggingPriority ()
169 {
170   switch (sglog().get_log_priority()) {
171   case SG_BULK:
172     return "bulk";
173   case SG_DEBUG:
174     return "debug";
175   case SG_INFO:
176     return "info";
177   case SG_WARN:
178     return "warn";
179   case SG_ALERT:
180     return "alert";
181   default:
182     SG_LOG(SG_GENERAL, SG_WARN, "Internal: Unknown logging priority number: "
183            << sglog().get_log_priority());
184     return "unknown";
185   }
186 }
187
188
189 /**
190  * Set the logging priority.
191  */
192 void
193 setLoggingPriority (const char * p)
194 {
195   if (p == 0)
196       return;
197   string priority = p;
198   if (priority == "bulk") {
199     sglog().set_log_priority(SG_BULK);
200   } else if (priority == "debug") {
201     sglog().set_log_priority(SG_DEBUG);
202   } else if (priority.empty() || priority == "info") { // default
203     sglog().set_log_priority(SG_INFO);
204   } else if (priority == "warn") {
205     sglog().set_log_priority(SG_WARN);
206   } else if (priority == "alert") {
207     sglog().set_log_priority(SG_ALERT);
208   } else {
209     SG_LOG(SG_GENERAL, SG_WARN, "Unknown logging priority " << priority);
210   }
211   SG_LOG(SG_GENERAL, SG_DEBUG, "Logging priority is " << getLoggingPriority());
212 }
213
214
215 /**
216  * Return the current frozen state.
217  */
218 static bool
219 getFreeze ()
220 {
221   return frozen;
222 }
223
224
225 /**
226  * Set the current frozen state.
227  */
228 static void
229 setFreeze (bool f)
230 {
231     frozen = f;
232
233     // Stop sound on a pause
234     SGSoundMgr *smgr = globals->get_soundmgr();
235     if ( smgr != NULL ) {
236         if ( f ) {
237             smgr->suspend();
238         } else if (fgGetBool("/sim/sound/working")) {
239             smgr->resume();
240         }
241     }
242
243     // Pause the particle system
244     simgear::Particles::setFrozen(f);
245 }
246
247
248 /**
249  * Return the number of milliseconds elapsed since simulation started.
250  */
251 static double
252 getElapsedTime_sec ()
253 {
254   return globals->get_sim_time_sec();
255 }
256
257
258 /**
259  * Return the current Zulu time.
260  */
261 static const char *
262 getDateString ()
263 {
264   static char buf[64];          // FIXME
265   
266   SGTime * st = globals->get_time_params();
267   if (!st) {
268     buf[0] = 0;
269     return buf;
270   }
271   
272   struct tm * t = st->getGmt();
273   sprintf(buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d",
274           t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
275           t->tm_hour, t->tm_min, t->tm_sec);
276   return buf;
277 }
278
279
280 /**
281  * Set the current Zulu time.
282  */
283 static void
284 setDateString (const char * date_string)
285 {
286   SGTime * st = globals->get_time_params();
287   struct tm * current_time = st->getGmt();
288   struct tm new_time;
289
290                                 // Scan for basic ISO format
291                                 // YYYY-MM-DDTHH:MM:SS
292   int ret = sscanf(date_string, "%d-%d-%dT%d:%d:%d",
293                    &(new_time.tm_year), &(new_time.tm_mon),
294                    &(new_time.tm_mday), &(new_time.tm_hour),
295                    &(new_time.tm_min), &(new_time.tm_sec));
296
297                                 // Be pretty picky about this, so
298                                 // that strange things don't happen
299                                 // if the save file has been edited
300                                 // by hand.
301   if (ret != 6) {
302     SG_LOG(SG_INPUT, SG_WARN, "Date/time string " << date_string
303            << " not in YYYY-MM-DDTHH:MM:SS format; skipped");
304     return;
305   }
306
307                                 // OK, it looks like we got six
308                                 // values, one way or another.
309   new_time.tm_year -= 1900;
310   new_time.tm_mon -= 1;
311                                 // Now, tell flight gear to use
312                                 // the new time.  This was far
313                                 // too difficult, by the way.
314   long int warp =
315     mktime(&new_time) - mktime(current_time) + globals->get_warp();
316     
317   fgSetInt("/sim/time/warp", warp);
318 }
319
320 /**
321  * Return the GMT as a string.
322  */
323 static const char *
324 getGMTString ()
325 {
326   static char buf[16];
327   SGTime * st = globals->get_time_params();
328   if (!st) {
329     buf[0] = 0;
330     return buf;
331   }
332   
333   struct tm *t = st->getGmt();
334   snprintf(buf, 16, "%.2d:%.2d:%.2d",
335       t->tm_hour, t->tm_min, t->tm_sec);
336   return buf;
337 }
338
339 /**
340  * Return the current heading in degrees.
341  */
342 static double
343 getHeadingMag ()
344 {
345   double magheading = fgGetDouble("/orientation/heading-deg") -
346     fgGetDouble("/environment/magnetic-variation-deg");
347   return SGMiscd::normalizePeriodic(0, 360, magheading );
348 }
349
350 /**
351  * Return the current track in degrees.
352  */
353 static double
354 getTrackMag ()
355 {
356   double magtrack = fgGetDouble("/orientation/track-deg") -
357     fgGetDouble("/environment/magnetic-variation-deg");
358   return SGMiscd::normalizePeriodic(0, 360, magtrack );
359 }
360
361 ////////////////////////////////////////////////////////////////////////
362 // Tie the properties.
363 ////////////////////////////////////////////////////////////////////////
364 SGConstPropertyNode_ptr FGProperties::_longDeg;
365 SGConstPropertyNode_ptr FGProperties::_latDeg;
366 SGConstPropertyNode_ptr FGProperties::_lonLatformat;
367
368 const char *
369 FGProperties::getLongitudeString ()
370 {
371   static char buf[32];
372   double d = _longDeg->getDoubleValue();
373   int format = _lonLatformat->getIntValue();
374   char c = d < 0.0 ? 'W' : 'E';
375   d = fabs(d);
376
377   if (format == 0) {
378     snprintf(buf, 32, "%3.6f%c", d, c);
379
380   } else if (format == 1) {
381     // dd mm.mmm' (DMM-Format) -- uses a round-off factor tailored to the
382     // required precision of the minutes field (three decimal places),
383     // preventing minute values of 60.
384     double min = (d - int(d)) * 60.0;
385     if (min >= 59.9995) {
386         min -= 60.0;
387         d += 1.0;
388     }
389     snprintf(buf, 32, "%d*%06.3f%c", int(d), fabs(min), c);
390
391   } else {
392     // mm'ss.s'' (DMS-Format) -- uses a round-off factor tailored to the
393     // required precision of the seconds field (one decimal place),
394     // preventing second values of 60.
395     double min = (d - int(d)) * 60.0;
396     double sec = (min - int(min)) * 60.0;
397     if (sec >= 59.95) {
398         sec -= 60.0;
399         min += 1.0;
400         if (min >= 60.0) {
401             min -= 60.0;
402             d += 1.0;
403         }
404     }
405     snprintf(buf, 32, "%d*%02d %04.1f%c", int(d),
406         int(min), fabs(sec), c);
407   }
408   buf[31] = '\0';
409   return buf;
410 }
411
412 const char *
413 FGProperties::getLatitudeString ()
414 {
415   static char buf[32];
416   double d = _latDeg->getDoubleValue();
417   int format = _lonLatformat->getIntValue();
418   char c = d < 0.0 ? 'S' : 'N';
419   d = fabs(d);
420
421   if (format == 0) {
422     snprintf(buf, 32, "%3.6f%c", d, c);
423
424   } else if (format == 1) {
425     double min = (d - int(d)) * 60.0;
426     if (min >= 59.9995) {
427         min -= 60.0;
428         d += 1.0;
429     }
430     snprintf(buf, 32, "%d*%06.3f%c", int(d), fabs(min), c);
431
432   } else {
433     double min = (d - int(d)) * 60.0;
434     double sec = (min - int(min)) * 60.0;
435     if (sec >= 59.95) {
436         sec -= 60.0;
437         min += 1.0;
438         if (min >= 60.0) {
439             min -= 60.0;
440             d += 1.0;
441         }
442     }
443     snprintf(buf, 32, "%d*%02d %04.1f%c", int(d),
444         int(min), fabs(sec), c);
445   }
446   buf[31] = '\0';
447   return buf;
448 }
449
450
451
452 \f
453
454 FGProperties::FGProperties ()
455 {
456 }
457
458 FGProperties::~FGProperties ()
459 {
460 }
461
462 void
463 FGProperties::init ()
464 {
465 }
466
467 void
468 FGProperties::bind ()
469 {
470   _longDeg      = fgGetNode("/position/longitude-deg", true);
471   _latDeg       = fgGetNode("/position/latitude-deg", true);
472   _lonLatformat = fgGetNode("/sim/lon-lat-format", true);
473
474   _offset = fgGetNode("/sim/time/local-offset", true);
475
476   // utc date/time
477   _uyear = fgGetNode("/sim/time/utc/year", true);
478   _umonth = fgGetNode("/sim/time/utc/month", true);
479   _uday = fgGetNode("/sim/time/utc/day", true);
480   _uhour = fgGetNode("/sim/time/utc/hour", true);
481   _umin = fgGetNode("/sim/time/utc/minute", true);
482   _usec = fgGetNode("/sim/time/utc/second", true);
483   _uwday = fgGetNode("/sim/time/utc/weekday", true);
484   _udsec = fgGetNode("/sim/time/utc/day-seconds", true);
485
486   // real local date/time
487   _ryear = fgGetNode("/sim/time/real/year", true);
488   _rmonth = fgGetNode("/sim/time/real/month", true);
489   _rday = fgGetNode("/sim/time/real/day", true);
490   _rhour = fgGetNode("/sim/time/real/hour", true);
491   _rmin = fgGetNode("/sim/time/real/minute", true);
492   _rsec = fgGetNode("/sim/time/real/second", true);
493   _rwday = fgGetNode("/sim/time/real/weekday", true);
494
495   _tiedProperties.setRoot(globals->get_props());
496
497   // Simulation
498   _tiedProperties.Tie("/sim/logging/priority", getLoggingPriority, setLoggingPriority);
499   _tiedProperties.Tie("/sim/logging/classes", getLoggingClasses, setLoggingClasses);
500   _tiedProperties.Tie("/sim/freeze/master", getFreeze, setFreeze);
501
502   _tiedProperties.Tie("/sim/time/elapsed-sec", getElapsedTime_sec);
503   _tiedProperties.Tie("/sim/time/gmt", getDateString, setDateString);
504   fgSetArchivable("/sim/time/gmt");
505   _tiedProperties.Tie("/sim/time/gmt-string", getGMTString);
506
507   // Position
508   _tiedProperties.Tie("/position/latitude-string", getLatitudeString);
509   _tiedProperties.Tie("/position/longitude-string", getLongitudeString);
510
511   // Orientation
512   _tiedProperties.Tie("/orientation/heading-magnetic-deg", getHeadingMag);
513   _tiedProperties.Tie("/orientation/track-magnetic-deg", getTrackMag);
514 }
515
516 void
517 FGProperties::unbind ()
518 {
519     _tiedProperties.Untie();
520
521     // drop static references to properties
522     _longDeg = 0;
523     _latDeg = 0;
524     _lonLatformat = 0;
525 }
526
527 void
528 FGProperties::update (double dt)
529 {
530     _offset->setIntValue(globals->get_time_params()->get_local_offset());
531
532     // utc date/time
533     struct tm *u = globals->get_time_params()->getGmt();
534     _uyear->setIntValue(u->tm_year + 1900);
535     _umonth->setIntValue(u->tm_mon + 1);
536     _uday->setIntValue(u->tm_mday);
537     _uhour->setIntValue(u->tm_hour);
538     _umin->setIntValue(u->tm_min);
539     _usec->setIntValue(u->tm_sec);
540     _uwday->setIntValue(u->tm_wday);
541     _udsec->setIntValue(u->tm_hour * 3600 + u->tm_min * 60 + u->tm_sec);
542
543     // real local date/time
544     time_t real = time(0);
545     struct tm *r = localtime(&real);
546     _ryear->setIntValue(r->tm_year + 1900);
547     _rmonth->setIntValue(r->tm_mon + 1);
548     _rday->setIntValue(r->tm_mday);
549     _rhour->setIntValue(r->tm_hour);
550     _rmin->setIntValue(r->tm_min);
551     _rsec->setIntValue(r->tm_sec);
552     _rwday->setIntValue(r->tm_wday);
553 }
554
555
556 \f
557 ////////////////////////////////////////////////////////////////////////
558 // Save and restore.
559 ////////////////////////////////////////////////////////////////////////
560
561
562 /**
563  * Save the current state of the simulator to a stream.
564  */
565 bool
566 fgSaveFlight (std::ostream &output, bool write_all)
567 {
568
569   fgSetBool("/sim/presets/onground", false);
570   fgSetArchivable("/sim/presets/onground");
571   fgSetBool("/sim/presets/trim", false);
572   fgSetArchivable("/sim/presets/trim");
573   fgSetString("/sim/presets/speed-set", "UVW");
574   fgSetArchivable("/sim/presets/speed-set");
575
576   try {
577     writeProperties(output, globals->get_props(), write_all);
578   } catch (const sg_exception &e) {
579     guiErrorMessage("Error saving flight: ", e);
580     return false;
581   }
582   return true;
583 }
584
585
586 /**
587  * Restore the current state of the simulator from a stream.
588  */
589 bool
590 fgLoadFlight (std::istream &input)
591 {
592   SGPropertyNode props;
593   try {
594     readProperties(input, &props);
595   } catch (const sg_exception &e) {
596     guiErrorMessage("Error reading saved flight: ", e);
597     return false;
598   }
599
600   fgSetBool("/sim/presets/onground", false);
601   fgSetBool("/sim/presets/trim", false);
602   fgSetString("/sim/presets/speed-set", "UVW");
603
604   copyProperties(&props, globals->get_props());
605
606   return true;
607 }
608
609
610 bool
611 fgLoadProps (const char * path, SGPropertyNode * props, bool in_fg_root, int default_mode)
612 {
613     string fullpath;
614     if (in_fg_root) {
615         SGPath loadpath(globals->get_fg_root());
616         loadpath.append(path);
617         fullpath = loadpath.str();
618     } else {
619         fullpath = path;
620     }
621
622     try {
623         readProperties(fullpath, props, default_mode);
624     } catch (const sg_exception &e) {
625         guiErrorMessage("Error reading properties: ", e);
626         return false;
627     }
628     return true;
629 }
630
631
632 \f
633 ////////////////////////////////////////////////////////////////////////
634 // Property convenience functions.
635 ////////////////////////////////////////////////////////////////////////
636
637 SGPropertyNode *
638 fgGetNode (const char * path, bool create)
639 {
640   return globals->get_props()->getNode(path, create);
641 }
642
643 SGPropertyNode * 
644 fgGetNode (const char * path, int index, bool create)
645 {
646   return globals->get_props()->getNode(path, index, create);
647 }
648
649 bool
650 fgHasNode (const char * path)
651 {
652   return (fgGetNode(path, false) != 0);
653 }
654
655 void
656 fgAddChangeListener (SGPropertyChangeListener * listener, const char * path)
657 {
658   fgGetNode(path, true)->addChangeListener(listener);
659 }
660
661 void
662 fgAddChangeListener (SGPropertyChangeListener * listener,
663                      const char * path, int index)
664 {
665   fgGetNode(path, index, true)->addChangeListener(listener);
666 }
667
668 bool
669 fgGetBool (const char * name, bool defaultValue)
670 {
671   return globals->get_props()->getBoolValue(name, defaultValue);
672 }
673
674 int
675 fgGetInt (const char * name, int defaultValue)
676 {
677   return globals->get_props()->getIntValue(name, defaultValue);
678 }
679
680 long
681 fgGetLong (const char * name, long defaultValue)
682 {
683   return globals->get_props()->getLongValue(name, defaultValue);
684 }
685
686 float
687 fgGetFloat (const char * name, float defaultValue)
688 {
689   return globals->get_props()->getFloatValue(name, defaultValue);
690 }
691
692 double
693 fgGetDouble (const char * name, double defaultValue)
694 {
695   return globals->get_props()->getDoubleValue(name, defaultValue);
696 }
697
698 const char *
699 fgGetString (const char * name, const char * defaultValue)
700 {
701   return globals->get_props()->getStringValue(name, defaultValue);
702 }
703
704 bool
705 fgSetBool (const char * name, bool val)
706 {
707   return globals->get_props()->setBoolValue(name, val);
708 }
709
710 bool
711 fgSetInt (const char * name, int val)
712 {
713   return globals->get_props()->setIntValue(name, val);
714 }
715
716 bool
717 fgSetLong (const char * name, long val)
718 {
719   return globals->get_props()->setLongValue(name, val);
720 }
721
722 bool
723 fgSetFloat (const char * name, float val)
724 {
725   return globals->get_props()->setFloatValue(name, val);
726 }
727
728 bool
729 fgSetDouble (const char * name, double val)
730 {
731   return globals->get_props()->setDoubleValue(name, val);
732 }
733
734 bool
735 fgSetString (const char * name, const char * val)
736 {
737   return globals->get_props()->setStringValue(name, val);
738 }
739
740 void
741 fgSetArchivable (const char * name, bool state)
742 {
743   SGPropertyNode * node = globals->get_props()->getNode(name);
744   if (node == 0)
745     SG_LOG(SG_GENERAL, SG_DEBUG,
746            "Attempt to set archive flag for non-existant property "
747            << name);
748   else
749     node->setAttribute(SGPropertyNode::ARCHIVE, state);
750 }
751
752 void
753 fgSetReadable (const char * name, bool state)
754 {
755   SGPropertyNode * node = globals->get_props()->getNode(name);
756   if (node == 0)
757     SG_LOG(SG_GENERAL, SG_DEBUG,
758            "Attempt to set read flag for non-existant property "
759            << name);
760   else
761     node->setAttribute(SGPropertyNode::READ, state);
762 }
763
764 void
765 fgSetWritable (const char * name, bool state)
766 {
767   SGPropertyNode * node = globals->get_props()->getNode(name);
768   if (node == 0)
769     SG_LOG(SG_GENERAL, SG_DEBUG,
770            "Attempt to set write flag for non-existant property "
771            << name);
772   else
773     node->setAttribute(SGPropertyNode::WRITE, state);
774 }
775
776 void
777 fgUntie(const char * name)
778 {
779   SGPropertyNode* node = globals->get_props()->getNode(name);
780   if (!node) {
781     SG_LOG(SG_GENERAL, SG_WARN, "fgUntie: unknown property " << name);
782     return;
783   }
784   
785   if (!node->isTied()) {
786     return;
787   }
788   
789   if (!node->untie()) {
790     SG_LOG(SG_GENERAL, SG_WARN, "Failed to untie property " << name);
791   }
792 }
793
794
795 // end of fg_props.cxx