Compare commits

...

10 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
27 changed files with 1916 additions and 322 deletions

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;
}
}
}

163
AlertPopup.resx Normal file
View File

@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<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>

211
Config.cs
View File

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace friction
{
public static class Config
public class Config
{
public struct RANGE
{
@@ -17,8 +17,9 @@ namespace friction
public float m_fHigh;
}
static string m_strPath = "";
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 };
@@ -29,12 +30,30 @@ namespace friction
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 };
static Config()
public class UncheckedMaterial
{
public List<string> m_Springs = new List<string>();
public List<string> m_Tables = new List<string>();
}
public static void Init()
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);
@@ -50,16 +69,60 @@ namespace friction
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
private static void Load()
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(new string[] { "//" }, StringSplitOptions.None);
string[] astrList = temp.ToString().Split(',');
foreach (string strFile in astrList)
OPTION.AddRecentFile(strFile);
OPTION.GetInstance().AddRecentFile(strFile);
}
iRes = GetPrivateProfileString("Option", "bound", "", temp, 10240, m_strPath);
@@ -74,32 +137,106 @@ namespace friction
int.TryParse(astrBound[2], out iTop);
int.TryParse(astrBound[3], out iHeight);
OPTION.WindowBound = new Rectangle(iLeft, iTop, iWidth, 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.CheckedColumns = astrBound.ToList();
OPTION.GetInstance().CheckedColumns = astrBound.ToList();
}
iRes = GetPrivateProfileString("Option", "unchecked-column", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
OPTION.UncheckedColumns = astrBound.ToList();
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 static void Save()
public void SetSpringChecked(List<string> CheckedItems)
{
WritePrivateProfileString("Option", "recent", OPTION.GetRecentAll(), m_strPath);
WritePrivateProfileString("Option", "bound", OPTION.WindowBoundStr(), m_strPath);
WritePrivateProfileString("Option", "checked-column", OPTION.CheckedColumnsStr(), m_strPath);
WritePrivateProfileString("Option", "unchecked-column", OPTION.UncheckedColumnsStr(), m_strPath);
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
{
@@ -113,14 +250,24 @@ namespace friction
}
public static class OPTION
public class OPTION
{
public static List<string> m_RecentList = new List<string>();
public static Rectangle WindowBound { set; get; }
public static List<string> CheckedColumns { set; get; }
public static List<string> UncheckedColumns { set; get; }
private static OPTION m_instance = null;
public static void AddRecentFile(string strPath)
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);
@@ -128,17 +275,17 @@ namespace friction
m_RecentList.Add(strPath);
}
public static string GetRecentAll()
public string GetRecentAll()
{
return string.Join("//", m_RecentList);
return string.Join(",", m_RecentList);
}
public static string WindowBoundStr()
public string WindowBoundStr()
{
return string.Format("{0}, {1}, {2}, {3}", WindowBound.Left, WindowBound.Width, WindowBound.Top, WindowBound.Height);
}
public static string CheckedColumnsStr()
public string CheckedColumnsStr()
{
string strResult = "";
if(CheckedColumns != null)
@@ -154,7 +301,7 @@ namespace friction
return strResult;
}
public static string UncheckedColumnsStr()
public string UncheckedColumnsStr()
{
string strResult = "";
@@ -173,7 +320,7 @@ namespace friction
}
public static class ANALYSIS
public class ANALYSIS
{
public enum RISK
{
@@ -192,9 +339,9 @@ namespace friction
public static RISK GetRisk(float fAvg)
{
if (fAvg <= 4)
if (fAvg <= 3)
return RISK.NO;
else if (fAvg <= 6)
else if (fAvg <= 5)
return RISK.POTENTIAL;
else
return RISK.HIGH;
@@ -211,8 +358,6 @@ namespace friction
else
return DEPENDANCY.HIGH;
}
}
}
}

View File

@@ -58,6 +58,7 @@ namespace friction
string m_strCurSpring = "";
string m_strCurTable = "";
string m_strPrevTable = "";
List<string> m_ColumnsNames = new List<string>();
List<string> m_ActiveColumns = new List<string>();
@@ -144,6 +145,7 @@ namespace friction
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>();
@@ -172,6 +174,7 @@ namespace friction
public void SetSelectedMaterial(string strSpring, string strTable)
{
m_strCurSpring = strSpring;
m_strPrevTable = m_strCurTable;
m_strCurTable = strTable;
}
@@ -199,7 +202,6 @@ namespace friction
catch{
return new List<RADAR_CHART>();
}
var group = rows.GroupBy(r => r[Config.COLUMN_NAME.TABLE]);
List<RADAR_CHART> result = rows
@@ -268,7 +270,7 @@ namespace friction
{
// 각 그룹의 평균들의 표준편차
var AvgOfGroup = rows
.GroupBy(r => r[Config.COLUMN_NAME.FORCE])
.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));
@@ -283,25 +285,23 @@ namespace friction
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)
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, "force");
result.m_fDiffByTemp = CalcDependency(rows, "temp");
result.m_fDiffByHumid = CalcDependency(rows, "humidity");
result.m_fDiffByVel = CalcDependency(rows, "velocity");
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
@@ -328,6 +328,11 @@ namespace friction
return m_SpringList;
}
public string GetPrevTable()
{
return m_strPrevTable;
}
public List<string> GetTableList()
{
return m_TableList;

View File

@@ -33,7 +33,15 @@ namespace friction
//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)
@@ -55,6 +63,14 @@ namespace friction
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
@@ -63,6 +79,15 @@ namespace friction
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
@@ -71,6 +96,15 @@ namespace friction
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

94
MainForm.Designer.cs generated
View File

@@ -38,8 +38,8 @@
this.toolStripButtonAnalysis = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonMap = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButtonRadarGraph = new System.Windows.Forms.ToolStripButton();
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();
@@ -52,10 +52,13 @@
this.analysisTableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.materialCompatibilityMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.graphToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.radarGraphToolStripMenuItem = 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();
@@ -79,8 +82,8 @@
this.toolStripButtonAnalysis,
this.toolStripButtonMap,
this.toolStripSeparator2,
this.toolStripButtonRadarGraph,
this.toolStripButtonTrendGraph});
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;
@@ -111,7 +114,7 @@
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(23, 29);
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);
@@ -127,7 +130,7 @@
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(23, 29);
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);
@@ -138,7 +141,7 @@
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(23, 29);
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);
@@ -149,7 +152,7 @@
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(23, 29);
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);
@@ -159,28 +162,28 @@
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 32);
//
// 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(23, 29);
this.toolStripButtonRadarGraph.Text = "toolStripButton3";
this.toolStripButtonRadarGraph.ToolTipText = "Radar Graph (Ctrl+D)";
this.toolStripButtonRadarGraph.Click += new System.EventHandler(this.toolStripButtonRadarGraph_Click);
//
// 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(23, 29);
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[] {
@@ -206,6 +209,7 @@
this.tableToolStripMenuItem,
this.graphToolStripMenuItem,
this.reportToolStripMenuItem,
this.preferenceToolStripMenuItem,
this.aToolStripMenuItem});
this.menuStrip.Location = new System.Drawing.Point(0, 0);
this.menuStrip.Name = "menuStrip";
@@ -226,20 +230,20 @@
// openDBToolStripMenuItem
//
this.openDBToolStripMenuItem.Name = "openDBToolStripMenuItem";
this.openDBToolStripMenuItem.Size = new System.Drawing.Size(152, 24);
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(152, 24);
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(152, 24);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(141, 24);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
@@ -277,12 +281,19 @@
// graphToolStripMenuItem
//
this.graphToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.radarGraphToolStripMenuItem,
this.trendGraphToolStripMenuItem});
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";
@@ -290,14 +301,6 @@
this.radarGraphToolStripMenuItem.Text = "Radar Graph";
this.radarGraphToolStripMenuItem.Click += new System.EventHandler(this.radarGraphToolStripMenuItem_Click);
//
// trendGraphToolStripMenuItem
//
this.trendGraphToolStripMenuItem.Enabled = false;
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);
//
// reportToolStripMenuItem
//
this.reportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -313,6 +316,27 @@
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[] {
@@ -352,6 +376,7 @@
this.Name = "MainForm";
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);
@@ -395,6 +420,9 @@
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

@@ -25,6 +25,8 @@ namespace friction
Report m_Report = null;
ToolStripMenuItem m_CurPref = null;
public MainForm()
{
InitializeComponent();
@@ -37,24 +39,39 @@ namespace friction
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);
}
Config.Init();
UpdateRecentFile();
if(Config.OPTION.WindowBound.Width > 0)
Bounds = Config.OPTION.WindowBound;
private void MainForm_Shown(object sender, EventArgs e)
{
//if (Config.GetInstance().DidAgreeAlert() == true)
// return;
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.m_RecentList))
foreach (string file in Enumerable.Reverse(Config.OPTION.GetInstance().m_RecentList))
{
ToolStripItem item = recentToolStripMenuItem.DropDownItems.Add(file);
item.BackColor = Theme.Backcolor;
@@ -69,6 +86,19 @@ namespace friction
OpenDB(strFile);
}
public void OnSpringCheckChanged(string strItem, bool bChecked)
{
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)
@@ -86,6 +116,9 @@ namespace friction
m_DBFileName = strFile;
}
Config.GetInstance().m_bOnLoad = true;
Config.GetInstance().Load();
Cursor.Current = Cursors.WaitCursor;
m_DataHandler.LoadData(m_DBFileName);
@@ -100,20 +133,23 @@ namespace friction
m_AnalysisPanel.UpdateData(m_DataHandler);
OpenPanel(m_AnalysisPanel);
m_RadarGraphPanel.UpdateGraph();
OpenPanel(m_RadarGraphPanel);
m_TrendGraphPanel.UpdateGraph();
OpenPanel(m_TrendGraphPanel);
m_RadarGraphPanel.UpdateGraph();
OpenPanel(m_RadarGraphPanel);
m_CompatibilityPanel.UpdateData();
OpenPanel(m_CompatibilityPanel);
toolStripStatusLabel.Text = m_DBFileName;
Config.OPTION.AddRecentFile(m_DBFileName);
Config.OPTION.GetInstance().AddRecentFile(m_DBFileName);
UpdateRecentFile();
Config.GetInstance().m_bOnLoad = false;
LoadPref(Config.GetInstance().m_strCurMaterial);
Cursor.Current = Cursors.Default;
}
@@ -174,7 +210,7 @@ namespace friction
private void trendGraphToolStripMenuItem_Click(object sender, EventArgs e)
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetTableList()[0]);
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetPrevTable());
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.UpdateGraph();
@@ -209,7 +245,7 @@ namespace friction
if(m_DataHandler.GetCurTable() != "" && m_DataHandler.GetCurTable() != "All")
{
if (m_DataHandler.GetCurTable() == "All")
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetTableList()[0]);
OnApplyData(this, m_DataHandler.GetCurSpring(), m_DataHandler.GetPrevTable());
OpenPanel(m_TrendGraphPanel);
m_TrendGraphPanel.CopyChart(PanelTrendGraph.GRAPH_TYPE.HUMIDITY);
@@ -300,10 +336,8 @@ namespace friction
if (m_DataHandler.GetCurTable() == "All")
{
string strSpring = m_DataHandler.GetCurSpring();
List<string> tableList = m_DataHandler.GetTableList();
if(tableList.Count > 0)
OnApplyData(this, strSpring, tableList[0]);
string strTable = m_DataHandler.GetPrevTable();
OnApplyData(this, strSpring, strTable);
}
OpenPanel(m_TrendGraphPanel);
@@ -329,10 +363,19 @@ namespace friction
{
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);
}
@@ -375,10 +418,156 @@ namespace friction
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
Config.OPTION.WindowBound = this.Bounds;
Config.OPTION.CheckedColumns = m_ResultPanel.GetCheckedColumns();
Config.OPTION.UncheckedColumns = m_ResultPanel.GetUncheckedColumns();
Config.Save();
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());
}
}
}

View File

@@ -167,34 +167,34 @@
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPYxhcwH/7dgXv3ZsdoFwMAJIDqYFyMYHvzs0N
vru2/IdyMQBIDqQGykUFKYuPvY9bfOBr/Pyjv0FsbDh28YFfyfMOfAOxodoQwHfi7v+kYKg2BGjff+N/
vru2/IdyMQBIDqQGykUFKYuPvY9avP9r/Pyjv0FsbDhy8Z5fybP3fAOxodoQwHfi7v+kYKg2BGjff+N/
274b/1uBuBmIm/Ze/98IxPVAXLfn+v+aPdf+V+++9r8SiqHaEODw26//97z6+H/rs7f/QWwQDeJjEzvw
9gt2AxovXv4PCqgtLz+D6aKzF7GKgdRCtSEASHD5wxf/W67cAtry5X/n1dv/Z917hlUMpwEzb9//n3vq
FFhxwenT//tv3MMqhtOA9qvX/4fs2w12bhiQLrtwFasYTgNIwVBtCHD49WcHUjBU24ADBgYAKxuMHM+h
n2IAAAAASUVORK5CYII=
</value>
</data>
<data name="toolStripButtonRadarGraph.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFbSURBVDhPYxh8wGfmJi6fSbtLfSfuPu88cffPyP27/hft
3/81a/uRTZlbDgtClWEHXlP2yvv2774O1PwfhlOOHvhfdeE0GBcfO/EjZeN+C6hyVACyGV0zCOedOgo3
AGZI6O4z/FBtCOA7YU8Zumbvvp1X848d/45sAAhn7Dy2AaoNAYC2X0AxYNLOBKgUQ/qOw7ORDQCFCVQK
AUABhmwzVBgOQE6HGVB57tR/qDACIBvgNXHXFagwBPz/z7j8wZsfu199/r/1xaf/q5++xzTAu3/HOZgB
IOwzYVciVIqhfNP5tsNvv/6H4bV3Xn2BSiGAz8TdRcgGQPE1MJ6w+3/55otwA6adfrAWqg0BQnqPcYKc
jmYAHHtP2PU/ffnJ/+uvvP5ef+IWH1QbKvCZsFsOnyFuvTtuJs3ZbwJVjh3Yz9/PAfHOrrO+/Ru/g/HE
3WeA/AKQHFTZoAEMDAB+FD5H91aCSgAAAABJRU5ErkJggg==
FFhxwenT//tv3MMqhtOA9qvX/4fs2w12bhiQLrtwFasYTgNIwVBtCHD49WcHUjBU24ADBgYA8TGMCJUH
0TwAAAAASUVORK5CYII=
</value>
</data>
<data name="toolStripButtonTrendGraph.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEpSURBVDhPY6A7COk9xuk1Za88lIsdBE7bKeY7aac1lIsC
/CbtXunbvvGfV/8uTagQJvCdtHuT78Td//2n7DSACoHB8RefxTsP3rruM2Hnbv/+/QJQYUww6eitw3Hz
D23d8+LDgcNvPrvaz9/PceDtZ91Dr7+sKD17Vqrq/MlAqFJMcOjNl7pNj14EVJ47ZQ/iL732vNunc9Ov
/CbtXunbvPafV/8uTagQJvCdtHuT78Td//2n7DSACoHB8RefxTsP3rruM2Hnbv/+/QJQYUww6eitw3Hz
D23d8+LDgcNvPrvaz9/PceDtZ91Dr7+sKD17Vqrq/MlAqFJMcOjNl7pNj14EVJ47ZQ/iL732vNunddOv
vDUnL4H45edO6FedPz0BxMYAB998DT785msOsiK/ybukAibte+IzcVc1iI/VALfeHULBk/ccb9595QCI
j66o8vyZgKrzx6RBbKwGgELUeeLuv74Tdi0B8TEMuHC6H+hvcIBiNQAE0nccds3YeVQMxCbLAHyKRooB
oBRWeOwYJ4hdf38/ByzaQACfHIWAgQEA49D9S+nmzuwAAAAASUVORK5CYII=
j66o8vyZgKrzx6RBbKwGgELUfuLuv74Tdi0B8TEMuHC6H+hvcIBiNQAE0nccds3YeVQMxCbLAHyKRooB
oBRWeOwYJ4hdf38/ByzaQACfHIWAgQEAtoT9O3T9CCEAAAAASUVORK5CYII=
</value>
</data>
<data name="toolStripButtonRadarGraph.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFbSURBVDhPYxh8wGfmJi6fSbtLfSfuPm8/cffPyP27/hft
3/81a/uRTZlbDgtClWEHXlP2yvv2774O1PwfhlOOHvhfdeE0GBcfO/EjZeN+C6hyVACyGV0zCOedOgo3
AGZI6O4z/FBtCOA7YU8Zumbvvp1X848d/45sAAhn7Dy2AaoNAYC2X0AxYNLOBKgUQ/qOw7ORDQCFCVQK
AUABhmwzVBgOQE6HGVB57tR/qDACIBvgNXHXFagwBPz/z7j4wZsfu199/r/1xaf/q5++xzTAu3/HOZgB
IOwzYVciVIqhfNP5tsNvv/6H4bV3Xn2BSiGAz8TdRcgGQPE1MJ6w+3/55otwA6adfrAWqg0BQnqPcYKc
jmYAHHtP2PU/ffnJ/+svvP5ef+IWH1QbKvCZsFsOnyFuvTtuJs3ZbwJVjh3Yz9/PAfHOrrO+/eu/g/HE
3WeA/AKQHFTZoAEMDABRBD4v4Uy/mAAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

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();
}
}
}

120
NewPreference.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -41,8 +41,10 @@
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
@@ -50,27 +52,23 @@
this.dgvAnalysis.AllowUserToAddRows = false;
this.dgvAnalysis.AllowUserToDeleteRows = false;
this.dgvAnalysis.AllowUserToOrderColumns = true;
this.dgvAnalysis.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.dgvAnalysis.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvAnalysis.Location = new System.Drawing.Point(12, 33);
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(856, 546);
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.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 4;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
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);
@@ -80,7 +78,8 @@
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.Location = new System.Drawing.Point(12, 585);
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());
@@ -88,7 +87,7 @@
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(856, 62);
this.tableLayoutPanel1.Size = new System.Drawing.Size(874, 64);
this.tableLayoutPanel1.TabIndex = 1;
//
// label1
@@ -98,7 +97,7 @@
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(165, 62);
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";
@@ -106,10 +105,10 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(430, 0);
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(135, 60);
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)";
@@ -121,9 +120,9 @@
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(174, 0);
this.lbInfo11.Location = new System.Drawing.Point(280, 0);
this.lbInfo11.Name = "lbInfo11";
this.lbInfo11.Size = new System.Drawing.Size(250, 12);
this.lbInfo11.Size = new System.Drawing.Size(154, 12);
this.lbInfo11.TabIndex = 2;
this.lbInfo11.Text = "No Stick-Slip Risk";
//
@@ -134,11 +133,11 @@
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(174, 12);
this.lbInfo12.Location = new System.Drawing.Point(280, 12);
this.lbInfo12.Name = "lbInfo12";
this.lbInfo12.Size = new System.Drawing.Size(250, 12);
this.lbInfo12.Size = new System.Drawing.Size(154, 24);
this.lbInfo12.TabIndex = 2;
this.lbInfo12.Text = "Potential S-Slip Risk";
this.lbInfo12.Text = "Potential Stick-Slip Risk";
//
// lbInfo13
//
@@ -147,9 +146,9 @@
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(174, 24);
this.lbInfo13.Location = new System.Drawing.Point(280, 36);
this.lbInfo13.Name = "lbInfo13";
this.lbInfo13.Size = new System.Drawing.Size(250, 12);
this.lbInfo13.Size = new System.Drawing.Size(154, 12);
this.lbInfo13.TabIndex = 2;
this.lbInfo13.Text = "High Stick-Slip Risk";
//
@@ -160,9 +159,9 @@
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(601, 0);
this.lbInfo21.Location = new System.Drawing.Point(717, 0);
this.lbInfo21.Name = "lbInfo21";
this.lbInfo21.Size = new System.Drawing.Size(252, 12);
this.lbInfo21.Size = new System.Drawing.Size(154, 12);
this.lbInfo21.TabIndex = 2;
this.lbInfo21.Text = "No Dependancy";
//
@@ -173,9 +172,9 @@
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(601, 12);
this.lbInfo22.Location = new System.Drawing.Point(717, 12);
this.lbInfo22.Name = "lbInfo22";
this.lbInfo22.Size = new System.Drawing.Size(252, 12);
this.lbInfo22.Size = new System.Drawing.Size(154, 24);
this.lbInfo22.TabIndex = 2;
this.lbInfo22.Text = "Potential Dependancy";
//
@@ -186,9 +185,9 @@
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(601, 24);
this.lbInfo23.Location = new System.Drawing.Point(717, 36);
this.lbInfo23.Name = "lbInfo23";
this.lbInfo23.Size = new System.Drawing.Size(252, 12);
this.lbInfo23.Size = new System.Drawing.Size(154, 12);
this.lbInfo23.TabIndex = 2;
this.lbInfo23.Text = "Obvious Dependancy";
//
@@ -199,29 +198,45 @@
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(601, 36);
this.lbInfo24.Location = new System.Drawing.Point(717, 48);
this.lbInfo24.Name = "lbInfo24";
this.lbInfo24.Size = new System.Drawing.Size(252, 12);
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(12, 9);
this.lbSpring.Location = new System.Drawing.Point(3, 0);
this.lbSpring.Name = "lbSpring";
this.lbSpring.Size = new System.Drawing.Size(0, 12);
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.lbSpring);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.dgvAnalysis);
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)
@@ -236,8 +251,9 @@
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -255,5 +271,6 @@
private System.Windows.Forms.Label lbInfo23;
private System.Windows.Forms.Label lbInfo24;
private System.Windows.Forms.Label lbSpring;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
}
}

View File

@@ -85,6 +85,7 @@ namespace friction
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);
@@ -128,6 +129,8 @@ namespace friction
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;
@@ -166,6 +169,15 @@ namespace friction
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")

View File

@@ -57,9 +57,13 @@
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
//

View File

@@ -17,6 +17,11 @@ namespace friction
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)
{
@@ -32,19 +37,89 @@ namespace friction
dgvMap.CellPainting += DgvMap_CellPainting;
dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
dgvMap.ColumnHeadersHeight = HEADER_SIZE;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
dgvMap.RowHeadersWidth = HEADER_SIZE;
dgvMap.DefaultCellStyle.Format = "N0";
dgvMap.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
dgvMap.RowHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.False;
dgvMap.CellToolTipTextNeeded += DgvMap_CellToolTipTextNeeded;
dgvMap.MouseWheel += DgvMap_MouseWheel;
}
private void DgvMap_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e)
public void SpringCheckChanged(string strItem, bool bChecked)
{
e.ToolTipText = "tooltip";
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()
@@ -57,6 +132,7 @@ namespace friction
int iCol = dgvMap.Columns.Add("table", "table");
dgvMap.Columns[iCol].Width = 10;
dgvMap.Columns[iCol].SortMode = DataGridViewColumnSortMode.NotSortable;
foreach (var table in Tables)
{
@@ -100,6 +176,11 @@ namespace friction
}
}
}
//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)
@@ -107,6 +188,8 @@ namespace friction
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
column.ReadOnly = true;
}
dgvMap.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
dgvMap.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
}
public object[] GetData()
@@ -118,9 +201,7 @@ namespace friction
dt.Columns.Add(" ");
foreach (DataGridViewColumn column in dgvMap.Columns)
{
if (column.Visible)
dt.Columns.Add(column.HeaderText);
dt.Columns.Add(column.HeaderText);
ColumnHeaders.Add(column.HeaderText);
}
@@ -149,6 +230,7 @@ namespace friction
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)
@@ -215,6 +297,7 @@ namespace friction
private void btPivot_Click(object sender, EventArgs e)
{
Pivot();
SetMaterialChecked(Config.GetInstance().m_strCurMaterial);
}
private void dgvMap_CellClick(object sender, DataGridViewCellEventArgs e)
@@ -274,5 +357,73 @@ namespace friction
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;
}
}
}

View File

@@ -33,11 +33,20 @@
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lvTable = new friction.NoDoubleClickAutoCheckListview();
this.lvchTable = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
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
@@ -53,7 +62,7 @@
//
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, 43);
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;
@@ -63,7 +72,7 @@
//
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, 389);
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;
@@ -74,44 +83,49 @@
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.lvTable, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.lvSpring, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3);
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 = 5;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
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;
//
// lvTable
// splitContainer1
//
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, 404);
this.lvTable.Name = "lvTable";
this.lvTable.Size = new System.Drawing.Size(292, 320);
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);
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;
//
// lvchTable
// splitContainer1.Panel1
//
this.lvchTable.Text = "Table";
this.lvchTable.Width = 305;
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
//
@@ -121,9 +135,9 @@
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, 58);
this.lvSpring.Location = new System.Drawing.Point(3, 23);
this.lvSpring.Name = "lvSpring";
this.lvSpring.Size = new System.Drawing.Size(292, 320);
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;
@@ -136,6 +150,45 @@
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);
@@ -155,6 +208,14 @@
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);
}
@@ -168,5 +229,8 @@
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;
}
}

View File

@@ -44,13 +44,20 @@ namespace friction
var TableList = data.GetTableList();
lvSpring.Items.Clear();
lvSpring.Items.Add("All");
foreach (var x in SpringList)
lvSpring.Items.Add(x);
{
ListViewItem item = lvSpring.Items.Add(x);
item.Checked = true;
}
lvTable.Items.Clear();
lvTable.Items.Add("All");
foreach (var x in TableList)
lvTable.Items.Add(x);
{
ListViewItem item = lvTable.Items.Add(x);
item.Checked = true;
}
lvSpring.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
lvTable.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
@@ -71,8 +78,16 @@ namespace friction
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;
@@ -87,6 +102,26 @@ namespace friction
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)
@@ -134,15 +169,110 @@ namespace friction
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 (view == lvTable && e.Item.Text == "All")
e.Item.Checked = true;
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

View File

@@ -41,6 +41,8 @@
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();
@@ -48,17 +50,18 @@
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
//
this.chart.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)));
chartArea1.Area3DStyle.Enable3D = true;
chartArea1.AxisX.MajorGrid.Enabled = false;
chartArea1.AxisX.MajorTickMark.LineWidth = 0;
@@ -66,9 +69,10 @@
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(3, 83);
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;
@@ -115,7 +119,7 @@
this.chart.Series.Add(series4);
this.chart.Series.Add(series5);
this.chart.Series.Add(series6);
this.chart.Size = new System.Drawing.Size(809, 573);
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);
@@ -135,24 +139,47 @@
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(809, 19);
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.rbLowTemp);
this.groupBox1.Controls.Add(this.rbHighHigh);
this.groupBox1.Controls.Add(this.rbHighLow);
this.groupBox1.Controls.Add(this.rbNormalHigh);
this.groupBox1.Controls.Add(this.rbNormalLow);
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;
@@ -233,7 +260,7 @@
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.chart, 0, 2);
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";
@@ -241,14 +268,33 @@
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(815, 659);
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(815, 659);
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)
@@ -261,11 +307,14 @@
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.Document;
this.TabText = "Radar Graph";
this.Text = "Radar Graph";
this.VisibleChanged += new System.EventHandler(this.PanelRadarGraph_VisibleChanged);
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);
@@ -284,5 +333,9 @@
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;
}
}

View File

@@ -20,11 +20,14 @@ namespace friction
DataHandler m_DataHandler = null;
string m_CurSpring = "";
bool m_bShowAlert = false;
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();
@@ -39,7 +42,7 @@ namespace friction
Theme.Apply(rbHighLow);
Theme.Apply(rbHighHigh);
Theme.Apply(rbLowTemp);
Theme.Apply(btnClose);
chart.ChartAreas[0].AxisY.Maximum = 10;
@@ -100,8 +103,11 @@ namespace friction
public void UpdateGraph()
{
panelPopup.Visible = false;
string strSpring = m_DataHandler.GetCurSpring();
if (m_CurSpring == strSpring)
List<string> uncheckedTable = Config.GetInstance().GetTableUnchecked();
if (strSpring == m_CurSpring && uncheckedTable == m_UncheckedTable)
return;
lbSpring.Text = "Material Spring: " + strSpring;
@@ -116,8 +122,13 @@ namespace friction
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);
@@ -125,16 +136,18 @@ namespace friction
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 (graphData.Count < 3)
if (iTableCnt < 3)
{
if (Visible == true)
MessageBox.Show(this, "데이터가 부족합니다");
else
m_bShowAlert = true;
panelPopup.Left = (panel2.Width - panelPopup.Width) / 2;
panelPopup.Top = (panel2.Height - panelPopup.Height) / 2;
panelPopup.Visible = true;
}
}
@@ -157,15 +170,6 @@ namespace friction
}
}
private void PanelRadarGraph_VisibleChanged(object sender, EventArgs e)
{
if(m_bShowAlert == true)
{
MessageBox.Show(this, "데이터가 부족합니다");
m_bShowAlert = false;
}
}
private void rbAll_CheckedChanged(object sender, EventArgs e)
{
if(sender.GetType() == typeof(RadioButton))
@@ -209,5 +213,37 @@ namespace friction
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;
}
}
}
}

View File

@@ -32,7 +32,9 @@
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
@@ -40,15 +42,13 @@
this.dgvData.AllowUserToAddRows = false;
this.dgvData.AllowUserToDeleteRows = false;
this.dgvData.AllowUserToOrderColumns = true;
this.dgvData.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.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(713, 719);
this.dgvData.Size = new System.Drawing.Size(716, 717);
this.dgvData.TabIndex = 0;
//
// lvColumn
@@ -60,10 +60,10 @@
this.lvchColumns});
this.lvColumn.FullRowSelect = true;
this.lvColumn.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.lvColumn.Location = new System.Drawing.Point(722, 3);
this.lvColumn.Location = new System.Drawing.Point(725, 3);
this.lvColumn.MultiSelect = false;
this.lvColumn.Name = "lvColumn";
this.lvColumn.Size = new System.Drawing.Size(199, 718);
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;
@@ -75,14 +75,28 @@
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.lvColumn);
this.Controls.Add(this.dgvData);
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)
@@ -94,6 +108,7 @@
this.TabText = "Result Table";
this.Text = "Result Table";
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -103,5 +118,6 @@
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.ListView lvColumn;
private System.Windows.Forms.ColumnHeader lvchColumns;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}

View File

@@ -49,8 +49,8 @@ namespace friction
if(lvColumn.Items.Count > 0)
{
Config.OPTION.CheckedColumns = GetCheckedColumns();
Config.OPTION.UncheckedColumns = GetUncheckedColumns();
Config.OPTION.GetInstance().CheckedColumns = GetCheckedColumns();
Config.OPTION.GetInstance().UncheckedColumns = GetUncheckedColumns();
}
lvColumn.Items.Clear();
@@ -63,9 +63,9 @@ namespace friction
ListViewItem item = new ListViewItem(new string[] { col });
item.Text = col;
if(Config.OPTION.CheckedColumns != null && Config.OPTION.CheckedColumns.Exists(s => s==col) == true)
if(Config.OPTION.GetInstance().CheckedColumns != null && Config.OPTION.GetInstance().CheckedColumns.Exists(s => s==col) == true)
item.Checked = true;
else if(Config.OPTION.UncheckedColumns != null && Config.OPTION.UncheckedColumns.Exists(s => s == col) == 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;

View File

@@ -35,11 +35,15 @@
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.rbVelocity = new System.Windows.Forms.RadioButton();
this.rbForce = new System.Windows.Forms.RadioButton();
this.panelGraph = new System.Windows.Forms.Panel();
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();
//
@@ -48,7 +52,7 @@
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(701, 603);
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);
@@ -88,9 +92,9 @@
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(8, 3);
this.groupBox1.Location = new System.Drawing.Point(6, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(297, 50);
this.groupBox1.Size = new System.Drawing.Size(300, 50);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Data";
@@ -121,21 +125,10 @@
this.rbForce.UseVisualStyleBackColor = true;
this.rbForce.CheckedChanged += new System.EventHandler(this.rbForce_CheckedChanged);
//
// panelGraph
//
this.panelGraph.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.panelGraph.Controls.Add(this.trendChart);
this.panelGraph.Location = new System.Drawing.Point(34, 59);
this.panelGraph.Name = "panelGraph";
this.panelGraph.Size = new System.Drawing.Size(701, 603);
this.panelGraph.TabIndex = 3;
//
// lbPair1
//
this.lbPair1.AutoSize = true;
this.lbPair1.Location = new System.Drawing.Point(327, 28);
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;
@@ -144,7 +137,7 @@
// lbPair2
//
this.lbPair2.AutoSize = true;
this.lbPair2.Location = new System.Drawing.Point(365, 28);
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;
@@ -153,23 +146,55 @@
// lbPair3
//
this.lbPair3.AutoSize = true;
this.lbPair3.Location = new System.Drawing.Point(403, 28);
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.lbPair3);
this.Controls.Add(this.lbPair2);
this.Controls.Add(this.lbPair1);
this.Controls.Add(this.panelGraph);
this.Controls.Add(this.groupBox1);
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)
@@ -180,11 +205,14 @@
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);
this.PerformLayout();
}
@@ -196,9 +224,11 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton rbVelocity;
private System.Windows.Forms.RadioButton rbForce;
private System.Windows.Forms.Panel panelGraph;
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;
}
}

View File

@@ -152,9 +152,8 @@ namespace friction
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
if (Chart.Count <= 0)
return;
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Humidity";
ChartValues<ScatterPoint>[] Points = {
@@ -176,6 +175,9 @@ namespace friction
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>();
@@ -224,8 +226,12 @@ namespace friction
};
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
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;
@@ -237,9 +243,7 @@ namespace friction
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
if (Chart.Count <= 0)
return;
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Temperature";
ChartValues<ScatterPoint>[] Points = {
@@ -257,6 +261,9 @@ namespace friction
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>();
@@ -290,8 +297,12 @@ namespace friction
};
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
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()
@@ -300,9 +311,7 @@ namespace friction
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
if (Chart.Count <= 0)
return;
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Force";
var Points = new ChartValues<ScatterPoint>();
@@ -314,6 +323,9 @@ namespace friction
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>();
@@ -340,8 +352,12 @@ namespace friction
};
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
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()
@@ -350,9 +366,7 @@ namespace friction
string strTable = m_DataHandler.GetCurTable();
var Chart = m_DataHandler.GetTrendChart(strSpring, strTable);
if (Chart.Count <= 0)
return;
trendChart.Series.Clear();
trendChart.AxisX[0].Title = "Velocity";
var Points = new ChartValues<ScatterPoint>();
@@ -364,6 +378,9 @@ namespace friction
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>();
@@ -390,8 +407,12 @@ namespace friction
};
trendChart.AxisX[0].MinValue = Chart.Min(r => r.HUMIDITY - 1);
trendChart.AxisX[0].MaxValue = Chart.Max(r => r.HUMIDITY - 1);
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)
@@ -445,22 +466,26 @@ namespace friction
private void rbHumidity_CheckedChanged(object sender, EventArgs e)
{
UpdateGraph(GRAPH_TYPE.HUMIDITY);
if(sender == rbHumidity && rbHumidity.Checked == true)
UpdateGraph(GRAPH_TYPE.HUMIDITY);
}
private void rbTemp_CheckedChanged(object sender, EventArgs e)
{
UpdateGraph(GRAPH_TYPE.TEMPERATURE);
if (sender == rbTemp && rbTemp.Checked == true)
UpdateGraph(GRAPH_TYPE.TEMPERATURE);
}
private void rbForce_CheckedChanged(object sender, EventArgs e)
{
UpdateGraph(GRAPH_TYPE.FORCE);
if (sender == rbForce && rbForce.Checked == true)
UpdateGraph(GRAPH_TYPE.FORCE);
}
private void rbVelocity_CheckedChanged(object sender, EventArgs e)
{
UpdateGraph(GRAPH_TYPE.VELOCITY);
if (sender == rbVelocity && rbVelocity.Checked == true)
UpdateGraph(GRAPH_TYPE.VELOCITY);
}
public void CopyChart(GRAPH_TYPE Type)
@@ -493,11 +518,15 @@ namespace friction
this.Invoke(new Action(() =>
{
Bitmap bm = new Bitmap(Width, Height);
panelGraph.DrawToBitmap(bm, new Rectangle(panelGraph.Left, panelGraph.Top, panelGraph.Width, panelGraph.Height));
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();
}
}
}

View File

@@ -137,10 +137,10 @@ namespace friction
// compatibility table
iRow += 1;
iCol = 2;
foreach (DataColumn column in CompatibilityData.Columns)
iCol = 3;
foreach (string column in CompatibilityColumns)
{
Sheet.Cells[iRow, iCol].Value = column.ColumnName;
Sheet.Cells[iRow, iCol].Value = column;
iCol++;
}
iRow++;
@@ -152,9 +152,12 @@ namespace friction
iNoOfTest = 0;
iAvgRPNColumn = 1;
foreach (DataRow row in CompatibilityData.Rows)
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)
@@ -193,7 +196,7 @@ namespace friction
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();
//Sheet.Cells[iTableRowStart, iTableColStart, iRow - 1, iCol - 1].AutoFitColumns();
iRow += 2;
iCol = 2;
@@ -202,10 +205,8 @@ namespace friction
// radar graph
double dX=0;
double dY=0;
for (int i = 1; i < iCol; i++)
dX += ExcelHelper.ColumnWidth2Pixel(Sheet, Sheet.Column(i).Width);
for (int i = 1; i < iRow; i++)
dY += ExcelHelper.RowHeight2Pixel(Sheet.Row(i).Height);
dX = ExcelHelper.Column2Pixel(Sheet, iCol);
dY = ExcelHelper.Row2Pixel(Sheet, iRow);
int iWidth = RadarChart.Width;
int iHeight = RadarChart.Height;
@@ -216,58 +217,74 @@ namespace friction
var picRadarChart = Sheet.Drawings.AddPicture("Radar Chart", RadarChart);
picRadarChart.SetPosition((int)dY, (int)dX);
picRadarChart.SetSize(iWidth, iHeight);
dY += iHeight + 60;
dY += iHeight;
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
if (TrendChartByHumidity != null)
{
const int iPictureWidth = 400;
Sheet.Cells[71, 2].Value = MaterialSpring + " vs " + MaterialTable;
Sheet.Cells[71, 2].Style.Font.Bold = true;
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);
dY += 20;
var picTrendChartHumidity = Sheet.Drawings.AddPicture("Trend Chart by Humidity", TrendChartByHumidity);
picTrendChartHumidity.SetPosition((int)dY, (int)dX);
iWidth = TrendChartByHumidity.Width;
iHeight = TrendChartByHumidity.Height;
iHeight = iHeight * 390 / iWidth;
iWidth = 390;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartHumidity.SetSize(iWidth, iHeight);
Sheet.Cells[84, 2].Value = "by Humidity";
int iPrevRow = iRow;
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, iCol].Value = "by Humidity";
dX += 400;
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 * 390 / iWidth;
iWidth = 390;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartTemperature.SetSize(iWidth, iHeight);
Sheet.Cells[84, 8].Value = "by Temperature";
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, iCol].Value = "by Temperature";
dX -= 400;
dY += iHeight + 10;
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 * 390 / iWidth;
iWidth = 390;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartForce.SetSize(iWidth, iHeight);
Sheet.Cells[97, 2].Value = "by Force";
iPrevRow = iRow;
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, 2].Value = "by Force";
dX += 400;
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 * 390 / iWidth;
iWidth = 390;
iHeight = iHeight * iPictureWidth / iWidth;
iWidth = iPictureWidth;
picTrendChartVelocity.SetSize(iWidth, iHeight);
Sheet.Cells[97, 8].Value = "by Velocity";
iRow = ExcelHelper.Pixel2NextRow(Sheet, iRow, iHeight);
Sheet.Cells[iRow, iCol].Value = "by Velocity";
}
package.SaveAs(new FileInfo(FilePath));

View File

@@ -167,8 +167,25 @@ namespace friction
foreach (ToolStripMenuItem item in ctrl.Items)
{
foreach (ToolStripMenuItem subitem in item.DropDownItems)
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;
@@ -202,4 +219,32 @@ namespace friction
}
}
}
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);
}
}
}

View File

@@ -77,6 +77,12 @@
<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" />
@@ -86,6 +92,12 @@
<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>
@@ -130,9 +142,15 @@
<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>