- 재질 check 기능 수정
- 리포트 맵 부분 수정
This commit is contained in:
57
Config.cs
57
Config.cs
@@ -31,13 +31,13 @@ namespace friction
|
||||
public static readonly RANGE HUMID_HIGH = new RANGE { m_fLow = 60.0f, m_fHigh = 100.0f };
|
||||
|
||||
|
||||
public class CheckedMaterial
|
||||
public class UncheckedMaterial
|
||||
{
|
||||
public List<string> m_Springs = new List<string>();
|
||||
public List<string> m_Tables = new List<string>();
|
||||
}
|
||||
|
||||
public Dictionary<string, CheckedMaterial> m_CheckedMaterial = new Dictionary<string, CheckedMaterial>();
|
||||
public Dictionary<string, UncheckedMaterial> m_UncheckedMaterial = new Dictionary<string, UncheckedMaterial>();
|
||||
public string m_strCurMaterial = "";
|
||||
public bool m_bOnLoad = false;
|
||||
|
||||
@@ -69,19 +69,19 @@ namespace friction
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
private CheckedMaterial LoadCheckedMaterial(string section)
|
||||
private UncheckedMaterial LoadUncheckedMaterial(string section)
|
||||
{
|
||||
CheckedMaterial cm = new CheckedMaterial();
|
||||
UncheckedMaterial cm = new UncheckedMaterial();
|
||||
|
||||
StringBuilder temp = new StringBuilder(10240);
|
||||
int iRes = GetPrivateProfileString(section, "checked-spring", "", temp, 10240, m_strPath);
|
||||
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, "checked-table", "", temp, 10240, m_strPath);
|
||||
iRes = GetPrivateProfileString(section, "unchecked-table", "", temp, 10240, m_strPath);
|
||||
if (temp.Length > 0)
|
||||
{
|
||||
string[] astrToken = temp.ToString().Split(',');
|
||||
@@ -93,7 +93,7 @@ namespace friction
|
||||
|
||||
public bool HasPref(string strName)
|
||||
{
|
||||
foreach(var pair in m_CheckedMaterial)
|
||||
foreach(var pair in m_UncheckedMaterial)
|
||||
{
|
||||
if (pair.Key == strName)
|
||||
return true;
|
||||
@@ -104,16 +104,16 @@ namespace friction
|
||||
|
||||
public void InsertPref(string strName)
|
||||
{
|
||||
m_CheckedMaterial.Add(strName, new CheckedMaterial());
|
||||
m_UncheckedMaterial.Add(strName, new UncheckedMaterial());
|
||||
}
|
||||
|
||||
public void RemovePref(string strName)
|
||||
{
|
||||
m_CheckedMaterial.Remove(strName);
|
||||
m_UncheckedMaterial.Remove(strName);
|
||||
WritePrivateProfileString(strName, null, null, m_strPath);
|
||||
}
|
||||
|
||||
private void Load()
|
||||
public void Load()
|
||||
{
|
||||
StringBuilder temp = new StringBuilder(10240);
|
||||
int iRes = GetPrivateProfileString("Option", "recent", "", temp, 10240, m_strPath);
|
||||
@@ -157,13 +157,13 @@ namespace friction
|
||||
iRes = GetPrivateProfileString("Option", "conf-names", "", temp, 10240, m_strPath);
|
||||
if (temp.Length > 0)
|
||||
{
|
||||
m_CheckedMaterial.Clear();
|
||||
m_UncheckedMaterial.Clear();
|
||||
|
||||
string[] astrSections = temp.ToString().Split(',');
|
||||
foreach(string section in astrSections)
|
||||
{
|
||||
CheckedMaterial cm = LoadCheckedMaterial(section);
|
||||
m_CheckedMaterial.Add(section, cm);
|
||||
UncheckedMaterial cm = LoadUncheckedMaterial(section);
|
||||
m_UncheckedMaterial.Add(section, cm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,27 +173,28 @@ namespace friction
|
||||
m_strCurMaterial = temp.ToString();
|
||||
}
|
||||
|
||||
if(m_CheckedMaterial.Count == 0)
|
||||
if(m_UncheckedMaterial.Count == 0)
|
||||
{
|
||||
m_strCurMaterial = "Default";
|
||||
m_CheckedMaterial.Add(m_strCurMaterial, new CheckedMaterial());
|
||||
m_UncheckedMaterial.Add(m_strCurMaterial, new UncheckedMaterial());
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
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);
|
||||
|
||||
foreach(var pair in m_CheckedMaterial)
|
||||
{
|
||||
WritePrivateProfileString(pair.Key, "checked-spring", string.Join(",", pair.Value.m_Springs.ToArray()), m_strPath);
|
||||
WritePrivateProfileString(pair.Key, "checked-table", string.Join(",", pair.Value.m_Tables.ToArray()), m_strPath);
|
||||
}
|
||||
WritePrivateProfileString("Option", "conf-names", string.Join(",", m_CheckedMaterial.Keys.ToArray()), m_strPath);
|
||||
|
||||
WritePrivateProfileString("Option", "conf-names", string.Join(",", m_UncheckedMaterial.Keys.ToArray()), m_strPath);
|
||||
WritePrivateProfileString("Option", "current-conf", m_strCurMaterial, m_strPath);
|
||||
if (bSavePref == true)
|
||||
{
|
||||
WritePrivateProfileString(m_strCurMaterial, "unchecked-spring", string.Join(",", m_UncheckedMaterial[m_strCurMaterial].m_Springs.ToArray()), m_strPath);
|
||||
WritePrivateProfileString(m_strCurMaterial, "unchecked-table", string.Join(",", m_UncheckedMaterial[m_strCurMaterial].m_Tables.ToArray()), m_strPath);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSpringChecked(List<string> CheckedItems)
|
||||
@@ -201,12 +202,12 @@ namespace friction
|
||||
if (m_bOnLoad == true)
|
||||
return;
|
||||
|
||||
m_CheckedMaterial[m_strCurMaterial].m_Springs = CheckedItems;
|
||||
m_UncheckedMaterial[m_strCurMaterial].m_Springs = CheckedItems;
|
||||
}
|
||||
|
||||
public List<string> GetSpringChecked()
|
||||
{
|
||||
return m_CheckedMaterial[m_strCurMaterial].m_Springs;
|
||||
return m_UncheckedMaterial[m_strCurMaterial].m_Springs;
|
||||
}
|
||||
|
||||
public void SetTableChecked(List<string> CheckedItems)
|
||||
@@ -214,11 +215,11 @@ namespace friction
|
||||
if (m_bOnLoad == true)
|
||||
return;
|
||||
|
||||
m_CheckedMaterial[m_strCurMaterial].m_Tables = CheckedItems;
|
||||
m_UncheckedMaterial[m_strCurMaterial].m_Tables = CheckedItems;
|
||||
}
|
||||
public List<string> GetTableChecked()
|
||||
public List<string> GetTableUnchecked()
|
||||
{
|
||||
return m_CheckedMaterial[m_strCurMaterial].m_Tables;
|
||||
return m_UncheckedMaterial[m_strCurMaterial].m_Tables;
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +262,7 @@ namespace friction
|
||||
|
||||
public string GetRecentAll()
|
||||
{
|
||||
return string.Join("//", m_RecentList);
|
||||
return string.Join(",", m_RecentList);
|
||||
}
|
||||
|
||||
public string WindowBoundStr()
|
||||
|
||||
Reference in New Issue
Block a user