SkylightMng.cpp 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "stdafx.h"
  2. #include "SkylightMng.h"
  3. CSkylightMng::CSkylightMng()
  4. {
  5. }
  6. CSkylightMng::~CSkylightMng()
  7. {
  8. }
  9. BOOL CSkylightMng::IsSkylight(SYSTEMTIME* pstTime)
  10. {
  11. if (pstTime == NULL)
  12. {
  13. SYSTEMTIME st;
  14. GetLocalTime(&st);
  15. if (st.wHour < 4 || st.wHour >= 23)
  16. return TRUE;
  17. }
  18. else
  19. {
  20. if (pstTime->wHour < 4 || pstTime->wHour >= 23)
  21. return TRUE;
  22. }
  23. return FALSE;
  24. }
  25. BOOL CSkylightMng::IsSkylight(COleDateTime* pdtTime)
  26. {
  27. if (pdtTime)
  28. {
  29. if (pdtTime->GetHour() < 4 || pdtTime->GetHour() >= 23)
  30. return TRUE;
  31. }
  32. return FALSE;
  33. }
  34. BOOL CSkylightMng::IsSkylight(CTime* ptmTime)
  35. {
  36. if (ptmTime)
  37. {
  38. if (ptmTime->GetHour() < 4 || ptmTime->GetHour()>=23)
  39. return TRUE;
  40. }
  41. return FALSE;
  42. }
  43. CSkylightMng CSkylightMng::m_pInstance;