Commit b3e5c982 authored by 潘栩锋's avatar 潘栩锋 🚴

1. 修正 FlyData_Mix 的错误

parent 0769412b
......@@ -96,7 +96,7 @@ namespace FLY.Weight.UI.Client
// %
DataGridTextColumn dgtc2 = new DataGridTextColumn()
{
Binding = new Binding() { Path = new PropertyPath($"Items[{i}].PDisp"), StringFormat = "{0:F3}" }
Binding = new Binding() { Path = new PropertyPath($"Items[{i}].PDisp"), StringFormat = "{0:F4}" }
};
StackPanel sp2 = new StackPanel() { Orientation = Orientation.Horizontal };
sp2.Children.Add(
......
......@@ -11,11 +11,7 @@ namespace FLY.Weight.Common
/// <summary>
/// 时间点
/// </summary>
public DateTime Time
{
get;
set;
}
public DateTime Time { get; set; }
public float Total { get; set; }
......@@ -59,12 +55,9 @@ namespace FLY.Weight.Common
{
string[] items = str.Split(new char[] { ',' });
if (items.Length < (2 + 2 * 4))
if (items.Length < (2))
return false;
int idx = 0;
DateTime t;
float f;
......@@ -81,21 +74,20 @@ namespace FLY.Weight.Common
Total = f;
idx++;
//翻译
//header += "," + n + "#";
//header += "," + n + "#%";
for (int i = 0; i < 4; i++)
int items_cnt = (items.Length - 2) / 2;
for (int i = 0; i < items_cnt; i++)
{
FlyData_MixItem mixitem = new FlyData_MixItem();
if (!float.TryParse(items[idx], out f))//?#重量
return false;
Items[i].Disp = f;
mixitem.Disp = f;
idx++;
if (!float.TryParse(items[idx], out f))//?#比例
return false;
Items[i].PDisp = f;
mixitem.PDisp = f;
idx++;
Items.Add(mixitem);
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment