Compare commits

...

32 Commits

Author SHA1 Message Date
6bd0c4337d 문구 수정
매번 뜨도록 수정
2018-02-22 12:08:58 +09:00
86bf3ca21b agree popup 추가 2018-02-18 21:08:01 +09:00
df16cb5533 radar chart와 map 화면 동시에 띄워놓고 더블클릭했을 때 반영되도록 수정 2017-08-29 00:03:53 +09:00
c10eeb864b risk 색상 범위 수정 2017-08-27 22:51:04 +09:00
a810a5b118 table, spring 전체 선택/해제
Potential S-Slip Risk -> Potential Stick-Slip Risk
Radar Graph Popup
2017-08-20 20:18:16 +09:00
fadd004b8d 리포트 수정 등 0816 요청사항 반영 2017-08-17 00:06:28 +09:00
7faddd3f3f - 재질 check 기능 수정
- 리포트 맵 부분 수정
2017-08-15 23:51:22 +09:00
4bee47633b 리포트 수정
그래프 범위 수정
그래프 활성화될 때 table 선택
2017-08-13 06:14:04 +09:00
d48d0167ac Radar Graph에 material check 항목 적용 2017-08-13 05:09:41 +09:00
bef2551cc6 Mateiral Pair에서 check된 항목 load/save/remove
Compatibility Map에 적용
2017-08-13 04:18:50 +09:00
b906236fef MaterialCompatibleMap 수정
- datagridview cell을 계속 그리는 문제 해결
 - 5가지 상태창 표시
 - layout 수정

RadarGraph 수정
 - 팝업창 두번씩 뜨지 않도록 수정
 - layout 수정
2017-08-10 01:01:49 +09:00
0d24b2d2d3 MaterialPair 창에서 엔터로 선택, 스페이스로 체크 2017-08-10 00:59:53 +09:00
9be9aa439a 레이더 그래프에 5가지 상태창 추가
피봇 기능 추가
2017-08-08 00:48:27 +09:00
879b3abda4 - 글자 크기와 툴바 아이콘 크기 조정
- Material compatibility table 리포트에 추가
- Material compatibility table 정렬되지 않도록
- 탭 패널 아이콘 적용

Radar Graph
- 항목의 폰트 크기 조정
- 영역에 색 지정 데이터는 라인으로
- 이 창을 띄울 땐 무조건 All이 선택되도록
- 데이터가 3개보다 적을 때 팝업

Trend Graph
- 재질 쌍 표시
- 영역 색을 조정

Analysis Table
- 재질 더블클릭 시 Material Table이 선택
2017-06-28 01:26:07 +09:00
fae1f8b7c9 - 리포트에서 Trend 그래프 정리 2017-06-24 17:32:17 +09:00
8c46481430 - 설정 업데이트 (창크기, Column 체크)
- 로딩 중 마우스 포인터
2017-06-24 15:34:18 +09:00
334c131e6e - 리포트 기능 추가(Trend Graph 제외)
- AboutBox 추가
2017-06-24 14:43:27 +09:00
4503bfc7a5 - Material Compatibility Map 추가 2017-06-23 15:53:56 +09:00
bc27de2ea5 - Material Pair에 layout 적용
- Trend Graph에 Force, Velocity 추가
2017-06-23 14:59:08 +09:00
244eab56a6 - 눈에 안 띄는 글자들 처리(listview group, trend chart legend)
- listview column width 꽉차도록 처리
2017-06-23 03:00:13 +09:00
c5344b873f - Material Pair 리스트뷰로 변경 및 그래프 refresh 수정 2017-06-23 02:21:25 +09:00
902c78615b - Radar Graph 추가
- Graph 클릭 이벤트 추가
2017-06-23 01:16:23 +09:00
44841453e9 - Congig 추가
- friction.exe -> squeak.exe
- 색상 변경
- analysis 기준 변경
2017-06-21 02:41:29 +09:00
9bf6a38f6d - TrendGraph에 trendline 추가 2017-06-20 05:44:31 +09:00
760ce6abc2 - 툴바 아이콘 지정
- 메뉴바 테마 적용
- 메뉴바 기능 연결
- 파일 로딩 후 기능들 연결
2017-06-20 03:52:08 +09:00
7be92b315a Analysis 구현 2017-06-19 19:23:01 +09:00
7603deef0d Trend Chart 구현 2017-06-19 19:22:33 +09:00
907d61ec1e - livechart 추가 2017-06-19 14:19:08 +09:00
cc42695fd8 - 각 창들 추가
- Analysis Panel 계산 준비
2017-06-19 14:07:56 +09:00
5e26c490b8 - form 이름 변경
- UI 수정
- Result Panel Column 연동
2017-06-15 23:47:36 +09:00
013aa87d3d .vs/ 폴더 삭제 2017-06-15 13:13:32 +09:00
6c158b161c dockpanelsuite 크래시 문제 해결 2017-06-15 13:13:04 +09:00
82 changed files with 82663 additions and 460 deletions

Binary file not shown.

109
AboutBox.Designer.cs generated Normal file
View File

@@ -0,0 +1,109 @@
namespace friction
{
partial class AboutBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox));
this.label1 = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(160, 12);
this.label1.TabIndex = 0;
this.label1.Text = "Material Stick-slip Analysis";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(233, 64);
this.tableLayoutPanel1.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 12);
this.label2.TabIndex = 0;
this.label2.Text = "Ver. 1.0";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(3, 32);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(212, 12);
this.label3.TabIndex = 0;
this.label3.Text = "Copyright © 2016, General Utility Ltd.";
//
// AboutBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(255, 77);
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
}
}

20
AboutBox.cs Normal file
View File

@@ -0,0 +1,20 @@
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;
namespace friction
{
public partial class AboutBox : Form
{
public AboutBox()
{
InitializeComponent();
}
}
}

6293
AboutBox.resx Normal file

File diff suppressed because it is too large Load Diff

101
AlertPopup.Designer.cs generated Normal file
View File

@@ -0,0 +1,101 @@
namespace friction
{
partial class AlertPopup
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AlertPopup));
this.tbAlert = new System.Windows.Forms.RichTextBox();
this.chAgree = new System.Windows.Forms.CheckBox();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// tbAlert
//
this.tbAlert.Location = new System.Drawing.Point(12, 12);
this.tbAlert.Name = "tbAlert";
this.tbAlert.Size = new System.Drawing.Size(614, 464);
this.tbAlert.TabIndex = 0;
this.tbAlert.Text = resources.GetString("tbAlert.Text");
//
// chAgree
//
this.chAgree.AutoSize = true;
this.chAgree.Location = new System.Drawing.Point(12, 482);
this.chAgree.Name = "chAgree";
this.chAgree.Size = new System.Drawing.Size(543, 16);
this.chAgree.TabIndex = 1;
this.chAgree.Text = "상기 정보 보호 관련 경고 사항을 확인하며, 이를 위반 시 민∙형사상 책임을 감수함을 서약합니다 ";
this.chAgree.UseVisualStyleBackColor = true;
this.chAgree.CheckedChanged += new System.EventHandler(this.chAgree_CheckedChanged);
//
// btnOK
//
this.btnOK.Enabled = false;
this.btnOK.Location = new System.Drawing.Point(442, 515);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 2;
this.btnOK.Text = "확인";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(523, 515);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "취소";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// AlertPopup
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(638, 549);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.chAgree);
this.Controls.Add(this.tbAlert);
this.Name = "AlertPopup";
this.Text = "보안 경고";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox tbAlert;
private System.Windows.Forms.CheckBox chAgree;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
}
}

44
AlertPopup.cs Normal file
View File

@@ -0,0 +1,44 @@
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;
namespace friction
{
public partial class AlertPopup : Form
{
public AlertPopup()
{
this.DialogResult = DialogResult.Abort;
InitializeComponent();
Theme.Apply(this);
Theme.Apply(tbAlert);
Theme.Apply(chAgree);
Theme.Apply(btnOK);
Theme.Apply(btnCancel);
}
private void chAgree_CheckedChanged(object sender, EventArgs e)
{
btnOK.Enabled = (chAgree.Checked == true);
}
private void btnOK_Click(object sender, EventArgs e)
{
if(chAgree.Checked == true)
this.DialogResult = DialogResult.OK;
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Abort;
}
}
}

View File

@@ -117,4 +117,47 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="tbAlert.Text" xml:space="preserve">
<value>회사 정보 보호 서약
제 1 조 【회사정보의 의의】
본인은 본 서약서에서 “회사정보”란 본인이 업무수행 중 또는 수행과 관계없이 지득한 회사의 영업비밀(공공연히 알려져 있지 아니하고 독립된 경제적 가치를 가지는 것으로서, 상당한 노력에 의하여 비밀로 유지된 생산방법, 판매방법, 그 밖에 영업활동에 유용한 회사의 기술상 또는 경영상의 정보)과 노하우 등을 포함하여 제2조에서 정한 사항과 관련된 일체의 정보를 뜻한다는 점을 이해하고 인지합니다.
제 2 조 【회사정보의 범위】
① 인사, 조직, 재무, 마케팅, 전산부문의 각종 현황 등 회사의 경영에 관한 사항
② 제품의 설계방법, 설계도면, 제조공정, 제조장치 기타 제품 제조나 생산•수리와 관련된 기술에 관한 비밀사항
③ 제품의 연구개발(R&amp;D) 계획, 작업보고서 및 일지, 실험데이터, 연구성과 분석자료, 신차 관련 정보 등 연구개발에 관한 사항
④ 사업계획, 생산계획, 예산 등 회사의 계획에 관한 사항
⑤ 회사의 임직원, 고객, 회원, 타사 직원 등의 개인정보에 관한 사항
⑥ 기타 업무수행 중 또는 업무수행과 관계없이 지득하게 된 회사경영과 관련된 제반사항
⑦ 본 소프트웨어(마찰맵 프로그램)의 일부 혹은 전체 내용과 구성 파일에 대한 담당자 승인없는 유출 행위 금지
⑧ 본 소프트웨어(마찰맵 프로그램)의 출력 화면과 그 결과물에 대한 담당자의 승인없는 유출 행위 금지
⑨ 본 소프트웨어(마찰맵 프로그램)를 통해 분석하는 모든 데이터 파일의 담당자의 승인없는 유출 행위 금지
제 3 조 [회사 보안관리규정의 준수]
본인은 회사의 회사정보 보호를 위한 지시 및 회사의 제반 보안관리규정을 준수하겠습니다.
제 4 조 [부정사용 / 누설 /공개 금지]
본인은 회사의 사전 서면 동의 없이 회사정보가 공지의 사실이 될 때까지 회사정보를 업무수행 목적 이외의 목적으로 사용하거나, 제3자에게 누설•공개하지 않겠습니다.
제 5 조 [무단복제금지 등]
① 본인은 업무수행 목적 이외의 목적으로 회사정보를 복사•녹음•촬영 등 기타 어떠한 방법으로 복제를 하지 않겠습니다.
② 본인은 회사의 시설물에서 승인되지 않은 장비(OA기기, 통신장비, USB 등 저장장치, 개인노트북 등) 사용, 출입금지구역 출입, 자료열람, 촬영행위를 하지 않겠으며 출입관련 회사의 제반 보안규정을 준수하겠습니다.
제 6 조 [회사정보의 반납 / 파기 / 보유 금지]
① 본인은 본인의 소속회사와 회사간 계약서 상에 명시된 정보의 보호기간(단, 계약서 상에 정보 보호기간이 명시되어 있지 않은 경우에는 계약기간)이 종료(또는 본인의 소속업체 퇴직)되는 즉시(또는 회사와의 합의에 따라 계약종료 후 정해진 일정한 시점) 용역과 관련된 도면, 도표, 설계도, 명세서, 메모, 보고서, 노트, 자기테이프, 디지털 및 아날로그 저장장치(자기테이프, 외장형 저장장치, USB 디스크, CD, DVD, 디지털 카메라, 컴퓨터 하드디스크, 스마트 패드, 영상기록장치 등)에 보관하고 있는 회사와 관련된 일체의 정보를 회사에 반납하거나 반납이 어려울 경우 회사와 협의하여 파기하고, 이에 관해 어떠한 형태의 사본도 보유하지 않겠습니다.
② 본인은 제6조 ①항에서 정한 사항의 이행여부를 확인하는 확인서를 회사에 제출하도록 하겠습니다.
제 7 조 [서약사항 위반시 민•형사상 책임]
본인은 본인의 소속회사 재직 중은 물론 퇴직 후에도 위 각 서약사항을 위반 시 ‘부정 경쟁방지 및 영업비밀보호에 관한 법률’, ‘산업기술의 유출 방지 및 보호에 관한 법률’ 등 관련 법률에 규정된 민•형사상 책임, 민사상의 채무 불이행책임 또는 불법행위로 인한 손해배상책임 등 제반 관련법규에 따른 민•형사상의 책임을 부담하며, 회사의 금전적 손해에 대해 손해액 일체를 즉시 배상하도록 하겠습니다.
현대/기아자동차주식회사 귀중</value>
</data>
</root>

363
Config.cs Normal file
View File

@@ -0,0 +1,363 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace friction
{
public class Config
{
public struct RANGE
{
public float m_fLow;
public float m_fHigh;
}
private static Config m_instance = null;
string m_strPath = "";
public static readonly RANGE TEMP_ALL = new RANGE { m_fLow = -100.0f, m_fHigh = 100.0f };
public static readonly RANGE TEMP_LOW = new RANGE { m_fLow = -100.0f, m_fHigh = 0.0f };
public static readonly RANGE TEMP_NORMAL = new RANGE { m_fLow = 15.0f, m_fHigh = 25.0f };
public static readonly RANGE TEMP_HIGH = new RANGE { m_fLow = 40.0f, m_fHigh = 90.0f };
public static readonly RANGE HUMID_ALL = new RANGE { m_fLow = -100.0f, m_fHigh = 100.0f };
public static readonly RANGE HUMID_LOW = new RANGE { m_fLow = 0.0f, m_fHigh = 60.0f };
public static readonly RANGE HUMID_HIGH = new RANGE { m_fLow = 60.0f, m_fHigh = 100.0f };
public class UncheckedMaterial
{
public List<string> m_Springs = new List<string>();
public List<string> m_Tables = new List<string>();
}
public Dictionary<string, UncheckedMaterial> m_UncheckedMaterial = new Dictionary<string, UncheckedMaterial>();
public string m_strCurMaterial = "";
public bool m_bOnLoad = false;
private Config()
{
}
public static Config GetInstance()
{
if (m_instance == null)
m_instance = new Config();
return m_instance;
}
public void Init()
{
string strPrjName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
string strFolder = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), strPrjName);
m_strPath = strFolder + "\\config.ini";
if (!Directory.Exists(strFolder))
Directory.CreateDirectory(strFolder);
Load();
}
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
private UncheckedMaterial LoadUncheckedMaterial(string section)
{
UncheckedMaterial cm = new UncheckedMaterial();
StringBuilder temp = new StringBuilder(10240);
int iRes = GetPrivateProfileString(section, "unchecked-spring", "", temp, 10240, m_strPath);
if(temp.Length > 0)
{
string[] astrToken = temp.ToString().Split(',');
cm.m_Springs = astrToken.ToList();
}
iRes = GetPrivateProfileString(section, "unchecked-table", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
string[] astrToken = temp.ToString().Split(',');
cm.m_Tables = astrToken.ToList();
}
return cm;
}
public bool HasPref(string strName)
{
foreach(var pair in m_UncheckedMaterial)
{
if (pair.Key == strName)
return true;
}
return false;
}
public void InsertPref(string strName)
{
m_UncheckedMaterial.Add(strName, new UncheckedMaterial());
}
public void RemovePref(string strName)
{
m_UncheckedMaterial.Remove(strName);
WritePrivateProfileString(strName, null, null, m_strPath);
}
public void Load()
{
StringBuilder temp = new StringBuilder(10240);
int iRes = GetPrivateProfileString("Option", "recent", "", temp, 10240, m_strPath);
if(temp.Length > 0)
{
string[] astrList = temp.ToString().Split(',');
foreach (string strFile in astrList)
OPTION.GetInstance().AddRecentFile(strFile);
}
iRes = GetPrivateProfileString("Option", "bound", "", temp, 10240, m_strPath);
if(temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
int iLeft, iWidth, iTop, iHeight;
int.TryParse(astrBound[0], out iLeft);
int.TryParse(astrBound[1], out iWidth);
int.TryParse(astrBound[2], out iTop);
int.TryParse(astrBound[3], out iHeight);
OPTION.GetInstance().WindowBound = new Rectangle(iLeft, iTop, iWidth, iHeight);
}
iRes = GetPrivateProfileString("Option", "checked-column", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
OPTION.GetInstance().CheckedColumns = astrBound.ToList();
}
iRes = GetPrivateProfileString("Option", "unchecked-column", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
OPTION.GetInstance().UncheckedColumns = astrBound.ToList();
}
iRes = GetPrivateProfileString("Option", "conf-names", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
m_UncheckedMaterial.Clear();
string[] astrSections = temp.ToString().Split(',');
foreach(string section in astrSections)
{
UncheckedMaterial cm = LoadUncheckedMaterial(section);
m_UncheckedMaterial.Add(section, cm);
}
}
iRes = GetPrivateProfileString("Option", "current-conf", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
m_strCurMaterial = temp.ToString();
}
if(m_UncheckedMaterial.Count == 0)
{
m_strCurMaterial = "Default";
m_UncheckedMaterial.Add(m_strCurMaterial, new UncheckedMaterial());
}
}
public void Save(bool bSavePref)
{
WritePrivateProfileString("Option", "recent", OPTION.GetInstance().GetRecentAll(), m_strPath);
WritePrivateProfileString("Option", "bound", OPTION.GetInstance().WindowBoundStr(), m_strPath);
WritePrivateProfileString("Option", "checked-column", OPTION.GetInstance().CheckedColumnsStr(), m_strPath);
WritePrivateProfileString("Option", "unchecked-column", OPTION.GetInstance().UncheckedColumnsStr(), m_strPath);
WritePrivateProfileString("Option", "conf-names", string.Join(",", m_UncheckedMaterial.Keys.ToArray()), m_strPath);
WritePrivateProfileString("Option", "current-conf", m_strCurMaterial, m_strPath);
if (bSavePref == true)
{
WritePrivateProfileString(m_strCurMaterial, "unchecked-spring", string.Join(",", m_UncheckedMaterial[m_strCurMaterial].m_Springs.ToArray()), m_strPath);
WritePrivateProfileString(m_strCurMaterial, "unchecked-table", string.Join(",", m_UncheckedMaterial[m_strCurMaterial].m_Tables.ToArray()), m_strPath);
}
}
public void SetSpringChecked(List<string> CheckedItems)
{
if (m_bOnLoad == true)
return;
m_UncheckedMaterial[m_strCurMaterial].m_Springs = CheckedItems;
}
public List<string> GetSpringChecked()
{
return m_UncheckedMaterial[m_strCurMaterial].m_Springs;
}
public void SetTableChecked(List<string> CheckedItems)
{
if (m_bOnLoad == true)
return;
m_UncheckedMaterial[m_strCurMaterial].m_Tables = CheckedItems;
}
public List<string> GetTableUnchecked()
{
return m_UncheckedMaterial[m_strCurMaterial].m_Tables;
}
public bool DidAgreeAlert()
{
StringBuilder temp = new StringBuilder(10240);
int iRes = GetPrivateProfileString("Agree", "agree", "", temp, 10240, m_strPath);
bool bResult = false;
bool.TryParse(temp.ToString(), out bResult);
return bResult;
}
public void SetAgreeAlert()
{
WritePrivateProfileString("Agree", "agree", "true", m_strPath);
}
public struct COLUMN_NAME
{
public static string SPRING = "SurfaceMtSpring";
public static string TABLE = "SurfaceMtCarriage";
public static string RPN = "RPN";
public static string FORCE = "normal force";
public static string TEMP = "temperature";
public static string HUMIDITY = "humidity";
public static string VELOCITY = "velocity";
}
public class OPTION
{
private static OPTION m_instance = null;
public List<string> m_RecentList = new List<string>();
public Rectangle WindowBound { set; get; }
public List<string> CheckedColumns { set; get; }
public List<string> UncheckedColumns { set; get; }
public static OPTION GetInstance()
{
if (m_instance == null)
m_instance = new OPTION();
return m_instance;
}
public void AddRecentFile(string strPath)
{
if(m_RecentList.Find(s => s==strPath) != null)
m_RecentList.Remove(strPath);
m_RecentList.Add(strPath);
}
public string GetRecentAll()
{
return string.Join(",", m_RecentList);
}
public string WindowBoundStr()
{
return string.Format("{0}, {1}, {2}, {3}", WindowBound.Left, WindowBound.Width, WindowBound.Top, WindowBound.Height);
}
public string CheckedColumnsStr()
{
string strResult = "";
if(CheckedColumns != null)
{
foreach (var item in CheckedColumns)
{
if (strResult.Length > 0)
strResult += ",";
strResult += item;
}
}
return strResult;
}
public string UncheckedColumnsStr()
{
string strResult = "";
if(UncheckedColumns != null)
{
foreach (var item in UncheckedColumns)
{
if (strResult.Length > 0)
strResult += ",";
strResult += item;
}
}
return strResult;
}
}
public class ANALYSIS
{
public enum RISK
{
NO=3,
POTENTIAL=5,
HIGH=10
}
public enum DEPENDANCY
{
NO,
POTENTIAL,
HIGH,
NOT_ENNOUGH_DATA
}
public static RISK GetRisk(float fAvg)
{
if (fAvg <= 3)
return RISK.NO;
else if (fAvg <= 5)
return RISK.POTENTIAL;
else
return RISK.HIGH;
}
public static DEPENDANCY GetDependancy(float fStdev, int iTestCnt)
{
if (iTestCnt <= 3)
return DEPENDANCY.NOT_ENNOUGH_DATA;
else if (fStdev < 3.5f)
return DEPENDANCY.NO;
else if (fStdev < 5.5f)
return DEPENDANCY.POTENTIAL;
else
return DEPENDANCY.HIGH;
}
}
}
}

View File

@@ -1,86 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OfficeOpenXml;
using System.IO;
using System.Data;
namespace friction
{
public class DataHandler
{
DataTable m_Data = new DataTable();
List<string> m_Material1 = new List<string>();
List<string> m_Material2 = new List<string>();
public void LoadData2(string strFileName)
{
FileInfo newFile = new FileInfo(strFileName);
ExcelPackage package = new ExcelPackage(newFile);
ExcelWorksheet Sheet = package.Workbook.Worksheets[1];
m_Data.Clear();
// read column
for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++)
{
string strCol = (string)Sheet.Cells[Sheet.Dimension.Start.Row, iCol].Value;
m_Data.Columns.Add(new DataColumn(strCol));
}
// read data
for (int iRow = Sheet.Dimension.Start.Row + 1; iRow <= Sheet.Dimension.End.Row; iRow++)
{
DataRow newRow = m_Data.NewRow();
for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++)
{
var value = Sheet.Cells[iRow, iCol].Value;
if (value is double)
{
float fData = (float)(double)value;
newRow[iCol-1] = fData;
}
else
{
string strData = "";
if (value != null)
strData = (string)value;
newRow[iCol-1] = strData;
}
}
m_Data.Rows.Add(newRow);
}
m_Material1 = (from r in m_Data.AsEnumerable()
select r["Material spring"]).Distinct().Cast<string>().ToList();
m_Material2 = (from r in m_Data.AsEnumerable()
select r["material 2 table"]).Distinct().Cast<string>().ToList();
Console.WriteLine("end");
}
public List<string> GetMaterial1()
{
return m_Material1;
}
public List<string> GetMaterial2()
{
return m_Material2;
}
public DataTable GetData()
{
return m_Data;
}
}
}

357
DataHandler.cs Normal file
View File

@@ -0,0 +1,357 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OfficeOpenXml;
using System.IO;
using System.Data;
namespace friction
{
public class DataHandler
{
public struct CalcResult
{
public int m_iCnt;
public float m_fAvgRPN;
public float m_fStdRPN;
public float m_fDiffByForce;
public float m_fDiffByTemp;
public float m_fDiffByHumid;
public float m_fDiffByVel;
}
public struct RADAR_CHART
{
public string m_strTable;
public float m_fMin;
public float m_fMax;
public float m_fAvg;
public int m_iCnt;
override public string ToString()
{
return string.Format("{0}: {1}-{2}-{3}", m_strTable, m_fMin, m_fAvg, m_fMax);
}
}
public struct TREND_CHART
{
public float HUMIDITY;
public float TEMPERATURE;
public float FORCE;
public float VELOCITY;
public float RPN;
override public string ToString()
{
return string.Format("Humi({0}) Temp({1}) RPN({2})", HUMIDITY, TEMPERATURE, RPN);
}
}
DataTable m_Data = new DataTable();
string m_strFileName = "";
string m_strFilePath = "";
string m_strCurSpring = "";
string m_strCurTable = "";
string m_strPrevTable = "";
List<string> m_ColumnsNames = new List<string>();
List<string> m_ActiveColumns = new List<string>();
List<string> m_NonactiveColumns = new List<string>();
List<string> m_SpringList = new List<string>();
List<string> m_TableList = new List<string>();
public DataHandler()
{
}
bool IsNumberColumn(string strColumn)
{
return (strColumn == Config.COLUMN_NAME.RPN ||
strColumn == Config.COLUMN_NAME.FORCE ||
strColumn == Config.COLUMN_NAME.TEMP ||
strColumn == Config.COLUMN_NAME.HUMIDITY ||
strColumn == Config.COLUMN_NAME.VELOCITY);
}
public void LoadData(string strFilePath)
{
using (ExcelPackage package = new ExcelPackage())
{
using (var stream = new FileStream(strFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
package.Load(stream);
ExcelWorksheet Sheet = package.Workbook.Worksheets[1];
m_Data.Columns.Clear();
m_Data.Rows.Clear();
// read column
for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++)
{
string strCol = (string)Sheet.Cells[Sheet.Dimension.Start.Row, iCol].Value;
m_Data.Columns.Add(new DataColumn(strCol, IsNumberColumn(strCol) ? typeof(float) : typeof(string)));
}
// read data
for (int iRow = Sheet.Dimension.Start.Row + 1; iRow <= Sheet.Dimension.End.Row; iRow++)
{
DataRow newRow = m_Data.NewRow();
for (int iCol = Sheet.Dimension.Start.Column; iCol <= Sheet.Dimension.End.Column; iCol++)
{
var value = Sheet.Cells[iRow, iCol].Value;
if (m_Data.Columns[iCol-1].DataType == typeof(float))
{
float fData = 0;
if (value != null)
{
if (value is string)
float.TryParse((string)value, out fData);
else
fData = (float)(double)value;
}
newRow[iCol - 1] = fData;
}
else
{
string strData = "";
if (value != null)
{
strData = value.ToString();
strData = strData.Trim();
}
newRow[iCol - 1] = strData;
}
}
m_Data.Rows.Add(newRow);
}
m_strFilePath = strFilePath;
int iSeperate = strFilePath.LastIndexOf('\\');
m_strFileName = strFilePath.Substring(iSeperate+1);
}
m_SpringList = (from r in m_Data.AsEnumerable()
select r[Config.COLUMN_NAME.SPRING]).Distinct().Cast<string>().ToList();
m_TableList = (from r in m_Data.AsEnumerable()
select r[Config.COLUMN_NAME.TABLE]).Distinct().Cast<string>().ToList();
m_strPrevTable = m_TableList[0];
m_ColumnsNames = (from c in m_Data.Columns.Cast<DataColumn>()
select c.ColumnName).ToList<string>();
m_ActiveColumns.Clear();
m_NonactiveColumns.Clear();
for (int i=0; i< m_ColumnsNames.Count; i++)
{
if(m_Data.Columns[i].DataType == typeof(string))
{
if(m_Data.AsEnumerable().Any(r => (string)r[i] != ""))
m_ActiveColumns.Add(m_ColumnsNames[i]);
else
m_NonactiveColumns.Add(m_ColumnsNames[i]);
}
else
{
m_ActiveColumns.Add(m_ColumnsNames[i]);
}
}
SetSelectedMaterial("", "");
}
public void SetSelectedMaterial(string strSpring, string strTable)
{
m_strCurSpring = strSpring;
m_strPrevTable = m_strCurTable;
m_strCurTable = strTable;
}
public string GetCurSpring()
{
return m_strCurSpring;
}
public string GetCurTable()
{
return m_strCurTable;
}
public List<RADAR_CHART> GetAvgAll(string strSpring, Config.RANGE TempCond, Config.RANGE HumidCond)
{
string strQuery = string.Format("[{0}]='{1}' and [{2}]>={3} and [{2}]<={4} and [{5}]>={6} and [{5}]<={7}",
Config.COLUMN_NAME.SPRING, strSpring,
Config.COLUMN_NAME.TEMP, TempCond.m_fLow, TempCond.m_fHigh,
Config.COLUMN_NAME.HUMIDITY, HumidCond.m_fLow, HumidCond.m_fHigh);
DataRow[] rows = null;
try{
rows = m_Data.Select(strQuery);
}
catch{
return new List<RADAR_CHART>();
}
var group = rows.GroupBy(r => r[Config.COLUMN_NAME.TABLE]);
List<RADAR_CHART> result = rows
.GroupBy(r => r[Config.COLUMN_NAME.TABLE])
.Select(t => new RADAR_CHART
{
m_strTable = t.Key.ToString(),
m_iCnt = t.Count(),
m_fMin = t.Min(k => (float)k[Config.COLUMN_NAME.RPN]),
m_fMax = t.Max(k => (float)k[Config.COLUMN_NAME.RPN]),
m_fAvg = t.Average(k => (float)k[Config.COLUMN_NAME.RPN])
})
.ToList<RADAR_CHART>();
return result;
}
public List<TREND_CHART> GetTrendChart(string strSpring, string strTable)
{
List<TREND_CHART> result = new List<TREND_CHART>();
if (m_Data.Rows.Count == 0)
return result;
string strQuery = string.Format("[{0}]='{1}' and [{2}]='{3}'", Config.COLUMN_NAME.SPRING, strSpring, Config.COLUMN_NAME.TABLE, strTable);
DataRow[] rows = m_Data.Select(strQuery);
foreach(DataRow r in rows)
{
result.Add(new TREND_CHART
{
HUMIDITY = (float)r[Config.COLUMN_NAME.HUMIDITY],
TEMPERATURE = (float)r[Config.COLUMN_NAME.TEMP],
FORCE = (float)r[Config.COLUMN_NAME.FORCE],
VELOCITY = (float)r[Config.COLUMN_NAME.VELOCITY],
RPN = (float)r[Config.COLUMN_NAME.RPN],
});
}
return result;
}
public List<float> GetMaxes(string strSpring, string strTable)
{
List<float> result = new List<float>();
Config.RANGE[] aTemp = new Config.RANGE[] { Config.TEMP_NORMAL, Config.TEMP_NORMAL, Config.TEMP_HIGH, Config.TEMP_HIGH, Config.TEMP_LOW };
Config.RANGE[] aHumidity = new Config.RANGE[] { Config.HUMID_LOW, Config.HUMID_HIGH, Config.HUMID_LOW, Config.HUMID_HIGH, Config.HUMID_ALL };
for(int i=0; i<aTemp.Length; i++)
{
string strQuery = string.Format("[{0}]='{1}' and [{2}]='{3}' and [{4}] >= {5} and [{4}] <= {6} and [{7}] >= {8} and [{7}] <= {9}",
Config.COLUMN_NAME.SPRING, strSpring, Config.COLUMN_NAME.TABLE, strTable,
Config.COLUMN_NAME.TEMP, aTemp[i].m_fLow, aTemp[i].m_fHigh,
Config.COLUMN_NAME.HUMIDITY, aHumidity[i].m_fLow, aHumidity[i].m_fHigh);
var rows = m_Data.Select(strQuery);
float fValue = 0;
if(rows.Length > 0)
fValue = rows.Max(t => (float)t[Config.COLUMN_NAME.RPN]);
result.Add(fValue);
}
return result;
}
#region calculation
float CalcDependency(DataRow[] rows, string strColumn)
{
// 각 그룹의 평균들의 표준편차
var AvgOfGroup = rows
.GroupBy(r => r[strColumn])
.Select(t => t.Average(k => (float)k[Config.COLUMN_NAME.RPN]));
var Avg = AvgOfGroup.Average();
var Squares = AvgOfGroup.Select(r => (r - Avg) * (r - Avg));
var result = (float)Math.Sqrt(Squares.Average());
return result;
}
public CalcResult GetCalc(string strSpring, string strTable)
{
CalcResult result = new CalcResult();
string strQuery = string.Format("[{0}]='{1}' and [{2}]='{3}'", Config.COLUMN_NAME.SPRING, strSpring, Config.COLUMN_NAME.TABLE, strTable);
DataRow[] rows = m_Data.Select(strQuery);
if (rows.Length > 0)
{
result.m_iCnt = rows.Length;
result.m_fAvgRPN = rows.Average(r => (float)r[Config.COLUMN_NAME.RPN]);
result.m_fStdRPN = rows.Average(r => (float)Math.Pow((float)r[Config.COLUMN_NAME.RPN] - result.m_fAvgRPN, 2));
result.m_fStdRPN = (float)Math.Sqrt(result.m_fStdRPN);
result.m_fDiffByForce = CalcDependency(rows, Config.COLUMN_NAME.FORCE);
result.m_fDiffByTemp = CalcDependency(rows, Config.COLUMN_NAME.TEMP);
result.m_fDiffByHumid = CalcDependency(rows, Config.COLUMN_NAME.HUMIDITY);
result.m_fDiffByVel = CalcDependency(rows, Config.COLUMN_NAME.VELOCITY);
}
else
{
}
return result;
}
#endregion
#region get
public DataTable GetData()
{
return m_Data;
}
public string GetFilePath()
{
return m_strFilePath;
}
public string GetFileName()
{
return m_strFileName;
}
public List<string> GetSpringList()
{
return m_SpringList;
}
public string GetPrevTable()
{
return m_strPrevTable;
}
public List<string> GetTableList()
{
return m_TableList;
}
public List<string> GetColumns()
{
return m_ColumnsNames;
}
public List<string> GetActiveColumns()
{
return m_ActiveColumns;
}
public List<string> GetNonactiveColumns()
{
return m_NonactiveColumns;
}
#endregion
}
}

124
ExcelHelper.cs Normal file
View File

@@ -0,0 +1,124 @@
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace friction
{
public class ExcelHelper
{
//The correct method to convert width to pixel is:
//Pixel =Truncate(((256 * {width} + Truncate(128/{Maximum DigitWidth}))/256)*{Maximum Digit Width})
//The correct method to convert pixel to width is:
//1. use the formula =Truncate(({pixels}-5)/{Maximum Digit Width} * 100+0.5)/100
// to convert pixel to character number.
//2. use the formula width = Truncate([{Number of Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256
// to convert the character number to width.
public const int MTU_PER_PIXEL = 9525;
public static int ColumnWidth2Pixel(ExcelWorksheet ws, double excelColumnWidth)
{
//The correct method to convert width to pixel is:
//Pixel =Truncate(((256 * {width} + Truncate(128/{Maximum DigitWidth}))/256)*{Maximum Digit Width})
//get the maximum digit width
decimal mdw = ws.Workbook.MaxFontWidth;
//convert width to pixel
decimal pixels = decimal.Truncate(((256 * (decimal)excelColumnWidth + decimal.Truncate(128 / mdw)) / 256) * mdw);
//double columnWidthInTwips = (double)(pixels * (1440f / 96f));
return Convert.ToInt32(pixels);
}
public static int Column2Pixel(ExcelWorksheet ws, int iColumn)
{
double dX = 0;
for (int i = 1; i < iColumn; i++)
dX += ColumnWidth2Pixel(ws, ws.Column(i).Width);
return (int)dX;
}
public static double Pixel2ColumnWidth(ExcelWorksheet ws, int pixels)
{
//The correct method to convert pixel to width is:
//1. use the formula =Truncate(({pixels}-5)/{Maximum Digit Width} * 100+0.5)/100
// to convert pixel to character number.
//2. use the formula width = Truncate([{Number of Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256
// to convert the character number to width.
//get the maximum digit width
decimal mdw = ws.Workbook.MaxFontWidth;
//convert pixel to character number
decimal numChars = decimal.Truncate(decimal.Add((pixels - 5) / mdw * 100, (decimal)0.5)) / 100;
//convert the character number to width
decimal excelColumnWidth = decimal.Truncate((decimal.Add(numChars * mdw, 5)) / mdw * 256) / 256;
return Convert.ToDouble(excelColumnWidth);
}
public static int Pixel2NextColumn(ExcelWorksheet ws, int iCol, int iPixels)
{
while (iPixels > 0)
iPixels -= ColumnWidth2Pixel(ws, ws.Column(iCol++).Width);
return iCol;
}
public static int RowHeight2Pixel(double excelRowHeight)
{
//convert height to pixel
decimal pixels = decimal.Truncate((decimal)(excelRowHeight / 0.75));
return Convert.ToInt32(pixels);
}
public static int Row2Pixel(ExcelWorksheet ws, int iRow)
{
int iY = 0;
for (int i = 1; i < iRow; i++)
iY += RowHeight2Pixel(ws.Row(i).Height);
return iY;
}
public static double Pixel2RowHeight(int pixels)
{
//convert height to pixel
double excelRowHeight = pixels * 0.75;
return excelRowHeight;
}
public static int Pixel2NextRow(ExcelWorksheet ws, int iRow, int iPixels)
{
double dPixels = iPixels;
while(dPixels > 0)
dPixels -= RowHeight2Pixel(ws.Row(iRow++).Height);
return iRow;
}
public static int MTU2Pixel(int mtus)
{
//convert MTU to pixel
decimal pixels = decimal.Truncate(mtus / MTU_PER_PIXEL);
return Convert.ToInt32(pixels);
}
public static int Pixel2MTU(int pixels)
{
//convert pixel to MTU
int mtus = pixels * MTU_PER_PIXEL;
return mtus;
}
}
}

335
MainForm.Designer.cs generated
View File

@@ -31,42 +31,166 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.toolStripMain = new System.Windows.Forms.ToolStrip();
this.toolStripButtonOpen = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButtonMaterial = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButtonResult = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonAnalysis = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonMap = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButtonTrendGraph = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonRadarGraph = new System.Windows.Forms.ToolStripButton();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.menuStrip = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resultTableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.analysisTableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.materialCompatibilityMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.graphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.trendGraphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.radarGraphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.reportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.allToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.preferenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new friction.ExtendedToolStripSeparator();
this.aToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
this.toolStripMain.SuspendLayout();
this.statusStrip.SuspendLayout();
this.menuStrip.SuspendLayout();
this.SuspendLayout();
//
// toolStripMain
//
this.toolStripMain.AutoSize = false;
this.toolStripMain.Font = new System.Drawing.Font("Malgun Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.toolStripMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStripMain.ImageScalingSize = new System.Drawing.Size(24, 24);
this.toolStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButtonOpen});
this.toolStripMain.Location = new System.Drawing.Point(0, 0);
this.toolStripButtonOpen,
this.toolStripSeparator1,
this.toolStripButtonMaterial,
this.toolStripSeparator3,
this.toolStripButtonResult,
this.toolStripButtonAnalysis,
this.toolStripButtonMap,
this.toolStripSeparator2,
this.toolStripButtonTrendGraph,
this.toolStripButtonRadarGraph});
this.toolStripMain.Location = new System.Drawing.Point(0, 28);
this.toolStripMain.Name = "toolStripMain";
this.toolStripMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.toolStripMain.Size = new System.Drawing.Size(947, 25);
this.toolStripMain.Size = new System.Drawing.Size(1184, 32);
this.toolStripMain.TabIndex = 0;
this.toolStripMain.Text = "toolStrip1";
//
// toolStripButtonOpen
//
this.toolStripButtonOpen.AutoSize = false;
this.toolStripButtonOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonOpen.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonOpen.Image")));
this.toolStripButtonOpen.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonOpen.Name = "toolStripButtonOpen";
this.toolStripButtonOpen.Size = new System.Drawing.Size(23, 22);
this.toolStripButtonOpen.Text = "toolStripButton1";
this.toolStripButtonOpen.Size = new System.Drawing.Size(32, 29);
this.toolStripButtonOpen.Text = "Open DB";
this.toolStripButtonOpen.ToolTipText = "Open DB (Ctrl+O)";
this.toolStripButtonOpen.Click += new System.EventHandler(this.toolStripButtonOpen_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 32);
//
// toolStripButtonMaterial
//
this.toolStripButtonMaterial.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonMaterial.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonMaterial.Image")));
this.toolStripButtonMaterial.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonMaterial.Name = "toolStripButtonMaterial";
this.toolStripButtonMaterial.Size = new System.Drawing.Size(28, 29);
this.toolStripButtonMaterial.Text = "toolStripButton1";
this.toolStripButtonMaterial.ToolTipText = "Material Pair (Ctrl+M)";
this.toolStripButtonMaterial.Click += new System.EventHandler(this.toolStripButtonMaterial_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 32);
//
// toolStripButtonResult
//
this.toolStripButtonResult.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonResult.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonResult.Image")));
this.toolStripButtonResult.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonResult.Name = "toolStripButtonResult";
this.toolStripButtonResult.Size = new System.Drawing.Size(28, 29);
this.toolStripButtonResult.Text = "toolStripButton1";
this.toolStripButtonResult.ToolTipText = "Result Table (Ctrl+R)";
this.toolStripButtonResult.Click += new System.EventHandler(this.toolStripButtonResult_Click);
//
// toolStripButtonAnalysis
//
this.toolStripButtonAnalysis.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonAnalysis.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonAnalysis.Image")));
this.toolStripButtonAnalysis.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonAnalysis.Name = "toolStripButtonAnalysis";
this.toolStripButtonAnalysis.Size = new System.Drawing.Size(28, 29);
this.toolStripButtonAnalysis.Text = "toolStripButton2";
this.toolStripButtonAnalysis.ToolTipText = "Analysis Table (Ctrl+A)";
this.toolStripButtonAnalysis.Click += new System.EventHandler(this.toolStripButtonAnalysis_Click);
//
// toolStripButtonMap
//
this.toolStripButtonMap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonMap.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonMap.Image")));
this.toolStripButtonMap.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonMap.Name = "toolStripButtonMap";
this.toolStripButtonMap.Size = new System.Drawing.Size(28, 29);
this.toolStripButtonMap.Text = "toolStripButton1";
this.toolStripButtonMap.ToolTipText = "Material Compatibility Map";
this.toolStripButtonMap.Click += new System.EventHandler(this.toolStripButtonMap_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 32);
//
// toolStripButtonTrendGraph
//
this.toolStripButtonTrendGraph.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonTrendGraph.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonTrendGraph.Image")));
this.toolStripButtonTrendGraph.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonTrendGraph.Name = "toolStripButtonTrendGraph";
this.toolStripButtonTrendGraph.Size = new System.Drawing.Size(28, 29);
this.toolStripButtonTrendGraph.Text = "toolStripButton4";
this.toolStripButtonTrendGraph.ToolTipText = "Trend Graph (Ctrl+T)";
this.toolStripButtonTrendGraph.Click += new System.EventHandler(this.toolStripButtonTrendGraph_Click);
//
// toolStripButtonRadarGraph
//
this.toolStripButtonRadarGraph.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButtonRadarGraph.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonRadarGraph.Image")));
this.toolStripButtonRadarGraph.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButtonRadarGraph.Name = "toolStripButtonRadarGraph";
this.toolStripButtonRadarGraph.Size = new System.Drawing.Size(28, 29);
this.toolStripButtonRadarGraph.Text = "toolStripButton3";
this.toolStripButtonRadarGraph.ToolTipText = "Radar Graph (Ctrl+D)";
this.toolStripButtonRadarGraph.Click += new System.EventHandler(this.toolStripButtonRadarGraph_Click);
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel});
this.statusStrip.Location = new System.Drawing.Point(0, 623);
this.statusStrip.Location = new System.Drawing.Point(0, 739);
this.statusStrip.Name = "statusStrip";
this.statusStrip.Size = new System.Drawing.Size(947, 22);
this.statusStrip.Size = new System.Drawing.Size(1184, 22);
this.statusStrip.TabIndex = 1;
this.statusStrip.Text = "statusStrip1";
//
@@ -76,28 +200,189 @@
this.toolStripStatusLabel.Size = new System.Drawing.Size(122, 17);
this.toolStripStatusLabel.Text = "Please open database";
//
// menuStrip
//
this.menuStrip.BackColor = System.Drawing.SystemColors.Control;
this.menuStrip.Font = new System.Drawing.Font("Malgun Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.tableToolStripMenuItem,
this.graphToolStripMenuItem,
this.reportToolStripMenuItem,
this.preferenceToolStripMenuItem,
this.aToolStripMenuItem});
this.menuStrip.Location = new System.Drawing.Point(0, 0);
this.menuStrip.Name = "menuStrip";
this.menuStrip.Size = new System.Drawing.Size(1184, 28);
this.menuStrip.TabIndex = 3;
this.menuStrip.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openDBToolStripMenuItem,
this.recentToolStripMenuItem,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24);
this.fileToolStripMenuItem.Text = "File";
//
// openDBToolStripMenuItem
//
this.openDBToolStripMenuItem.Name = "openDBToolStripMenuItem";
this.openDBToolStripMenuItem.Size = new System.Drawing.Size(141, 24);
this.openDBToolStripMenuItem.Text = "Open DB";
this.openDBToolStripMenuItem.Click += new System.EventHandler(this.openDBToolStripMenuItem_Click);
//
// recentToolStripMenuItem
//
this.recentToolStripMenuItem.Name = "recentToolStripMenuItem";
this.recentToolStripMenuItem.Size = new System.Drawing.Size(141, 24);
this.recentToolStripMenuItem.Text = "Recent";
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(141, 24);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// tableToolStripMenuItem
//
this.tableToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.resultTableToolStripMenuItem,
this.analysisTableToolStripMenuItem,
this.materialCompatibilityMapToolStripMenuItem});
this.tableToolStripMenuItem.Name = "tableToolStripMenuItem";
this.tableToolStripMenuItem.Size = new System.Drawing.Size(58, 24);
this.tableToolStripMenuItem.Text = "Table";
//
// resultTableToolStripMenuItem
//
this.resultTableToolStripMenuItem.Name = "resultTableToolStripMenuItem";
this.resultTableToolStripMenuItem.Size = new System.Drawing.Size(266, 24);
this.resultTableToolStripMenuItem.Text = "Result Table";
this.resultTableToolStripMenuItem.Click += new System.EventHandler(this.resultTableToolStripMenuItem_Click);
//
// analysisTableToolStripMenuItem
//
this.analysisTableToolStripMenuItem.Name = "analysisTableToolStripMenuItem";
this.analysisTableToolStripMenuItem.Size = new System.Drawing.Size(266, 24);
this.analysisTableToolStripMenuItem.Text = "Analysis Table";
this.analysisTableToolStripMenuItem.Click += new System.EventHandler(this.analysisTableToolStripMenuItem_Click);
//
// materialCompatibilityMapToolStripMenuItem
//
this.materialCompatibilityMapToolStripMenuItem.Name = "materialCompatibilityMapToolStripMenuItem";
this.materialCompatibilityMapToolStripMenuItem.Size = new System.Drawing.Size(266, 24);
this.materialCompatibilityMapToolStripMenuItem.Text = "Material Compatibility Map";
this.materialCompatibilityMapToolStripMenuItem.Click += new System.EventHandler(this.materialCompatibilityMapToolStripMenuItem_Click);
//
// graphToolStripMenuItem
//
this.graphToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.trendGraphToolStripMenuItem,
this.radarGraphToolStripMenuItem});
this.graphToolStripMenuItem.Name = "graphToolStripMenuItem";
this.graphToolStripMenuItem.Size = new System.Drawing.Size(63, 24);
this.graphToolStripMenuItem.Text = "Graph";
//
// trendGraphToolStripMenuItem
//
this.trendGraphToolStripMenuItem.Name = "trendGraphToolStripMenuItem";
this.trendGraphToolStripMenuItem.Size = new System.Drawing.Size(164, 24);
this.trendGraphToolStripMenuItem.Text = "Trend Graph";
this.trendGraphToolStripMenuItem.Click += new System.EventHandler(this.trendGraphToolStripMenuItem_Click);
//
// radarGraphToolStripMenuItem
//
this.radarGraphToolStripMenuItem.Name = "radarGraphToolStripMenuItem";
this.radarGraphToolStripMenuItem.Size = new System.Drawing.Size(164, 24);
this.radarGraphToolStripMenuItem.Text = "Radar Graph";
this.radarGraphToolStripMenuItem.Click += new System.EventHandler(this.radarGraphToolStripMenuItem_Click);
//
// reportToolStripMenuItem
//
this.reportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.allToolStripMenuItem});
this.reportToolStripMenuItem.Name = "reportToolStripMenuItem";
this.reportToolStripMenuItem.Size = new System.Drawing.Size(66, 24);
this.reportToolStripMenuItem.Text = "Report";
//
// allToolStripMenuItem
//
this.allToolStripMenuItem.Name = "allToolStripMenuItem";
this.allToolStripMenuItem.Size = new System.Drawing.Size(179, 24);
this.allToolStripMenuItem.Text = "Export to Excel";
this.allToolStripMenuItem.Click += new System.EventHandler(this.allToolStripMenuItem_Click);
//
// preferenceToolStripMenuItem
//
this.preferenceToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.toolStripSeparator4});
this.preferenceToolStripMenuItem.Name = "preferenceToolStripMenuItem";
this.preferenceToolStripMenuItem.Size = new System.Drawing.Size(93, 24);
this.preferenceToolStripMenuItem.Text = "Preference";
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(108, 24);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(105, 6);
//
// aToolStripMenuItem
//
this.aToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.aboutToolStripMenuItem});
this.aToolStripMenuItem.Name = "aToolStripMenuItem";
this.aToolStripMenuItem.Size = new System.Drawing.Size(53, 24);
this.aToolStripMenuItem.Text = "Help";
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(120, 24);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// dockPanel
//
this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel.Location = new System.Drawing.Point(0, 25);
this.dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
this.dockPanel.Location = new System.Drawing.Point(0, 60);
this.dockPanel.Name = "dockPanel";
this.dockPanel.Size = new System.Drawing.Size(947, 598);
this.dockPanel.Size = new System.Drawing.Size(1184, 679);
this.dockPanel.TabIndex = 2;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(947, 645);
this.ClientSize = new System.Drawing.Size(1184, 761);
this.Controls.Add(this.dockPanel);
this.Controls.Add(this.statusStrip);
this.Controls.Add(this.toolStripMain);
this.Controls.Add(this.menuStrip);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip;
this.MinimumSize = new System.Drawing.Size(800, 600);
this.Name = "MainForm";
this.Text = "Form1";
this.Text = "Material Stick-Slip Analysis";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Shown += new System.EventHandler(this.MainForm_Shown);
this.toolStripMain.ResumeLayout(false);
this.toolStripMain.PerformLayout();
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.menuStrip.ResumeLayout(false);
this.menuStrip.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -110,6 +395,34 @@
private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;
private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton toolStripButtonResult;
private System.Windows.Forms.ToolStripButton toolStripButtonAnalysis;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton toolStripButtonRadarGraph;
private System.Windows.Forms.ToolStripButton toolStripButtonTrendGraph;
private System.Windows.Forms.MenuStrip menuStrip;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openDBToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem recentToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem tableToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem resultTableToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem analysisTableToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem graphToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem radarGraphToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem trendGraphToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem reportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem allToolStripMenuItem;
private System.Windows.Forms.ToolStripButton toolStripButtonMaterial;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem aToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripButton toolStripButtonMap;
private System.Windows.Forms.ToolStripMenuItem materialCompatibilityMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem preferenceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private ExtendedToolStripSeparator toolStripSeparator4;
}
}

View File

