|
|
|
|
|
|
|
|
|
// CcdDataImageProcessingDlg.h : ͷ<>ļ<EFBFBD>
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include "afxwin.h"
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#include "FileMgr.h"
|
|
|
|
|
#include <map>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#define WHITE RGB(255, 255, 255) // <20><><EFBFBD><EFBFBD> WHITE <20><>ɫ
|
|
|
|
|
|
|
|
|
|
// CCcdDataImageProcessingDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
|
|
|
|
|
class CCcdDataImageProcessingDlg : public CDialogEx
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
public:
|
|
|
|
|
CCcdDataImageProcessingDlg(CWnd* pParent = NULL); // <20><><EFBFBD><D7BC><EFBFBD>캯<EFBFBD><ECBAAF>
|
|
|
|
|
|
|
|
|
|
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
#ifdef AFX_DESIGN_TIME
|
|
|
|
|
enum { IDD = IDD_CCDDATAIMAGEPROCESSING_DIALOG };
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ʵ<><CAB5>
|
|
|
|
|
protected:
|
|
|
|
|
HICON m_hIcon;
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>Ϣӳ<CFA2>亯<EFBFBD><E4BAAF>
|
|
|
|
|
virtual BOOL OnInitDialog();
|
|
|
|
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
|
|
|
|
afx_msg void OnPaint();
|
|
|
|
|
afx_msg HCURSOR OnQueryDragIcon();
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
|
public:
|
|
|
|
|
CEdit m_MinEnergy1;
|
|
|
|
|
CEdit m_MaxEnergy1;
|
|
|
|
|
CEdit m_MinEnergy2;
|
|
|
|
|
CEdit m_MaxEnergy2;
|
|
|
|
|
CEdit m_MinEnergy3;
|
|
|
|
|
CEdit m_MaxEnergy3;
|
|
|
|
|
CEdit m_MinEnergy4;
|
|
|
|
|
CEdit m_MaxEnergy4;
|
|
|
|
|
CEdit m_MinEnergy5;
|
|
|
|
|
CEdit m_MaxEnergy5;
|
|
|
|
|
CEdit m_MinEnergy6;
|
|
|
|
|
CEdit m_MaxEnergy6;
|
|
|
|
|
CEdit m_MinEnergy7;
|
|
|
|
|
CEdit m_MaxEnergy7;
|
|
|
|
|
CEdit m_MinEnergy8;
|
|
|
|
|
CEdit m_MaxEnergy8;
|
|
|
|
|
CEdit m_MinEnergy9;
|
|
|
|
|
CEdit m_MaxEnergy9;
|
|
|
|
|
CEdit m_MinEnergy10;
|
|
|
|
|
CEdit m_MaxEnergy10;
|
|
|
|
|
|
|
|
|
|
CComboBox m_bEnergy1;
|
|
|
|
|
CComboBox m_bEnergy2;
|
|
|
|
|
CComboBox m_bEnergy3;
|
|
|
|
|
CComboBox m_bEnergy4;
|
|
|
|
|
CComboBox m_bEnergy5;
|
|
|
|
|
CComboBox m_bEnergy6;
|
|
|
|
|
CComboBox m_bEnergy7;
|
|
|
|
|
CComboBox m_bEnergy8;
|
|
|
|
|
CComboBox m_bEnergy9;
|
|
|
|
|
CComboBox m_bEnergy10;
|
|
|
|
|
|
|
|
|
|
CEdit m_ProportionEnergy1;
|
|
|
|
|
CEdit m_ProportionEnergy2;
|
|
|
|
|
CEdit m_ProportionEnergy3;
|
|
|
|
|
CEdit m_ProportionEnergy4;
|
|
|
|
|
CEdit m_ProportionEnergy5;
|
|
|
|
|
CEdit m_ProportionEnergy6;
|
|
|
|
|
CEdit m_ProportionEnergy7;
|
|
|
|
|
CEdit m_ProportionEnergy8;
|
|
|
|
|
CEdit m_ProportionEnergy9;
|
|
|
|
|
CEdit m_ProportionEnergy10;
|
|
|
|
|
|
|
|
|
|
CComboBox m_Color1;
|
|
|
|
|
CComboBox m_Color2;
|
|
|
|
|
CComboBox m_Color3;
|
|
|
|
|
CComboBox m_Color4;
|
|
|
|
|
CComboBox m_Color5;
|
|
|
|
|
CComboBox m_Color6;
|
|
|
|
|
CComboBox m_Color7;
|
|
|
|
|
CComboBox m_Color8;
|
|
|
|
|
CComboBox m_Color9;
|
|
|
|
|
CComboBox m_Color10;
|
|
|
|
|
|
|
|
|
|
CEdit m_CddDataPath;
|
|
|
|
|
CStatic m_StaticCtrl;
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD>ݳ<EFBFBD>Ա
|
|
|
|
|
std::vector<std::vector<std::string>> m_data; // <20>洢<EFBFBD><E6B4A2>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
float m_minEnergy, m_maxEnergy;
|
|
|
|
|
float m_SumEnergy, m_NumEnergy;
|
|
|
|
|
float m_Scheme1, m_Scheme2, m_Scheme3, m_Scheme4, m_Scheme5, m_Scheme6, m_Scheme7, m_Scheme8, m_Scheme9, m_Scheme10;
|
|
|
|
|
public:
|
|
|
|
|
afx_msg void OnBnClickedImageInfoSaveButton();
|
|
|
|
|
afx_msg void OnBnClickedDlgMinButton();
|
|
|
|
|
afx_msg void OnBnClickedDlgMaxButton();
|
|
|
|
|
afx_msg void OnBnClickedImageGenerateButton();
|
|
|
|
|
afx_msg void OnBnClickedSlectPathButton();
|
|
|
|
|
afx_msg void OnBnClickedSaveImageButton();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void OnInitEnergyCombo();
|
|
|
|
|
void OnInitEnergyInfo();
|
|
|
|
|
void OnInitCcdDataPath();
|
|
|
|
|
void UpProportionEnergy();
|
|
|
|
|
void OnInitAll();
|
|
|
|
|
void LoadEnergyDataFromFile(const CString& strFilePath);
|
|
|
|
|
void LoadData(CString cddDataPath);
|
|
|
|
|
void OnPaintCcd();
|
|
|
|
|
void SaveImage(const CString& savePath);
|
|
|
|
|
|
|
|
|
|
BOOL FileExists(const CString& strFilePath);
|
|
|
|
|
COLORREF GetColorFromEnergy(float energy);// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>ɫ<EFBFBD><C9AB>Χ<EFBFBD>ṹ<EFBFBD><E1B9B9>
|
|
|
|
|
struct ColorRange {
|
|
|
|
|
float minEnergy;
|
|
|
|
|
float maxEnergy;
|
|
|
|
|
COLORREF color;
|
|
|
|
|
const int proportionEnergy;
|
|
|
|
|
ColorRange(float minE, float maxE, COLORREF col, const int proportionE)
|
|
|
|
|
: minEnergy(minE), maxEnergy(maxE), color(col), proportionEnergy(proportionE){}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
class ColorScheme {
|
|
|
|
|
public:
|
|
|
|
|
std::string name; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
std::vector<ColorRange> ranges; // <20>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD>Ͷ<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
|
|
|
|
|
// Ĭ<>Ϲ<EFBFBD><CFB9>캯<EFBFBD><ECBAAF>
|
|
|
|
|
ColorScheme() : name("") {}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>캯<EFBFBD><ECBAAF>
|
|
|
|
|
ColorScheme(std::string schemeName) : name(schemeName) {}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ
|
|
|
|
|
void addRange(float minEnergy, float maxEnergy, COLORREF color, const int proportionEnergy) {
|
|
|
|
|
ranges.push_back(ColorRange{ minEnergy, maxEnergy, color ,proportionEnergy});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
COLORREF getColor(float energy);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
class ColorSchemeManager {
|
|
|
|
|
public:
|
|
|
|
|
std::map<std::string, ColorScheme> schemes;
|
|
|
|
|
ColorScheme* currentScheme;
|
|
|
|
|
|
|
|
|
|
ColorSchemeManager() : currentScheme(nullptr) {}
|
|
|
|
|
|
|
|
|
|
void addScheme(const std::string& name) {
|
|
|
|
|
schemes[name] = ColorScheme(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setCurrentScheme(const std::string& name) {
|
|
|
|
|
currentScheme = &schemes[name];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern ColorSchemeManager m_colorSchemeManager;
|
|
|
|
|
extern std::map<const int, int> m_proportionEnergy;
|