111 lines
2.7 KiB
C#
111 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using WeifenLuo.WinFormsUI.Docking;
|
|
|
|
namespace friction
|
|
{
|
|
public partial class MainForm : Form
|
|
{
|
|
string m_DBFileName = "";
|
|
DataHandler m_DataHandler = new DataHandler();
|
|
PanelMaterial m_MaterialPanel = null;
|
|
PanelResult m_ResultPanel = null;
|
|
PanelAnalysis m_AnalysisPanel = null;
|
|
PanelRadarGraph m_RadarGraphPanel = null;
|
|
PanelTrendGraph m_TrendGraphPanel = null;
|
|
|
|
public MainForm()
|
|
{
|
|
InitializeComponent();
|
|
|
|
dockPanel.Theme = new VS2015DarkTheme();
|
|
m_MaterialPanel = new PanelMaterial(this);
|
|
m_ResultPanel = new PanelResult(this);
|
|
m_AnalysisPanel = new PanelAnalysis(this);
|
|
m_RadarGraphPanel = new PanelRadarGraph(this);
|
|
m_TrendGraphPanel = new PanelTrendGraph(this);
|
|
}
|
|
|
|
private void OpenPanel(DockContent panel)
|
|
{
|
|
if (panel.Visible == false)
|
|
panel.Show(dockPanel);
|
|
if (panel.IsHidden == true)
|
|
panel.IsHidden = false;
|
|
|
|
if(panel.DockState == DockState.DockTopAutoHide ||
|
|
panel.DockState == DockState.DockBottomAutoHide ||
|
|
panel.DockState == DockState.DockLeftAutoHide ||
|
|
panel.DockState == DockState.DockRightAutoHide)
|
|
{
|
|
dockPanel.ActiveAutoHideContent = panel;
|
|
}
|
|
}
|
|
|
|
private void toolStripButtonOpen_Click(object sender, EventArgs e)
|
|
{
|
|
OpenFileDialog ofd = new OpenFileDialog();
|
|
ofd.Filter = "엑셀 파일 (*.xlsx)|*.xlsx|엑셀 파일 (*.xls)|*.xls|전체|*";
|
|
DialogResult result = ofd.ShowDialog();
|
|
if (result == DialogResult.OK)
|
|
{
|
|
m_DBFileName = ofd.FileName;
|
|
m_DataHandler.LoadData(m_DBFileName);
|
|
|
|
m_MaterialPanel.UpdateData(m_DataHandler);
|
|
OpenPanel(m_MaterialPanel);
|
|
|
|
m_ResultPanel.UpdateData(m_DataHandler);
|
|
OpenPanel(m_ResultPanel);
|
|
|
|
toolStripStatusLabel.Text = m_DBFileName;
|
|
}
|
|
}
|
|
|
|
private void toolStripButtonMaterial_Click(object sender, EventArgs e)
|
|
{
|
|
OpenPanel(m_MaterialPanel);
|
|
}
|
|
|
|
private void toolStripButtonResult_Click(object sender, EventArgs e)
|
|
{
|
|
OpenPanel(m_ResultPanel);
|
|
}
|
|
|
|
private void toolStripButtonAnalysis_Click(object sender, EventArgs e)
|
|
{
|
|
OpenPanel(m_AnalysisPanel);
|
|
}
|
|
|
|
private void toolStripButtonRadarGraph_Click(object sender, EventArgs e)
|
|
{
|
|
OpenPanel(m_RadarGraphPanel);
|
|
}
|
|
|
|
private void toolStripButtonTrendGraph_Click(object sender, EventArgs e)
|
|
{
|
|
OpenPanel(m_TrendGraphPanel);
|
|
}
|
|
|
|
#region Events from panels
|
|
public void OnApplyData()
|
|
{
|
|
m_AnalysisPanel.UpdateData(m_DataHandler);
|
|
OpenPanel(m_AnalysisPanel);
|
|
}
|
|
|
|
public void OnColumnChecked(string strColumn, bool bChecked)
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
}
|
|
}
|