@@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -14,46 +15,559 @@ namespace friction
public partial class MainForm : Form
{
string m_DBFileName = "";
DataHandler m_DataLoader = new DataHandler();
TablePanel m_TablePanel = null;
RowPanel m_RowPanel = null;
DataHandler m_DataHandler = new DataHandler();
PanelMaterial m_MaterialPanel = null;
PanelResult m_ResultPanel = null;
PanelAnalysis m_AnalysisPanel = null;
PanelCompatibility m_CompatibilityPanel = null;
PanelRadarGraph m_RadarGraphPanel = null;
PanelTrendGraph m_TrendGraphPanel = null;
Report m_Report = null;
ToolStripMenuItem m_CurPref = null;
public MainForm()
{
InitializeComponent();
dockPanel.Theme = new VS2015DarkTheme();
m_TablePanel = new TablePanel(this);
m_RowPanel = new RowPanel(this);
m_MaterialPanel = new PanelMaterial(this);
m_ResultPanel = new PanelResult(this);
m_AnalysisPanel = new PanelAnalysis(this);
m_CompatibilityPanel = new PanelCompatibility(this, m_DataHandler);
m_RadarGraphPanel = new PanelRadarGraph(this, m_DataHandler);
m_TrendGraphPanel = new PanelTrendGraph(this, m_DataHandler);
Config.GetInstance().Init();
UpdateRecentFile();
UpdatePreference();
if(Config.OPTION.GetInstance().WindowBound.Width > 0)
Bounds = Config.OPTION.GetInstance().WindowBound;
Theme.Apply(this);
Theme.Apply(menuStrip);
Theme.Apply(toolStripMain);
Theme.Apply(statusStrip);
dockPanel.Font = new Font(dockPanel.Font.FontFamily, 12.0f);
}
private void toolStripButtonOpen_Click(object sender, EventArgs e)
private void MainForm_Shown(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_DataLoader.LoadData2(m_DBFileName);
UpdateTablePanel();
//if (Config.GetInstance().DidAgreeAlert() == true)
// return;
toolStripStatusLabel.Text = m_DBFileName;
AlertPopup alert = new AlertPopup();
DialogResult alertResult = alert.ShowDialog();
if (alertResult == DialogResult.OK)
Config.GetInstance().SetAgreeAlert();
else
Application.Exit();
}
void UpdateRecentFile()
{
recentToolStripMenuItem.DropDownItems.Clear();
foreach (string file in Enumerable.Reverse(Config.OPTION.GetInstance().m_RecentList))
{
ToolStripItem item = recentToolStripMenuItem.DropDownItems.Add(file);
item.BackColor = Theme.Backcolor;
item.ForeColor = Theme.Forecolor;
item.Click += RecentToolStripMenuItem_Click;
}
}
private void UpdateTablePanel()
private void RecentToolStripMenuItem_Click(object sender, EventArgs e)
{
m_TablePanel.UpdateData(m_DataLoader);
if(m_TablePanel.Visible == false)
m_TablePanel.Show(dockPanel);
string strFile = ((ToolStripItem)sender).Text;
OpenDB(strFile);
}
public void OnApplyData()
public void OnSpringCheckChanged(string strItem, bool bChecked)
{
m_RowPanel.UpdateData(m_DataLoader);
if (m_RowPanel.Visible == false)
m_RowPanel.Show(dockPanel);
m_CompatibilityPanel.SpringCheckChanged(strItem, bChecked);
}
public void OnTableCheckChanged(string strItem, bool bChecked)
{
m_CompatibilityPanel.TableCheckChanged(strItem, bChecked);
m_AnalysisPanel.TableCheckChanged(strItem, bChecked);
m_RadarGraphPanel.UpdateGraph();
}
private void OpenDB(string strFile=null)
{
if (strFile == null)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "엑셀 파일 (*.xlsx)|*.xlsx|엑셀 파일 (*.xls)|*.xls|전체|*";
DialogResult result = ofd.ShowDialog();
if (result == DialogResult.OK)
m_DBFileName = ofd.FileName;
else
return;
}
else
{
m_DBFileName = strFile;
}
Config.GetInstance().m_bOnLoad = true;
Config.GetInstance().Load();
Cursor.Current = Cursors.WaitCursor;
m_DataHandler.LoadData(m_DBFileName);
m_MaterialPanel.UpdateData(m_DataHandler);
OpenPanel(m_MaterialPanel);
m_ResultPanel.UpdateData(m_DataHandler);
OpenPanel(m_ResultPanel);
m_AnalysisPanel.Reset();
m_AnalysisPanel.UpdateData(m_DataHandler);
OpenPanel(m_AnalysisPanel);
m_TrendGraphPanel.UpdateGraph();
OpenPanel(m_TrendGraphPanel);
m_RadarGraphPanel.UpdateGraph();
OpenPanel(m_RadarGraphPanel);
m_CompatibilityPanel.UpdateData();
OpenPanel(m_CompatibilityPanel);
toolStripStatusLabel.Text = m_DBFileName;
Config.OPTION.GetInstance().AddRecentFile(m_DBFileName);
UpdateRecentFile();
Config.GetInstance().m_bOnLoad = false;
LoadPref(Config.GetInstance().m_strCurMaterial);
Cursor.Current = Cursors.Default;
}
public void OpenPanel(DockContent panel)
{
if (panel.Visible == false)
panel.Show(dockPanel);
if (panel.IsHidden == true)
panel.IsHidden = false;
panel.ShowIcon = true;
if (panel.DockState == DockState.DockTopAutoHide ||
panel.DockState == DockState.DockBottomAutoHide ||
panel.DockState == DockState.DockLeftAutoHide ||
panel.DockState == DockState.DockRightAutoHide)
{
dockPanel.ActiveAutoHideContent = panel;
}
}
#region Events from menu
private void openDBToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenDB();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void resultTableToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenPanel(m_ResultPanel);
}
private void analysisTableToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenPanel(m_AnalysisPanel);
}
private void materialCompatibilityMapToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenPanel(m_CompatibilityPanel);
m_CompatibilityPanel.UpdateData();
}
private void radarGraphToolStripMenuItem_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() != "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), "All");
OpenPanel(m_RadarGraphPanel);
m_RadarGraphPanel.UpdateGraph();
}
private void trendGraphToolStripMenuItem_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetPrevTable());
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.UpdateGraph();
}
private void allToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "엑셀 파일 (*.xlsx)|*.xlsx|엑셀 파일 (*.xls)|*.xls|전체|*";
DialogResult result = sfd.ShowDialog();
string strFilePath = "";
if (result == DialogResult.OK)
strFilePath = sfd.FileName;
else
return;
Cursor.Current = Cursors.WaitCursor;
m_Report = new Report();
m_Report.FilePath = strFilePath;
m_Report.MaterialSpring = m_DataHandler.GetCurSpring();
m_Report.MaterialTable = m_DataHandler.GetCurTable();
m_Report.AnalysisData = m_AnalysisPanel.GetData();
object[] CompData = m_CompatibilityPanel.GetData();
m_Report.CompatibilityData = (DataTable)CompData[0];
m_Report.CompatibilityColumns = (List<string>)CompData[1];
m_Report.CompatibilityRows = (List<string>)CompData[2];
m_Report.RadarChart = m_RadarGraphPanel.CopyChart();
if(m_DataHandler.GetCurTable() != "" && m_DataHandler.GetCurTable() != "All")
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetPrevTable());
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.CopyChart(PanelTrendGraph.GRAPH_TYPE.HUMIDITY);
}
else
{
m_Report.Export();
m_Report = null;
Cursor.Current = Cursors.Default;
}
}
public void OnChartUpdate(Bitmap bm, PanelTrendGraph.GRAPH_TYPE Type)
{
switch(Type)
{
case PanelTrendGraph.GRAPH_TYPE.HUMIDITY:
m_Report.TrendChartByHumidity = bm;
m_TrendGraphPanel.CopyChart(PanelTrendGraph.GRAPH_TYPE.TEMPERATURE);
break;
case PanelTrendGraph.GRAPH_TYPE.TEMPERATURE:
m_Report.TrendChartByTemperature = bm;
m_TrendGraphPanel.CopyChart(PanelTrendGraph.GRAPH_TYPE.FORCE);
break;
case PanelTrendGraph.GRAPH_TYPE.FORCE:
m_Report.TrendChartByForce = bm;
m_TrendGraphPanel.CopyChart(PanelTrendGraph.GRAPH_TYPE.VELOCITY);
break;
case PanelTrendGraph.GRAPH_TYPE.VELOCITY:
m_Report.TrendChartByVelocity = bm;
m_Report.Export();
m_Report = null;
Cursor.Current = Cursors.Default;
break;
}
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutBox aboutWindow = new AboutBox();
aboutWindow.ShowDialog();
}
#endregion
#region Events from toolbox
private void toolStripButtonOpen_Click(object sender, EventArgs e)
{
OpenDB();
}
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 toolStripButtonMap_Click(object sender, EventArgs e)
{
OpenPanel(m_CompatibilityPanel);
m_CompatibilityPanel.UpdateData();
}
private void toolStripButtonRadarGraph_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() != "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), "All");
OpenPanel(m_RadarGraphPanel);
m_RadarGraphPanel.UpdateGraph();
}
private void toolStripButtonTrendGraph_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() == "All")
{
string strSpring = m_DataHandler.GetCurSpring();
string strTable = m_DataHandler.GetPrevTable();
OnApplyData(this, strSpring, strTable);
}
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.UpdateGraph();
}
#endregion
#region Events from panels
public void OnApplyData(object sender, string strSpring, string strTable)
{
Console.WriteLine("[MainForm::OnApply] start");
m_DataHandler.SetSelectedMaterial(strSpring, strTable);
if (strTable == "All")
{
if (m_RadarGraphPanel != null)
m_RadarGraphPanel.UpdateGraph();
if (m_TrendGraphPanel != null)
m_TrendGraphPanel.UpdateGraph();
}
else
{
if (m_TrendGraphPanel != null)
m_TrendGraphPanel.UpdateGraph();
if (m_RadarGraphPanel != null && m_RadarGraphPanel.Visible == true)
{
OnApplyData(this, strSpring, "All");
return;
}
}
if (sender != m_MaterialPanel)
{
m_MaterialPanel.SelectSpring(strSpring);
m_MaterialPanel.SelectTable(strTable);
}
m_AnalysisPanel.UpdateData(m_DataHandler);
}
public void OnRadarSelectTable(string strTable)
{
if (m_AnalysisPanel != null)
m_AnalysisPanel.SelectRow(strTable);
OpenPanel(m_AnalysisPanel);
}
public void OnTrendSelectByHumidity(string strSpring, string strTable, float fHumidity, float fRPN)
{
if (m_ResultPanel != null)
m_ResultPanel.SelectRowByHumidity(strSpring, strTable, fHumidity, fRPN);
OpenPanel(m_ResultPanel);
}
public void OnTrendSelectByTemperature(string strSpring, string strTable, float fTemperature, float fRPN)
{
if (m_ResultPanel != null)
m_ResultPanel.SelectRowByTemperature(strSpring, strTable, fTemperature, fRPN);
OpenPanel(m_ResultPanel);
}
public void OnTrendSelectByForce(string strSpring, string strTable, float fTemperature, float fRPN)
{
if (m_ResultPanel != null)
m_ResultPanel.SelectRowByForce(strSpring, strTable, fTemperature, fRPN);
OpenPanel(m_ResultPanel);
}
public void OnTrendSelectByVelocity(string strSpring, string strTable, float fTemperature, float fRPN)
{
if (m_ResultPanel != null)
m_ResultPanel.SelectRowByVelocity(strSpring, strTable, fTemperature, fRPN);
OpenPanel(m_ResultPanel);
}
#endregion
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
Config.OPTION.GetInstance().WindowBound = this.Bounds;
Config.OPTION.GetInstance().CheckedColumns = m_ResultPanel.GetCheckedColumns();
Config.OPTION.GetInstance().UncheckedColumns = m_ResultPanel.GetUncheckedColumns();
Config.GetInstance().Save(false);
}
#region preference
void UpdatePreference()
{
foreach (string pref in Config.GetInstance().m_UncheckedMaterial.Keys)
{
ToolStripMenuItem item = new ToolStripMenuItem(pref);
ToolStripItem load = item.DropDownItems.Add("Load");
load.Click += PreferenceLoadClick;
ToolStripItem save = item.DropDownItems.Add("Save");
save.Click += PreferenceSaveClick;
if (pref != "Default")
{
ToolStripItem remove = item.DropDownItems.Add("Remove");
remove.Click += PreferenceRemoveClick;
}
preferenceToolStripMenuItem.DropDownItems.Add(item);
if (pref == Config.GetInstance().m_strCurMaterial)
{
item.Text = "ㆍ" + pref;
m_CurPref = item;
}
}
}
private void SelectPref(string strPrefName)
{
foreach (ToolStripItem menuitem in preferenceToolStripMenuItem.DropDownItems)
{
if (menuitem.Text.StartsWith("ㆍ") == true)
menuitem.Text = menuitem.Text.Substring("ㆍ".Length);
if (menuitem.Text == strPrefName)
{
menuitem.Text = "ㆍ" + menuitem.Text;
m_CurPref = (ToolStripMenuItem)menuitem;
}
}
}
private void LoadPref(string strPrefName)
{
Config.GetInstance().m_strCurMaterial = strPrefName;
m_MaterialPanel.LoadUncheckedMaterial(strPrefName);
m_CompatibilityPanel.SetMaterialChecked(strPrefName);
SelectPref(strPrefName);
Config.GetInstance().Save(false);
}
private void PreferenceLoadClick(object sender, EventArgs e)
{
ToolStripItem item = (ToolStripItem)sender;
ToolStripMenuItem parent = (ToolStripMenuItem)item.OwnerItem;
string strPrefName = parent.Text;
if (strPrefName.StartsWith("ㆍ"))
strPrefName = strPrefName.Substring("ㆍ".Length);
LoadPref(strPrefName);
}
private void PreferenceSaveClick(object sender, EventArgs e)
{
ToolStripItem item = (ToolStripItem)sender;
ToolStripMenuItem parent = (ToolStripMenuItem)item.OwnerItem;
string strPrefName = parent.Text;
if (strPrefName.StartsWith("ㆍ"))
strPrefName = strPrefName.Substring("ㆍ".Length);
Config.GetInstance().m_strCurMaterial = strPrefName;
m_MaterialPanel.SaveUncheckedMaterial(strPrefName);
SelectPref(strPrefName);
Config.GetInstance().Save(true);
}
private void PreferenceRemoveClick(object sender, EventArgs e)
{
ToolStripItem item = (ToolStripItem)sender;
ToolStripMenuItem parent = (ToolStripMenuItem)item.OwnerItem;
string strPrefName = parent.Text;
if (strPrefName.StartsWith("ㆍ"))
strPrefName = strPrefName.Substring("ㆍ".Length);
Config.GetInstance().RemovePref(strPrefName);
preferenceToolStripMenuItem.DropDownItems.Remove(parent);
if (parent == m_CurPref)
PreferenceLoadClick(((ToolStripMenuItem)preferenceToolStripMenuItem.DropDownItems[2]).DropDownItems[0], null);
Config.GetInstance().Save(true);
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
NewPreference popup = new NewPreference(this);
popup.Show();
}
public void OnPreferenceAdd(string strName)
{
if(Config.GetInstance().HasPref(strName) == true)
{
MessageBox.Show("Preference name should be different from others.");
NewPreference popup = new NewPreference(this);
popup.Show();
return;
}
Config.GetInstance().InsertPref(strName);
Config.GetInstance().m_strCurMaterial = strName;
ToolStripMenuItem item = new ToolStripMenuItem(strName);
ToolStripItem load = item.DropDownItems.Add("Load");
load.Click += PreferenceLoadClick;
ToolStripItem save = item.DropDownItems.Add("Save");
save.Click += PreferenceSaveClick;
ToolStripItem remove = item.DropDownItems.Add("Remove");
remove.Click += PreferenceRemoveClick;
preferenceToolStripMenuItem.DropDownItems.Add(item);
if(m_CurPref != null)
m_CurPref.Text = m_CurPref.Text.Substring("ㆍ".Length);
m_CurPref = item;
m_CurPref.Text = "ㆍ" + m_CurPref.Text;
Theme.Apply(menuStrip);
}
#endregion
public void OnRadarGraphActivated()
{
if (m_DataHandler.GetCurTable() != "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), "All");
}
public void OnTrendGraphActivated()
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetPrevTable());
}
}
}

File diff suppressed because it is too large Load Diff

98
NewPreference.Designer.cs generated Normal file
View File

@@ -0,0 +1,98 @@
namespace friction
{
partial class NewPreference
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnAdd = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.tbName = new System.Windows.Forms.TextBox();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(151, 75);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(75, 23);
this.btnAdd.TabIndex = 0;
this.btnAdd.Text = "Add";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(34, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 12);
this.label1.TabIndex = 1;
this.label1.Text = "Name: ";
//
// tbName
//
this.tbName.Location = new System.Drawing.Point(87, 30);
this.tbName.Name = "tbName";
this.tbName.Size = new System.Drawing.Size(188, 21);
this.tbName.TabIndex = 2;
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(232, 75);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// NewPreference
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(319, 106);
this.ControlBox = false;
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.tbName);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnAdd);
this.Name = "NewPreference";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "New Preference";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbName;
private System.Windows.Forms.Button btnCancel;
}
}

45
NewPreference.cs Normal file
View File

@@ -0,0 +1,45 @@
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;
namespace friction
{
public partial class NewPreference : Form
{
MainForm m_Owner = null;
public NewPreference(MainForm owner)
{
m_Owner = owner;
InitializeComponent();
this.AcceptButton = btnAdd;
tbName.Select();
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (tbName.Text.Length == 0)
{
MessageBox.Show("Please enter new preference's name");
}
else
{
m_Owner.OnPreferenceAdd(tbName.Text);
Close();
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
}
}

276
PanelAnalysis.Designer.cs generated Normal file
View File

@@ -0,0 +1,276 @@
namespace friction
{
partial class PanelAnalysis
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelAnalysis));
this.dgvAnalysis = new System.Windows.Forms.DataGridView();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.lbInfo11 = new System.Windows.Forms.Label();
this.lbInfo12 = new System.Windows.Forms.Label();
this.lbInfo13 = new System.Windows.Forms.Label();
this.lbInfo21 = new System.Windows.Forms.Label();
this.lbInfo22 = new System.Windows.Forms.Label();
this.lbInfo23 = new System.Windows.Forms.Label();
this.lbInfo24 = new System.Windows.Forms.Label();
this.lbSpring = new System.Windows.Forms.Label();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// dgvAnalysis
//
this.dgvAnalysis.AllowUserToAddRows = false;
this.dgvAnalysis.AllowUserToDeleteRows = false;
this.dgvAnalysis.AllowUserToOrderColumns = true;
this.dgvAnalysis.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvAnalysis.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvAnalysis.Location = new System.Drawing.Point(3, 19);
this.dgvAnalysis.Name = "dgvAnalysis";
this.dgvAnalysis.ReadOnly = true;
this.dgvAnalysis.RowTemplate.Height = 23;
this.dgvAnalysis.Size = new System.Drawing.Size(874, 557);
this.dgvAnalysis.TabIndex = 0;
this.dgvAnalysis.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvAnalysis_CellContentDoubleClick);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 4;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 160F));
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.lbInfo11, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.lbInfo12, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.lbInfo13, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.lbInfo21, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.lbInfo22, 3, 1);
this.tableLayoutPanel1.Controls.Add(this.lbInfo23, 3, 2);
this.tableLayoutPanel1.Controls.Add(this.lbInfo24, 3, 3);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 582);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 5;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(874, 64);
this.tableLayoutPanel1.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.tableLayoutPanel1.SetRowSpan(this.label1, 5);
this.label1.Size = new System.Drawing.Size(271, 64);
this.label1.TabIndex = 0;
this.label1.Text = "For smaller than 10 number of tests (marked red) results should be considered car" +
"efully";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(440, 0);
this.label2.Name = "label2";
this.tableLayoutPanel1.SetRowSpan(this.label2, 5);
this.label2.Size = new System.Drawing.Size(242, 36);
this.label2.TabIndex = 1;
this.label2.Text = "For large standard deviations indicating a possible change of Stick-Slip Risk Cla" +
"ss (marked red)";
//
// lbInfo11
//
this.lbInfo11.AutoSize = true;
this.lbInfo11.BackColor = System.Drawing.Color.LimeGreen;
this.lbInfo11.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo11.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo11.ForeColor = System.Drawing.Color.Black;
this.lbInfo11.Location = new System.Drawing.Point(280, 0);
this.lbInfo11.Name = "lbInfo11";
this.lbInfo11.Size = new System.Drawing.Size(154, 12);
this.lbInfo11.TabIndex = 2;
this.lbInfo11.Text = "No Stick-Slip Risk";
//
// lbInfo12
//
this.lbInfo12.AutoSize = true;
this.lbInfo12.BackColor = System.Drawing.Color.Gold;
this.lbInfo12.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo12.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo12.ForeColor = System.Drawing.Color.Black;
this.lbInfo12.Location = new System.Drawing.Point(280, 12);
this.lbInfo12.Name = "lbInfo12";
this.lbInfo12.Size = new System.Drawing.Size(154, 24);
this.lbInfo12.TabIndex = 2;
this.lbInfo12.Text = "Potential Stick-Slip Risk";
//
// lbInfo13
//
this.lbInfo13.AutoSize = true;
this.lbInfo13.BackColor = System.Drawing.Color.OrangeRed;
this.lbInfo13.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo13.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo13.ForeColor = System.Drawing.Color.Black;
this.lbInfo13.Location = new System.Drawing.Point(280, 36);
this.lbInfo13.Name = "lbInfo13";
this.lbInfo13.Size = new System.Drawing.Size(154, 12);
this.lbInfo13.TabIndex = 2;
this.lbInfo13.Text = "High Stick-Slip Risk";
//
// lbInfo21
//
this.lbInfo21.AutoSize = true;
this.lbInfo21.BackColor = System.Drawing.Color.LimeGreen;
this.lbInfo21.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo21.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo21.ForeColor = System.Drawing.Color.Black;
this.lbInfo21.Location = new System.Drawing.Point(717, 0);
this.lbInfo21.Name = "lbInfo21";
this.lbInfo21.Size = new System.Drawing.Size(154, 12);
this.lbInfo21.TabIndex = 2;
this.lbInfo21.Text = "No Dependancy";
//
// lbInfo22
//
this.lbInfo22.AutoSize = true;
this.lbInfo22.BackColor = System.Drawing.Color.Gold;
this.lbInfo22.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo22.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo22.ForeColor = System.Drawing.Color.Black;
this.lbInfo22.Location = new System.Drawing.Point(717, 12);
this.lbInfo22.Name = "lbInfo22";
this.lbInfo22.Size = new System.Drawing.Size(154, 24);
this.lbInfo22.TabIndex = 2;
this.lbInfo22.Text = "Potential Dependancy";
//
// lbInfo23
//
this.lbInfo23.AutoSize = true;
this.lbInfo23.BackColor = System.Drawing.Color.OrangeRed;
this.lbInfo23.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo23.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo23.ForeColor = System.Drawing.Color.Black;
this.lbInfo23.Location = new System.Drawing.Point(717, 36);
this.lbInfo23.Name = "lbInfo23";
this.lbInfo23.Size = new System.Drawing.Size(154, 12);
this.lbInfo23.TabIndex = 2;
this.lbInfo23.Text = "Obvious Dependancy";
//
// lbInfo24
//
this.lbInfo24.AutoSize = true;
this.lbInfo24.BackColor = System.Drawing.Color.DarkGray;
this.lbInfo24.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbInfo24.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbInfo24.ForeColor = System.Drawing.Color.Black;
this.lbInfo24.Location = new System.Drawing.Point(717, 48);
this.lbInfo24.Name = "lbInfo24";
this.lbInfo24.Size = new System.Drawing.Size(154, 12);
this.lbInfo24.TabIndex = 2;
this.lbInfo24.Text = "Not Enough Data";
//
// lbSpring
//
this.lbSpring.AutoSize = true;
this.lbSpring.Location = new System.Drawing.Point(3, 0);
this.lbSpring.Name = "lbSpring";
this.lbSpring.Padding = new System.Windows.Forms.Padding(2, 4, 0, 0);
this.lbSpring.Size = new System.Drawing.Size(2, 16);
this.lbSpring.TabIndex = 2;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 0, 2);
this.tableLayoutPanel2.Controls.Add(this.lbSpring, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.dgvAnalysis, 0, 1);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 3;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 70F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(880, 649);
this.tableLayoutPanel2.TabIndex = 3;
//
// PanelAnalysis
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(880, 649);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel2);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelAnalysis";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Analysis Table";
this.Text = "Analysis Table";
this.Resize += new System.EventHandler(this.PanelAnalysis_Resize);
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvAnalysis;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lbInfo11;
private System.Windows.Forms.Label lbInfo12;
private System.Windows.Forms.Label lbInfo13;
private System.Windows.Forms.Label lbInfo21;
private System.Windows.Forms.Label lbInfo22;
private System.Windows.Forms.Label lbInfo23;
private System.Windows.Forms.Label lbInfo24;
private System.Windows.Forms.Label lbSpring;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
}
}

195
PanelAnalysis.cs Normal file
View File

@@ -0,0 +1,195 @@
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 PanelAnalysis : DockContent
{
MainForm m_Owner = null;
string m_CurSpring = "";
public PanelAnalysis(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
Theme.Apply(this);
Theme.Apply(dgvAnalysis);
lbInfo11.BackColor = Theme.Green;
lbInfo12.BackColor = Theme.Yellow;
lbInfo13.BackColor = Theme.Red;
lbInfo21.BackColor = Theme.Green;
lbInfo22.BackColor = Theme.Yellow;
lbInfo23.BackColor = Theme.Red;
lbInfo24.BackColor = Theme.Gray;
}
public void Reset()
{
m_CurSpring = "";
}
private Color GetDependancyColor(float fValue, int iCnt)
{
Config.ANALYSIS.DEPENDANCY Type = Config.ANALYSIS.GetDependancy(fValue, iCnt);
switch(Type)
{
case Config.ANALYSIS.DEPENDANCY.NO:
return Theme.Green;
case Config.ANALYSIS.DEPENDANCY.POTENTIAL:
return Theme.Yellow;
case Config.ANALYSIS.DEPENDANCY.HIGH:
return Theme.Red;
case Config.ANALYSIS.DEPENDANCY.NOT_ENNOUGH_DATA:
return Theme.Gray;
}
return Theme.White;
}
public void UpdateData(DataHandler data)
{
string strSpring = data.GetCurSpring();
if (strSpring == m_CurSpring)
return;
lbSpring.Text = "Material Spring: " +strSpring;
lbSpring.ForeColor = Theme.Orange;
dgvAnalysis.Columns.Clear();
dgvAnalysis.Rows.Clear();
dgvAnalysis.DefaultCellStyle.Format = "N2";
dgvAnalysis.Columns.Add("chTable", "Table");
dgvAnalysis.Columns.Add("chNoTest", "No. of Tests");
dgvAnalysis.Columns.Add("chAvg", "Average RPN");
dgvAnalysis.Columns.Add("chSTD", "Standard Deviation");
dgvAnalysis.Columns.Add("chForce", "Normal Force");
dgvAnalysis.Columns.Add("chTemp", "Temperature");
dgvAnalysis.Columns.Add("chHumi", "Rel. Humidity");
dgvAnalysis.Columns.Add("chVel", "Velocity");
List<string> uncheckedTables = Config.GetInstance().GetTableUnchecked();
foreach (string strTable in data.GetTableList())
{
DataHandler.CalcResult result = data.GetCalc(strSpring, strTable);
if (result.m_iCnt <= 0)
continue;
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);
Config.ANALYSIS.RISK RiskType = Config.ANALYSIS.GetRisk(result.m_fAvgRPN);
Config.ANALYSIS.DEPENDANCY DependancyType = Config.ANALYSIS.GetDependancy(result.m_fStdRPN, result.m_iCnt);
if(DependancyType == Config.ANALYSIS.DEPENDANCY.NOT_ENNOUGH_DATA)
{
for (int i = 2; i <= 7; i++)
{
dgvAnalysis.Rows[iIdx].Cells[i].Style.BackColor = Theme.Gray;
dgvAnalysis.Rows[iIdx].Cells[i].Style.ForeColor = Theme.Backcolor;
}
}
else
{
switch (RiskType)
{
case Config.ANALYSIS.RISK.NO:
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Green;
break;
case Config.ANALYSIS.RISK.POTENTIAL:
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Yellow;
break;
case Config.ANALYSIS.RISK.HIGH:
dgvAnalysis.Rows[iIdx].Cells[2].Style.BackColor = Theme.Red;
break;
}
dgvAnalysis.Rows[iIdx].Cells[3].Style.BackColor = GetDependancyColor(result.m_fStdRPN, result.m_iCnt);
dgvAnalysis.Rows[iIdx].Cells[4].Style.BackColor = GetDependancyColor(result.m_fDiffByForce, result.m_iCnt);
dgvAnalysis.Rows[iIdx].Cells[5].Style.BackColor = GetDependancyColor(result.m_fDiffByTemp, result.m_iCnt);
dgvAnalysis.Rows[iIdx].Cells[6].Style.BackColor = GetDependancyColor(result.m_fDiffByHumid, result.m_iCnt);
dgvAnalysis.Rows[iIdx].Cells[7].Style.BackColor = GetDependancyColor(result.m_fDiffByVel, result.m_iCnt);
}
dgvAnalysis.Rows[iIdx].Visible = (uncheckedTables.Contains(strTable) == false);
}
m_CurSpring = strSpring;
}
public void SelectRow(string strTable)
{
dgvAnalysis.ClearSelection();
foreach (DataGridViewRow row in dgvAnalysis.Rows)
{
if ((string)row.Cells["chTable"].Value == strTable)
{
row.Selected = true;
break;
}
}
}
public DataTable GetData()
{
var dt = new DataTable();
foreach (DataGridViewColumn column in dgvAnalysis.Columns)
{
if (column.Visible)
dt.Columns.Add(column.HeaderText);
}
object[] cellValues = new object[dgvAnalysis.Columns.Count];
foreach (DataGridViewRow row in dgvAnalysis.Rows)
{
for (int i = 0; i < row.Cells.Count; i++)
cellValues[i] = row.Cells[i].Value;
dt.Rows.Add(cellValues);
}
return dt;
}
public void TableCheckChanged(string strItem, bool bChecked)
{
foreach (DataGridViewRow row in dgvAnalysis.Rows)
{
if((string)row.Cells[0].Value == strItem)
row.Visible = bChecked;
}
}
private void dgvAnalysis_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if(dgvAnalysis.Columns[e.ColumnIndex].HeaderText == "Table")
{
string strTable = dgvAnalysis.Rows[e.RowIndex].Cells[e.ColumnIndex].Value as string;
m_Owner.OnApplyData(this, m_CurSpring, strTable);
}
}
private void PanelAnalysis_Resize(object sender, EventArgs e)
{
Console.WriteLine("Panel size : {0}", this.Bounds);
}
}
}

6293
PanelAnalysis.resx Normal file

File diff suppressed because it is too large Load Diff

269
PanelCompatibility.Designer.cs generated Normal file
View File

@@ -0,0 +1,269 @@
namespace friction
{
partial class PanelCompatibility
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelCompatibility));
this.dgvMap = new System.Windows.Forms.DataGridView();
this.btPivot = new System.Windows.Forms.Button();
this.detailPanel = new System.Windows.Forms.TableLayoutPanel();
this.lbLowTemp = new System.Windows.Forms.Label();
this.lbHighHigh = new System.Windows.Forms.Label();
this.lbHighLow = new System.Windows.Forms.Label();
this.lbNormalHigh = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.lbNormalLow = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.dgvMap)).BeginInit();
this.detailPanel.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// dgvMap
//
this.dgvMap.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvMap.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvMap.Location = new System.Drawing.Point(3, 32);
this.dgvMap.Name = "dgvMap";
this.dgvMap.RowTemplate.Height = 23;
this.dgvMap.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.dgvMap.Size = new System.Drawing.Size(817, 576);
this.dgvMap.TabIndex = 0;
this.dgvMap.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMap_CellClick);
this.dgvMap.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvMap_CellDoubleClick);
this.dgvMap.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgvMap_KeyDown);
this.dgvMap.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dgvMap_KeyUp);
//
// btPivot
//
this.btPivot.Location = new System.Drawing.Point(3, 3);
this.btPivot.Name = "btPivot";
this.btPivot.Size = new System.Drawing.Size(75, 23);
this.btPivot.TabIndex = 1;
this.btPivot.Text = "Pivot";
this.btPivot.UseVisualStyleBackColor = true;
this.btPivot.Click += new System.EventHandler(this.btPivot_Click);
//
// detailPanel
//
this.detailPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.detailPanel.ColumnCount = 5;
this.detailPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.detailPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.detailPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.detailPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.detailPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.detailPanel.Controls.Add(this.lbLowTemp, 4, 1);
this.detailPanel.Controls.Add(this.lbHighHigh, 3, 1);
this.detailPanel.Controls.Add(this.lbHighLow, 2, 1);
this.detailPanel.Controls.Add(this.lbNormalHigh, 1, 1);
this.detailPanel.Controls.Add(this.label5, 4, 0);
this.detailPanel.Controls.Add(this.label4, 3, 0);
this.detailPanel.Controls.Add(this.label3, 2, 0);
this.detailPanel.Controls.Add(this.label2, 1, 0);
this.detailPanel.Controls.Add(this.label1, 0, 0);
this.detailPanel.Controls.Add(this.lbNormalLow, 0, 1);
this.detailPanel.Location = new System.Drawing.Point(3, 614);
this.detailPanel.Name = "detailPanel";
this.detailPanel.RowCount = 2;
this.detailPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.detailPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.detailPanel.Size = new System.Drawing.Size(817, 54);
this.detailPanel.TabIndex = 2;
//
// lbLowTemp
//
this.lbLowTemp.AutoSize = true;
this.lbLowTemp.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbLowTemp.Location = new System.Drawing.Point(655, 27);
this.lbLowTemp.Name = "lbLowTemp";
this.lbLowTemp.Size = new System.Drawing.Size(159, 27);
this.lbLowTemp.TabIndex = 19;
this.lbLowTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lbHighHigh
//
this.lbHighHigh.AutoSize = true;
this.lbHighHigh.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbHighHigh.Location = new System.Drawing.Point(492, 27);
this.lbHighHigh.Name = "lbHighHigh";
this.lbHighHigh.Size = new System.Drawing.Size(157, 27);
this.lbHighHigh.TabIndex = 18;
this.lbHighHigh.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lbHighLow
//
this.lbHighLow.AutoSize = true;
this.lbHighLow.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbHighLow.Location = new System.Drawing.Point(329, 27);
this.lbHighLow.Name = "lbHighLow";
this.lbHighLow.Size = new System.Drawing.Size(157, 27);
this.lbHighLow.TabIndex = 17;
this.lbHighLow.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lbNormalHigh
//
this.lbNormalHigh.AutoSize = true;
this.lbNormalHigh.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbNormalHigh.Location = new System.Drawing.Point(166, 27);
this.lbNormalHigh.Name = "lbNormalHigh";
this.lbNormalHigh.Size = new System.Drawing.Size(157, 27);
this.lbNormalHigh.TabIndex = 16;
this.lbNormalHigh.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(655, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(159, 27);
this.label5.TabIndex = 14;
this.label5.Text = "Low Temp";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(492, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(157, 27);
this.label4.TabIndex = 13;
this.label4.Text = "High Temp\r\nHigh Humid";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(329, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(157, 27);
this.label3.TabIndex = 12;
this.label3.Text = "High Temp\r\nLow Humid";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(166, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(157, 27);
this.label2.TabIndex = 11;
this.label2.Text = "Normal Temp\r\nHigh Humid";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(157, 27);
this.label1.TabIndex = 10;
this.label1.Text = "Normal Temp\r\nLow Humid";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbNormalLow
//
this.lbNormalLow.AutoSize = true;
this.lbNormalLow.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbNormalLow.Location = new System.Drawing.Point(3, 27);
this.lbNormalLow.Name = "lbNormalLow";
this.lbNormalLow.Size = new System.Drawing.Size(157, 27);
this.lbNormalLow.TabIndex = 15;
this.lbNormalLow.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.btPivot, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.dgvMap, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.detailPanel, 0, 2);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(823, 671);
this.tableLayoutPanel1.TabIndex = 3;
//
// PanelCompatibility
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(823, 671);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelCompatibility";
this.Text = "Material Compatibility Map";
((System.ComponentModel.ISupportInitialize)(this.dgvMap)).EndInit();
this.detailPanel.ResumeLayout(false);
this.detailPanel.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvMap;
private System.Windows.Forms.Button btPivot;
private System.Windows.Forms.TableLayoutPanel detailPanel;
private System.Windows.Forms.Label lbLowTemp;
private System.Windows.Forms.Label lbHighHigh;
private System.Windows.Forms.Label lbHighLow;
private System.Windows.Forms.Label lbNormalHigh;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lbNormalLow;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

429
PanelCompatibility.cs Normal file
View File

@@ -0,0 +1,429 @@
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 PanelCompatibility : DockContent
{
const int HEADER_SIZE = 100;
MainForm m_Owner = null;
DataHandler m_DataHandler = null;
//float m_Scale = 1.0f;
//float m_OrgFontSize = 10;
//float m_OrgCellWidth = 10;
//float m_OrgCellHeight = 10;
//bool m_bScaling = false;
public PanelCompatibility(MainForm owner, DataHandler dataHandler)
{
InitializeComponent();
m_Owner = owner;
m_DataHandler = dataHandler;
Theme.Apply(this);
Theme.Apply(dgvMap);
Theme.Apply(btPivot);
dgvMap.CellPainting += DgvMap_CellPainting;
dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
dgvMap.ColumnHeadersHeight = HEADER_SIZE;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
dgvMap.RowHeadersWidth = HEADER_SIZE;
dgvMap.DefaultCellStyle.Format = "N0";
dgvMap.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
dgvMap.RowHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
dgvMap.MouseWheel += DgvMap_MouseWheel;
}
public void SpringCheckChanged(string strItem, bool bChecked)
{
if (dgvMap.Columns.Count <= 0)
return;
if (dgvMap.Columns[0].HeaderText == "spring")
{
foreach(DataGridViewColumn col in dgvMap.Columns)
{
if(col.HeaderText == strItem)
{
col.Visible = bChecked;
break;
}
}
}
else
{
foreach(DataGridViewRow row in dgvMap.Rows)
{
if((string)row.HeaderCell.Value == strItem)
{
row.Visible = bChecked;
break;
}
}
}
}
public void TableCheckChanged(string strItem, bool bChecked)
{
if (dgvMap.Columns.Count <= 0)
return;
if (dgvMap.Columns[0].HeaderText == "table")
{
foreach (DataGridViewColumn col in dgvMap.Columns)
{
if (col.HeaderText == strItem)
{
col.Visible = bChecked;
break;
}
}
}
else
{
foreach (DataGridViewRow row in dgvMap.Rows)
{
if ((string)row.HeaderCell.Value == strItem)
{
row.Visible = bChecked;
break;
}
}
}
}
public void SetMaterialChecked(string strPrefName)
{
if (dgvMap.Columns.Count <= 0)
return;
for (int i = 1; i < dgvMap.Columns.Count; i++)
dgvMap.Columns[i].Visible = true;
for (int i = 1; i < dgvMap.Rows.Count-1; i++)
dgvMap.Rows[i].Visible = true;
Config.UncheckedMaterial cm = Config.GetInstance().m_UncheckedMaterial[strPrefName];
foreach (string item in cm.m_Springs)
SpringCheckChanged(item, false);
foreach (string item in cm.m_Tables)
TableCheckChanged(item, false);
}
public void UpdateData()
{
var Springs = m_DataHandler.GetSpringList();
var Tables = m_DataHandler.GetTableList();
dgvMap.Rows.Clear();
dgvMap.Columns.Clear();
int iCol = dgvMap.Columns.Add("table", "table");
dgvMap.Columns[iCol].Width = 10;
dgvMap.Columns[iCol].SortMode = DataGridViewColumnSortMode.NotSortable;
foreach (var table in Tables)
{
string strHeaderText = table;
//if (strHeaderText.Length > 10)
// strHeaderText = strHeaderText.Substring(0, 7) + "...";
iCol = dgvMap.Columns.Add(table, strHeaderText);
dgvMap.Columns[iCol].Width = 10;
dgvMap.Columns[iCol].SortMode = DataGridViewColumnSortMode.NotSortable;
dgvMap.Columns[iCol].HeaderCell.ToolTipText = table;
}
int iRow = dgvMap.Rows.Add();
dgvMap.Rows[iRow].HeaderCell.Value = "spring";
foreach (var spring in Springs)
{
iRow = dgvMap.Rows.Add();
dgvMap.Rows[iRow].HeaderCell.Value = spring;
dgvMap.Rows[iRow].HeaderCell.ToolTipText = spring;
var Averages = m_DataHandler.GetAvgAll(spring, Config.TEMP_ALL, Config.HUMID_ALL);
foreach(var avg in Averages)
{
if(avg.m_fMax > 0)
{
var cell = dgvMap.Rows[iRow].Cells[avg.m_strTable];
cell.Value = avg.m_fMax;
Config.ANALYSIS.RISK Risk = Config.ANALYSIS.GetRisk(avg.m_fMax);
switch(Risk)
{
case Config.ANALYSIS.RISK.NO:
cell.Style.BackColor = Theme.Green;
break;
case Config.ANALYSIS.RISK.POTENTIAL:
cell.Style.BackColor = Theme.Yellow;
break;
case Config.ANALYSIS.RISK.HIGH:
cell.Style.BackColor = Theme.Red;
break;
}
}
}
//m_OrgFontSize = dgvMap.Font.Size;
//m_OrgCellWidth = (float)dgvMap.Rows[0].Cells[0].Size.Width;
//m_OrgCellHeight = (float)dgvMap.RowTemplate.Height;
//m_Scale = 1.0f;
}
foreach (DataGridViewColumn column in dgvMap.Columns)
{
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
column.ReadOnly = true;
}
dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
}
public object[] GetData()
{
List<string> ColumnHeaders = new List<string>();
List<string> RowHeaders = new List<string>();
var dt = new DataTable();
dt.Columns.Add(" ");
foreach (DataGridViewColumn column in dgvMap.Columns)
{
dt.Columns.Add(column.HeaderText);
ColumnHeaders.Add(column.HeaderText);
}
object[] cellValues = new object[dgvMap.Columns.Count];
foreach (DataGridViewRow row in dgvMap.Rows)
{
for (int i = 0; i < row.Cells.Count; i++)
cellValues[i] = row.Cells[i].Value;
dt.Rows.Add(cellValues);
RowHeaders.Add((string)row.HeaderCell.Value);
}
return new object[]{ dt, ColumnHeaders, RowHeaders };
}
private void DgvMap_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
DataGridView view = sender as DataGridView;
if (e.RowIndex == -1 && e.ColumnIndex >= 0)
{
Brush brush = new SolidBrush(this.dgvMap.ForeColor);
e.PaintBackground(e.ClipBounds, true);
Rectangle rect = view.GetColumnDisplayRectangle(e.ColumnIndex, true);
Size titleSize = TextRenderer.MeasureText(e.Value.ToString(), e.CellStyle.Font);
//Size titleSize = e.CellBounds.Size;
//if (view.ColumnHeadersHeight < titleSize.Width)
// view.ColumnHeadersHeight = titleSize.Width;
//if (view.ColumnHeadersHeight > HEADER_SIZE)
// view.ColumnHeadersHeight = HEADER_SIZE;
e.Graphics.TranslateTransform(0, titleSize.Width);
e.Graphics.RotateTransform(-90.0F);
e.Graphics.DrawString(e.Value.ToString(), this.Font, brush,
new PointF(rect.Y - (view.ColumnHeadersHeight - titleSize.Width), rect.X + (e.CellBounds.Width - titleSize.Height) / 2));
e.Graphics.RotateTransform(90.0F);
e.Graphics.TranslateTransform(0, -titleSize.Width);
e.Handled = true;
}
}
void Pivot()
{
object[] viewData = GetData();
DataTable data = (DataTable)viewData[0];
List<string> ColumnHeaders = (List<string>)viewData[1];
List<string> RowHeaders = (List<string>)viewData[2];
dgvMap.Rows.Clear();
dgvMap.Columns.Clear();
int iColSize = ColumnHeaders.Count;
int iRowSize = RowHeaders.Count - 1;
for (int i = 0; i < iRowSize; i++)
dgvMap.Columns.Add(RowHeaders[i], RowHeaders[i]);
for (int iCol = 0; iCol < iColSize; iCol++)
{
int iRowIdx = dgvMap.Rows.Add();
dgvMap.Rows[iRowIdx].HeaderCell.Value = ColumnHeaders[iCol];
for (int iRow = 0; iRow < iRowSize; iRow++)
{
DataGridViewCell cell = dgvMap.Rows[iRowIdx].Cells[iRow];
cell.Value = data.Rows[iRow][iCol];
float fValue = 0;
if (cell.Value.GetType() != typeof(System.DBNull))
{
float.TryParse((string)cell.Value, out fValue);
Config.ANALYSIS.RISK Risk = Config.ANALYSIS.GetRisk(fValue);
switch (Risk)
{
case Config.ANALYSIS.RISK.NO:
cell.Style.BackColor = Theme.Green;
break;
case Config.ANALYSIS.RISK.POTENTIAL:
cell.Style.BackColor = Theme.Yellow;
break;
case Config.ANALYSIS.RISK.HIGH:
cell.Style.BackColor = Theme.Red;
break;
}
}
}
}
for (int i = 0; i < iRowSize; i++)
dgvMap.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
}
private void btPivot_Click(object sender, EventArgs e)
{
Pivot();
SetMaterialChecked(Config.GetInstance().m_strCurMaterial);
}
private void dgvMap_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex < 0)
return;
if (dgvMap.Rows.Count < e.RowIndex || dgvMap.Columns.Count < e.ColumnIndex)
return;
DataGridViewCell cell = dgvMap.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (cell.Value == null || cell.Value.GetType() == typeof(System.DBNull))
{
Label[] aLabels = { lbNormalLow, lbNormalHigh, lbHighLow, lbHighHigh, lbLowTemp };
for (int i = 0; i < aLabels.Length; i++)
{
aLabels[i].Text = "";
Theme.Apply(aLabels[i]);
}
}
else
{
string strSpring = "";
string strTable = "";
if ((string)dgvMap.Rows[0].HeaderCell.Value == "spring")
{
strSpring = (string)dgvMap.Rows[e.RowIndex].HeaderCell.Value;
strTable = dgvMap.Columns[e.ColumnIndex].HeaderText;
}
else
{
strTable = (string)dgvMap.Rows[e.RowIndex].HeaderCell.Value;
strSpring = dgvMap.Columns[e.ColumnIndex].HeaderText;
}
List<float> maxes = m_DataHandler.GetMaxes(strSpring, strTable);
Label[] aLabels = { lbNormalLow, lbNormalHigh, lbHighLow, lbHighHigh, lbLowTemp };
for (int i = 0; i < aLabels.Length; i++)
{
aLabels[i].Text = maxes[i].ToString("N0");
Config.ANALYSIS.RISK Risk = Config.ANALYSIS.GetRisk(maxes[i]);
switch (Risk)
{
case Config.ANALYSIS.RISK.NO:
aLabels[i].BackColor = Theme.Green;
break;
case Config.ANALYSIS.RISK.POTENTIAL:
aLabels[i].BackColor = Theme.Yellow;
break;
case Config.ANALYSIS.RISK.HIGH:
aLabels[i].BackColor = Theme.Red;
break;
}
}
detailPanel.Visible = true;
}
}
private void dgvMap_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex < 0)
return;
if (dgvMap.Rows.Count < e.RowIndex || dgvMap.Columns.Count < e.ColumnIndex)
return;
DataGridViewCell cell = dgvMap.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (cell.Value == null || cell.Value.GetType() == typeof(System.DBNull))
return;
string strSpring = "";
string strTable = "";
if ((string)dgvMap.Rows[0].HeaderCell.Value == "spring")
{
strSpring = (string)dgvMap.Rows[e.RowIndex].HeaderCell.Value;
strTable = dgvMap.Columns[e.ColumnIndex].HeaderText;
}
else
{
strTable = (string)dgvMap.Rows[e.RowIndex].HeaderCell.Value;
strSpring = dgvMap.Columns[e.ColumnIndex].HeaderText;
}
m_Owner.OnApplyData(this, strSpring, strTable);
}
public void ZoomGrid(float f)
{
//dgvMap.Scale(new SizeF(f, f));
//dgvMap.Font = new Font(dgvMap.Font.FontFamily, m_OrgFontSize * f, dgvMap.Font.Style);
//dgvMap.RowTemplate.Height = (int)(m_OrgCellHeight * f);
//foreach (DataGridViewColumn col in dgvMap.Columns)
// col.Width = (int)(m_OrgCellWidth * f);
//foreach (DataGridViewRow row in dgvMap.Rows)
// row.Height = (int)(m_OrgCellHeight * f);
}
private void DgvMap_MouseWheel(object sender, MouseEventArgs e)
{
//if (m_bScaling == true)
//{
// m_Scale += e.Delta / 120.0f * 0.05f;
// Console.WriteLine(string.Format("m_Scale : {0}", m_Scale));
// if (m_Scale <= 0.001f)
// m_Scale = 0.001f;
// else if (m_Scale > 5.0f)
// m_Scale = 5.0f;
// ZoomGrid(m_Scale);
//}
}
private void dgvMap_KeyDown(object sender, KeyEventArgs e)
{
//if (e.Control == true)
// m_bScaling = true;
}
private void dgvMap_KeyUp(object sender, KeyEventArgs e)
{
//if (e.Control == true)
// m_bScaling = false;
}
}
}

6293
PanelCompatibility.resx Normal file

File diff suppressed because it is too large Load Diff

236
PanelMaterial.Designer.cs generated Normal file
View File

@@ -0,0 +1,236 @@
namespace friction
{
partial class PanelMaterial
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelMaterial));
this.lbFileName = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.lvSpring = new friction.NoDoubleClickAutoCheckListview();
this.lvchSpring = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.lvTable = new friction.NoDoubleClickAutoCheckListview();
this.lvchTable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout();
//
// lbFileName
//
this.lbFileName.AutoSize = true;
this.lbFileName.Font = new System.Drawing.Font("Malgun Gothic", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbFileName.Location = new System.Drawing.Point(3, 0);
this.lbFileName.Name = "lbFileName";
this.lbFileName.Size = new System.Drawing.Size(0, 25);
this.lbFileName.TabIndex = 4;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(90, 12);
this.label2.TabIndex = 5;
this.label2.Text = "Material Spring";
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(3, 8);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(86, 12);
this.label3.TabIndex = 6;
this.label3.Text = "Material Table";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.lbFileName, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.splitContainer1, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(298, 727);
this.tableLayoutPanel1.TabIndex = 9;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(3, 28);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel2);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tableLayoutPanel3);
this.splitContainer1.Size = new System.Drawing.Size(292, 696);
this.splitContainer1.SplitterDistance = 348;
this.splitContainer1.TabIndex = 5;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Controls.Add(this.label2, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.lvSpring, 0, 1);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(292, 348);
this.tableLayoutPanel2.TabIndex = 0;
//
// lvSpring
//
this.lvSpring.CheckBoxes = true;
this.lvSpring.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.lvchSpring});
this.lvSpring.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvSpring.FullRowSelect = true;
this.lvSpring.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.lvSpring.Location = new System.Drawing.Point(3, 23);
this.lvSpring.Name = "lvSpring";
this.lvSpring.Size = new System.Drawing.Size(286, 322);
this.lvSpring.TabIndex = 7;
this.lvSpring.UseCompatibleStateImageBehavior = false;
this.lvSpring.View = System.Windows.Forms.View.Details;
this.lvSpring.SizeChanged += new System.EventHandler(this.lvSpring_SizeChanged);
this.lvSpring.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvSpring_KeyDown);
this.lvSpring.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvSpring_MouseDoubleClick);
//
// lvchSpring
//
this.lvchSpring.Text = "Material Spring";
this.lvchSpring.Width = 308;
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 1;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.Controls.Add(this.label3, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.lvTable, 0, 1);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(292, 344);
this.tableLayoutPanel3.TabIndex = 0;
//
// lvTable
//
this.lvTable.CheckBoxes = true;
this.lvTable.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.lvchTable});
this.lvTable.Dock = System.Windows.Forms.DockStyle.Fill;
this.lvTable.FullRowSelect = true;
this.lvTable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.lvTable.Location = new System.Drawing.Point(3, 23);
this.lvTable.Name = "lvTable";
this.lvTable.Size = new System.Drawing.Size(286, 318);
this.lvTable.TabIndex = 8;
this.lvTable.UseCompatibleStateImageBehavior = false;
this.lvTable.View = System.Windows.Forms.View.Details;
this.lvTable.SizeChanged += new System.EventHandler(this.lvTable_SizeChanged);
this.lvTable.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvTable_KeyDown);
this.lvTable.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvTable_MouseDoubleClick);
//
// lvchTable
//
this.lvchTable.Text = "Table";
this.lvchTable.Width = 305;
//
// PanelMaterial
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(298, 727);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelMaterial";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft;
this.TabText = "Material Pair";
this.Text = "Material Pair";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lbFileName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private NoDoubleClickAutoCheckListview lvSpring;
private NoDoubleClickAutoCheckListview lvTable;
private System.Windows.Forms.ColumnHeader lvchSpring;
private System.Windows.Forms.ColumnHeader lvchTable;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
}
}

343
PanelMaterial.cs Normal file
View File

@@ -0,0 +1,343 @@
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 PanelMaterial : DockContent
{
MainForm m_Owner = null;
ListViewItem m_SelectedSpring = null;
ListViewItem m_SelectedTable = null;
public PanelMaterial(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
this.ApplyTheme();
Theme.Apply(this);
Theme.Apply(lvSpring);
Theme.Apply(lvTable);
lvSpring.ListViewItemSorter = new ListViewItemCheckboxComparer();
lvSpring.ItemChecked += Listview_ItemChecked;
lvTable.ListViewItemSorter = new ListViewItemCheckboxComparer();
lvTable.ItemChecked += Listview_ItemChecked;
}
public void UpdateData(DataHandler data)
{
m_SelectedSpring = null;
m_SelectedTable = null;
var SpringList = data.GetSpringList();
var TableList = data.GetTableList();
lvSpring.Items.Clear();
lvSpring.Items.Add("All");
foreach (var x in SpringList)
{
ListViewItem item = lvSpring.Items.Add(x);
item.Checked = true;
}
lvTable.Items.Clear();
lvTable.Items.Add("All");
foreach (var x in TableList)
{
ListViewItem item = lvTable.Items.Add(x);
item.Checked = true;
}
lvSpring.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
lvTable.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
lbFileName.Text = data.GetFileName();
SelectSpring(0);
SelectTable(0);
}
private void lvSpring_SizeChanged(object sender, EventArgs e)
{
Theme.ResizeFullColumn(lvSpring);
}
private void lvTable_SizeChanged(object sender, EventArgs e)
{
Theme.ResizeFullColumn(lvTable);
}
#region select
private void SelectSpring(int iIdx)
{
if(iIdx == 0 && lvSpring.Items[iIdx].Text == "All")
{
if(m_SelectedSpring == null)
SelectSpring(1);
return;
}
if (m_SelectedSpring != null)
{
m_SelectedSpring.Font = lvSpring.Font;
m_SelectedSpring.ForeColor = Theme.Forecolor;
}
m_SelectedSpring = lvSpring.Items[iIdx];
m_SelectedSpring.Font = new Font(lvSpring.Font, FontStyle.Bold);
m_SelectedSpring.ForeColor = Theme.Orange;
if(m_SelectedSpring != null && m_SelectedTable != null)
m_Owner.OnApplyData(this, m_SelectedSpring.Text, m_SelectedTable.Text);
}
public void SelectSpring(string strSpring)
{
if (m_SelectedSpring != null)
{
m_SelectedSpring.Font = lvSpring.Font;
m_SelectedSpring.ForeColor = Theme.Forecolor;
}
foreach (ListViewItem item in lvSpring.Items)
{
if (item.Text == strSpring)
{
m_SelectedSpring = item;
item.Font = new Font(lvSpring.Font, FontStyle.Bold);
item.ForeColor = Theme.Orange;
break;
}
}
}
private void SelectTable(int iIdx)
{
if (m_SelectedTable != null)
{
m_SelectedTable.Font = lvTable.Font;
m_SelectedTable.ForeColor = Theme.Forecolor;
}
m_SelectedTable = lvTable.Items[iIdx];
m_SelectedTable.Font = new Font(lvTable.Font, FontStyle.Bold);
m_SelectedTable.ForeColor = Theme.Orange;
if (m_SelectedSpring != null && m_SelectedTable != null)
m_Owner.OnApplyData(this, m_SelectedSpring.Text, m_SelectedTable.Text);
}
public void SelectTable(string strTable)
{
if (m_SelectedTable != null)
{
m_SelectedTable.Font = lvTable.Font;
m_SelectedTable.ForeColor = Theme.Forecolor;
}
foreach(ListViewItem item in lvTable.Items)
{
if(item.Text == strTable)
{
m_SelectedTable = item;
item.Font = new Font(lvTable.Font, FontStyle.Bold);
item.ForeColor = Theme.Orange;
break;
}
}
}
private void lvSpring_MouseDoubleClick(object sender, MouseEventArgs e)
{
if(lvSpring.SelectedIndices.Count == 1)
SelectSpring(lvSpring.SelectedIndices[0]);
}
private void lvTable_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (lvTable.SelectedIndices.Count == 1)
SelectTable(lvTable.SelectedIndices[0]);
}
#endregion select
#region check
public void LoadUncheckedMaterial(string strPrefName)
{
Config.UncheckedMaterial cm = Config.GetInstance().m_UncheckedMaterial[strPrefName];
List<string> UncheckedSprings = new List<string>();
List<string> UncheckedTables = new List<string>();
foreach (string s in cm.m_Springs)
UncheckedSprings.Add(s);
foreach (string s in cm.m_Tables)
UncheckedTables.Add(s);
foreach (ListViewItem item in lvSpring.Items)
{
item.Checked = true;
}
foreach (string strSpring in UncheckedSprings)
{
foreach (ListViewItem item in lvSpring.Items)
{
if (item.Text == strSpring)
{
item.Checked = false;
break;
}
}
}
foreach (ListViewItem item in lvTable.Items)
{
item.Checked = true;
}
foreach (string strTable in UncheckedTables)
{
foreach (ListViewItem item in lvTable.Items)
{
if (item.Text == strTable)
{
item.Checked = false;
break;
}
}
}
}
public void SaveUncheckedMaterial(string strPrefName)
{
Config.UncheckedMaterial cm = Config.GetInstance().m_UncheckedMaterial[strPrefName];
cm.m_Springs.Clear();
foreach (ListViewItem item in lvSpring.Items)
{
if (item.Checked == false)
cm.m_Springs.Add(item.Text);
}
cm.m_Tables.Clear();
foreach (ListViewItem item in lvTable.Items)
{
if (item.Checked == false)
cm.m_Tables.Add(item.Text);
}
}
private void Listview_ItemChecked(object sender, ItemCheckedEventArgs e)
{
ListView view = (ListView)sender;
if (e.Item.Text == "All")
{
foreach(ListViewItem item in view.Items)
{
if(item != null && item.Text != "All")
item.Checked = e.Item.Checked;
}
return;
}
List<string> UncheckedItems = new List<string>();
foreach (ListViewItem item in view.Items)
{
if(item.Checked == false)
UncheckedItems.Add(item.Text);
}
if (view == lvTable)
Config.GetInstance().SetTableChecked(UncheckedItems);
else
Config.GetInstance().SetSpringChecked(UncheckedItems);
view.Sort();
if (view == lvSpring)
m_Owner.OnSpringCheckChanged(e.Item.Text, e.Item.Checked);
else
m_Owner.OnTableCheckChanged(e.Item.Text, e.Item.Checked);
}
#endregion check
private class ListViewItemCheckboxComparer : IComparer<ListViewItem>, System.Collections.IComparer
{
public int Compare(ListViewItem x, ListViewItem y)
{
if (x.Text == "All")
return -1;
else if (y.Text == "All")
return 1;
else if (x.Checked != y.Checked)
return -(x.Checked ? 1 : 0).CompareTo(y.Checked ? 1 : 0);
else
return x.Text.CompareTo(y.Text);
}
public int Compare(object x, object y)
{
return Compare(x as ListViewItem, y as ListViewItem);
}
}
private void lvSpring_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
SelectSpring(lvSpring.SelectedIndices[0]);
}
private void lvTable_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
SelectTable(lvTable.SelectedIndices[0]);
}
}
public class NoDoubleClickAutoCheckListview : ListView
{
private bool checkFromDoubleClick = false;
protected override void OnItemCheck(ItemCheckEventArgs ice)
{
if (this.checkFromDoubleClick)
{
ice.NewValue = ice.CurrentValue;
this.checkFromDoubleClick = false;
}
else
base.OnItemCheck(ice);
}
protected override void OnMouseDown(MouseEventArgs e)
{
// Is this a double-click?
if ((e.Button == MouseButtons.Left) && (e.Clicks > 1))
{
this.checkFromDoubleClick = true;
}
base.OnMouseDown(e);
}
protected override void OnKeyDown(KeyEventArgs e)
{
this.checkFromDoubleClick = false;
base.OnKeyDown(e);
}
}
}

6293
PanelMaterial.resx Normal file

File diff suppressed because it is too large Load Diff

341
PanelRadarGraph.Designer.cs generated Normal file
View File

@@ -0,0 +1,341 @@
namespace friction
{
partial class PanelRadarGraph
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelRadarGraph));
this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.lbSpring = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panel2 = new System.Windows.Forms.Panel();
this.panelPopup = new System.Windows.Forms.Panel();
this.rbLowTemp = new System.Windows.Forms.RadioButton();
this.rbHighHigh = new System.Windows.Forms.RadioButton();
this.rbHighLow = new System.Windows.Forms.RadioButton();
this.rbNormalHigh = new System.Windows.Forms.RadioButton();
this.rbNormalLow = new System.Windows.Forms.RadioButton();
this.rbAll = new System.Windows.Forms.RadioButton();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout();
this.panelPopup.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// chart
//
chartArea1.Area3DStyle.Enable3D = true;
chartArea1.AxisX.MajorGrid.Enabled = false;
chartArea1.AxisX.MajorTickMark.LineWidth = 0;
chartArea1.AxisX2.MajorGrid.Enabled = false;
chartArea1.BackImageTransparentColor = System.Drawing.Color.Black;
chartArea1.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea1);
this.chart.Dock = System.Windows.Forms.DockStyle.Fill;
legend1.Name = "Legend1";
this.chart.Legends.Add(legend1);
this.chart.Location = new System.Drawing.Point(0, 0);
this.chart.Name = "chart";
series1.ChartArea = "ChartArea1";
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series1.IsVisibleInLegend = false;
series1.Legend = "Legend1";
series1.LegendText = "High Risk";
series1.MarkerSize = 0;
series1.Name = "SeriesHigh";
series2.ChartArea = "ChartArea1";
series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series2.IsVisibleInLegend = false;
series2.Legend = "Legend1";
series2.LegendText = "Potential Risk";
series2.MarkerSize = 0;
series2.Name = "SeriesPotential";
series3.ChartArea = "ChartArea1";
series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series3.IsVisibleInLegend = false;
series3.Legend = "Legend1";
series3.LegendText = "No Risk";
series3.MarkerSize = 0;
series3.Name = "SeriesNo";
series4.ChartArea = "ChartArea1";
series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series4.Legend = "Legend1";
series4.LegendText = "Max";
series4.MarkerSize = 0;
series4.Name = "SeriesMax";
series5.ChartArea = "ChartArea1";
series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series5.Legend = "Legend1";
series5.LegendText = "Average";
series5.MarkerSize = 0;
series5.Name = "SeriesAvg";
series6.ChartArea = "ChartArea1";
series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Radar;
series6.Legend = "Legend1";
series6.LegendText = "Min";
series6.MarkerSize = 0;
series6.Name = "SeriesMin";
this.chart.Series.Add(series1);
this.chart.Series.Add(series2);
this.chart.Series.Add(series3);
this.chart.Series.Add(series4);
this.chart.Series.Add(series5);
this.chart.Series.Add(series6);
this.chart.Size = new System.Drawing.Size(1068, 823);
this.chart.TabIndex = 0;
this.chart.Text = "chart";
this.chart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.chart_MouseClick);
//
// lbSpring
//
this.lbSpring.AutoSize = true;
this.lbSpring.Font = new System.Drawing.Font("Gulim", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbSpring.Location = new System.Drawing.Point(11, 8);
this.lbSpring.Name = "lbSpring";
this.lbSpring.Size = new System.Drawing.Size(0, 12);
this.lbSpring.TabIndex = 1;
//
// panel1
//
this.panel1.Controls.Add(this.lbSpring);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1068, 19);
this.panel1.TabIndex = 2;
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.rbAll);
this.groupBox1.Controls.Add(this.rbNormalLow);
this.groupBox1.Controls.Add(this.rbNormalHigh);
this.groupBox1.Controls.Add(this.rbHighLow);
this.groupBox1.Controls.Add(this.rbHighHigh);
this.groupBox1.Controls.Add(this.rbLowTemp);
this.groupBox1.Location = new System.Drawing.Point(3, 28);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(623, 49);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
//
// panel2
//
this.panel2.Controls.Add(this.panelPopup);
this.panel2.Controls.Add(this.chart);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(3, 83);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1068, 823);
this.panel2.TabIndex = 5;
//
// panelPopup
//
this.panelPopup.Controls.Add(this.btnClose);
this.panelPopup.Controls.Add(this.label1);
this.panelPopup.Location = new System.Drawing.Point(198, 201);
this.panelPopup.Name = "panelPopup";
this.panelPopup.Size = new System.Drawing.Size(200, 100);
this.panelPopup.TabIndex = 1;
this.panelPopup.Visible = false;
this.panelPopup.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelPopup_MouseDown);
this.panelPopup.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panelPopup_MouseMove);
this.panelPopup.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panelPopup_MouseUp);
//
// rbLowTemp
//
this.rbLowTemp.Appearance = System.Windows.Forms.Appearance.Button;
this.rbLowTemp.Location = new System.Drawing.Point(516, 13);
this.rbLowTemp.Name = "rbLowTemp";
this.rbLowTemp.Size = new System.Drawing.Size(96, 34);
this.rbLowTemp.TabIndex = 0;
this.rbLowTemp.TabStop = true;
this.rbLowTemp.Text = "Low Temp";
this.rbLowTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.rbLowTemp.UseVisualStyleBackColor = true;
this.rbLowTemp.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbHighHigh
//
this.rbHighHigh.Appearance = System.Windows.Forms.Appearance.Button;
this.rbHighHigh.Location = new System.Drawing.Point(414, 13);
this.rbHighHigh.Name = "rbHighHigh";
this.rbHighHigh.Size = new System.Drawing.Size(96, 34);
this.rbHighHigh.TabIndex = 0;
this.rbHighHigh.TabStop = true;
this.rbHighHigh.Text = "High Temp\r\nHigh Humid";
this.rbHighHigh.UseVisualStyleBackColor = true;
this.rbHighHigh.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbHighLow
//
this.rbHighLow.Appearance = System.Windows.Forms.Appearance.Button;
this.rbHighLow.Location = new System.Drawing.Point(312, 13);
this.rbHighLow.Name = "rbHighLow";
this.rbHighLow.Size = new System.Drawing.Size(96, 34);
this.rbHighLow.TabIndex = 0;
this.rbHighLow.TabStop = true;
this.rbHighLow.Text = "High Temp\r\nLow Humid";
this.rbHighLow.UseVisualStyleBackColor = true;
this.rbHighLow.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbNormalHigh
//
this.rbNormalHigh.Appearance = System.Windows.Forms.Appearance.Button;
this.rbNormalHigh.Location = new System.Drawing.Point(210, 13);
this.rbNormalHigh.Name = "rbNormalHigh";
this.rbNormalHigh.Size = new System.Drawing.Size(96, 34);
this.rbNormalHigh.TabIndex = 0;
this.rbNormalHigh.TabStop = true;
this.rbNormalHigh.Text = "Normal Temp\r\nHigh Humid";
this.rbNormalHigh.UseVisualStyleBackColor = true;
this.rbNormalHigh.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbNormalLow
//
this.rbNormalLow.Appearance = System.Windows.Forms.Appearance.Button;
this.rbNormalLow.Location = new System.Drawing.Point(108, 13);
this.rbNormalLow.Name = "rbNormalLow";
this.rbNormalLow.Size = new System.Drawing.Size(96, 34);
this.rbNormalLow.TabIndex = 0;
this.rbNormalLow.TabStop = true;
this.rbNormalLow.Text = "Normal Temp\r\nLow Humid";
this.rbNormalLow.UseVisualStyleBackColor = true;
this.rbNormalLow.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// rbAll
//
this.rbAll.Appearance = System.Windows.Forms.Appearance.Button;
this.rbAll.Location = new System.Drawing.Point(6, 13);
this.rbAll.Name = "rbAll";
this.rbAll.Size = new System.Drawing.Size(96, 34);
this.rbAll.TabIndex = 0;
this.rbAll.TabStop = true;
this.rbAll.Text = "All";
this.rbAll.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.rbAll.UseVisualStyleBackColor = true;
this.rbAll.CheckedChanged += new System.EventHandler(this.rbAll_CheckedChanged);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.groupBox1, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 2);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 55F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1074, 909);
this.tableLayoutPanel1.TabIndex = 4;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(39, 41);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(117, 12);
this.label1.TabIndex = 0;
this.label1.Text = "데이터가 부족합니다";
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(122, 74);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 1;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// PanelRadarGraph
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1074, 909);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelRadarGraph";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Radar Graph";
this.Text = "Radar Graph";
this.Enter += new System.EventHandler(this.PanelRadarGraph_Enter);
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panelPopup.ResumeLayout(false);
this.panelPopup.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataVisualization.Charting.Chart chart;
private System.Windows.Forms.Label lbSpring;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton rbLowTemp;
private System.Windows.Forms.RadioButton rbHighHigh;
private System.Windows.Forms.RadioButton rbHighLow;
private System.Windows.Forms.RadioButton rbNormalHigh;
private System.Windows.Forms.RadioButton rbNormalLow;
private System.Windows.Forms.RadioButton rbAll;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panelPopup;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Label label1;
}
}

249
PanelRadarGraph.cs Normal file
View File

@@ -0,0 +1,249 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using WeifenLuo.WinFormsUI.Docking;
namespace friction
{
public partial class PanelRadarGraph : DockContent
{
MainForm m_Owner = null;
DataHandler m_DataHandler = null;
string m_CurSpring = "";
List<string> m_UncheckedTable = null;
Config.RANGE m_TempRange = Config.TEMP_ALL;
Config.RANGE m_HumidRange = Config.HUMID_ALL;
bool m_bPopupDrag = false;
Point m_DragPos;
public PanelRadarGraph(MainForm owner, DataHandler data)
{
InitializeComponent();
m_Owner = owner;
m_DataHandler = data;
Theme.Apply(this);
Theme.Apply(rbAll);
Theme.Apply(rbNormalLow);
Theme.Apply(rbNormalHigh);
Theme.Apply(rbHighLow);
Theme.Apply(rbHighHigh);
Theme.Apply(rbLowTemp);
Theme.Apply(btnClose);
chart.ChartAreas[0].AxisY.Maximum = 10;
//chart.Series["SeriesHigh"].Color = Color.FromArgb(255, 200, 200, 200);
//chart.Series["SeriesPotential"].Color = Color.FromArgb(255, 180, 180, 180);
//chart.Series["SeriesNo"].Color = Color.FromArgb(255, 140, 140, 140);
chart.Series["SeriesHigh"].Color = Color.FromArgb(255, 255, 185, 185);
chart.Series["SeriesHigh"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesPotential"].Color = Color.FromArgb(255, 255, 255, 151);
chart.Series["SeriesPotential"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesNo"].Color = Color.FromArgb(255, 175, 255, 211);
chart.Series["SeriesNo"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesMax"].Color = Color.FromArgb(255, 192, 0, 0);
chart.Series["SeriesMax"]["RadarDrawingStyle"] = "Line";
chart.Series["SeriesMax"].BorderWidth = 3;
chart.Series["SeriesMax"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesAvg"].Color = Color.FromArgb(255, 229, 150, 9);
chart.Series["SeriesAvg"]["RadarDrawingStyle"] = "Line";
chart.Series["SeriesAvg"].BorderWidth = 3;
chart.Series["SeriesAvg"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.Series["SeriesMin"].Color = Color.FromArgb(255, 79, 98, 40);
chart.Series["SeriesMin"]["RadarDrawingStyle"] = "Line";
chart.Series["SeriesMin"].BorderWidth = 3;
chart.Series["SeriesMin"].Font = new Font(chart.Series["SeriesNo"].Font.FontFamily, 20.0f);
chart.ChartAreas[0].AxisX.LabelStyle.Font = new Font(chart.ChartAreas[0].AxisX.LabelStyle.Font.FontFamily, 14.0f);
chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 1;
chart.ChartAreas[0].AxisY.MajorGrid.LineWidth = 1;
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Black;
chart.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
chart.ChartAreas[0].AxisX.MinorTickMark.Enabled = false;
chart.ChartAreas[0].AxisY.MajorTickMark.Enabled = true;
chart.ChartAreas[0].AxisY.MajorTickMark.LineWidth = 1;
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = Color.FromArgb(150, 0, 0, 0);
chart.ChartAreas[0].AxisY.MinorTickMark.Enabled = false;
chart.ChartAreas[0].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont;
chart.ChartAreas[0].AxisX.IsLabelAutoFit = true;
foreach (var series in chart.Series)
series["AreaDrawingStyle"] = "Polygon";
panel1.BackColor = Color.Gray;
}
public void Reset()
{
m_CurSpring = "";
}
public void UpdateGraph()
{
panelPopup.Visible = false;
string strSpring = m_DataHandler.GetCurSpring();
List<string> uncheckedTable = Config.GetInstance().GetTableUnchecked();
if (strSpring == m_CurSpring && uncheckedTable == m_UncheckedTable)
return;
lbSpring.Text = "Material Spring: " + strSpring;
lbSpring.BackColor = Color.Gray;
lbSpring.ForeColor = Color.Black;
foreach (var series in chart.Series)
series.Points.Clear();
List<DataHandler.RADAR_CHART> graphData = m_DataHandler.GetAvgAll(strSpring, m_TempRange, m_HumidRange);
List<string> xValues = new List<string>();
List<float> yValues = new List<float>();
int iTableCnt = 0;
foreach(var data in graphData)
{
if (uncheckedTable.Contains(data.m_strTable) == true)
continue;
chart.Series["SeriesMax"].Points.AddXY(data.m_strTable, data.m_fMax);
chart.Series["SeriesAvg"].Points.AddXY(data.m_strTable, data.m_fAvg);
chart.Series["SeriesMin"].Points.AddXY(data.m_strTable, data.m_fMin);
chart.Series["SeriesHigh"].Points.AddXY(data.m_strTable, (int)Config.ANALYSIS.RISK.HIGH);
chart.Series["SeriesPotential"].Points.AddXY(data.m_strTable, (int)Config.ANALYSIS.RISK.POTENTIAL);
chart.Series["SeriesNo"].Points.AddXY(data.m_strTable, (int)Config.ANALYSIS.RISK.NO);
iTableCnt++;
}
m_CurSpring = strSpring;
if (iTableCnt < 3)
{
panelPopup.Left = (panel2.Width - panelPopup.Width) / 2;
panelPopup.Top = (panel2.Height - panelPopup.Height) / 2;
panelPopup.Visible = true;
}
}
public Bitmap CopyChart()
{
MemoryStream ms = new MemoryStream();
chart.SaveImage(ms, ChartImageFormat.Bmp);
Bitmap bm = new Bitmap(ms);
return bm;
}
private void chart_MouseClick(object sender, MouseEventArgs e)
{
HitTestResult result = chart.HitTest(e.X, e.Y);
if(result.ChartElementType == ChartElementType.AxisLabels &&
result.Object != null)
{
string strTable = (string)result.Object;
m_Owner.OnRadarSelectTable(strTable);
}
}
private void rbAll_CheckedChanged(object sender, EventArgs e)
{
if(sender.GetType() == typeof(RadioButton))
{
RadioButton btn = sender as RadioButton;
if (btn.Checked == false)
return;
}
if (rbAll.Checked == true)
{
m_TempRange = Config.TEMP_ALL;
m_HumidRange = Config.HUMID_ALL;
}
else if (rbNormalLow.Checked == true)
{
m_TempRange = Config.TEMP_NORMAL;
m_HumidRange = Config.HUMID_LOW;
}
else if (rbNormalHigh.Checked == true)
{
m_TempRange = Config.TEMP_NORMAL;
m_HumidRange = Config.HUMID_HIGH;
}
else if (rbHighLow.Checked == true)
{
m_TempRange = Config.TEMP_HIGH;
m_HumidRange = Config.HUMID_LOW;
}
else if (rbHighHigh.Checked == true)
{
m_TempRange = Config.TEMP_HIGH;
m_HumidRange = Config.HUMID_HIGH;
}
else if (rbLowTemp.Checked == true)
{
m_TempRange = Config.TEMP_LOW;
m_HumidRange = Config.HUMID_ALL;
}
m_CurSpring = "";
UpdateGraph();
}
private void PanelRadarGraph_Enter(object sender, EventArgs e)
{
m_Owner.OnRadarGraphActivated();
}
private void btnClose_Click(object sender, EventArgs e)
{
panelPopup.Visible = false;
}
private void panelPopup_MouseDown(object sender, MouseEventArgs e)
{
m_bPopupDrag = true;
m_DragPos = e.Location;
panelPopup.Capture = true;
}
private void panelPopup_MouseUp(object sender, MouseEventArgs e)
{
m_bPopupDrag = false;
panelPopup.Capture = false;
}
private void panelPopup_MouseMove(object sender, MouseEventArgs e)
{
if (m_bPopupDrag == true)
{
panelPopup.Left = e.X + panelPopup.Left - m_DragPos.X;
panelPopup.Top = e.Y + panelPopup.Top - m_DragPos.Y;
}
}
}
}

6293
PanelRadarGraph.resx Normal file

File diff suppressed because it is too large Load Diff

123
PanelResult.Designer.cs generated Normal file
View File

@@ -0,0 +1,123 @@
namespace friction
{
partial class PanelResult
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelResult));
this.dgvData = new System.Windows.Forms.DataGridView();
this.lvColumn = new System.Windows.Forms.ListView();
this.lvchColumns = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// dgvData
//
this.dgvData.AllowUserToAddRows = false;
this.dgvData.AllowUserToDeleteRows = false;
this.dgvData.AllowUserToOrderColumns = true;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvData.Location = new System.Drawing.Point(3, 3);
this.dgvData.Name = "dgvData";
this.dgvData.ReadOnly = true;
this.dgvData.RowTemplate.Height = 23;
this.dgvData.Size = new System.Drawing.Size(716, 717);
this.dgvData.TabIndex = 0;
//
// lvColumn
//
this.lvColumn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.lvColumn.CheckBoxes = true;
this.lvColumn.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.lvchColumns});
this.lvColumn.FullRowSelect = true;
this.lvColumn.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lvColumn.Location = new System.Drawing.Point(725, 3);
this.lvColumn.MultiSelect = false;
this.lvColumn.Name = "lvColumn";
this.lvColumn.Size = new System.Drawing.Size(194, 717);
this.lvColumn.TabIndex = 1;
this.lvColumn.UseCompatibleStateImageBehavior = false;
this.lvColumn.View = System.Windows.Forms.View.Details;
this.lvColumn.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvColumn_ItemChecked);
this.lvColumn.SizeChanged += new System.EventHandler(this.lvColumn_SizeChanged);
//
// lvchColumns
//
this.lvchColumns.Text = "Columns";
this.lvchColumns.Width = 175;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 200F));
this.tableLayoutPanel1.Controls.Add(this.dgvData, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.lvColumn, 1, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(922, 723);
this.tableLayoutPanel1.TabIndex = 2;
//
// PanelResult
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(922, 723);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelResult";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Result Table";
this.Text = "Result Table";
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.ListView lvColumn;
private System.Windows.Forms.ColumnHeader lvchColumns;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

203
PanelResult.cs Normal file
View File

@@ -0,0 +1,203 @@
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 PanelResult : DockContent
{
MainForm m_Owner = null;
public PanelResult(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
Theme.Apply(this);
Theme.Apply(dgvData);
Theme.Apply(lvColumn);
dgvData.CellFormatting += DgvData_CellFormatting;
}
private void DgvData_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
DataGridViewRow row = dgvData.Rows[e.RowIndex];
if(e.ColumnIndex == row.Cells[Config.COLUMN_NAME.RPN].ColumnIndex)
{
if ((float)e.Value <= 3)
e.CellStyle.BackColor = Theme.Green;
else if ((float)e.Value <= 5)
e.CellStyle.BackColor = Theme.Yellow;
else
e.CellStyle.BackColor = Theme.Red;
}
}
public void UpdateData(DataHandler data)
{
dgvData.DataSource = data.GetData();
dgvData.DefaultCellStyle.Format = "N2";
if(lvColumn.Items.Count > 0)
{
Config.OPTION.GetInstance().CheckedColumns = GetCheckedColumns();
Config.OPTION.GetInstance().UncheckedColumns = GetUncheckedColumns();
}
lvColumn.Items.Clear();
List<List<string>> Columns = new List<List<string>>() { data.GetActiveColumns(), data.GetNonactiveColumns() };
for(int iGroup=0; iGroup<Columns.Count; iGroup++)
{
foreach(string col in Columns[iGroup])
{
ListViewItem item = new ListViewItem(new string[] { col });
item.Text = col;
if(Config.OPTION.GetInstance().CheckedColumns != null && Config.OPTION.GetInstance().CheckedColumns.Exists(s => s==col) == true)
item.Checked = true;
else if(Config.OPTION.GetInstance().UncheckedColumns != null && Config.OPTION.GetInstance().UncheckedColumns.Exists(s => s == col) == true)
item.Checked = false;
else if (iGroup == 0)
item.Checked = true;
else
item.Checked = false;
item.ForeColor = (iGroup == 0) ? Theme.Forecolor : Theme.Gray;
lvColumn.Items.Add(item);
}
}
}
private void lvColumn_ItemChecked(object sender, ItemCheckedEventArgs e)
{
string strColName = e.Item.SubItems[0].Text;
bool bShow = e.Item.Checked;
dgvData.Columns[strColName].Visible = bShow;
}
private void lvColumn_SizeChanged(object sender, EventArgs e)
{
Theme.ResizeFullColumn(lvColumn);
}
public void SelectRowByHumidity(string strSpring, string strTable, float fHumidity, float fRPN)
{
dgvData.ClearSelection();
DataGridViewRow row = dgvData.Rows
.Cast<DataGridViewRow>()
.Where(r =>
r.Cells[Config.COLUMN_NAME.SPRING].Value.Equals(strSpring) &&
r.Cells[Config.COLUMN_NAME.TABLE].Value.Equals(strTable) &&
r.Cells[Config.COLUMN_NAME.RPN].Value.Equals(fRPN) &&
r.Cells[Config.COLUMN_NAME.HUMIDITY].Value.Equals(fHumidity)
)
.First();
if (row != null)
{
row.Selected = true;
dgvData.FirstDisplayedScrollingRowIndex = row.Index;
}
}
public void SelectRowByTemperature(string strSpring, string strTable, float fTemperature, float fRPN)
{
dgvData.ClearSelection();
DataGridViewRow row = dgvData.Rows
.Cast<DataGridViewRow>()
.Where(r =>
r.Cells[Config.COLUMN_NAME.SPRING].Value.Equals(strSpring) &&
r.Cells[Config.COLUMN_NAME.TABLE].Value.Equals(strTable) &&
r.Cells[Config.COLUMN_NAME.RPN].Value.Equals(fRPN) &&
r.Cells[Config.COLUMN_NAME.TEMP].Value.Equals(fTemperature)
)
.First();
if (row != null)
{
row.Selected = true;
dgvData.FirstDisplayedScrollingRowIndex = row.Index;
}
}
public void SelectRowByForce(string strSpring, string strTable, float fForce, float fRPN)
{
dgvData.ClearSelection();
DataGridViewRow row = dgvData.Rows
.Cast<DataGridViewRow>()
.Where(r =>
r.Cells[Config.COLUMN_NAME.SPRING].Value.Equals(strSpring) &&
r.Cells[Config.COLUMN_NAME.TABLE].Value.Equals(strTable) &&
r.Cells[Config.COLUMN_NAME.RPN].Value.Equals(fRPN) &&
r.Cells[Config.COLUMN_NAME.FORCE].Value.Equals(fForce)
)
.First();
if (row != null)
{
row.Selected = true;
dgvData.FirstDisplayedScrollingRowIndex = row.Index;
}
}
public void SelectRowByVelocity(string strSpring, string strTable, float fVelocity, float fRPN)
{
dgvData.ClearSelection();
DataGridViewRow row = dgvData.Rows
.Cast<DataGridViewRow>()
.Where(r =>
r.Cells[Config.COLUMN_NAME.SPRING].Value.Equals(strSpring) &&
r.Cells[Config.COLUMN_NAME.TABLE].Value.Equals(strTable) &&
r.Cells[Config.COLUMN_NAME.RPN].Value.Equals(fRPN) &&
r.Cells[Config.COLUMN_NAME.VELOCITY].Value.Equals(fVelocity)
)
.First();
if (row != null)
{
row.Selected = true;
dgvData.FirstDisplayedScrollingRowIndex = row.Index;
}
}
public List<string> GetCheckedColumns()
{
List<string> result = new List<string>();
foreach(ListViewItem item in lvColumn.Items)
{
if (item.Checked == true)
result.Add(item.Text);
}
return result;
}
public List<string> GetUncheckedColumns()
{
List<string> result = new List<string>();
foreach (ListViewItem item in lvColumn.Items)
{
if (item.Checked == false)
result.Add(item.Text);
}
return result;
}
}
}

6293
PanelResult.resx Normal file

File diff suppressed because it is too large Load Diff

234
PanelTrendGraph.Designer.cs generated Normal file
View File

@@ -0,0 +1,234 @@
namespace friction
{
partial class PanelTrendGraph
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelTrendGraph));
this.trendChart = new LiveCharts.WinForms.CartesianChart();
this.rbHumidity = new System.Windows.Forms.RadioButton();
this.rbTemp = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rbVelocity = new System.Windows.Forms.RadioButton();
this.rbForce = new System.Windows.Forms.RadioButton();
this.lbPair1 = new System.Windows.Forms.Label();
this.lbPair2 = new System.Windows.Forms.Label();
this.lbPair3 = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel1 = new System.Windows.Forms.Panel();
this.panelGraph = new System.Windows.Forms.Panel();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.panelGraph.SuspendLayout();
this.SuspendLayout();
//
// trendChart
//
this.trendChart.Dock = System.Windows.Forms.DockStyle.Fill;
this.trendChart.Location = new System.Drawing.Point(0, 0);
this.trendChart.Name = "trendChart";
this.trendChart.Size = new System.Drawing.Size(756, 608);
this.trendChart.TabIndex = 0;
this.trendChart.Text = "trendChart";
this.trendChart.UpdaterTick += new LiveCharts.Events.UpdaterTickHandler(this.trendChart_UpdaterTick);
//
// rbHumidity
//
this.rbHumidity.Appearance = System.Windows.Forms.Appearance.Button;
this.rbHumidity.AutoSize = true;
this.rbHumidity.Checked = true;
this.rbHumidity.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.rbHumidity.Location = new System.Drawing.Point(6, 19);
this.rbHumidity.Name = "rbHumidity";
this.rbHumidity.Size = new System.Drawing.Size(66, 24);
this.rbHumidity.TabIndex = 1;
this.rbHumidity.TabStop = true;
this.rbHumidity.Text = "Humidity";
this.rbHumidity.UseVisualStyleBackColor = true;
this.rbHumidity.CheckedChanged += new System.EventHandler(this.rbHumidity_CheckedChanged);
//
// rbTemp
//
this.rbTemp.Appearance = System.Windows.Forms.Appearance.Button;
this.rbTemp.AutoSize = true;
this.rbTemp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.rbTemp.Location = new System.Drawing.Point(77, 19);
this.rbTemp.Name = "rbTemp";
this.rbTemp.Size = new System.Drawing.Size(89, 24);
this.rbTemp.TabIndex = 1;
this.rbTemp.Text = "Temperature";
this.rbTemp.UseVisualStyleBackColor = true;
this.rbTemp.CheckedChanged += new System.EventHandler(this.rbTemp_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.rbHumidity);
this.groupBox1.Controls.Add(this.rbVelocity);
this.groupBox1.Controls.Add(this.rbForce);
this.groupBox1.Controls.Add(this.rbTemp);
this.groupBox1.ForeColor = System.Drawing.SystemColors.ControlText;
this.groupBox1.Location = new System.Drawing.Point(6, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(300, 50);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Data";
//
// rbVelocity
//
this.rbVelocity.Appearance = System.Windows.Forms.Appearance.Button;
this.rbVelocity.AutoSize = true;
this.rbVelocity.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.rbVelocity.Location = new System.Drawing.Point(225, 19);
this.rbVelocity.Name = "rbVelocity";
this.rbVelocity.Size = new System.Drawing.Size(62, 24);
this.rbVelocity.TabIndex = 1;
this.rbVelocity.Text = "Velocity";
this.rbVelocity.UseVisualStyleBackColor = true;
this.rbVelocity.CheckedChanged += new System.EventHandler(this.rbVelocity_CheckedChanged);
//
// rbForce
//
this.rbForce.Appearance = System.Windows.Forms.Appearance.Button;
this.rbForce.AutoSize = true;
this.rbForce.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.rbForce.Location = new System.Drawing.Point(171, 19);
this.rbForce.Name = "rbForce";
this.rbForce.Size = new System.Drawing.Size(49, 24);
this.rbForce.TabIndex = 1;
this.rbForce.Text = "Force";
this.rbForce.UseVisualStyleBackColor = true;
this.rbForce.CheckedChanged += new System.EventHandler(this.rbForce_CheckedChanged);
//
// lbPair1
//
this.lbPair1.AutoSize = true;
this.lbPair1.Location = new System.Drawing.Point(312, 28);
this.lbPair1.Name = "lbPair1";
this.lbPair1.Size = new System.Drawing.Size(32, 12);
this.lbPair1.TabIndex = 4;
this.lbPair1.Text = "label";
//
// lbPair2
//
this.lbPair2.AutoSize = true;
this.lbPair2.Location = new System.Drawing.Point(350, 28);
this.lbPair2.Name = "lbPair2";
this.lbPair2.Size = new System.Drawing.Size(32, 12);
this.lbPair2.TabIndex = 5;
this.lbPair2.Text = "label";
//
// lbPair3
//
this.lbPair3.AutoSize = true;
this.lbPair3.Location = new System.Drawing.Point(388, 28);
this.lbPair3.Name = "lbPair3";
this.lbPair3.Size = new System.Drawing.Size(32, 12);
this.lbPair3.TabIndex = 6;
this.lbPair3.Text = "label";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.panelGraph, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(762, 674);
this.tableLayoutPanel1.TabIndex = 7;
//
// panel1
//
this.panel1.Controls.Add(this.groupBox1);
this.panel1.Controls.Add(this.lbPair1);
this.panel1.Controls.Add(this.lbPair3);
this.panel1.Controls.Add(this.lbPair2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(756, 54);
this.panel1.TabIndex = 8;
//
// panelGraph
//
this.panelGraph.Controls.Add(this.trendChart);
this.panelGraph.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelGraph.Location = new System.Drawing.Point(3, 63);
this.panelGraph.Name = "panelGraph";
this.panelGraph.Size = new System.Drawing.Size(756, 608);
this.panelGraph.TabIndex = 8;
//
// PanelTrendGraph
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(762, 674);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)
| WeifenLuo.WinFormsUI.Docking.DockAreas.Document)));
this.HideOnClose = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "PanelTrendGraph";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Trend Graph";
this.Text = "Trend Graph";
this.Enter += new System.EventHandler(this.PanelTrendGraph_Enter);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panelGraph.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private LiveCharts.WinForms.CartesianChart trendChart;
private System.Windows.Forms.RadioButton rbHumidity;
private System.Windows.Forms.RadioButton rbTemp;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton rbVelocity;
private System.Windows.Forms.RadioButton rbForce;
private System.Windows.Forms.Label lbPair1;
private System.Windows.Forms.Label lbPair2;
private System.Windows.Forms.Label lbPair3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panelGraph;
}
}

532
PanelTrendGraph.cs Normal file
View File

@@ -0,0 +1,532 @@
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;
using LiveCharts;
using LiveCharts.Wpf;
using LiveCharts.WinForms;
using LiveCharts.Defaults;
using System.Windows.Media;
using System.Timers;
namespace friction
{
public partial class PanelTrendGraph : DockContent
{
public enum GRAPH_TYPE
{
NONE,
HUMIDITY,
TEMPERATURE,
FORCE,
VELOCITY
}
MainForm m_Owner = null;
DataHandler m_DataHandler = null;
string m_CurSpring = "";
string m_CurTable = "";
GRAPH_TYPE m_GraphType = GRAPH_TYPE.NONE;
// for report
bool m_bReport = false;
System.Windows.Forms.Timer m_ReportTimer = null;
public PanelTrendGraph(MainForm owner, DataHandler data)
{
InitializeComponent();
m_Owner = owner;
m_DataHandler = data;
Theme.Apply(this);
Theme.Apply(trendChart);
Theme.Apply(groupBox1);
Theme.Apply(rbHumidity);
Theme.Apply(rbTemp);
lbPair1.ForeColor = Theme.Orange;
lbPair2.ForeColor = Theme.White;
lbPair3.ForeColor = Theme.Orange;
lbPair1.Text = "";
lbPair2.Text = "";
lbPair3.Text = "";
trendChart.AxisX.Add(new Axis
{
Title = "Humidity",
});
trendChart.AxisY.Add(new Axis
{
Title = "RPN",
MinValue = 0,
MaxValue = 10,
Sections = new SectionsCollection
{
new AxisSection
{
Value = 5,
SectionWidth = 5,
Fill = new SolidColorBrush
{
Color = System.Windows.Media.Color.FromArgb(Theme.Red.A, Theme.Red.R, Theme.Red.G, Theme.Red.B),
Opacity = .25
}
},
new AxisSection
{
Value = 3,
SectionWidth = 2,
Fill = new SolidColorBrush
{
Color = System.Windows.Media.Color.FromArgb(Theme.Yellow.A, Theme.Yellow.R, Theme.Yellow.G, Theme.Yellow.B),
Opacity = .25
}
},
new AxisSection
{
Value = 0,
SectionWidth = 3,
Fill = new SolidColorBrush
{
Color = System.Windows.Media.Color.FromArgb(Theme.Green.A, Theme.Green.R, Theme.Green.G, Theme.Green.B),
Opacity = .25
}
}
}
});
trendChart.LegendLocation = LegendLocation.Right;
trendChart.DataClick += TrendChart_DataClick;
trendChart.DefaultLegend.Foreground = new SolidColorBrush(
System.Windows.Media.Color.FromArgb(
Theme.Forecolor.A, Theme.Forecolor.R, Theme.Forecolor.G, Theme.Forecolor.B));
}
public void Reset()
{
m_CurSpring = "";
m_CurTable = "";
m_GraphType = GRAPH_TYPE.NONE;
}
private void TrendChart_DataClick(object sender, ChartPoint chartPoint)
{
switch (m_GraphType)
{
case GRAPH_TYPE.HUMIDITY:
m_Owner.OnTrendSelectByHumidity(m_CurSpring, m_CurTable, (float)chartPoint.X, (float)chartPoint.Y);
break;
case GRAPH_TYPE.TEMPERATURE:
m_Owner.OnTrendSelectByTemperature(m_CurSpring, m_CurTable, (float)chartPoint.X, (float)chartPoint.Y);
break;
case GRAPH_TYPE.FORCE:
m_Owner.OnTrendSelectByForce(m_CurSpring, m_CurTable, (float)chartPoint.X, (float)chartPoint.Y);
break;
case GRAPH_TYPE.VELOCITY:
m_Owner.OnTrendSelectByVelocity(m_CurSpring, m_CurTable, (float)chartPoint.X, (float)chartPoint.Y);
break;
}
}
private void UpdateGraphHumidity()
{
string strSpring = m_DataHandler.GetCurSpring();
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Humidity";
ChartValues<ScatterPoint>[] Points = {
new ChartValues<ScatterPoint>(),
new ChartValues<ScatterPoint>(),
new ChartValues<ScatterPoint>() };
var Values = new List<TrendLine.POINT>();
foreach (var pnt in Chart)
{
if (pnt.TEMPERATURE < 0)
Points[0].Add(new ScatterPoint(pnt.HUMIDITY, pnt.RPN, 2));
else if (pnt.TEMPERATURE > 30)
Points[2].Add(new ScatterPoint(pnt.HUMIDITY, pnt.RPN, 2));
else
Points[1].Add(new ScatterPoint(pnt.HUMIDITY, pnt.RPN, 2));
Values.Add(new TrendLine.POINT { X = pnt.HUMIDITY, Y = pnt.RPN });
}
if (Chart.Count <= 0)
return;
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
TrendLine trendline = new TrendLine(Values);
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
TrendPoints.Add(new ScatterPoint(Values[0].X, trendline.GetY(Values[0].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count / 2].X, trendline.GetY(Values[Values.Count / 2].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count - 1].X, trendline.GetY(Values[Values.Count - 1].X)));
System.Windows.Media.SolidColorBrush[] brushes = {
System.Windows.Media.Brushes.DodgerBlue.Clone(),
System.Windows.Media.Brushes.Green.Clone(),
System.Windows.Media.Brushes.IndianRed.Clone() };
foreach (var brush in brushes)
brush.Opacity = 1;
trendChart.Series = new SeriesCollection
{
new ScatterSeries
{
Title = "Low Temp",
Values = Points[0],
Fill = brushes[0],
LabelPoint = p => string.Format("{0:n2}%, RPN {1}", p.X, p.Y),
},
new ScatterSeries
{
Title = "Mid Temp",
Values = Points[1],
Fill = brushes[1],
LabelPoint = p => string.Format("{0:n2}%, RPN {1}", p.X, p.Y),
},
new ScatterSeries
{
Title = "High Temp",
Values = Points[2],
Fill = brushes[2],
LabelPoint = p => string.Format("{0:n2}%, RPN {1}", p.X, p.Y),
},
new LineSeries
{
Title = "Trend",
Values = TrendPoints,
PointGeometry = DefaultGeometries.None,
StrokeThickness = 4,
Stroke = System.Windows.Media.Brushes.Orange,
},
};
float fMin = Chart.Min(r => r.HUMIDITY);
float fMax = Chart.Max(r => r.HUMIDITY);
float fMargin = (fMax - fMin) * 0.05f;
trendChart.AxisX[0].MinValue = (fMin-fMargin);
trendChart.AxisX[0].MaxValue = (fMax+fMargin);
m_CurSpring = strSpring;
m_CurTable = strTable;
}
private void UpdateGraphTemperature()
{
string strSpring = m_DataHandler.GetCurSpring();
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Temperature";
ChartValues<ScatterPoint>[] Points = {
new ChartValues<ScatterPoint>(),
new ChartValues<ScatterPoint>() };
var Values = new List<TrendLine.POINT>();
foreach (var pnt in Chart)
{
if (pnt.HUMIDITY <= 60)
Points[0].Add(new ScatterPoint(pnt.TEMPERATURE, pnt.RPN, 2));
else
Points[1].Add(new ScatterPoint(pnt.TEMPERATURE, pnt.RPN, 2));
Values.Add(new TrendLine.POINT { X = pnt.TEMPERATURE, Y = pnt.RPN });
}
if (Chart.Count <= 0)
return;
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
TrendLine trendline = new TrendLine(Values);
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
TrendPoints.Add(new ScatterPoint(Values[0].X, trendline.GetY(Values[0].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count / 2].X, trendline.GetY(Values[Values.Count / 2].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count - 1].X, trendline.GetY(Values[Values.Count - 1].X)));
trendChart.Series = new SeriesCollection
{
new ScatterSeries
{
Title = "Low Humidity",
Values = Points[0],
Foreground = System.Windows.Media.Brushes.SkyBlue,
LabelPoint = p => string.Format("{0:n2}℃, RPN {1}", p.X, p.Y),
},
new ScatterSeries
{
Title = "High Humidity",
Values = Points[1],
Foreground = System.Windows.Media.Brushes.DarkBlue,
LabelPoint = p => string.Format("{0:n2}℃, RPN {1}", p.X, p.Y),
},
new LineSeries
{
Title = "Trend",
Values = TrendPoints,
PointGeometry = DefaultGeometries.None,
StrokeThickness = 4,
},
};
float fMin = Chart.Min(r => r.TEMPERATURE);
float fMax = Chart.Max(r => r.TEMPERATURE);
float fMargin = (fMax - fMin) * 0.05f;
trendChart.AxisX[0].MinValue = (fMin - fMargin);
trendChart.AxisX[0].MaxValue = (fMax + fMargin);
}
private void UpdateGraphForce()
{
string strSpring = m_DataHandler.GetCurSpring();
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Force";
var Points = new ChartValues<ScatterPoint>();
var Values = new List<TrendLine.POINT>();
foreach (var pnt in Chart)
{
Points.Add(new ScatterPoint(pnt.FORCE, pnt.RPN, 2));
Values.Add(new TrendLine.POINT { X = pnt.FORCE, Y = pnt.RPN });
}
if (Chart.Count <= 0)
return;
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
TrendLine trendline = new TrendLine(Values);
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
TrendPoints.Add(new ScatterPoint(Values[0].X, trendline.GetY(Values[0].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count / 2].X, trendline.GetY(Values[Values.Count / 2].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count - 1].X, trendline.GetY(Values[Values.Count - 1].X)));
trendChart.Series = new SeriesCollection
{
new ScatterSeries
{
Title = "RPN by force",
Values = Points,
Foreground = System.Windows.Media.Brushes.SkyBlue,
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
},
new LineSeries
{
Title = "Trend",
Values = TrendPoints,
PointGeometry = DefaultGeometries.None,
StrokeThickness = 4,
},
};
float fMin = Chart.Min(r => r.FORCE);
float fMax = Chart.Max(r => r.FORCE);
float fMargin = (fMax - fMin) * 0.05f;
trendChart.AxisX[0].MinValue = (fMin - fMargin);
trendChart.AxisX[0].MaxValue = (fMax + fMargin);
}
private void UpdateGraphVelocity()
{
string strSpring = m_DataHandler.GetCurSpring();
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Velocity";
var Points = new ChartValues<ScatterPoint>();
var Values = new List<TrendLine.POINT>();
foreach (var pnt in Chart)
{
Points.Add(new ScatterPoint(pnt.VELOCITY, pnt.RPN, 2));
Values.Add(new TrendLine.POINT { X = pnt.VELOCITY, Y = pnt.RPN });
}
if (Chart.Count <= 0)
return;
Values.Sort((a, b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
TrendLine trendline = new TrendLine(Values);
ChartValues<ScatterPoint> TrendPoints = new ChartValues<ScatterPoint>();
TrendPoints.Add(new ScatterPoint(Values[0].X, trendline.GetY(Values[0].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count / 2].X, trendline.GetY(Values[Values.Count / 2].X)));
TrendPoints.Add(new ScatterPoint(Values[Values.Count - 1].X, trendline.GetY(Values[Values.Count - 1].X)));
trendChart.Series = new SeriesCollection
{
new ScatterSeries
{
Title = "RPN by velocity",
Values = Points,
Foreground = System.Windows.Media.Brushes.SkyBlue,
LabelPoint = p => string.Format("{0:n2}, {1}", p.X, p.Y),
},
new LineSeries
{
Title = "Trend",
Values = TrendPoints,
PointGeometry = DefaultGeometries.None,
StrokeThickness = 4,
},
};
float fMin = Chart.Min(r => r.VELOCITY);
float fMax = Chart.Max(r => r.VELOCITY);
float fMargin = (fMax - fMin) * 0.05f;
trendChart.AxisX[0].MinValue = (fMin - fMargin);
trendChart.AxisX[0].MaxValue = (fMax + fMargin);
}
public void UpdateGraph(GRAPH_TYPE Type=GRAPH_TYPE.NONE)
{
if (Type == GRAPH_TYPE.NONE)
{
if (rbHumidity.Checked == true)
UpdateGraph(GRAPH_TYPE.HUMIDITY);
else if (rbTemp.Checked == true)
UpdateGraph(GRAPH_TYPE.TEMPERATURE);
else if (rbForce.Checked == true)
UpdateGraph(GRAPH_TYPE.FORCE);
else if (rbVelocity.Checked == true)
UpdateGraph(GRAPH_TYPE.VELOCITY);
return;
}
string strSpring = m_DataHandler.GetCurSpring();
string strTable = m_DataHandler.GetCurTable();
switch (Type)
{
case GRAPH_TYPE.HUMIDITY:
UpdateGraphHumidity();
break;
case GRAPH_TYPE.TEMPERATURE:
UpdateGraphTemperature();
break;
case GRAPH_TYPE.FORCE:
UpdateGraphForce();
break;
case GRAPH_TYPE.VELOCITY:
UpdateGraphVelocity();
break;
}
m_CurSpring = strSpring;
m_CurTable = strTable;
m_GraphType = Type;
lbPair1.Text = strSpring;
lbPair2.Text = " vs ";
lbPair3.Text = strTable;
lbPair2.Left = lbPair1.Right;
lbPair3.Left = lbPair2.Right;
}
private void rbHumidity_CheckedChanged(object sender, EventArgs e)
{
if(sender == rbHumidity && rbHumidity.Checked == true)
UpdateGraph(GRAPH_TYPE.HUMIDITY);
}
private void rbTemp_CheckedChanged(object sender, EventArgs e)
{
if (sender == rbTemp && rbTemp.Checked == true)
UpdateGraph(GRAPH_TYPE.TEMPERATURE);
}
private void rbForce_CheckedChanged(object sender, EventArgs e)
{
if (sender == rbForce && rbForce.Checked == true)
UpdateGraph(GRAPH_TYPE.FORCE);
}
private void rbVelocity_CheckedChanged(object sender, EventArgs e)
{
if (sender == rbVelocity && rbVelocity.Checked == true)
UpdateGraph(GRAPH_TYPE.VELOCITY);
}
public void CopyChart(GRAPH_TYPE Type)
{
Cursor.Current = Cursors.WaitCursor;
m_bReport = true;
trendChart.DisableAnimations = true;
UpdateGraph(Type);
}
private void trendChart_UpdaterTick(object sender)
{
if(m_bReport == true)
{
Cursor.Current = Cursors.WaitCursor;
m_ReportTimer = new System.Windows.Forms.Timer();
m_ReportTimer.Interval = 500;
m_ReportTimer.Tick += new EventHandler(TimerCallback);
m_ReportTimer.Start();
Console.WriteLine("Chart Updated ({0})", m_GraphType);
}
}
private void TimerCallback(object sender, EventArgs e)
{
Console.WriteLine("Chart Timer Callback ({0})", m_GraphType);
m_bReport = false;
m_ReportTimer.Stop();
this.Invoke(new Action(() =>
{
Bitmap bm = new Bitmap(panelGraph.Width, panelGraph.Height);
panelGraph.DrawToBitmap(bm, new Rectangle(0, 0, panelGraph.Width, panelGraph.Height));
m_Owner.OnChartUpdate(bm, m_GraphType);
}));
}
private void PanelTrendGraph_Enter(object sender, EventArgs e)
{
m_Owner.OnTrendGraphActivated();
}
}
}

6293
PanelTrendGraph.resx Normal file

File diff suppressed because it is too large Load Diff

295
Report.cs Normal file
View File

@@ -0,0 +1,295 @@
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace friction
{
public class Report
{
public string FilePath { set; get; }
public string MaterialSpring { set; get; }
public string MaterialTable { set; get; }
public DataTable AnalysisData { set; get; }
public DataTable CompatibilityData { set; get; }
public List<string> CompatibilityColumns { set; get; }
public List<string> CompatibilityRows { set; get; }
public Bitmap RadarChart { set; get; }
public Bitmap TrendChartByHumidity { set; get; }
public Bitmap TrendChartByTemperature { set; get; }
public Bitmap TrendChartByForce { set; get; }
public Bitmap TrendChartByVelocity { set; get; }
public void Export()
{
using (ExcelPackage package = new ExcelPackage())
{
if (package.Workbook.Worksheets.Count < 1)
package.Workbook.Worksheets.Add("Report");
ExcelWorksheet Sheet = package.Workbook.Worksheets[1];
int iRow = 2;
int iCol = 2;
Sheet.Cells[iRow, iCol].Value = "Material Spring: " + MaterialSpring;
Sheet.Cells[iRow, iCol].Style.Font.Bold = true;
// analysis table
iRow += 1;
foreach(DataColumn column in AnalysisData.Columns)
{
Sheet.Cells[iRow, iCol].Value = column.ColumnName;
iCol++;
}
iRow++;
iCol = 2;
int iTableRowStart = iRow-1;
int iTableColStart = iCol;
double dValue;
int iNoOfTest = 0;
int iAvgRPNColumn = 1;
foreach(DataRow row in AnalysisData.Rows)
{
int.TryParse(row["No. of Tests"].ToString(), out iNoOfTest);
iCol = 2;
for (int i = 0; i < AnalysisData.Columns.Count; i++)
{
if(double.TryParse(row[i].ToString(), out dValue) == true)
{
Sheet.Cells[iRow, iCol].Value = dValue;
if(AnalysisData.Columns[i].ColumnName == "No. of Tests")
{
}
else if (AnalysisData.Columns[i].ColumnName == "Average RPN")
{
Sheet.Cells[iRow, iCol].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
var Risk = Config.ANALYSIS.GetRisk((float)dValue);
switch (Risk)
{
case Config.ANALYSIS.RISK.NO:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Green);
break;
case Config.ANALYSIS.RISK.POTENTIAL:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Yellow);
break;
case Config.ANALYSIS.RISK.HIGH:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Red);
break;
}
iAvgRPNColumn = iCol;
}
else
{
Sheet.Cells[iRow, iCol].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
var Dependancy = Config.ANALYSIS.GetDependancy((float)dValue, iNoOfTest);
switch (Dependancy)
{
case Config.ANALYSIS.DEPENDANCY.NO:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Green);
break;
case Config.ANALYSIS.DEPENDANCY.POTENTIAL:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Yellow);
break;
case Config.ANALYSIS.DEPENDANCY.HIGH:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Red);
break;
case Config.ANALYSIS.DEPENDANCY.NOT_ENNOUGH_DATA:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Gray);
Sheet.Cells[iRow, iAvgRPNColumn].Style.Fill.BackgroundColor.SetColor(Theme.Gray);
break;
}
}
}
else
{
Sheet.Cells[iRow, iCol].Value = row[i].ToString();
}
iCol++;
}
iRow++;
}
Sheet.Cells[iTableRowStart, iTableColStart, iTableRowStart, iCol-1].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
Sheet.Cells[iTableRowStart, iTableColStart, iRow-1, iTableColStart].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
Sheet.Cells[iTableRowStart, iTableColStart, iRow-1, iCol-1].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thick);
Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].AutoFitColumns();
// compatibility table
iRow += 1;
iCol = 3;
foreach (string column in CompatibilityColumns)
{
Sheet.Cells[iRow, iCol].Value = column;
iCol++;
}
iRow++;
iCol = 2;
iTableRowStart = iRow - 1;
iTableColStart = iCol;
dValue = 0;
iNoOfTest = 0;
iAvgRPNColumn = 1;
for(int j=0; j<CompatibilityData.Rows.Count; j++)
{
DataRow row = CompatibilityData.Rows[j];
iCol = 2;
Sheet.Cells[iRow, iCol].Value = CompatibilityRows[j];
iCol++;
for (int i = 0; i < CompatibilityData.Columns.Count; i++)
{
if (double.TryParse(row[i].ToString(), out dValue) == true)
{
Sheet.Cells[iRow, iCol].Value = dValue;
Sheet.Cells[iRow, iCol].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
var Risk = Config.ANALYSIS.GetRisk((float)dValue);
switch (Risk)
{
case Config.ANALYSIS.RISK.NO:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Green);
break;
case Config.ANALYSIS.RISK.POTENTIAL:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Yellow);
break;
case Config.ANALYSIS.RISK.HIGH:
Sheet.Cells[iRow, iCol].Style.Fill.BackgroundColor.SetColor(Theme.Red);
break;
}
}
else
{
Sheet.Cells[iRow, iCol].Value = row[i].ToString();
}
iCol++;
}
iRow++;
}
Sheet.Cells[iTableRowStart, iTableColStart, iTableRowStart, iCol - 1].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iTableColStart].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thick);
//Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].AutoFitColumns();
iRow += 2;
iCol = 2;
// radar graph
double dX=0;
double dY=0;
dX = ExcelHelper.Column2Pixel(Sheet, iCol);
dY = ExcelHelper.Row2Pixel(Sheet, iRow);
int iWidth = RadarChart.Width;
int iHeight = RadarChart.Height;
iHeight = iHeight * 800 / iWidth;
iWidth = 800;
var picRadarChart = Sheet.Drawings.AddPicture("Radar Chart", RadarChart);
picRadarChart.SetPosition((int)dY, (int)dX);
picRadarChart.SetSize(iWidth, iHeight);
dY += iHeight;
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
if (TrendChartByHumidity != null)
{
const int iPictureWidth = 400;
iRow += 3;
iCol = 2;
Sheet.Cells[iRow, iCol].Value = MaterialSpring + " vs " + MaterialTable;
Sheet.Cells[iRow, iCol].Style.Font.Bold = true;
iRow += 1;
dY = ExcelHelper.Row2Pixel(Sheet, iRow);
var picTrendChartHumidity = Sheet.Drawings.AddPicture("Trend Chart by Humidity", TrendChartByHumidity);
picTrendChartHumidity.SetPosition((int)dY, (int)dX);
iWidth = TrendChartByHumidity.Width;
iHeight = TrendChartByHumidity.Height;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartHumidity.SetSize(iWidth, iHeight);
int iPrevRow = iRow;
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, iCol].Value = "by Humidity";
iRow = iPrevRow;
iCol = ExcelHelper.Pixel2NextColumn(Sheet, iCol, iWidth);
dX = ExcelHelper.Column2Pixel(Sheet, iCol);
var picTrendChartTemperature = Sheet.Drawings.AddPicture("Trend Chart by Temperature", TrendChartByTemperature);
picTrendChartTemperature.SetPosition((int)dY, (int)dX);
iWidth = TrendChartByTemperature.Width;
iHeight = TrendChartByTemperature.Height;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartTemperature.SetSize(iWidth, iHeight);
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, iCol].Value = "by Temperature";
iRow += 2;
iCol = 2;
dX = ExcelHelper.Column2Pixel(Sheet, iCol);
dY = ExcelHelper.Row2Pixel(Sheet, iRow);
var picTrendChartForce = Sheet.Drawings.AddPicture("Trend Chart by Force", TrendChartByForce);
picTrendChartForce.SetPosition((int)dY, (int)dX);
iWidth = TrendChartByForce.Width;
iHeight = TrendChartByForce.Height;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartForce.SetSize(iWidth, iHeight);
iPrevRow = iRow;
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, 2].Value = "by Force";
iRow = iPrevRow;
iCol = ExcelHelper.Pixel2NextColumn(Sheet, iCol, iWidth);
dX = ExcelHelper.Column2Pixel(Sheet, iCol);
var picTrendChartVelocity = Sheet.Drawings.AddPicture("Trend Chart by Velocity", TrendChartByVelocity);
picTrendChartVelocity.SetPosition((int)dY, (int)dX);
iWidth = TrendChartByVelocity.Width;
iHeight = TrendChartByVelocity.Height;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartVelocity.SetSize(iWidth, iHeight);
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, iCol].Value = "by Velocity";
}
package.SaveAs(new FileInfo(FilePath));
Console.WriteLine("Report Saved");
}
}
}
}

75
RowPanel.Designer.cs generated
View File

@@ -1,75 +0,0 @@
namespace friction
{
partial class RowPanel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgvData = new System.Windows.Forms.DataGridView();
this.lbColumn = new System.Windows.Forms.CheckedListBox();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.SuspendLayout();
//
// dgvData
//
this.dgvData.AllowUserToOrderColumns = true;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Location = new System.Drawing.Point(12, 12);
this.dgvData.Name = "dgvData";
this.dgvData.RowTemplate.Height = 23;
this.dgvData.Size = new System.Drawing.Size(701, 699);
this.dgvData.TabIndex = 0;
//
// lbColumn
//
this.lbColumn.FormattingEnabled = true;
this.lbColumn.Location = new System.Drawing.Point(719, 12);
this.lbColumn.Name = "lbColumn";
this.lbColumn.Size = new System.Drawing.Size(176, 708);
this.lbColumn.TabIndex = 1;
//
// RowPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(919, 723);
this.Controls.Add(this.lbColumn);
this.Controls.Add(this.dgvData);
this.HideOnClose = true;
this.Name = "RowPanel";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.Text = "Row Data";
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.CheckedListBox lbColumn;
}
}

View File

@@ -1,31 +0,0 @@
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 RowPanel : DockContent
{
MainForm m_Owner = null;
public RowPanel(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
}
public void UpdateData(DataHandler dataHandler)
{
dgvData.DataSource = dataHandler.GetData();
dgvData.Update();
}
}
}

84
TablePanel.Designer.cs generated
View File

@@ -1,84 +0,0 @@
namespace friction
{
partial class TablePanel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.cbMaterial2 = new System.Windows.Forms.ComboBox();
this.cbMaterial1 = new System.Windows.Forms.ComboBox();
this.btApply = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// cbMaterial2
//
this.cbMaterial2.FormattingEnabled = true;
this.cbMaterial2.Location = new System.Drawing.Point(32, 122);
this.cbMaterial2.Name = "cbMaterial2";
this.cbMaterial2.Size = new System.Drawing.Size(121, 20);
this.cbMaterial2.TabIndex = 1;
//
// cbMaterial1
//
this.cbMaterial1.FormattingEnabled = true;
this.cbMaterial1.Location = new System.Drawing.Point(32, 61);
this.cbMaterial1.Name = "cbMaterial1";
this.cbMaterial1.Size = new System.Drawing.Size(121, 20);
this.cbMaterial1.TabIndex = 2;
//
// btApply
//
this.btApply.Location = new System.Drawing.Point(32, 179);
this.btApply.Name = "btApply";
this.btApply.Size = new System.Drawing.Size(75, 23);
this.btApply.TabIndex = 3;
this.btApply.Text = "Apply";
this.btApply.UseVisualStyleBackColor = true;
this.btApply.Click += new System.EventHandler(this.btApply_Click);
//
// TablePanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.btApply);
this.Controls.Add(this.cbMaterial1);
this.Controls.Add(this.cbMaterial2);
this.HideOnClose = true;
this.Name = "TablePanel";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft;
this.Text = "TablePanel";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ComboBox cbMaterial2;
private System.Windows.Forms.ComboBox cbMaterial1;
private System.Windows.Forms.Button btApply;
}
}

View File

@@ -1,45 +0,0 @@
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 TablePanel : DockContent
{
MainForm m_Owner = null;
public TablePanel(MainForm owner)
{
InitializeComponent();
m_Owner = owner;
this.ApplyTheme();
}
public void UpdateData(DataHandler data)
{
var Material1 = data.GetMaterial1();
var Material2 = data.GetMaterial2();
cbMaterial1.Items.Clear();
foreach(var x in Material1)
cbMaterial1.Items.Add(x);
cbMaterial2.Items.Clear();
foreach (var x in Material2)
cbMaterial2.Items.Add(x);
}
private void btApply_Click(object sender, EventArgs e)
{
m_Owner.OnApplyData();
}
}
}

250
Theme.cs Normal file
View File

@@ -0,0 +1,250 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace friction
{
public static class Theme
{
public static Color Backcolor = Color.FromArgb(255, 45, 45, 48);
public static Color BackColorTrans = Color.FromArgb(230, 45, 45, 48);
public static Color Forecolor = Color.FromArgb(255, 235, 235, 235);
public static Color Green = Color.LimeGreen;
public static Color Yellow = Color.FromArgb(255, 255, 165, 0);
public static Color Red = Color.OrangeRed;
public static Color Gray = Color.DarkGray;
public static Color White = Color.Snow;
public static Color Orange = Color.Orange;
public static void Apply(Control ctrl)
{
ctrl.BackColor = Backcolor;
ctrl.ForeColor = Forecolor;
//ctrl.Font = new Font(ctrl.Font.FontFamily, 11.0f);
}
public static void Apply(DataGridView ctrl)
{
ctrl.BackgroundColor = Backcolor;
ctrl.DefaultCellStyle.BackColor = Backcolor;
ctrl.DefaultCellStyle.ForeColor = Forecolor;
ctrl.EnableHeadersVisualStyles = false;
ctrl.ColumnHeadersDefaultCellStyle.BackColor = Backcolor;
ctrl.ColumnHeadersDefaultCellStyle.ForeColor = Forecolor;
ctrl.RowHeadersDefaultCellStyle.BackColor = Backcolor;
ctrl.RowHeadersDefaultCellStyle.ForeColor = Forecolor;
ctrl.Font = new Font(ctrl.Font.FontFamily, 11.0f);
typeof(DataGridView).InvokeMember("DoubleBuffered",
BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty,
null, ctrl, new object[] { true });
}
public static void Apply(ListView ctrl)
{
ctrl.BackColor = Backcolor;
ctrl.ForeColor = Forecolor;
ctrl.Font = new Font(ctrl.Font.FontFamily, 11.0f);
ctrl.OwnerDraw = true;
ctrl.DrawColumnHeader +=
new DrawListViewColumnHeaderEventHandler
(
(sender, e) => ListViewHeaderDraw(sender, e, Backcolor, Forecolor)
);
ctrl.DrawItem += new DrawListViewItemEventHandler(ListViewBodyDraw);
typeof(ListView).InvokeMember("DoubleBuffered",
BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty,
null, ctrl, new object[] { true });
}
private static void ListViewHeaderDraw(object sender, DrawListViewColumnHeaderEventArgs e, Color backColor, Color foreColor)
{
e.Graphics.FillRectangle(new SolidBrush(backColor), e.Bounds);
e.Graphics.DrawString(e.Header.Text, e.Font, new SolidBrush(foreColor), e.Bounds);
}
private static void ListViewBodyDraw(object sender, DrawListViewItemEventArgs e)
{
e.DrawDefault = true;
}
public static void ResizeFullColumn(ListView view)
{
bool bScrollbarPresented = false;
foreach (var scroll in view.Controls.OfType<VScrollBar>())
{
bScrollbarPresented = true;
break;
}
int iWidth = view.Width;
if (bScrollbarPresented == true)
iWidth -= SystemInformation.VerticalScrollBarWidth;
switch (view.BorderStyle)
{
case BorderStyle.Fixed3D:
iWidth -= 4;
break;
case BorderStyle.FixedSingle:
iWidth -= 2;
break;
}
for (int i = 0; i < view.Columns.Count; i++)
{
if (view.Columns[i].Width < iWidth)
{
iWidth -= view.Columns[i].Width;
}
else
{
view.Columns[i].Width = iWidth;
// Hide columns that can't fit
for (int jx = i + 1; jx < view.Columns.Count; ++jx)
view.Columns[jx].Width = 0;
return;
}
}
view.Columns[view.Columns.Count - 1].Width += iWidth;
}
public class MenustripColor : ProfessionalColorTable
{
public override Color MenuItemSelected { get { return BackColorTrans; } }
public override Color MenuItemSelectedGradientBegin { get { return BackColorTrans; } }
public override Color MenuItemSelectedGradientEnd { get { return BackColorTrans; } }
public override Color MenuItemPressedGradientBegin { get { return Backcolor; } }
public override Color MenuItemPressedGradientEnd { get { return Backcolor; } }
public override Color MenuItemBorder { get { return BackColorTrans; } }
public override Color MenuBorder { get { return Backcolor; } }
}
class MenustripRenderer : ToolStripProfessionalRenderer
{
public MenustripRenderer() : base(new MenustripColor())
{
}
protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e)
{
if (e.Item.Enabled)
base.OnRenderMenuItemBackground(e);
else
{
e.Item.BackColor = Backcolor;
base.OnRenderMenuItemBackground(e);
if (e.Item.Selected == true)
{
e.Item.ImageTransparentColor = Backcolor;
base.OnRenderMenuItemBackground(e);
}
}
}
protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
{
if (e.Item.Enabled)
base.OnRenderMenuItemBackground(e);
}
}
public static void Apply(MenuStrip ctrl)
{
ctrl.BackColor = Backcolor;
ctrl.ForeColor = Forecolor;
foreach (ToolStripMenuItem item in ctrl.Items)
{
foreach (ToolStripItem subitem in item.DropDownItems)
{
if(subitem.GetType() == typeof(ToolStripMenuItem))
{
foreach (ToolStripItem subsubitem in ((ToolStripMenuItem)subitem).DropDownItems)
{
subsubitem.BackColor = Backcolor;
subsubitem.ForeColor = Forecolor;
subsubitem.MouseEnter += Ctrl_MouseEnter;
subsubitem.MouseLeave += Ctrl_MouseLeave;
}
}
else if(subitem.GetType() == typeof(ToolStripSeparator))
{
((ToolStripSeparator)subitem).BackColor = Backcolor;
((ToolStripSeparator)subitem).ForeColor = Forecolor;
}
subitem.BackColor = Backcolor;
subitem.ForeColor = Forecolor;
subitem.MouseEnter += Ctrl_MouseEnter;
subitem.MouseLeave += Ctrl_MouseLeave;
}
item.BackColor = Backcolor;
item.ForeColor = Forecolor;
item.MouseEnter += Ctrl_MouseEnter;
item.MouseLeave += Ctrl_MouseLeave;
}
ctrl.Renderer = new MenustripRenderer();
}
private static void Ctrl_MouseEnter(object sender, EventArgs e)
{
if(sender is ToolStripMenuItem)
{
((ToolStripMenuItem)sender).ForeColor = Orange;
}
}
private static void Ctrl_MouseLeave(object sender, EventArgs e)
{
if (sender is ToolStripMenuItem)
{
((ToolStripMenuItem)sender).ForeColor = Forecolor;
}
}
}
public class ExtendedToolStripSeparator : ToolStripSeparator
{
public ExtendedToolStripSeparator()
{
this.Paint += ExtendedToolStripSeparator_Paint;
}
private void ExtendedToolStripSeparator_Paint(object sender, PaintEventArgs e)
{
// Get the separator's width and height.
ToolStripSeparator toolStripSeparator = (ToolStripSeparator)sender;
int width = toolStripSeparator.Width;
int height = toolStripSeparator.Height;
// Choose the colors for drawing.
// I've used Color.White as the foreColor.
Color foreColor = Theme.Forecolor;
// Color.Teal as the backColor.
Color backColor = Theme.Backcolor;
// Fill the background.
e.Graphics.FillRectangle(new SolidBrush(backColor), 0, 0, width, height);
// Draw the line.
e.Graphics.DrawLine(new Pen(foreColor), 4, height / 2, width - 4, height / 2);
}
}
}

99
TrendLine.cs Normal file
View File

@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace friction
{
public class TrendLine
{
public struct POINT
{
public float X;
public float Y;
}
private readonly List<POINT> AxisValues;
private int count;
private float xAxisValuesSum;
private float xxSum;
private float xySum;
private float yAxisValuesSum;
//public TrendLine(IList<float> xAxisValues, IList<float> yAxisValues)
//{
// this.xAxisValues = xAxisValues;
// this.yAxisValues = yAxisValues;
// this.Initialize();
//}
public TrendLine(List<POINT> points)
{
AxisValues = points;
AxisValues.Sort((POINT a, POINT b) => (a.X == b.X) ? 0 : (a.X < b.X) ? -1 : 1);
this.Initialize();
}
public float Slope { get; private set; }
public float Intercept { get; private set; }
public float Start { get; private set; }
public float End { get; private set; }
private void Initialize()
{
this.count = this.AxisValues.Count;
this.yAxisValuesSum = this.AxisValues.Sum(e => e.Y);
this.xAxisValuesSum = this.AxisValues.Sum(e => e.X);
this.xxSum = 0;
this.xySum = 0;
for (int i = 0; i < this.count; i++)
{
this.xySum += (this.AxisValues[i].X * this.AxisValues[i].Y);
this.xxSum += (this.AxisValues[i].X * this.AxisValues[i].X);
}
this.Slope = this.CalculateSlope();
this.Intercept = this.CalculateIntercept();
this.Start = this.CalculateStart();
this.End = this.CalculateEnd();
}
private float CalculateSlope()
{
try
{
return ((this.count * this.xySum) - (this.xAxisValuesSum * this.yAxisValuesSum)) / ((this.count * this.xxSum) - (this.xAxisValuesSum * this.xAxisValuesSum));
}
catch (DivideByZeroException)
{
return 0;
}
}
private float CalculateIntercept()
{
return (this.yAxisValuesSum - (this.Slope * this.xAxisValuesSum)) / this.count;
}
private float CalculateStart()
{
return (this.Slope * this.AxisValues.First().X) + this.Intercept;
}
private float CalculateEnd()
{
return (this.Slope * this.AxisValues.Last().X) + this.Intercept;
}
public float GetY(float fX)
{
return (this.Slope * fX) + this.Intercept;
}
}
}

View File

@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>friction</RootNamespace>
<AssemblyName>friction</AssemblyName>
<AssemblyName>squeak</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -32,13 +32,32 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>main_icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="EPPlus, Version=4.1.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<HintPath>packages\EPPlus.4.1.0\lib\net40\EPPlus.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="LiveCharts, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<HintPath>packages\LiveCharts.0.9.6\lib\net45\LiveCharts.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="LiveCharts.WinForms, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<HintPath>packages\LiveCharts.WinForms.0.9.6\lib\net45\LiveCharts.WinForms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="LiveCharts.Wpf, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<HintPath>packages\LiveCharts.Wpf.0.9.6\lib\net45\LiveCharts.Wpf.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms.DataVisualization" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -48,32 +67,102 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataExcel.cs" />
<Compile Include="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="AlertPopup.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AlertPopup.Designer.cs">
<DependentUpon>AlertPopup.cs</DependentUpon>
</Compile>
<Compile Include="Config.cs" />
<Compile Include="DataHandler.cs" />
<Compile Include="ExcelHelper.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="NewPreference.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NewPreference.Designer.cs">
<DependentUpon>NewPreference.cs</DependentUpon>
</Compile>
<Compile Include="PanelAnalysis.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelAnalysis.Designer.cs">
<DependentUpon>PanelAnalysis.cs</DependentUpon>
</Compile>
<Compile Include="PanelCompatibility.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelCompatibility.Designer.cs">
<DependentUpon>PanelCompatibility.cs</DependentUpon>
</Compile>
<Compile Include="PanelRadarGraph.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelRadarGraph.Designer.cs">
<DependentUpon>PanelRadarGraph.cs</DependentUpon>
</Compile>
<Compile Include="PanelTrendGraph.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PanelTrendGraph.Designer.cs">
<DependentUpon>PanelTrendGraph.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RowPanel.cs">
<Compile Include="PanelResult.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="RowPanel.Designer.cs">
<DependentUpon>RowPanel.cs</DependentUpon>
<Compile Include="PanelResult.Designer.cs">
<DependentUpon>PanelResult.cs</DependentUpon>
</Compile>
<Compile Include="TablePanel.cs">
<Compile Include="PanelMaterial.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TablePanel.Designer.cs">
<DependentUpon>TablePanel.cs</DependentUpon>
<Compile Include="PanelMaterial.Designer.cs">
<DependentUpon>PanelMaterial.cs</DependentUpon>
</Compile>
<Compile Include="Report.cs" />
<Compile Include="Theme.cs" />
<Compile Include="TrendLine.cs" />
<EmbeddedResource Include="AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="AlertPopup.resx">
<DependentUpon>AlertPopup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NewPreference.resx">
<DependentUpon>NewPreference.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PanelAnalysis.resx">
<DependentUpon>PanelAnalysis.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PanelCompatibility.resx">
<DependentUpon>PanelCompatibility.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PanelRadarGraph.resx">
<DependentUpon>PanelRadarGraph.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PanelTrendGraph.resx">
<DependentUpon>PanelTrendGraph.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -83,11 +172,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="RowPanel.resx">
<DependentUpon>RowPanel.cs</DependentUpon>
<EmbeddedResource Include="PanelResult.resx">
<DependentUpon>PanelResult.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TablePanel.resx">
<DependentUpon>TablePanel.cs</DependentUpon>
<EmbeddedResource Include="PanelMaterial.resx">
<DependentUpon>PanelMaterial.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
@@ -113,6 +202,12 @@
<Name>WinFormsUI</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="main_icon.ico" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

BIN
main_icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

View File

@@ -3,4 +3,7 @@
<package id="DockPanelSuite" version="2.15.0" targetFramework="net452" />
<package id="DockPanelSuite.ThemeVS2015" version="2.15.0" targetFramework="net452" />
<package id="EPPlus" version="4.1.0" targetFramework="net452" />
<package id="LiveCharts" version="0.9.6" targetFramework="net452" />
<package id="LiveCharts.WinForms" version="0.9.6" targetFramework="net452" />
<package id="LiveCharts.Wpf" version="0.9.6" targetFramework="net452" />
</packages>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

23
packages/LiveCharts.0.9.6/readme.txt vendored Normal file
View File

@@ -0,0 +1,23 @@
==================================
<<<<<<<<<<< IMPORTANT >>>>>>>>>>>>
==================================
LiveCharts is now multipatform (at least the design).
So this package contains nothing but the core of the library,
you might also need to install the desired platform.
For example if using wpf you must also install the wpf package.
------------------------------------
> Install-Package LiveCharts.Wpf
------------------------------------
For future updates, you will only need to update LiveCharts.Wpf (or any other platform)
forget about the core, all the platforms packages will have a dependency to core.
------------------------------------
> Update-Package LiveCharts.Wpf
------------------------------------
Happy coding!

Binary file not shown.

View File

@@ -0,0 +1,793 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>LiveCharts.WinForms</name>
</assembly>
<members>
<member name="T:LiveCharts.WinForms.AngularGauge">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.AngularGauge.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.AngularGauge.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.AngularGauge"/> class.
</summary>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Wedge">
<summary>
Gets or sets the wedge.
</summary>
<value>
The wedge.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.TickStep">
<summary>
Gets or sets the tick step.
</summary>
<value>
The tick step.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.LabelsStep">
<summary>
Gets or sets the labels step.
</summary>
<value>
The labels step.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.FromValue">
<summary>
Gets or sets from value.
</summary>
<value>
From value.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.ToValue">
<summary>
Gets or sets to value.
</summary>
<value>
To value.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Sections">
<summary>
Gets or sets the sections.
</summary>
<value>
The sections.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Value">
<summary>
Gets or sets the value.
</summary>
<value>
The value.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.LabelFormatter">
<summary>
Gets or sets the label formatter.
</summary>
<value>
The label formatter.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.TicksForeground">
<summary>
Gets or sets the ticks foreground.
</summary>
<value>
The ticks foreground.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.SectionsInnerRadius">
<summary>
Gets or sets the sections inner radius.
</summary>
<value>
The sections inner radius.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.NeedleFill">
<summary>
Gets or sets the needle fill.
</summary>
<value>
The needle fill.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.LabelsEffect">
<summary>
Gets or sets the labels effect.
</summary>
<value>
The labels effect.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.TicksStrokeThickness">
<summary>
Gets or sets the ticks stroke thickness.
</summary>
<value>
The ticks stroke thickness.
</value>
</member>
<member name="T:LiveCharts.WinForms.CartesianChart">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.CartesianChart.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.CartesianChart.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.CartesianChart"/> class.
</summary>
</member>
<member name="M:LiveCharts.WinForms.CartesianChart.Update(System.Boolean,System.Boolean)">
<summary>
Updates the specified restart view.
</summary>
<param name="restartView">if set to <c>true</c> [restart view].</param>
<param name="force">if set to <c>true</c> [force].</param>
</member>
<member name="E:LiveCharts.WinForms.CartesianChart.DataClick">
<summary>
Occurs when the users clicks any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.CartesianChart.DataHover">
<summary>
Occurs when the users hovers over any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.CartesianChart.UpdaterTick">
<summary>
Occurs every time the chart updates
</summary>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.AxisY">
<summary>
Gets or sets the axis y.
</summary>
<value>
The axis y.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.AxisX">
<summary>
Gets or sets the axis x.
</summary>
<value>
The axis x.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.DefaultLegend">
<summary>
Gets or sets the default legend.
</summary>
<value>
The default legend.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Zoom">
<summary>
Gets or sets the zoom.
</summary>
<value>
The zoom.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Pan">
<summary>
Gets or sets the pan.
</summary>
<value>
The pan.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.LegendLocation">
<summary>
Gets or sets the legend location.
</summary>
<value>
The legend location.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Series">
<summary>
Gets or sets the series.
</summary>
<value>
The series.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.DataTooltip">
<summary>
Gets or sets the data tooltip.
</summary>
<value>
The data tooltip.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Hoverable">
<summary>
Gets or sets a value indicating whether this <see cref="T:LiveCharts.WinForms.CartesianChart"/> is hoverable.
</summary>
<value>
<c>true</c> if hoverable; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollMode">
<summary>
Gets or sets the scroll mode.
</summary>
<value>
The scroll mode.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollHorizontalFrom">
<summary>
Gets or sets the scroll horizontal from.
</summary>
<value>
The scroll horizontal from.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollHorizontalTo">
<summary>
Gets or sets the scroll horizontal to.
</summary>
<value>
The scroll horizontal to.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollVerticalFrom">
<summary>
Gets or sets the scroll vertical from.
</summary>
<value>
The scroll vertical from.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollVerticalTo">
<summary>
Gets or sets the scroll vertical to.
</summary>
<value>
The scroll vertical to.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollBarFill">
<summary>
Gets or sets the scroll bar fill.
</summary>
<value>
The scroll bar fill.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Background">
<summary>
Gets or sets the background.
</summary>
<value>
The background.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.VisualElements">
<summary>
Gets or sets the visual elements.
</summary>
<value>
The visual elements.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.UpdaterState">
<summary>
Gets or sets the state of the updater.
</summary>
<value>
The state of the updater.
</value>
</member>
<member name="T:LiveCharts.WinForms.SolidGauge">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.SolidGauge.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.SolidGauge.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.SolidGauge"/> class.
</summary>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Uses360Mode">
<summary>
Gets or sets a value indicating whether [uses360 mode].
</summary>
<value>
<c>true</c> if [uses360 mode]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.From">
<summary>
Gets or sets from.
</summary>
<value>
From.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.To">
<summary>
Gets or sets to.
</summary>
<value>
To.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Value">
<summary>
Gets or sets the value.
</summary>
<value>
The value.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.InnerRadius">
<summary>
Gets or sets the inner radius.
</summary>
<value>
The inner radius.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Stroke">
<summary>
Gets or sets the stroke.
</summary>
<value>
The stroke.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.StrokeThickness">
<summary>
Gets or sets the stroke thickness.
</summary>
<value>
The stroke thickness.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.ToColor">
<summary>
Gets or sets to color.
</summary>
<value>
To color.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FromColor">
<summary>
Gets or sets from color.
</summary>
<value>
From color.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.GaugeBackground">
<summary>
Gets or sets the gauge background.
</summary>
<value>
The gauge background.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.LabelFormatter">
<summary>
Gets or sets the label formatter.
</summary>
<value>
The label formatter.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.HighFontSize">
<summary>
Gets or sets the size of the high font.
</summary>
<value>
The size of the high font.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontSize">
<summary>
Gets or sets the size of the font.
</summary>
<value>
The size of the font.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontFamily">
<summary>
Gets or sets the font family.
</summary>
<value>
The font family.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontWeight">
<summary>
Gets or sets the font weight.
</summary>
<value>
The font weight.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontStyle">
<summary>
Gets or sets the font style.
</summary>
<value>
The font style.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontStretch">
<summary>
Gets or sets the font stretch.
</summary>
<value>
The font stretch.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.ForeGround">
<summary>
Gets or sets the fore ground.
</summary>
<value>
The fore ground.
</value>
</member>
<member name="T:LiveCharts.WinForms.GeoMap">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.GeoMap.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.GeoMap.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.GeoMap"/> class.
</summary>
</member>
<member name="E:LiveCharts.WinForms.GeoMap.LandClick">
<summary>
Occurs when [land click].
</summary>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.LanguagePack">
<summary>
Gets or sets the language pack.
</summary>
<value>
The language pack.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.DefaultLandFill">
<summary>
Gets or sets the default land fill.
</summary>
<value>
The default land fill.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.LandStrokeThickness">
<summary>
Gets or sets the land stroke thickness.
</summary>
<value>
The land stroke thickness.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.LandStroke">
<summary>
Gets or sets the land stroke.
</summary>
<value>
The land stroke.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.Hoverable">
<summary>
Gets or sets a value indicating whether this <see cref="T:LiveCharts.WinForms.GeoMap"/> is hoverable.
</summary>
<value>
<c>true</c> if hoverable; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.HeatMap">
<summary>
Gets or sets the heat map.
</summary>
<value>
The heat map.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.GradientStopCollection">
<summary>
Gets or sets the gradient stop collection.
</summary>
<value>
The gradient stop collection.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.Source">
<summary>
Gets or sets the source.
</summary>
<value>
The source.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.EnableZoomingAndPanning">
<summary>
Gets or sets a value indicating whether [enable zooming and panning].
</summary>
<value>
<c>true</c> if [enable zooming and panning]; otherwise, <c>false</c>.
</value>
</member>
<member name="T:LiveCharts.WinForms.PieChart">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.PieChart.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.PieChart.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.PieChart"/> class.
</summary>
</member>
<member name="M:LiveCharts.WinForms.PieChart.Update(System.Boolean,System.Boolean)">
<summary>
Updates the specified restart view.
</summary>
<param name="restartView">if set to <c>true</c> [restart view].</param>
<param name="force">if set to <c>true</c> [force].</param>
</member>
<member name="E:LiveCharts.WinForms.PieChart.DataClick">
<summary>
Occurs when the users clicks any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.PieChart.DataHover">
<summary>
Occurs when the users hovers over any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.PieChart.UpdaterTick">
<summary>
Occurs every time the chart updates
</summary>
</member>
<member name="P:LiveCharts.WinForms.PieChart.AxisY">
<summary>
Gets or sets the axis y.
</summary>
<value>
The axis y.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.AxisX">
<summary>
Gets or sets the axis x.
</summary>
<value>
The axis x.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.DefaultLegend">
<summary>
Gets or sets the default legend.
</summary>
<value>
The default legend.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.Zoom">
<summary>
Gets or sets the zoom.
</summary>
<value>
The zoom.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.LegendLocation">
<summary>
Gets or sets the legend location.
</summary>
<value>
The legend location.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.Series">
<summary>
Gets or sets the series.
</summary>
<value>
The series.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.DataTooltip">
<summary>
Gets or sets the data tooltip.
</summary>
<value>
The data tooltip.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.InnerRadius">
<summary>
Gets or sets the inner radius.
</summary>
<value>
The inner radius.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.StartingRotationAngle">
<summary>
Gets or sets the starting rotation angle.
</summary>
<value>
The starting rotation angle.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.UpdaterState">
<summary>
Gets or sets the state of the updater.
</summary>
<value>
The state of the updater.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.HoverPushOut">
<summary>
Gets or sets the units that a slice is pushed out when a user moves the mouse over data point.
</summary>
<value>
The hover push out.
</value>
</member>
</members>
</doc>

View File

@@ -0,0 +1,793 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>LiveCharts.WinForms</name>
</assembly>
<members>
<member name="T:LiveCharts.WinForms.AngularGauge">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.AngularGauge.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.AngularGauge.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.AngularGauge"/> class.
</summary>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Wedge">
<summary>
Gets or sets the wedge.
</summary>
<value>
The wedge.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.TickStep">
<summary>
Gets or sets the tick step.
</summary>
<value>
The tick step.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.LabelsStep">
<summary>
Gets or sets the labels step.
</summary>
<value>
The labels step.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.FromValue">
<summary>
Gets or sets from value.
</summary>
<value>
From value.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.ToValue">
<summary>
Gets or sets to value.
</summary>
<value>
To value.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Sections">
<summary>
Gets or sets the sections.
</summary>
<value>
The sections.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.Value">
<summary>
Gets or sets the value.
</summary>
<value>
The value.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.LabelFormatter">
<summary>
Gets or sets the label formatter.
</summary>
<value>
The label formatter.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.TicksForeground">
<summary>
Gets or sets the ticks foreground.
</summary>
<value>
The ticks foreground.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.SectionsInnerRadius">
<summary>
Gets or sets the sections inner radius.
</summary>
<value>
The sections inner radius.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.NeedleFill">
<summary>
Gets or sets the needle fill.
</summary>
<value>
The needle fill.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.LabelsEffect">
<summary>
Gets or sets the labels effect.
</summary>
<value>
The labels effect.
</value>
</member>
<member name="P:LiveCharts.WinForms.AngularGauge.TicksStrokeThickness">
<summary>
Gets or sets the ticks stroke thickness.
</summary>
<value>
The ticks stroke thickness.
</value>
</member>
<member name="T:LiveCharts.WinForms.CartesianChart">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.CartesianChart.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.CartesianChart.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.CartesianChart"/> class.
</summary>
</member>
<member name="M:LiveCharts.WinForms.CartesianChart.Update(System.Boolean,System.Boolean)">
<summary>
Updates the specified restart view.
</summary>
<param name="restartView">if set to <c>true</c> [restart view].</param>
<param name="force">if set to <c>true</c> [force].</param>
</member>
<member name="E:LiveCharts.WinForms.CartesianChart.DataClick">
<summary>
Occurs when the users clicks any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.CartesianChart.DataHover">
<summary>
Occurs when the users hovers over any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.CartesianChart.UpdaterTick">
<summary>
Occurs every time the chart updates
</summary>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.AxisY">
<summary>
Gets or sets the axis y.
</summary>
<value>
The axis y.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.AxisX">
<summary>
Gets or sets the axis x.
</summary>
<value>
The axis x.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.DefaultLegend">
<summary>
Gets or sets the default legend.
</summary>
<value>
The default legend.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Zoom">
<summary>
Gets or sets the zoom.
</summary>
<value>
The zoom.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Pan">
<summary>
Gets or sets the pan.
</summary>
<value>
The pan.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.LegendLocation">
<summary>
Gets or sets the legend location.
</summary>
<value>
The legend location.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Series">
<summary>
Gets or sets the series.
</summary>
<value>
The series.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.DataTooltip">
<summary>
Gets or sets the data tooltip.
</summary>
<value>
The data tooltip.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Hoverable">
<summary>
Gets or sets a value indicating whether this <see cref="T:LiveCharts.WinForms.CartesianChart"/> is hoverable.
</summary>
<value>
<c>true</c> if hoverable; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollMode">
<summary>
Gets or sets the scroll mode.
</summary>
<value>
The scroll mode.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollHorizontalFrom">
<summary>
Gets or sets the scroll horizontal from.
</summary>
<value>
The scroll horizontal from.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollHorizontalTo">
<summary>
Gets or sets the scroll horizontal to.
</summary>
<value>
The scroll horizontal to.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollVerticalFrom">
<summary>
Gets or sets the scroll vertical from.
</summary>
<value>
The scroll vertical from.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollVerticalTo">
<summary>
Gets or sets the scroll vertical to.
</summary>
<value>
The scroll vertical to.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.ScrollBarFill">
<summary>
Gets or sets the scroll bar fill.
</summary>
<value>
The scroll bar fill.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.Background">
<summary>
Gets or sets the background.
</summary>
<value>
The background.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.VisualElements">
<summary>
Gets or sets the visual elements.
</summary>
<value>
The visual elements.
</value>
</member>
<member name="P:LiveCharts.WinForms.CartesianChart.UpdaterState">
<summary>
Gets or sets the state of the updater.
</summary>
<value>
The state of the updater.
</value>
</member>
<member name="T:LiveCharts.WinForms.SolidGauge">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.SolidGauge.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.SolidGauge.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.SolidGauge"/> class.
</summary>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Uses360Mode">
<summary>
Gets or sets a value indicating whether [uses360 mode].
</summary>
<value>
<c>true</c> if [uses360 mode]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.From">
<summary>
Gets or sets from.
</summary>
<value>
From.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.To">
<summary>
Gets or sets to.
</summary>
<value>
To.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Value">
<summary>
Gets or sets the value.
</summary>
<value>
The value.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.InnerRadius">
<summary>
Gets or sets the inner radius.
</summary>
<value>
The inner radius.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.Stroke">
<summary>
Gets or sets the stroke.
</summary>
<value>
The stroke.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.StrokeThickness">
<summary>
Gets or sets the stroke thickness.
</summary>
<value>
The stroke thickness.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.ToColor">
<summary>
Gets or sets to color.
</summary>
<value>
To color.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FromColor">
<summary>
Gets or sets from color.
</summary>
<value>
From color.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.GaugeBackground">
<summary>
Gets or sets the gauge background.
</summary>
<value>
The gauge background.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.LabelFormatter">
<summary>
Gets or sets the label formatter.
</summary>
<value>
The label formatter.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.HighFontSize">
<summary>
Gets or sets the size of the high font.
</summary>
<value>
The size of the high font.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontSize">
<summary>
Gets or sets the size of the font.
</summary>
<value>
The size of the font.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontFamily">
<summary>
Gets or sets the font family.
</summary>
<value>
The font family.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontWeight">
<summary>
Gets or sets the font weight.
</summary>
<value>
The font weight.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontStyle">
<summary>
Gets or sets the font style.
</summary>
<value>
The font style.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.FontStretch">
<summary>
Gets or sets the font stretch.
</summary>
<value>
The font stretch.
</value>
</member>
<member name="P:LiveCharts.WinForms.SolidGauge.ForeGround">
<summary>
Gets or sets the fore ground.
</summary>
<value>
The fore ground.
</value>
</member>
<member name="T:LiveCharts.WinForms.GeoMap">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.GeoMap.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.GeoMap.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.GeoMap"/> class.
</summary>
</member>
<member name="E:LiveCharts.WinForms.GeoMap.LandClick">
<summary>
Occurs when [land click].
</summary>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.Base">
<summary>
Gets the base.
</summary>
<value>
The base.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.LanguagePack">
<summary>
Gets or sets the language pack.
</summary>
<value>
The language pack.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.DefaultLandFill">
<summary>
Gets or sets the default land fill.
</summary>
<value>
The default land fill.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.LandStrokeThickness">
<summary>
Gets or sets the land stroke thickness.
</summary>
<value>
The land stroke thickness.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.LandStroke">
<summary>
Gets or sets the land stroke.
</summary>
<value>
The land stroke.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.Hoverable">
<summary>
Gets or sets a value indicating whether this <see cref="T:LiveCharts.WinForms.GeoMap"/> is hoverable.
</summary>
<value>
<c>true</c> if hoverable; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.HeatMap">
<summary>
Gets or sets the heat map.
</summary>
<value>
The heat map.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.GradientStopCollection">
<summary>
Gets or sets the gradient stop collection.
</summary>
<value>
The gradient stop collection.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.Source">
<summary>
Gets or sets the source.
</summary>
<value>
The source.
</value>
</member>
<member name="P:LiveCharts.WinForms.GeoMap.EnableZoomingAndPanning">
<summary>
Gets or sets a value indicating whether [enable zooming and panning].
</summary>
<value>
<c>true</c> if [enable zooming and panning]; otherwise, <c>false</c>.
</value>
</member>
<member name="T:LiveCharts.WinForms.PieChart">
<summary>
</summary>
<seealso cref="T:System.Windows.Forms.Integration.ElementHost"/>
</member>
<member name="F:LiveCharts.WinForms.PieChart.WpfBase">
<summary>
The WPF base
</summary>
</member>
<member name="M:LiveCharts.WinForms.PieChart.#ctor">
<summary>
Initializes a new instance of the <see cref="T:LiveCharts.WinForms.PieChart"/> class.
</summary>
</member>
<member name="M:LiveCharts.WinForms.PieChart.Update(System.Boolean,System.Boolean)">
<summary>
Updates the specified restart view.
</summary>
<param name="restartView">if set to <c>true</c> [restart view].</param>
<param name="force">if set to <c>true</c> [force].</param>
</member>
<member name="E:LiveCharts.WinForms.PieChart.DataClick">
<summary>
Occurs when the users clicks any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.PieChart.DataHover">
<summary>
Occurs when the users hovers over any point in the chart
</summary>
</member>
<member name="E:LiveCharts.WinForms.PieChart.UpdaterTick">
<summary>
Occurs every time the chart updates
</summary>
</member>
<member name="P:LiveCharts.WinForms.PieChart.AxisY">
<summary>
Gets or sets the axis y.
</summary>
<value>
The axis y.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.AxisX">
<summary>
Gets or sets the axis x.
</summary>
<value>
The axis x.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.DefaultLegend">
<summary>
Gets or sets the default legend.
</summary>
<value>
The default legend.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.Zoom">
<summary>
Gets or sets the zoom.
</summary>
<value>
The zoom.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.LegendLocation">
<summary>
Gets or sets the legend location.
</summary>
<value>
The legend location.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.Series">
<summary>
Gets or sets the series.
</summary>
<value>
The series.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.AnimationsSpeed">
<summary>
Gets or sets the animations speed.
</summary>
<value>
The animations speed.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.DisableAnimations">
<summary>
Gets or sets a value indicating whether [disable animations].
</summary>
<value>
<c>true</c> if [disable animations]; otherwise, <c>false</c>.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.DataTooltip">
<summary>
Gets or sets the data tooltip.
</summary>
<value>
The data tooltip.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.InnerRadius">
<summary>
Gets or sets the inner radius.
</summary>
<value>
The inner radius.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.StartingRotationAngle">
<summary>
Gets or sets the starting rotation angle.
</summary>
<value>
The starting rotation angle.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.UpdaterState">
<summary>
Gets or sets the state of the updater.
</summary>
<value>
The state of the updater.
</value>
</member>
<member name="P:LiveCharts.WinForms.PieChart.HoverPushOut">
<summary>
Gets or sets the units that a slice is pushed out when a user moves the mouse over data point.
</summary>
<value>
The hover push out.
</value>
</member>
</members>
</doc>

View File

@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
$DTE.ItemOperations.Navigate("https://lvcharts.net/thanks/wpf")

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
$DTE.ItemOperations.Navigate("https://lvcharts.net/thanks/wpf")

BIN
resource/anaylisys3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
resource/main_icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
resource/map3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

BIN
resource/open3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
resource/pair3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
resource/radar3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
resource/result3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
resource/trend3.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB