#pragma once
#include "readonlyedit.h"
#include "afxwin.h"
#include "afxcmn.h"
#include "colorstatic.h"


// CDlg_Results dialog

class CDlg_Results : public CDialog
{
	DECLARE_DYNAMIC(CDlg_Results)

public:
	CDlg_Results(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlg_Results();

// Dialog Data
	enum { IDD = IDD_RESULTS };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();
	
	DECLARE_MESSAGE_MAP()
public:
	CReadOnlyEdit m_editAuxElec;
	CReadOnlyEdit m_editLightElec;
	CReadOnlyEdit m_editDHW;
	CReadOnlyEdit m_editHtDemBase;
	CReadOnlyEdit m_TCID;
	CReadOnlyEdit m_TCID2;
	CReadOnlyEdit m_editTotalEmissions;

	CString str_editAuxElec;
	CString str_editLightElec;
	CString str_editDHW;
	
	
	CString str_editHtDemBase;
	
	CString str_TCID;
	
	CString str_TCID2;
	
	CString str_editTotalEmissions;
	CReadOnlyEdit m_editTotalElec;
	CString str_editTotalElec;
	afx_msg void OnEnChangeEdit4();
	CComboBox m_comboClimate;
	CString str_comboClimate;
	CListBox m_listHouseType;
	CString str_listHouseType;
	CListBox m_listYearOfBuild;
	CString str_listYearOfBuild;
	CReadOnlyEdit m_editFloorArea;
	CString str_editFloorArea;
	CSliderCtrl m_sliderInsulation;
	CSliderCtrl m_sliderAirtightness;
	CSliderCtrl m_sliderCapacity;
	CSliderCtrl m_sliderSolarIngress;
	CSliderCtrl m_sliderOccupancy;
	CSliderCtrl m_sliderControllesSpace;
	
	CComboBox m_comboFuel;
	CString str_comboFuel;
	

	CReadOnlyEdit m_editHeatingEff;
	CString str_editHeatingEff;
	
	CComboBox m_comboDHWfuel;
	CString str_comboDHWfuel;
	CReadOnlyEdit m_editDHWEff;
	CString str_editDHWEff;
	
	CComboBox m_comboCoolingFuel;
	CString str_comboCoolingFuel;
	CReadOnlyEdit m_editCoolingEff;
	CString str_editCoolingEff;
	
	CButton m_chkInsulation;
	CButton m_chkAirtightness;
	CButton m_chkCapacity;
	CButton m_chkSolarIngress;
	CButton m_chkOccupancy;
	CButton m_chkControlledSpace;
	CButton m_chkHeatingFuel;
	CButton m_chkHeatingEff;
	CButton m_chkDHWfuel;
	CButton m_chkDHWEff;
	CButton m_chkCoolingFuel;
	CButton m_chkCoolingEff;

	CReadOnlyEdit m_editTotalEmissions2;
	CString str_editTotalEmissions2;
	CReadOnlyEdit m_editCapitalCost;
	CString str_editCapitalCost;
	CButton m_btnBase;
	CButton m_btnImp1;
	CButton m_btnImp2;
	CButton m_btnImp3;
	CButton m_btnImp4;
	CButton m_btnImp5;
	CReadOnlyEdit m_editHtDemImp1;
	CReadOnlyEdit m_editHtDemImp2;
	CReadOnlyEdit m_editHtDemImp3;
	
	CReadOnlyEdit m_editDHWImp1;
	CReadOnlyEdit m_editDHWImp2;
	CReadOnlyEdit m_editDHWImp3;
	CReadOnlyEdit m_editLightElecImp1;
	
	CReadOnlyEdit m_editLightElecImp2;
	CReadOnlyEdit m_editLightElecImp3;
	
	CReadOnlyEdit m_editAuxElecImp1;
	CReadOnlyEdit m_editAuxElecImp2;
	CReadOnlyEdit m_editAuxElecImp3;
	CReadOnlyEdit m_editTotalElecImp1;
	CReadOnlyEdit m_editTotalElecImp2;
	CReadOnlyEdit m_editTotalElecImp3;

	CReadOnlyEdit m_editTotalCost2Imp1;
	CReadOnlyEdit m_editTotalCost2Imp2;
	CReadOnlyEdit m_editTotalCost2Imp3;
	CReadOnlyEdit m_editTotalEmissionsImp1;
	CReadOnlyEdit m_editTotalEmissionsImp2;
	CReadOnlyEdit m_editTotalEmissionsImp3;
	CReadOnlyEdit m_editTotalEmissions2Imp1;
	CReadOnlyEdit m_editTotalEmissions2Imp2;
	CReadOnlyEdit m_editTotalEmissions2Imp3;
	CReadOnlyEdit m_editCapitalCostImp1;
	CReadOnlyEdit m_editCapitalCostImp2;
	CReadOnlyEdit m_editCapitalCostImp3;
	CButton m_chkSDHW;
	CButton m_chkPV;
	CButton m_chkWT;
	CButton m_chkuCHP;
	CButton m_chkuHydro;
	CButton m_chkPCM;
	CButton m_chkMVHR;

	CColorStatic m_labelHL1;
	CColorStatic m_labelHL2;
	CColorStatic m_labelHL3;
	CColorStatic m_labelHL4;
	CColorStatic m_labelHL5;
	CColorStatic m_labelHL6;
	CColorStatic m_labelspaceHeating;
	CColorStatic m_labelDHW;
	CColorStatic m_labelLighting;
	
	CColorStatic m_labelRenSupply;
	CColorStatic m_labelPrimaryFuel;
	CColorStatic m_labelCost;
	CColorStatic m_labelSecFuel;
	CColorStatic m_labelEmm;

	afx_msg BOOL PreTranslateMessage(MSG* pMsg);
	CColorStatic m_labelSDHW;
	CColorStatic m_labelPV;
	CColorStatic m_labelWY;
	CColorStatic m_labeluCHP;
	CColorStatic m_labeluHydro;
	CColorStatic m_labelPCM;
	CColorStatic m_labelMVHR;
	

		
	CReadOnlyEdit m_LZCTelecSoldBase;
	CReadOnlyEdit m_LZCTelecSoldImp1;
	CReadOnlyEdit m_LZCTelecSoldImp2;
	CReadOnlyEdit m_LZCTelecSoldImp3;
	CReadOnlyEdit m_LZCTeleDispBase;
	CReadOnlyEdit m_LZCTeleDispImp1;
	CReadOnlyEdit m_LZCTeleDispImp2;
	CReadOnlyEdit m_LZCTeleDispImp3;
	CString str_LZCTelecSoldBase;
	CString str_LZCTelecSoldImp1;
	CString str_LZCTelecSoldImp2;
	CString str_LZCTelecSoldImp3;
	CString str_LZCTeleDispBase;
	CString str_LZCTeleDispImp1;
	CString str_LZCTeleDispImp2;
	CString str_LZCTeleDispImp3;
	CReadOnlyEdit m_editSpaceCoolingSupply;
	CReadOnlyEdit m_editSpaceCoolingSupplyImp1;
	CReadOnlyEdit m_editSpaceCoolingSupplyImp2;
	CReadOnlyEdit m_editSpaceCoolingSupplyImp3;
	CString str_editSpaceCoolingSupply;
	CString str_editSpaceCoolingSupplyImp1;
	CString str_editSpaceCoolingSupplyImp2;
	CString str_editSpaceCoolingSupplyImp3;
	CString str_editTotalElecImp1;
	CString str_editTotalElecImp2;
	CString str_editTotalElecImp3;
	CReadOnlyEdit m_editPrimaryFuelBase;
	CReadOnlyEdit m_editPrimaryFuelImp1;
	CReadOnlyEdit m_editPrimaryFuelImp2;
	CReadOnlyEdit m_editPrimaryFuelImp3;
	CReadOnlyEdit m_editSecFuelBase;
	CReadOnlyEdit m_editSecFuelImp1;
	CReadOnlyEdit m_editSecFuelImp2;
	CReadOnlyEdit m_editSecFuelImp3;
	CString str_editPrimaryFuelBase;
	CString str_editPrimaryFuelImp1;
	CString str_editPrimaryFuelImp2;
	CString str_editPrimaryFuelImp3;
	CString str_editSecFuelBase;
	CString str_editSecFuelImp1;
	CString str_editSecFuelImp2;
	CString str_editSecFuelImp3;
	
	CString str_editHtDemImp1;
	CString str_editDHWImp1;
	CString str_editLightElecImp1;
	CString str_editAuxElecImp1;
	CString str_editTotalCost2Imp1;
	CString str_editTotalEmissionsImp1;
	CString str_editTotalEmissions2Imp1;
	CString str_editHtDemImp2;
	CString str_editDHWImp2;
	CString str_editLightElecImp2;
	CString str_editAuxElecImp2;
	CString str_editTotalCost2Imp2;
	CString str_editTotalEmissionsImp2;
	CString str_editTotalEmissions2Imp2;
	CString str_editHtDemImp3;
	CString str_editDHWImp3;
	CString str_editLightElecImp3;
	CString str_editAuxElecImp3;
	CString str_editTotalCost2Imp3;
	CString str_editTotalEmissionsImp3;
	CString str_editTotalEmissions2Imp3;

	
	CReadOnlyEdit m_editSpaceCoolingSupplyImp4;
	CReadOnlyEdit m_editHtDemImp4;
	CReadOnlyEdit m_editHtDemImp5;
	CReadOnlyEdit m_editSpaceCoolingSupplyImp5;
	CReadOnlyEdit m_editDHWImp4;
	CReadOnlyEdit m_editDHWImp5;
	CReadOnlyEdit m_editLightElecImp4;
	CReadOnlyEdit m_editLightElecImp5;
	CReadOnlyEdit m_editAuxElecImp4;
	CReadOnlyEdit m_editAuxElecImp5;
	CReadOnlyEdit m_editTotalElecImp4;
	CReadOnlyEdit m_editTotalElecImp5;
	CReadOnlyEdit m_editPrimaryFuelImp4;
	CReadOnlyEdit m_editPrimaryFuelImp5;
	CReadOnlyEdit m_editSecFuelImp4;
	CReadOnlyEdit m_editSecFuelImp5;
	CReadOnlyEdit m_editTotalCostImp4;
	CReadOnlyEdit m_editTotalCost2Imp4;
	CReadOnlyEdit m_editTotalCost2Imp5;
	CReadOnlyEdit m_editTotalEmissionsImp4;
	CReadOnlyEdit m_editTotalEmissionsImp5;
	CReadOnlyEdit m_editTotalEmissions2Imp4;
	CReadOnlyEdit m_editTotalEmissions2Imp5;
	CReadOnlyEdit m_LZCTelecSoldImp4;
	CReadOnlyEdit m_LZCTelecSoldImp5;
	CReadOnlyEdit m_LZCTeleDispImp4;
	CReadOnlyEdit m_LZCTeleDispImp5;
	CString str_editSpaceCoolingSupplyImp4;
	CString str_editHtDemImp4;
	CString str_editHtDemImp5;
	CString str_editSpaceCoolingSupplyImp5;
	CString str_editDHWImp4;
	CString str_editDHWImp5;
	CString str_editLightElecImp4;
	CString str_editLightElecImp5;
	CString str_editAuxElecImp4;
	CString str_editAuxElecImp5;
	CString str_editTotalElecImp4;
	CString str_editTotalElecImp5;
	CString str_editPrimaryFuelImp4;
	CString str_editPrimaryFuelImp5;
	CString str_editSecFuelImp4;
	CString str_editSecFuelImp5;
	CString str_editTotalCost2Imp4;
	CString str_editTotalCost2Imp5;
	CString str_editTotalEmissionsImp4;
	CString str_editTotalEmissionsImp5;
	CString str_editTotalEmissions2Imp4;
	CString str_editTotalEmissions2Imp5;
	CString str_LZCTelecSoldImp4;
	CString str_LZCTelecSoldImp5;
	CString str_LZCTeleDispImp4;
	CString str_LZCTeleDispImp5;
	
	CColorStatic m_labelAuxElec;
	CColorStatic m_labelCooling;
	CColorStatic m_labelElecSold;
	CColorStatic m_labelTotElecDisp;
	CButton m_chkActual;
	CButton m_chkperm2;
	CButton m_chkEnergy;
	CButton m_chkCost;
	CButton m_chkEmissions;

	

	CButton m_chkFGHRS;
	CButton m_chkWWHRS;
	
	CColorStatic m_labelBase;
	CColorStatic m_labelImp1;
	CColorStatic m_labelImp2;
	CColorStatic m_labelImp3;
	CColorStatic m_labelImp4;
	CColorStatic m_labelImp5;
	CColorStatic m_labelElec;
	CColorStatic m_labelElec2;
	CColorStatic m_labelElec3;
	CColorStatic m_labelCO2small;
	CReadOnlyEdit m_editHtDemCurrent;
	CString str_editHtDemCurrent;
	CReadOnlyEdit m_editSpaceCoolingSupplyCurrent;
	CString str_editSpaceCoolingSupplyCurrent;
	CReadOnlyEdit m_editDHWCurrent;
	CString str_editDHWCurrent;
	CReadOnlyEdit m_editLightCurrent;
	CString str_editLightCurrent;
	CReadOnlyEdit m_editAuxElecCurrent;
	CString str_editAuxElecCurrent;
	CReadOnlyEdit m_editTotalElecCurrent;
	CString str_editTotalElecCurrent;
	CReadOnlyEdit m_editPrimFuelCurrent;
	CString str_editPrimFuelCurrent;
	CReadOnlyEdit m_editSecFuelCurrent;
	CString str_editSecFuelCurrent;
	CReadOnlyEdit m_editLZCTElecSoldCurrent;
	CString str_editLZCTElecSoldCurrent;
	CReadOnlyEdit m_editLZCTElecDispCurrent;
	CString str_editLZCTElecDispCurrent;
	CColorStatic m_labelsmall1;
	CColorStatic m_labelsmall2;
	CColorStatic m_labelsmall3;
	CColorStatic m_labelsmall4;
	CColorStatic m_labelsmall5;
	CColorStatic m_labelsmall;
	
	CColorStatic m_labelBC;
	CColorStatic m_labelSC;
	CColorStatic m_labelLZCT;
	CSliderCtrl m_sliderHeff;
	CSliderCtrl m_sliderDHWeff;

	afx_msg void ReadValuesFromSHCSFile();
	afx_msg void EstablishNumberOfOccupants();
	afx_msg void CalculateAuxillaryElectricity();
	afx_msg void CalculateLightingElectricity();
	afx_msg void CalculateDHW();
	afx_msg void CalculateFGHRS();
	afx_msg void CalculateWWHRS();
	afx_msg void CalculateDistributionLosses();
	afx_msg void CalculateStorageLosses();
	afx_msg void CalculatePrimaryCircuitLosses();
	afx_msg void CalculateCombiLosses();
	afx_msg void SubtractDHWLossFromSpaceHeatingRequirement();
	afx_msg void CalculateSDHW();
	afx_msg void CalculateDHWsupply();
	afx_msg void CalculatePVInput();
	afx_msg void CalculateWTInput();
	afx_msg void CalculateMicroHydroInput();
	afx_msg void CalculateTotalEnergy();
	afx_msg void CalculateCostEmissionsAndPrimaryEnergy();
	afx_msg void CalculatePrimaryAndSecondaryFuel();

	afx_msg void CalculateResultsForSAPP();
	afx_msg void ReadInputsFromResultsDialog();
	afx_msg void ReadPreviousInputsForResultsDialog();
	afx_msg void EnableOrDisableControls();
	afx_msg void ChangeIndexNumberBasedOnHouseTypeAndAgeForResultsDialog();	
	afx_msg void CreateIndexNumberForDatabase();
	afx_msg void SpaceHeatingDemandResultsBasedOnTCIndex();
	afx_msg void OnNMCustomdrawSlider1(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawSlider2(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawSlider3(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawSlider4(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawSlider5(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawSlider6(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnCbnSelchangeCombo1();
	afx_msg void OnLbnSelchangeList2();
	afx_msg void OnLbnSelchangeList3();
	afx_msg void OnEnChangeEdit17();
	afx_msg void OnCbnSelchangeCombo2();
	afx_msg void OnEnChangeEdit18();
	afx_msg void OnCbnSelchangeCombo4();
	afx_msg void OnEnChangeEdit19();
	afx_msg void OnCbnSelchangeCombo11();
	afx_msg void OnEnChangeEdit20();
	afx_msg void OnBnClickedCheck1();
	afx_msg void OnBnClickedCheck2();
	afx_msg void OnBnClickedCheck3();
	afx_msg void OnBnClickedCheck4();
	afx_msg void OnBnClickedCheck5();
	afx_msg void OnBnClickedCheck6();
	afx_msg void OnBnClickedCheck13();
	afx_msg void OnBnClickedCheck22();
	afx_msg void OnBnClickedCheck23();
	afx_msg void OnBnClickedCheck24();
	afx_msg void OnBnClickedCheck25();
	afx_msg void OnBnClickedCheck26();
	afx_msg void OnEnChangeEdit3();
	afx_msg void OnEnChangeEdit34();
	afx_msg void OnEnChangeEdit1();
	afx_msg void OnBnClickedCheck19();
	afx_msg void OnBnClickedCheck21();
	afx_msg void OnBnClickedCheck27();
	afx_msg void OnBnClickedCheck20();
	afx_msg void OnBnClickedCheck28();
	afx_msg void OnBnClickedCheck29();
	afx_msg void OnBnClickedCheck30();
	afx_msg void OnStnClickedStatic2();
	afx_msg void OnSelectHouseTypeFromResultsDlg();
	afx_msg void DisplayHouseTypeOnResultsDlgBasedOnBuiltForm();
	afx_msg void OnSelectYearOfBuildFromResultsDlg();
	afx_msg void DisplayYearOfBuildOnResultsDlgBasedOnBuiltForm();
	afx_msg void ModifyResultsBasedOnEnergyCostOrEmissions();
	afx_msg void DisplayBaseResultsForEnergyCostOrEmissions();
	afx_msg void DisplayImp1ResultsForEnergyCostOrEmissions();
	afx_msg void DisplayImp2ResultsForEnergyCostOrEmissions();
	afx_msg void DisplayImp3ResultsForEnergyCostOrEmissions();
	afx_msg void DisplayImp4ResultsForEnergyCostOrEmissions();
	afx_msg void DisplayImp5ResultsForEnergyCostOrEmissions();
	afx_msg void OnBnClickedBase();
	afx_msg void SpaceHeatingDemandIfMVHR();
	afx_msg void OnBnClickedImprovement1();
	afx_msg void OnBnClickedImprovement2();
	afx_msg void OnBnClickedImprovement3();
	afx_msg void DisplayResultsBasedOnCaseForRunningProject();
	afx_msg void DisplayResultsBasedOnCaseForOpenedProject();
	afx_msg void OnBnClickedImprovement4();
	afx_msg void OnBnClickedImprovement5();
	afx_msg void OnBnClickedCheck34();
	afx_msg void OnBnClickedCheck31();
	afx_msg void OnBnClickedCheck32();
	afx_msg void OnBnClickedCheck33();
	afx_msg void OnBnClickedCheck35();
	afx_msg void OnStnClickedStaticUnits();
	afx_msg void OnBnClickedCheck36();
	afx_msg void OnBnClickedCheck37();
	afx_msg void OnStnClickedStaticImp1();
	afx_msg void OnEnChangeEdit50();
	afx_msg void OnEnChangeEdit68();
	afx_msg void DisplayResultsInList();
	afx_msg void OnNMCustomdrawSlider7(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMCustomdrawSlider8(NMHDR *pNMHDR, LRESULT *pResult);
	CColorStatic m_lableFGHRS;
	CColorStatic m_lableWWHRS;
};
