Changeset 13955
- Timestamp:
- 05/28/12 23:51:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r13953 r13955 191 191 description = state[name]; 192 192 193 string arr; 194 ostringstream out; 195 if (isday) 196 { 197 out << fSunSetDarkTime-time; 198 arr = "↓"; 199 } 200 else 201 { 202 out << fSunRiseDayTime-time; 203 arr = "↑"; 204 } 205 206 description += " ["+out.str().substr(0, 5)+arr+"]"; 193 const string arr = isday ? 194 fSunSetDarkTime.MinutesTo(time)+"↓" : 195 fSunRiseDayTime.MinutesTo(time)+"↑"; 196 197 description += " ["+arr+"]"; 207 198 208 199 switch (state) … … 282 273 color = disk>75 ? HTML::kRed : HTML::kYellow; 283 274 284 string arr; 285 ostringstream dt; 286 if (fMoonSet<fMoonRise) 287 { 288 dt << fMoonSet-time; 289 arr = "↓"; 290 } 291 else 292 { 293 dt << fMoonRise-time; 294 arr = "↑"; 295 } 275 const string arr = fMoonSet<fMoonRise ? 276 fMoonSet.MinutesTo(time)+"↓" : 277 fMoonRise.MinutesTo(time)+"↑"; 296 278 297 279 ostringstream out; 298 280 out << setprecision(2); 299 out << (visible?"visible ":"") << (disk<0.1?0:disk) << "% [" << dt.str().substr(0,5) <<arr << "]";281 out << (visible?"visible ":"") << (disk<0.1?0:disk) << "% [" << arr << "]"; 300 282 301 283 description = out.str(); … … 409 391 bool fSunIsVisible; 410 392 bool fMoonIsVisible; 393 394 Time fTimeOfCivilTwilight; 411 395 412 396 int fHasError; … … 675 659 fSunIsVisible = astro.state>=3 && astro.state<=5; 676 660 fMoonIsVisible = !fSunIsVisible && moon.visible; 661 662 fTimeOfCivilTwilight = astro.fSunSetCivil; 677 663 678 664 ofstream(fPath+"/weather.data") << out.str(); … … 1554 1540 return HTML::kWhite + "\t—\n"; 1555 1541 1556 1557 return (rc.index<green?HTML::kYellow:HTML::kGreen) + '\t' + rc.name + '\n'; 1542 string col = HTML::kGreen; 1543 if (rc.index<green) 1544 col = HTML::kYellow; 1545 if (rc.index>0xff) 1546 col = HTML::kRed; 1547 1548 return col + '\t' + rc.name + '\n'; 1558 1549 } 1559 1550 … … 1575 1566 // ============================================================== 1576 1567 1568 const bool data_taking = 1569 fDimMcp.state()==MCP::State::kTriggerOn || 1570 fDimMcp.state()==MCP::State::kTakingData; 1571 1577 1572 ostringstream msg; 1578 1573 … … 1581 1576 if (!fDimDNS.online()) 1582 1577 msg << "DIM network not available.<br/>"; 1583 if (fDimDriveControl.state()>0xff )1584 msg << "Drive in ERROR state <br/>";1585 if (fDimBiasControl.state()<BIAS::State::kRamping && (fDimMcp.state()==MCP::State::kTriggerOn || fDimMcp.state()==MCP::State::kTakingData))1578 if (fDimDriveControl.state()>0xff && data_taking) 1579 msg << "Drive in ERROR state during data-taking<br/>"; 1580 if (fDimBiasControl.state()<BIAS::State::kRamping && data_taking) 1586 1581 msg << "BIAS not operating during data-taking<br/>"; 1587 1582 if (fDimBiasControl.state()==BIAS::State::kOverCurrent) … … 1596 1591 msg << "Maximum current exceeds 90µA/pix<br/>"; 1597 1592 } 1598 if (fMagicWeatherHist[kHum].size()>0 && fMagicWeatherHist[kHum].back()>98 && (fDimMcp.state()==MCP::State::kTriggerOn || fDimMcp.state()==MCP::State::kTakingData))1593 if (fMagicWeatherHist[kHum].size()>0 && fMagicWeatherHist[kHum].back()>98 && data_taking) 1599 1594 msg << "Outside humidity exceeds 98% during data-taking<br/>"; 1600 1595 if (fMagicWeatherHist[kGusts].size()>0 && fMagicWeatherHist[kGusts].back()>98 && fDimDriveControl.state()==Drive::State::kTracking) … … 1602 1597 if (fFscControlTemperatureHist.size()>0 && fFscControlTemperatureHist.back()>7) 1603 1598 msg << "Sensor temperature exceeds outside temperature by more than 7°C<br/>"; 1604 if (fFtmControlTriggerRateCam<0.01 && (fDimMcp.state()==MCP::State::kTriggerOn || fDimMcp.state()==MCP::State::kTakingData))1599 if (fFtmControlTriggerRateCam<0.01 && data_taking) 1605 1600 msg << "Trigger rate below 10mHz during data taking<br/>"; 1606 1601 if (fFscControlHumidityAvg>60) … … 1745 1740 { 1746 1741 if (fMcpConfigurationState==MCP::State::kTakingData) 1747 { 1748 ostringstream d; 1749 d << Time()-fMcpConfigurationRunStart; 1750 tim << d.str().substr(3, 5); 1751 } 1742 tim << fMcpConfigurationRunStart.SecondsTo(); 1752 1743 } 1753 1744 … … 1790 1781 //out << rc.name << '\t'; 1791 1782 out << fDriveControlPointingAz << ' '; 1783 out << fDriveControlPointingZd << "°"; 1792 1784 out << setprecision(2); 1793 out << fDriveControlPointingZd << "°";1794 1785 if (fDimDriveControl.state()==Drive::State::kTracking) 1795 1786 { 1796 1787 out << " ± " << dev << '"'; 1797 1788 if (!fDriveControlSourceName.empty()) 1798 out << '['<< fDriveControlSourceName << ']';1789 out << " [" << fDriveControlSourceName << ']'; 1799 1790 } 1800 1791 if (fDimDriveControl.state()==Drive::State::kMoving) … … 1805 1796 out << HTML::kWhite << '\t'; 1806 1797 if (fSunIsVisible) 1798 { 1807 1799 out << " ☼"; 1800 if (fTimeOfCivilTwilight.IsValid() && fDimDriveControl.state()<Drive::State::kArmed) 1801 out << " [" << fTimeOfCivilTwilight.MinutesTo() << "]"; 1802 } 1808 1803 else 1809 1804 if (fMoonIsVisible) … … 1978 1973 fBiasControlCurrentMax(0), 1979 1974 fFscControlHumidityAvg(0), 1975 fDriveControlMoonDist(-1), 1976 fFadControlNumEvents(0), 1980 1977 fFadControlDrsRuns(3), 1981 1978 fFtmControlTriggerRateCam(0), … … 1983 1980 fRateScanBoard(0), 1984 1981 fSunIsVisible(true), 1982 fMoonIsVisible(false), 1983 fTimeOfCivilTwilight(Time::none), 1985 1984 fHasError(2), 1986 1985 // ---
Note:
See TracChangeset
for help on using the changeset viewer.