- 툴바 아이콘 지정

- 메뉴바 테마 적용
- 메뉴바 기능 연결
- 파일 로딩 후 기능들 연결
This commit is contained in:
2017-06-20 03:52:08 +09:00
parent 7be92b315a
commit 760ce6abc2
23 changed files with 6673 additions and 315 deletions

View File

@@ -15,15 +15,35 @@ namespace friction
{
MainForm m_Owner = null;
string m_CurSpring = "";
public PanelAnalysis(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
Theme.Apply(this);
Theme.Apply(dgvAnalysis);
lbInfo25.ForeColor = Theme.Backcolor;
}
public void Reset()
{
m_CurSpring = "";
}
public void UpdateData(DataHandler data)
{
string strSpring = data.GetCurSpring();
if (strSpring == m_CurSpring)
return;
dgvAnalysis.Columns.Clear();
dgvAnalysis.Rows.Clear();
dgvAnalysis.Columns.Add("chTable", "Table");
dgvAnalysis.Columns.Add("chNoTest", "No. of Tests");
dgvAnalysis.Columns.Add("chAvg", "Average RPN");
@@ -33,51 +53,48 @@ namespace friction
dgvAnalysis.Columns.Add("chHumi", "Rel. Humidity");
dgvAnalysis.Columns.Add("chVel", "Velocity");
Color green = Color.YellowGreen;
Color yellow = Color.Gold;
Color red = Color.DarkOrange;
Color gray = Color.DarkGray;
Color white = Color.Snow;
string strSpring = data.GetCurSpring();
foreach(string strTable in data.GetTableList())
{
DataHandler.CalcResult result = data.GetCalc(strSpring, strTable);
int iIdx = dgvAnalysis.Rows.Add(strTable, result.m_iCnt, result.m_fAvgRPN, result.m_fStdRPN, result.m_fDiffByForce, result.m_fDiffByTemp, result.m_fDiffByHumid, result.m_fDiffByVel);
if (result.m_fAvgRPN <= 4)
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = green;
else if(result.m_fAvgRPN <= 7)
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = yellow;
else
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = red;
if(result.m_iCnt <= 5)
{
dgvAnalysis.Rows[iIdx].Cells[3].Style.BackColor = white;
dgvAnalysis.Rows[iIdx].Cells[4].Style.BackColor = white;
dgvAnalysis.Rows[iIdx].Cells[5].Style.BackColor = white;
dgvAnalysis.Rows[iIdx].Cells[6].Style.BackColor = white;
dgvAnalysis.Rows[iIdx].Cells[7].Style.BackColor = white;
for (int i = 2; i <= 7; i++)
{
dgvAnalysis.Rows[iIdx].Cells[i].Style.BackColor = Theme.White;
dgvAnalysis.Rows[iIdx].Cells[i].Style.ForeColor = Theme.Backcolor;
}
}
else if(result.m_iCnt <= 10)
{
dgvAnalysis.Rows[iIdx].Cells[3].Style.BackColor = gray;
dgvAnalysis.Rows[iIdx].Cells[4].Style.BackColor = gray;
dgvAnalysis.Rows[iIdx].Cells[5].Style.BackColor = gray;
dgvAnalysis.Rows[iIdx].Cells[6].Style.BackColor = gray;
dgvAnalysis.Rows[iIdx].Cells[7].Style.BackColor = gray;
for (int i = 2; i <= 7; i++)
{
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Gray;
dgvAnalysis.Rows[iIdx].Cells[2].Style.ForeColor = Theme.Backcolor;
}
}
else
{
dgvAnalysis.Rows[iIdx].Cells[3].Style.BackColor = (result.m_fStdRPN <= 1.5) ? green : red;
dgvAnalysis.Rows[iIdx].Cells[4].Style.BackColor = (result.m_fDiffByForce <= 1.5) ? green : red;
dgvAnalysis.Rows[iIdx].Cells[5].Style.BackColor = (result.m_fDiffByTemp <= 1.5) ? green : red;
dgvAnalysis.Rows[iIdx].Cells[6].Style.BackColor = (result.m_fDiffByHumid <= 1.5) ? green : red;
dgvAnalysis.Rows[iIdx].Cells[7].Style.BackColor = (result.m_fDiffByVel <= 1.5) ? green : red;
if (result.m_fAvgRPN <= 3)
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Green;
else if (result.m_fAvgRPN <= 5)
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Yellow;
else
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Red;
dgvAnalysis.Rows[iIdx].Cells[3].Style.BackColor = (result.m_fStdRPN <= 1.5) ? Theme.Green : Theme.Red;
dgvAnalysis.Rows[iIdx].Cells[4].Style.BackColor = (result.m_fDiffByForce <= 1.5) ? Theme.Green : Theme.Red;
dgvAnalysis.Rows[iIdx].Cells[5].Style.BackColor = (result.m_fDiffByTemp <= 1.5) ? Theme.Green : Theme.Red;
dgvAnalysis.Rows[iIdx].Cells[6].Style.BackColor = (result.m_fDiffByHumid <= 1.5) ? Theme.Green : Theme.Red;
dgvAnalysis.Rows[iIdx].Cells[7].Style.BackColor = (result.m_fDiffByVel <= 1.5) ? Theme.Green : Theme.Red;
}
}
m_CurSpring = strSpring;
}
}
}