⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 astronomypane.hpp

📁 一个基于BREW上的电子时钟程序,通过太阳历计算当前时间,并有闹铃和日志功能.
💻 HPP
字号:
//
//      AstronomyPane.hpp
//
//      Copyright (C) 2006 Sophia Cradle Incorporated

#ifndef __ASTRONOMYPANE_HPP
#define __ASTRONOMYPANE_HPP

#include <SophiaFramework.hpp>
#include "AstronomicalMath.hpp"

#define ASTRONOMYPANE_DEFAULT_LONGITUDE		139.741		// 娤應抧揰偺宱搙偺婛掕抣 (搶嫗)
#define ASTRONOMYPANE_DEFAULT_LATITUDE		35.658		// 娤應抧揰偺堒搙偺婛掕抣 (搶嫗)
#define ASTRONOMYPANE_DEFAULT_HEIGHT		0.0			// 娤應抧揰偺崅搙偺婛掕抣 (m)

SFMTYPEDEFCLASS(AstronomyPane)
class AstronomyPane : public SFRPane {
SFMSEALCOPY(AstronomyPane)
private:
	SFXDate _gmtDate;					// 尰嵼昞帵拞偺帪崗
	Float64 _moonAge;					// 寧楊
	SFRMessageDialogPtr _dialog;		// 寁嶼拞偵昞帵偡傞僟僀傾儘僌
	SFXDateDuration _timeDifference;	// GMT 偐傜偺帪嵎
	Float64 _longitude;					// 娤應抧揰偺宱搙 (搶偑 +)
	Float64 _latitude;					// 娤應抧揰偺堒搙 (杒偑 +)
	Float64 _height;					// 娤應抧揰偺崅搙 (m)
	AstronomicalMath::SunRiseSunSet _sun;		// 擔弌杤帪崗
	AstronomicalMath::MoonRiseMoonSet _moon;	// 寧弌杤帪崗
	Bool _autoUpdate;

public:
	explicit AstronomyPane(SFRResponderPtr responder, SFXRectangleConstRef rect, SFXDateDurationConstRef timeDifference = SFXDateDuration(9 * 3600), Float64 longitude = ASTRONOMYPANE_DEFAULT_LONGITUDE, Float64 latitude = ASTRONOMYPANE_DEFAULT_LATITUDE, Float64 height = ASTRONOMYPANE_DEFAULT_HEIGHT);
	virtual ~AstronomyPane(Void);
	Void UpdateInformation(Void);
	Void UpdateInformation(SFXDateConstRef utcDate);
	static Void UpdateInformationTimerSPP(VoidPtr data);
	Void SetObserverPosition(Float64 longitude, Float64 latitude, Float64 height = ASTRONOMYPANE_DEFAULT_HEIGHT);
	Void SetTimeDifference(SFXDateDurationConstRef timeDifference);
	static Void HourlyUpdate(VoidPtr data);
	SFXDateDurationConstRef GetTimeDifference(Void) const;
private:
	SFXWideString GetMoonAgeString(Void) const;
	SFXWideString GetSunRiseString(Void) const;
	SFXWideString GetSunSetString(Void) const;
	SFXWideString GetMoonRiseString(Void) const;
	SFXWideString GetMoonSetString(Void) const;
	Void UpdateInformationInner(Void);
	Void Compute(Void);
	HANDLER_DECLARE_VOIDRENDER(AstronomyPane, OnContent)
	HANDLER_DECLARE_VOIDRESUME(AstronomyPane, OnAppResume)
	HANDLER_DECLARE_VOIDSUSPEND(AstronomyPane, OnAppSuspend)
	HANDLER_DECLARE_BOOLEVENT(AstronomyPane, OnNoButtonDialogKey)
	HANDLER_DECLARE_VOIDEVENT(AstronomyPane, OnNoButtonDialogSoftkey)
};

// 娤應抧揰偺埵抲忣曬傪愝掕偡傞
// longitude : 宱搙
// latitude : 堒搙
// height : 崅搙
inline Void AstronomyPane::SetObserverPosition(Float64 longitude, Float64 latitude, Float64 height)
{
	_longitude = longitude;
	_latitude = latitude;
	_height = height;
}

// 娤應抧揰偺 GMT 偐傜偺帪嵎傪巜掕偡傞
inline Void AstronomyPane::SetTimeDifference(SFXDateDurationConstRef timeDifference)
{
	_timeDifference = timeDifference;
}

// 娤應抧揰偺 GMT 偐傜偺帪嵎傪巜掕偡傞
inline SFXDateDurationConstRef AstronomyPane::GetTimeDifference(Void) const
{
	return _timeDifference;
}













#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -