- Timestamp:
- 06/02/12 15:38:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r14036 r14037 3 3 #include <libnova/lunar.h> 4 4 #include <libnova/rise_set.h> 5 #include <libnova/transform.h> 5 6 #endif 6 7 … … 214 215 double dec; 215 216 217 double zd; 218 double az; 219 216 220 double disk; 217 221 … … 237 241 observer.lng = lon; 238 242 observer.lat = lat; 243 244 //observer.lng.degrees = -5; 245 //observer.lng.minutes = 36; 246 //observer.lng.seconds = 30; 247 //observer.lat.degrees = 42; 248 //observer.lat.minutes = 35; 249 //observer.lat.seconds = 40; 239 250 240 251 ln_rst_time moon; … … 264 275 ln_get_lunar_equ_coords(JD, &pos); 265 276 277 ln_hrz_posn hrz; 278 ln_get_hrz_from_equ (&pos, &observer, JD, &hrz); 279 az = hrz.az; 280 zd = 90-hrz.alt; 281 266 282 ra = pos.ra/15; 267 283 dec = pos.dec; … … 326 342 { 327 343 private: 328 const Time fRunTime;329 330 344 enum states_t 331 345 { … … 336 350 // ------------------------- Internal variables ----------------------- 337 351 352 const Time fRunTime; 353 338 354 PixelMap fPixelMap; 355 356 string fDatabase; 339 357 340 358 Time fLastUpdate; … … 407 425 Sun fSun; 408 426 Moon fMoon; 409 410 //bool fSunIsVisible;411 //bool fMoonIsVisible;412 //Time fTimeOfCivilTwilight;413 //float fMoonPhase;414 427 415 428 // --------------------------- File header ---------------------------- … … 714 727 ostringstream out; 715 728 out << d.GetJavaDate() << '\n'; 716 out << fSun.color << '\t' << fSun.description << '\n'; 717 out << setprecision(2); 718 out << (fSun.isday?HTML::kWhite:fMoon.color) << '\t' << fMoon.description << '\n'; 729 if (fSun.time.IsValid() && fMoon.time.IsValid()) 730 { 731 out << fSun.color << '\t' << fSun.description << '\n'; 732 out << setprecision(2); 733 out << (fSun.isday?HTML::kWhite:fMoon.color) << '\t' << fMoon.description << '\n'; 734 } 735 else 736 out << "\n\n"; 719 737 out << setprecision(3); 720 738 for (int i=0; i<6; i++) … … 1652 1670 1653 1671 ostringstream out; 1672 out << setprecision(3); 1654 1673 out << fSun.time.JavaDate() << '\n'; 1655 1674 out << HTML::kWhite << '\t' << fSun.fSunRiseDarkTime.GetAsStr("%H:%M") << '\n'; … … 1667 1686 out << HTML::kWhite << '\t' << fMoon.fMoonSet.GetAsStr("%H:%M") << '\n'; 1668 1687 1688 if (!fMoon.visible) 1689 out << HTML::kWhite << "\t—\n"; 1690 else 1691 { 1692 string col = HTML::kGreen; 1693 if (fMoon.zd>25) 1694 col = HTML::kYellow; 1695 if (fMoon.zd>45 && fMoon.zd<85) 1696 col = HTML::kRed; 1697 out << col << '\t' << fMoon.zd << '\n'; 1698 } 1699 1669 1700 out << fMoon.color << '\t' << fMoon.description << '\n'; 1670 1701 … … 1672 1703 try 1673 1704 { 1674 const string fDatabase = "readpo:readc0nf1g@10.0.100.21/scheduling";1675 1676 1705 //static const boost::regex expr("(([[:word:].-]+)(:(.+))?@)?([[:word:].-]+)(:([[:digit:]]+))?(/([[:word:].-]+))?"); 1677 1706 static const boost::regex expr("(([[:word:].-]+)(:(.+))?@)?([[:word:].-]+)(:([[:digit:]]+))?(/([[:word:].-]+))"); … … 1732 1761 catch (const exception &e) 1733 1762 { 1734 Warn("Source database access: "+string(e.what())); 1763 out << '\n'; 1764 out << HTML::kWhite << '\t' << "ERROR - "+string(e.what()) << '\n'; 1735 1765 } 1736 1766 #endif … … 2352 2382 } 2353 2383 2354 fPath = conf.Get<string>("path"); 2384 fPath = conf.Get<string>("path"); 2385 fDatabase = conf.Get<string>("source-database"); 2355 2386 2356 2387 ostringstream out; … … 2378 2409 po::options_description control("Smart FACT"); 2379 2410 control.add_options() 2380 ("pixel-map-file", var<string>("FACTmapV5a.txt"), "Pixel mapping file. Used here to get the default reference voltage") 2381 ("path", var<string>("www/smartfact/data"), "Output path for the data-files") 2411 ("pixel-map-file", var<string>("FACTmapV5a.txt"), "Pixel mapping file. Used here to get the default reference voltage") 2412 ("path", var<string>("www/smartfact/data"), "Output path for the data-files") 2413 ("source-database", var<string>(), "Database link as in\n\tuser:password@server[:port]/database.") 2382 2414 ; 2383 2415
Note:
See TracChangeset
for help on using the changeset viewer.