Compare commits

...

4 Commits

Author SHA1 Message Date
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
22 changed files with 1220 additions and 181 deletions

192
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,30 +137,89 @@ 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;
}
@@ -113,14 +235,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 +260,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 +286,7 @@ namespace friction
return strResult;
}
public static string UncheckedColumnsStr()
public string UncheckedColumnsStr()
{
string strResult = "";
@@ -173,7 +305,7 @@ namespace friction
}
public static class ANALYSIS
public class ANALYSIS
{
public enum RISK
{
@@ -211,8 +343,6 @@ namespace friction
else
return DEPENDANCY.HIGH;
}
}
}
}

View File

@@ -199,7 +199,6 @@ namespace friction
catch{
return new List<RADAR_CHART>();
}
var group = rows.GroupBy(r => r[Config.COLUMN_NAME.TABLE]);
List<RADAR_CHART> result = rows

46
MainForm.Designer.cs generated
View File

@@ -56,6 +56,9 @@
this.trendGraphToolStripMenuItem = 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();
@@ -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);
@@ -165,7 +168,7 @@
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.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);
@@ -176,7 +179,7 @@
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);
@@ -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);
//
@@ -313,6 +317,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(152, 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(149, 6);
//
// aToolStripMenuItem
//
this.aToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -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,26 @@ 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;
}
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 +73,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 +103,9 @@ namespace friction
m_DBFileName = strFile;
}
Config.GetInstance().m_bOnLoad = true;
Config.GetInstance().Load();
Cursor.Current = Cursors.WaitCursor;
m_DataHandler.LoadData(m_DBFileName);
@@ -111,9 +131,12 @@ namespace friction
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;
}
@@ -332,7 +355,10 @@ namespace friction
}
if (sender != m_MaterialPanel)
{
m_MaterialPanel.SelectSpring(strSpring);
m_MaterialPanel.SelectTable(strTable);
}
m_AnalysisPanel.UpdateData(m_DataHandler);
}
@@ -375,10 +401,160 @@ 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")
{
List<string> tableList = m_DataHandler.GetTableList();
if(tableList.Count > 0)
OnApplyData(this, m_DataHandler.GetCurSpring(), tableList[1]);
}
}
}
}

View File

@@ -167,34 +167,34 @@
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAELSURBVDhPYxhcwH/7dgXv3ZsdoFwMAJIDqYFyMYHvzs0N
vru2/IdyMQBIDqQGykUFKYuPvY9bfOBr/Pyjv0FsbDh28YFfyfMOfAOxodoQwHfi7v+kYKg2BGjff+N/
vru2/IdyMQBIDqQGykUFKYuPvY9ZvP9r/Pyjv0FsbDh68b5fyXP2fQOxodoQwHfi7v+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=
FFhxwenT//tv3MMqhtOA9qvX/4fs2w12bhiQLrtwFasYTgNIwVBtCHD49WcHUjBU24ADBgYAC0KMEbMo
xeMAAAAASUVORK5CYII=
</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
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFbSURBVDhPYxh8wGfmJi6fSbtLfSfuPu84cffPyP27/hft
3/81a/uRTZlbDgtClWEHXlP2yvv2774O1PwfhlOOHvhfdeE0GBcfO/EjZeN+C6hyVACyGV0zCOedOgo3
AGZI6O4z/FBtCOA7YU8Zumbvvp1X848d/45sAAhn7Dy2AaoNAYC2X0AxYNLOBKgUQ/qOw7ORDQCFCVQK
AUABhmwzVBgOQE6HGVB57tR/qDACIBvgNXHXFagwBPz/z7j8wZsfu199/r/1xaf/q5++xzTAu3/HOZgB
AUABhmwzVBgOQE6HGVB57tR/qDACIBvgNXHXFagwBPz/z7j0wZsfu199/r/1xaf/q5++xzTAu3/HOZgB
IOwzYVciVIqhfNP5tsNvv/6H4bV3Xn2BSiGAz8TdRcgGQPE1MJ6w+3/55otwA6adfrAWqg0BQnqPcYKc
jmYAHHtP2PU/ffnJ/+uvvP5ef+IWH1QbKvCZsFsOnyFuvTtuJs3ZbwJVjh3Yz9/PAfHOrrO+/Ru/g/HE
3WeA/AKQHFTZoAEMDAB+FD5H91aCSgAAAABJRU5ErkJggg==
jmYAHHtP2PU/ffnJ/+svvf5ef+IWH1QbKvCZsFsOnyFuvTtuJs3ZbwJVjh3Yz9/PAfHOrrO+/eu/g/HE
3WeA/AKQHFTZoAEMDABmSD45Ez7cuwAAAABJRU5ErkJggg==
</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
/CbtXunbuv6fV/8uTagQJvCdtHuT78Td//2n7DSACoHB8RefxTsP3rruM2Hnbv/+/QJQYUww6eitw3Hz
D23d8+LDgcNvPrvaz9/PceDtZ91Dr7+sKD17Vqrq/MlAqFJMcOjNl7pNj14EVJ47ZQ/iL732vNunfdOv
vDUnL4H45edO6FedPz0BxMYAB998DT785msOsiK/ybukAibte+IzcVc1iI/VALfeHULBk/ccb9595QCI
j66o8vyZgKrzx6RBbKwGgELUeeLuv74Tdi0B8TEMuHC6H+hvcIBiNQAE0nccds3YeVQMxCbLAHyKRooB
oBRWeOwYJ4hdf38/ByzaQACfHIWAgQEA49D9S+nmzuwAAAAASUVORK5CYII=
j66o8vyZgKrzx6RBbKwGgELUceLuv74Tdi0B8TEMuHC6H+hvcIBiNQAE0nccds3YeVQMxCbLAHyKRooB
oBRWeOwYJ4hdf38/ByzaQACfHIWAgQEAzSr9Q3GkmpEAAAAASUVORK5CYII=
</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, 3);
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, 573);
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,9 +133,9 @@
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, 12);
this.lbInfo12.TabIndex = 2;
this.lbInfo12.Text = "Potential S-Slip Risk";
//
@@ -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, 24);
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, 12);
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, 24);
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,9 +198,9 @@
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, 36);
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";
//
@@ -213,15 +212,29 @@
this.lbSpring.Size = new System.Drawing.Size(0, 12);
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, 1);
this.tableLayoutPanel2.Controls.Add(this.dgvAnalysis, 0, 0);
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.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 70F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(880, 649);
this.tableLayoutPanel2.TabIndex = 3;
//
// PanelAnalysis
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(880, 649);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel2);
this.Controls.Add(this.lbSpring);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.dgvAnalysis);
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,6 +249,7 @@
((System.ComponentModel.ISupportInitialize)(this.dgvAnalysis)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -255,5 +269,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

@@ -45,12 +45,18 @@ namespace friction
lvSpring.Items.Clear();
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,6 +77,7 @@ namespace friction
Theme.ResizeFullColumn(lvTable);
}
#region select
private void SelectSpring(int iIdx)
{
if (m_SelectedSpring != null)
@@ -87,6 +94,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,6 +161,74 @@ 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)
{
@@ -141,8 +236,27 @@ namespace friction
if (view == lvTable && e.Item.Text == "All")
e.Item.Checked = true;
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

@@ -262,6 +262,7 @@
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();

View File

@@ -20,6 +20,7 @@ namespace friction
DataHandler m_DataHandler = null;
string m_CurSpring = "";
List<string> m_UncheckedTable = null;
bool m_bShowAlert = false;
Config.RANGE m_TempRange = Config.TEMP_ALL;
@@ -101,7 +102,8 @@ namespace friction
public void UpdateGraph()
{
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;
@@ -118,6 +120,9 @@ namespace friction
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);
@@ -129,13 +134,13 @@ namespace friction
m_CurSpring = strSpring;
if (graphData.Count < 3)
{
if (Visible == true)
MessageBox.Show(this, "데이터가 부족합니다");
else
m_bShowAlert = true;
}
//if (graphData.Count < 3)
//{
// if (Visible == true)
// MessageBox.Show(this, "데이터가 부족합니다");
// else
// m_bShowAlert = true;
//}
}
public Bitmap CopyChart()
@@ -209,5 +214,10 @@ namespace friction
m_CurSpring = "";
UpdateGraph();
}
private void PanelRadarGraph_Enter(object sender, EventArgs e)
{
m_Owner.OnRadarGraphActivated();
}
}
}

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(916, 717);
this.dgvData.TabIndex = 0;
//
// lvColumn
@@ -75,14 +75,29 @@
this.lvchColumns.Text = "Columns";
this.lvchColumns.Width = 175;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
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, 20F));
this.tableLayoutPanel1.Controls.Add(this.dgvData, 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 = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(922, 723);
this.tableLayoutPanel1.TabIndex = 2;
//
// PanelResult
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(922, 723);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.lvColumn);
this.Controls.Add(this.dgvData);
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 +109,7 @@
this.TabText = "Result Table";
this.Text = "Result Table";
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -103,5 +119,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)
@@ -499,5 +524,9 @@ namespace friction
}));
}
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)
@@ -221,9 +224,12 @@ namespace friction
if (TrendChartByHumidity != null)
{
iRow += 29;
Sheet.Cells[71, 2].Value = MaterialSpring + " vs " + MaterialTable;
Sheet.Cells[71, 2].Style.Font.Bold = true;
Sheet.Cells[iRow, 2].Value = MaterialSpring + " vs " + MaterialTable;
Sheet.Cells[iRow, 2].Style.Font.Bold = true;
iRow += 14;
dY += 20;
var picTrendChartHumidity = Sheet.Drawings.AddPicture("Trend Chart by Humidity", TrendChartByHumidity);
@@ -233,7 +239,7 @@ namespace friction
iHeight = iHeight * 390 / iWidth;
iWidth = 390;
picTrendChartHumidity.SetSize(iWidth, iHeight);
Sheet.Cells[84, 2].Value = "by Humidity";
Sheet.Cells[iRow, 2].Value = "by Humidity";
dX += 400;
@@ -244,9 +250,9 @@ namespace friction
iHeight = iHeight * 390 / iWidth;
iWidth = 390;
picTrendChartTemperature.SetSize(iWidth, iHeight);
Sheet.Cells[84, 8].Value = "by Temperature";
Sheet.Cells[iRow, 8].Value = "by Temperature";
iRow += 15;
dX -= 400;
dY += iHeight + 10;
var picTrendChartForce = Sheet.Drawings.AddPicture("Trend Chart by Force", TrendChartByForce);
@@ -256,7 +262,7 @@ namespace friction
iHeight = iHeight * 390 / iWidth;
iWidth = 390;
picTrendChartForce.SetSize(iWidth, iHeight);
Sheet.Cells[97, 2].Value = "by Force";
Sheet.Cells[iRow, 2].Value = "by Force";
dX += 400;
@@ -267,7 +273,7 @@ namespace friction
iHeight = iHeight * 390 / iWidth;
iWidth = 390;
picTrendChartVelocity.SetSize(iWidth, iHeight);
Sheet.Cells[97, 8].Value = "by Velocity";
Sheet.Cells[iRow, 8].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

@@ -86,6 +86,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>
@@ -133,6 +139,9 @@
<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>