diff --git a/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.Designer.cs b/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.Designer.cs index b908a7d..015b0f3 100644 --- a/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.Designer.cs +++ b/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.Designer.cs @@ -30,11 +30,11 @@ namespace Million_Hunter.HunterSubForm private void InitializeComponent() { this.treeList_ResultData = new DevExpress.XtraTreeList.TreeList(); - this.repositoryItemCheckEdit_Inclustion = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit(); this.treeListColumn_Desciprtion = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.treeListColumn_WinRate = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.treeListColumn_ProfitRate = new DevExpress.XtraTreeList.Columns.TreeListColumn(); this.treeListColumn_SavedTime = new DevExpress.XtraTreeList.Columns.TreeListColumn(); + this.repositoryItemCheckEdit_Inclustion = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit(); ((System.ComponentModel.ISupportInitialize)(this.treeList_ResultData)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit_Inclustion)).BeginInit(); this.SuspendLayout(); @@ -50,21 +50,20 @@ namespace Million_Hunter.HunterSubForm this.treeList_ResultData.Dock = System.Windows.Forms.DockStyle.Fill; this.treeList_ResultData.Location = new System.Drawing.Point(0, 0); this.treeList_ResultData.Name = "treeList_ResultData"; + this.treeList_ResultData.OptionsView.ShowIndicator = false; + this.treeList_ResultData.OptionsView.ShowRoot = false; this.treeList_ResultData.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemCheckEdit_Inclustion}); this.treeList_ResultData.Size = new System.Drawing.Size(731, 228); this.treeList_ResultData.TabIndex = 6; - // - // repositoryItemCheckEdit_Inclustion - // - this.repositoryItemCheckEdit_Inclustion.AutoHeight = false; - this.repositoryItemCheckEdit_Inclustion.Name = "repositoryItemCheckEdit_Inclustion"; + this.treeList_ResultData.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.treeList_ResultData_MouseDoubleClick); // // treeListColumn_Desciprtion // this.treeListColumn_Desciprtion.Caption = "내용"; this.treeListColumn_Desciprtion.FieldName = "Description"; this.treeListColumn_Desciprtion.Name = "treeListColumn_Desciprtion"; + this.treeListColumn_Desciprtion.OptionsColumn.AllowEdit = false; this.treeListColumn_Desciprtion.Visible = true; this.treeListColumn_Desciprtion.VisibleIndex = 0; this.treeListColumn_Desciprtion.Width = 413; @@ -74,6 +73,7 @@ namespace Million_Hunter.HunterSubForm this.treeListColumn_WinRate.Caption = "승률"; this.treeListColumn_WinRate.FieldName = "FirstWinRate"; this.treeListColumn_WinRate.Name = "treeListColumn_WinRate"; + this.treeListColumn_WinRate.OptionsColumn.AllowEdit = false; this.treeListColumn_WinRate.Visible = true; this.treeListColumn_WinRate.VisibleIndex = 1; this.treeListColumn_WinRate.Width = 63; @@ -83,6 +83,7 @@ namespace Million_Hunter.HunterSubForm this.treeListColumn_ProfitRate.Caption = "수익률"; this.treeListColumn_ProfitRate.FieldName = "FirstProfitRate"; this.treeListColumn_ProfitRate.Name = "treeListColumn_ProfitRate"; + this.treeListColumn_ProfitRate.OptionsColumn.AllowEdit = false; this.treeListColumn_ProfitRate.Visible = true; this.treeListColumn_ProfitRate.VisibleIndex = 2; this.treeListColumn_ProfitRate.Width = 65; @@ -91,19 +92,28 @@ namespace Million_Hunter.HunterSubForm // this.treeListColumn_SavedTime.Caption = "저장 시간"; this.treeListColumn_SavedTime.FieldName = "SavedTime"; + this.treeListColumn_SavedTime.Format.FormatString = "d"; + this.treeListColumn_SavedTime.Format.FormatType = DevExpress.Utils.FormatType.DateTime; this.treeListColumn_SavedTime.Name = "treeListColumn_SavedTime"; + this.treeListColumn_SavedTime.OptionsColumn.AllowEdit = false; this.treeListColumn_SavedTime.Visible = true; this.treeListColumn_SavedTime.VisibleIndex = 3; this.treeListColumn_SavedTime.Width = 206; // + // repositoryItemCheckEdit_Inclustion + // + this.repositoryItemCheckEdit_Inclustion.AutoHeight = false; + this.repositoryItemCheckEdit_Inclustion.Name = "repositoryItemCheckEdit_Inclustion"; + // // LoadAnalysisResultDataForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(731, 228); this.Controls.Add(this.treeList_ResultData); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.Name = "LoadAnalysisResultDataForm"; - this.Text = "LoadAnalysisResultDataForm"; + this.Text = "분석 결과 불러 오기"; ((System.ComponentModel.ISupportInitialize)(this.treeList_ResultData)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit_Inclustion)).EndInit(); this.ResumeLayout(false); diff --git a/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.cs b/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.cs index 76648c0..3bbed55 100644 --- a/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.cs +++ b/Million Hunter/HunterSubForm/LoadAnalysisResultDataForm.cs @@ -1,4 +1,5 @@ using DevExpress.XtraEditors; +using DevExpress.XtraTreeList; using Million.FileDBManagement; using Million.SaveData; using System; @@ -16,33 +17,60 @@ namespace Million_Hunter.HunterSubForm { public partial class LoadAnalysisResultDataForm : DevExpress.XtraEditors.XtraForm { - public LoadAnalysisResultDataForm(string savedResultAnalysisDataPath) + ResultViewerForm _resultViewerForm = null; + + public LoadAnalysisResultDataForm(ResultViewerForm resultViewerForm) { InitializeComponent(); - initform(savedResultAnalysisDataPath); + // Return 할 선택된 결과 분석 데이터 + _resultViewerForm = resultViewerForm; + + GetAnalysisResultDataInfo(); } - private void initform(string savedResultAnalysisDataPath) + private void GetAnalysisResultDataInfo() { // 분석 데이터 정보 파일 항목 불러오기(.data) // 폴더 검사 - if (Directory.Exists(savedResultAnalysisDataPath)) + if (Directory.Exists(_resultViewerForm._savedResultData.SavedResultAnalysisDataPath)) { - var fileList = Directory.GetFiles(savedResultAnalysisDataPath,"*info"); + var fileList = Directory.GetFiles(_resultViewerForm._savedResultData.SavedResultAnalysisDataPath, "*info"); - var analysisDataList = new List(); + var savedAnalysisDataList = new List(); - foreach(var file in fileList) + foreach(var filePath in fileList) { - analysisDataList.Add(FileManager.LoadResultAnalysisDataFromFile(file)); + var savedSnalysisData = FileManager.LoadResultAnalysisDataInfoFromFile(filePath); + savedSnalysisData.SavedInfoDataPath = filePath; + savedSnalysisData.SavedResultDataPath = filePath.Replace("info","data"); + savedAnalysisDataList.Add(savedSnalysisData); } - treeList_ResultData.DataSource = analysisDataList; + treeList_ResultData.DataSource = savedAnalysisDataList; } else MessageBox.Show("데이터 없음"); } + + private void treeList_ResultData_MouseDoubleClick(object sender, MouseEventArgs e) + { + var treeList = sender as TreeList; + + if (treeList == null) return; + + var hitInfo = treeList.CalcHitInfo(e.Location); + + if (hitInfo.HitInfoType != HitInfoType.Cell) return; + + var selectedResultData = (SavedAnalysisData)treeList.GetDataRecordByNode(hitInfo.Node); + + // 선택된 Info 데이터의 Result Data 가져오기 + selectedResultData.AnalysisDataList = FileManager.LoadResultAnalysisDataFromFile(selectedResultData.SavedResultDataPath); + + _resultViewerForm._savedAnalysisData = selectedResultData; + this.DialogResult = DialogResult.OK; + } } } \ No newline at end of file diff --git a/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs b/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs index 8d8951c..27f3a6a 100644 --- a/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs +++ b/Million Hunter/HunterSubForm/ResultViewerForm.Designer.cs @@ -72,6 +72,7 @@ namespace Million_Hunter.HunterSubForm this.textEdit_Description = new DevExpress.XtraEditors.TextEdit(); this.simpleButton_LoadAnalysisResultData = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton_SavaAnalysisData = new DevExpress.XtraEditors.SimpleButton(); + this.simpleButton_resetData = new DevExpress.XtraEditors.SimpleButton(); ((System.ComponentModel.ISupportInitialize)(this.panelControl_IndicatorCondition)).BeginInit(); this.panelControl_IndicatorCondition.SuspendLayout(); this.groupBox_.SuspendLayout(); @@ -605,6 +606,7 @@ namespace Million_Hunter.HunterSubForm // this.panelControl1.Controls.Add(this.labelControl1); this.panelControl1.Controls.Add(this.textEdit_Description); + this.panelControl1.Controls.Add(this.simpleButton_resetData); this.panelControl1.Controls.Add(this.simpleButton_LoadAnalysisResultData); this.panelControl1.Controls.Add(this.simpleButton_SavaAnalysisData); this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top; @@ -615,6 +617,7 @@ namespace Million_Hunter.HunterSubForm // // labelControl1 // + this.labelControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelControl1.Location = new System.Drawing.Point(737, 15); this.labelControl1.Name = "labelControl1"; this.labelControl1.Size = new System.Drawing.Size(32, 14); @@ -623,6 +626,7 @@ namespace Million_Hunter.HunterSubForm // // textEdit_Description // + this.textEdit_Description.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.textEdit_Description.Location = new System.Drawing.Point(775, 12); this.textEdit_Description.Name = "textEdit_Description"; this.textEdit_Description.Size = new System.Drawing.Size(344, 20); @@ -630,6 +634,8 @@ namespace Million_Hunter.HunterSubForm // // simpleButton_LoadAnalysisResultData // + this.simpleButton_LoadAnalysisResultData.Appearance.ForeColor = System.Drawing.Color.IndianRed; + this.simpleButton_LoadAnalysisResultData.Appearance.Options.UseForeColor = true; this.simpleButton_LoadAnalysisResultData.Location = new System.Drawing.Point(8, 5); this.simpleButton_LoadAnalysisResultData.Name = "simpleButton_LoadAnalysisResultData"; this.simpleButton_LoadAnalysisResultData.Size = new System.Drawing.Size(121, 32); @@ -639,6 +645,7 @@ namespace Million_Hunter.HunterSubForm // // simpleButton_SavaAnalysisData // + this.simpleButton_SavaAnalysisData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton_SavaAnalysisData.Location = new System.Drawing.Point(1127, 5); this.simpleButton_SavaAnalysisData.Name = "simpleButton_SavaAnalysisData"; this.simpleButton_SavaAnalysisData.Size = new System.Drawing.Size(136, 32); @@ -646,6 +653,17 @@ namespace Million_Hunter.HunterSubForm this.simpleButton_SavaAnalysisData.Text = "결과 저장"; this.simpleButton_SavaAnalysisData.Click += new System.EventHandler(this.simpleButton_SavaAnalysisData_Click); // + // simpleButton_resetData + // + this.simpleButton_resetData.Appearance.ForeColor = System.Drawing.Color.Teal; + this.simpleButton_resetData.Appearance.Options.UseForeColor = true; + this.simpleButton_resetData.Location = new System.Drawing.Point(135, 5); + this.simpleButton_resetData.Name = "simpleButton_resetData"; + this.simpleButton_resetData.Size = new System.Drawing.Size(121, 32); + this.simpleButton_resetData.TabIndex = 0; + this.simpleButton_resetData.Text = "필터 초기화"; + this.simpleButton_resetData.Click += new System.EventHandler(this.simpleButton_resetData_Click); + // // ResultViewerForm // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); @@ -733,5 +751,6 @@ namespace Million_Hunter.HunterSubForm private DevExpress.XtraEditors.LabelControl labelControl1; private DevExpress.XtraEditors.TextEdit textEdit_Description; private DevExpress.XtraEditors.SimpleButton simpleButton_LoadAnalysisResultData; + private DevExpress.XtraEditors.SimpleButton simpleButton_resetData; } } \ No newline at end of file diff --git a/Million Hunter/HunterSubForm/ResultViewerForm.cs b/Million Hunter/HunterSubForm/ResultViewerForm.cs index e9481e5..eb8a7e9 100644 --- a/Million Hunter/HunterSubForm/ResultViewerForm.cs +++ b/Million Hunter/HunterSubForm/ResultViewerForm.cs @@ -21,6 +21,9 @@ namespace Million_Hunter.HunterSubForm // TreeList에 옮길 가공 데이터 public List_analysisDatas; + // Analysis Data 를 Load 하는 경우 저장 변수 + public SavedAnalysisData _savedAnalysisData; + public ResultViewerForm(SavedResultData savedResultData) { InitializeComponent(); @@ -68,8 +71,6 @@ namespace Million_Hunter.HunterSubForm treeList_ResultData.DataSource = _analysisDatas; treeList_ResultData.RefreshDataSource(); - - //var loadedData = FileManager.LoadFormBinaryFile(_savedResultData.SavedResultAnalysisDataPath); } // 분석 결과 저장 버튼 클릭 이벤트 @@ -127,12 +128,23 @@ namespace Million_Hunter.HunterSubForm // 결과 분석 데이터 불러오기 버튼 클릭 이벤트 private void simpleButton_LoadAnalysisResultData_Click(object sender, EventArgs e) { - var loadAnalysisResultDataForm = new LoadAnalysisResultDataForm(_savedResultData.SavedResultAnalysisDataPath); + var loadAnalysisResultDataForm = new LoadAnalysisResultDataForm(this); loadAnalysisResultDataForm.StartPosition = FormStartPosition.CenterParent; if(loadAnalysisResultDataForm.ShowDialog(this) == DialogResult.OK) { - + // 정상으로 데이터를 로드 하면 + if(_savedAnalysisData != null) + { + treeList_ResultData.DataSource = _savedAnalysisData.AnalysisDataList; + treeList_ResultData.RefreshDataSource(); + } } } + + private void simpleButton_resetData_Click(object sender, EventArgs e) + { + // 데이터 초기화 + InitForm(); + } } } \ No newline at end of file diff --git a/Million Hunter/MainForm.cs b/Million Hunter/MainForm.cs index 33b3586..9a8b4f4 100644 --- a/Million Hunter/MainForm.cs +++ b/Million Hunter/MainForm.cs @@ -400,7 +400,7 @@ namespace Million_Hunter } var resultViewerForm = new ResultViewerForm(_saveResultData) { StartPosition = FormStartPosition.CenterScreen}; - resultViewerForm.Visible = true; + resultViewerForm.ShowDialog(); } // 저장된 결과 데이터 폼 불러오기 diff --git a/Million/FileManagement/FileContoler.cs b/Million/FileManagement/FileContoler.cs index 06211bb..b27bc1c 100644 --- a/Million/FileManagement/FileContoler.cs +++ b/Million/FileManagement/FileContoler.cs @@ -124,9 +124,15 @@ namespace Million.FileDBManagement } // 결과 분석 데이터 불러오기 - public static SavedAnalysisData LoadResultAnalysisDataFromFile(string fileFullPath) + public static SavedAnalysisData LoadResultAnalysisDataInfoFromFile(string fileFullPath) { - var savedResultData = (SavedAnalysisData)LoadFormBinaryFile(fileFullPath); + var savedResultInfo = (SavedAnalysisData)LoadFormBinaryFile(fileFullPath); + return savedResultInfo; + } + + public static List LoadResultAnalysisDataFromFile(string fileFullPath) + { + var savedResultData = (List)LoadFormBinaryFile(fileFullPath); return savedResultData; }