承蒙各位支持!
正式版已推出,请前往http://tieba.baidu.com/p/3398574166
请不要在这里回复,我无法保证回复您的及时性!
更新日志:
V1.0 Release。
V8.0,卡顿问题缓解,彻底解决遇到很多麻烦,暂时无法实现,求大神。
0.79---------------------------------------
0.78 --------------------------------------
11/05/2014,晚,V0.77,揭示板功能发布!
11/05/2014,傍晚,V0.76,新增更新提醒,点击左上角方框可取消,否则5分钟检查一次。
11/05/2014,午,V0.75,BBS内部测试发布(其实也不是BBS啦),详情看下面。
11/04/2014,午,V0.73,修复全部有关文件位置错误的bug,包括生成的记录莫名其妙跑到桌面,或者跑到了Windows\System32
11/03/2014,更晚,V0.71,资源统计图的加载使用异步调用,现在不会卡顿了。
11/03/2014,晚,V0.7,修复大部分UI有关问题,经过各种姿势确认应该是没问题了。新增错误处理页面。下面有介绍。
11/03/2014,午,V0.68发布,修复更新与资源统计相关的Bug。
11/02/2014,晚,努力了一整天,从早上8点到晚上9点,终于完成了绘制图表的工作,真的很辛苦。。。下面有详细。
11/02/2014,午,V0.61,修复bug,新增捐赠页面。
11/01/2014,晚,V0.6发布,服务器全部迁移,Updater更新,修复大量bug。
10/31/2014,更晚,V0.59⑨发布,修复切换统计数据出错的bug,修复按钮名称错误的bug。
10/31/2014,晚,V0.59发布,现可直接查看统计数据。
10/31/2014,午,v0.52发布,修复bug。
10/31/2014,早,V0.51发布,修复csv乱码。
10/30/2014,晚间,解决全部更新有关的bug。
->啊咧?多了个功能?
差不多做了个模子。。。
有什么用呢?秋活dalao推图的时候,能用这个实时更新探路情况,别的人也可以持续刷新,看看别人的出击阵容。
但是首先,你得有人用。。。。。大概会有人用吧。。。。。
如果报错,再试一次应该就没问题了。
无法在英文系统下读取和发布标题带有中文的内容,如要使用请将区域改为中文。
->错误处理页面是个什么东东?
大概就是这样的
->Chart !读取CSV文件并绘制折线图。
Google没有任何资源!全部靠自己干!弄了13个小时终于搞定!!!!!
这是定义图表控件的XAML代码。
<chartingToolkit:Chart Name="LineChart1" Title="Material Log">
<chartingToolkit:LineSeries Name="Fuel"
Title="Fuel"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [0]}"
IsSelectionEnabled="True" AnimationSequence="FirstToLast"/>
<chartingToolkit:LineSeries Name="Ammo"
Title="Ammo"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [1]}"
IsSelectionEnabled="True" AnimationSequence="FirstToLast"/>
<chartingToolkit:LineSeries Name="Steel"
Title="Steel"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [2]}"
IsSelectionEnabled="True" AnimationSequence="FirstToLast"/>
<chartingToolkit:LineSeries Name="Bauxite"
Title="Bauxite"
DependentValuePath="countOfMat"
IndependentValuePath="DateOF"
ItemsSource="{Binding [3]}"
IsSelectionEnabled="True"
AnimationSequence="FirstToLast"/> </chartingToolkit:Chart>
以下是本人心血,C#逻辑代码。
private static Style GetNewDataPointStyle(int R,int G,int B)
{
Random random = new Random();
Color background = Color.FromRgb((byte)R,
(byte)G,
(byte)B);
Style style = new Style(typeof(DataPoint));
Setter st1 = new Setter(DataPoint.BackgroundProperty,
new SolidColorBrush(background));
Setter st2 = new Setter(DataPoint.BorderBrushProperty,
new SolidColorBrush(Colors.White));
Setter st3 = new Setter(DataPoint.BorderThicknessProperty, new Thickness(0.1)); Setter st4 = new Setter(DataPoint.TemplateProperty, null);
style.Setters.Add(st1);
style.Setters.Add(st2);
style.Setters.Add(st3);
style.Setters.Add(st4);
return style;
} private void loadMatChart()
{
LineSeries fuelLine = LineChart1.Series[] as LineSeries;
fuelLine.ItemsSource = loadFuel();
LineSeries ammoLine = LineChart1.Series[] as LineSeries;
ammoLine.ItemsSource = loadAmmo();
LineSeries steelLine = LineChart1.Series[] as LineSeries;
steelLine.ItemsSource = loadSteel();
LineSeries bauxiteLine = LineChart1.Series[] as LineSeries;
bauxiteLine.ItemsSource = loadBauxite();
Style dataPointStyle1 = GetNewDataPointStyle(,,);
Style dataPointStyle2 = GetNewDataPointStyle(,,);
Style dataPointStyle3 = GetNewDataPointStyle(,,);
Style dataPointStyle4 = GetNewDataPointStyle(,,);
fuelLine.DataPointStyle = dataPointStyle1;
ammoLine.DataPointStyle = dataPointStyle2;
steelLine.DataPointStyle = dataPointStyle3;
bauxiteLine.DataPointStyle = dataPointStyle4;
} private List<MatData> loadBauxite()
{
List<MatData> matdata = new List<MatData>();
foreach (string[] ss in ReadCSV("MaterialsLog.csv"))
{
matdata.Add(new MatData(ss[], Int32.Parse(ss[])));
}
return matdata;
} private List<MatData> loadSteel()
{
List<MatData> matdata = new List<MatData>();
foreach (string[] ss in ReadCSV("MaterialsLog.csv"))
{
matdata.Add(new MatData(ss[], Int32.Parse(ss[])));
}
return matdata;
} private List<MatData> loadAmmo()
{
List<MatData> matdata = new List<MatData>();
foreach (string[] ss in ReadCSV("MaterialsLog.csv"))
{
matdata.Add(new MatData(ss[], Int32.Parse(ss[])));
}
return matdata;
} private List<MatData> loadFuel()
{
List<MatData> matdata = new List<MatData>();
foreach (string[] ss in ReadCSV("MaterialsLog.csv"))
{
matdata.Add(new MatData(ss[], Int32.Parse(ss[])));
}
return matdata;
} public static List<String[]> ReadCSV(string filePathName)
{
List<String[]> ls = new List<String[]>();
StreamReader fileReader = new StreamReader(filePathName);
string strLine = "";
while (strLine != null)
{
strLine = fileReader.ReadLine();
if (strLine != null && strLine.Length > )
{
ls.Add(strLine.Split(','));
//Debug.WriteLine(strLine);
}
}
fileReader.Close();
return ls;
} private void initializeSoNoDobiraWo()
{
try
{
loadMatChart();
}
catch (Exception ex)
{
MessageBox.Show("加载统计图错误!(重开KCV试试?) " + ex.ToString());
}
}
} public class MatData
{
public string DateOF { get; set; }
public int countOfMat { get; set; } public MatData(string dateof, int countofmat)
{
DateOF = dateof;
countOfMat = countofmat;
}
}
什么?看起来很简单?实践出真知。
->内建统计数据查看器:
因为WPF控件的特殊性,老夫翻遍了百度找不到读取csv的方法。
然后,我突然忘了一件重要的事——平时我都是用Google的啊!
美帝的方法也是乱七八糟五花八门,最后终于让我找到了!
非常感谢这位叫做morio的博主!
这是他的文章——
CSVファイルを読み込んでDataGridに表示
http://morio2.blogspot.jp/2012/11/csvdatagrid.html
天气转凉,大家注意保重身体!
下载地址:V0.41 : http://pan.baidu.com/s/1kToStfh
V0.5 : http://pan.baidu.com/s/1mgxDO3Q
永久下载地址:http://provissy.boo.jp/PrvTools_Beta_Download/ProvissyTools-Beta.dll