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

1. 修正 FlyData_Mix 的错误

parent 0769412b
...@@ -96,7 +96,7 @@ namespace FLY.Weight.UI.Client ...@@ -96,7 +96,7 @@ namespace FLY.Weight.UI.Client
// % // %
DataGridTextColumn dgtc2 = new DataGridTextColumn() 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 }; StackPanel sp2 = new StackPanel() { Orientation = Orientation.Horizontal };
sp2.Children.Add( sp2.Children.Add(
......
...@@ -11,11 +11,7 @@ namespace FLY.Weight.Common ...@@ -11,11 +11,7 @@ namespace FLY.Weight.Common
/// <summary> /// <summary>
/// 时间点 /// 时间点
/// </summary> /// </summary>
public DateTime Time public DateTime Time { get; set; }
{
get;
set;
}
public float Total { get; set; } public float Total { get; set; }
...@@ -59,12 +55,9 @@ namespace FLY.Weight.Common ...@@ -59,12 +55,9 @@ namespace FLY.Weight.Common
{ {
string[] items = str.Split(new char[] { ',' }); string[] items = str.Split(new char[] { ',' });
if (items.Length < (2 + 2 * 4)) if (items.Length < (2))
return false; return false;
int idx = 0; int idx = 0;
DateTime t; DateTime t;
float f; float f;
...@@ -81,21 +74,20 @@ namespace FLY.Weight.Common ...@@ -81,21 +74,20 @@ namespace FLY.Weight.Common
Total = f; Total = f;
idx++; idx++;
//翻译 int items_cnt = (items.Length - 2) / 2;
//header += "," + n + "#"; for (int i = 0; i < items_cnt; i++)
//header += "," + n + "#%";
for (int i = 0; i < 4; i++)
{ {
FlyData_MixItem mixitem = new FlyData_MixItem();
if (!float.TryParse(items[idx], out f))//?#重量 if (!float.TryParse(items[idx], out f))//?#重量
return false; return false;
Items[i].Disp = f; mixitem.Disp = f;
idx++; idx++;
if (!float.TryParse(items[idx], out f))//?#比例 if (!float.TryParse(items[idx], out f))//?#比例
return false; return false;
Items[i].PDisp = f; mixitem.PDisp = f;
idx++; idx++;
Items.Add(mixitem);
} }
return true; 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