Commit 01eb94dd authored by 潘栩锋's avatar 潘栩锋 🚴

1. 修复 上料频率设定=0

2. 改进 上料流量界面加速
3. 修复 收卷预警逻辑修正
parent 9f3ca040
......@@ -15,6 +15,7 @@ namespace Misc
/// <returns></returns>
public static string BytesToString(byte[] bytes)
{
return Encoding.GetEncoding("GB2312").GetString(bytes);//System.Text.Encoding.UTF8.GetString(bytes);
}
/// <summary>
......
......@@ -267,6 +267,7 @@
<sys:String x:Key="strDynAreaIO">IO State</sys:String>
<sys:String x:Key="strMainEdit">Main Edit</sys:String>
<sys:String x:Key="strConfiguration">Conf</sys:String>
<sys:String x:Key="strClickMe">Click Me</sys:String>
<sys:String x:Key="strDynArea">DynArea</sys:String>
<sys:String x:Key="strGraphArea">GraphArea</sys:String>
......
......@@ -271,6 +271,7 @@
<sys:String x:Key="strDynAreaIO">IO状态</sys:String>
<sys:String x:Key="strMainEdit">主界面布局管理</sys:String>
<sys:String x:Key="strConfiguration">配置</sys:String>
<sys:String x:Key="strClickMe">点我编辑</sys:String>
<sys:String x:Key="strDynArea">动态区</sys:String>
<sys:String x:Key="strGraphArea">图表区</sys:String>
......
......@@ -194,13 +194,20 @@
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
</StackPanel.Resources>
<Button Click="button_selectall_Click" >
<Grid >
<Border Background="{StaticResource Color_theme_static}" >
<TextBlock Text="All" FontSize="25" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</Grid>
</Button>
<StackPanel Orientation="Horizontal">
<Button Click="button_selectall_Click" >
<Grid >
<Border Background="{StaticResource Color_theme_static}" >
<TextBlock Text="All" FontSize="25" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</Grid>
</Button>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding TotalFlow,StringFormat={}{0:F1}}" FontSize="25" Foreground="Black" VerticalAlignment="Bottom" />
<TextBlock Text="kg/h" FontSize="15" Foreground="Black" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
<ItemsControl ItemsSource="{Binding Items}" Panel.ZIndex="2">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
......
......@@ -106,7 +106,8 @@ namespace FLY.Weight.UI.Client.UIModule
"BucketValveIsOpen",
"ScrewMotorFreq",
"ScrewMotorIsOn",
"ScrewIsAutoMode"
"ScrewIsAutoMode",
"ScrewManualFreq"
});
setPlan_items.Add(plan);
}
......@@ -117,19 +118,7 @@ namespace FLY.Weight.UI.Client.UIModule
Window_Frequency w = new Window_Frequency();
FLY.Weight.Common.WeighterC weight = ((Button)sender).Tag as FLY.Weight.Common.WeighterC;
w.FrequencySet = weight.ScrewManualFreq;
DependencyObject dobj_window = this;
//一直向上找,直到找到window
do
{
if (dobj_window is Window)
{
break;
}
dobj_window = System.Windows.Media.VisualTreeHelper.GetParent(dobj_window);
} while (dobj_window != null);
w.Owner = dobj_window as Window;
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
if (w.ShowDialog()==true)
{
//TODO
......@@ -140,6 +129,7 @@ namespace FLY.Weight.UI.Client.UIModule
private void button_ratio_Click(object sender, RoutedEventArgs e)
{
Window_RatioSet w = new Window_RatioSet();
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
//w.DataContext = root_grid.DataContext;
w.Init(mWeighterCsService);
w.ShowDialog();
......@@ -172,18 +162,7 @@ namespace FLY.Weight.UI.Client.UIModule
w.Init(weight);
DependencyObject dobj_window = this;
//一直向上找,直到找到window
do
{
if (dobj_window is Window)
{
break;
}
dobj_window = System.Windows.Media.VisualTreeHelper.GetParent(dobj_window);
} while (dobj_window != null);
w.Owner = dobj_window as Window;
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
......@@ -199,18 +178,9 @@ namespace FLY.Weight.UI.Client.UIModule
w.IsRimNoRecycle = mWeighterCsService.Accessory.IsRimNoRecycle;
DependencyObject dobj_window = this;
//一直向上找,直到找到window
do
{
if (dobj_window is Window)
{
break;
}
dobj_window = System.Windows.Media.VisualTreeHelper.GetParent(dobj_window);
} while (dobj_window != null);
w.Owner = dobj_window as Window;
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
if (w.ShowDialog() == true)
{
mWeighterCsService.Accessory.SetThickness = w.SetThickness;
......
......@@ -300,7 +300,7 @@ namespace FLY.Weight.Server
{
FlyData_Flow f = new FlyData_Flow();
f.Time = DateTime.Now - TimeSpan.FromMinutes((FlowListSize - j) * FlowInterval);
f.Total = Accessory.TotalFlow;
f.Items = new FlyData_FlowItem[ItemsCnt];
for (int i = 0; i < Items.Count; i++)
{
......@@ -326,6 +326,7 @@ namespace FLY.Weight.Server
//f.Items[i].MixCumPercent[2] = Items[i].MixPSet_3;
//f.Items[i].MixCumPercent[3] = Items[i].MixPSet_4;
}
f.Total = f.Items.Sum(i => i.Flow);
last_f = f;
FlowList.Add(f);
}
......
......@@ -21,15 +21,15 @@ namespace FLY.Winder.UI.Client.Converter
/// <returns></returns>
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Count() != 2)
if (values.Count() != 3)
return false;
double[] v = new double[2];
for (int i = 0; i < 2; i++)
double[] v = new double[3];
for (int i = 0; i < 3; i++)
{
if (!double.TryParse(values[i].ToString(), out v[i]))
return false;
}
if (v[0] > v[1])
if (v[0] > v[1] - v[2])
return true;
return false;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
namespace FLY.Winder.UI.Client.Converter
{
public class RatioConverter : IMultiValueConverter
{
#region IMultiValueConverter 成员
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values.Length == 3)//必须要检查,不然 界面生成器 会错误,提示转换异常
{
double ratio;
double value = System.Convert.ToDouble(values[0]);
double max = System.Convert.ToDouble(values[1]);
double ActualWidth = System.Convert.ToDouble(values[2]);
if (max <= 0)
ratio = 0;
else
ratio = (double)value / max;
if (ratio < 0)
ratio = 0;
else if (ratio > 1)
ratio = 1;
return ActualWidth * ratio;
}
else
{
return 100;
}
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
#endregion
}
}
......@@ -60,6 +60,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\IsGTMultiValueConverter.cs" />
<Compile Include="Converter\RatioConverter.cs" />
<Compile Include="Page_ErrorNewestTable.xaml.cs">
<DependentUpon>Page_ErrorNewestTable.xaml</DependentUpon>
</Compile>
......
<?xml version="1.0" encoding="utf-8"?>
<FLYLayout DynAreaWidth="250" IsDynAreaVisible="True" Left="0" Top="2" Width="1366" Height="768" WindowState="Maximized">
<Items>
<GraphTabItem Header="收 卷" ColumnCount="1" RowCount="1">
<ColumnDefinitions>
<Boolean value="False" />
</ColumnDefinitions>
<RowDefinitions>
<Boolean value="False" />
</RowDefinitions>
<Graphs>
<GraphComponent ID="49956960" Module="FLY.Winder.UI.Client.UIModule.UIModule_Main" Row="0" Column="0" RowSpan="1" ColumnSpan="1" />
</Graphs>
</GraphTabItem>
<GraphTabItem Header="称 重" ColumnCount="1" RowCount="1">
<ColumnDefinitions>
<Boolean value="False" />
</ColumnDefinitions>
<RowDefinitions>
<Boolean value="False" />
</RowDefinitions>
<Graphs>
<GraphComponent ID="60426628" Module="FLY.Weight.UI.Client.UIModule.UIModule_Main" Row="0" Column="0" RowSpan="1" ColumnSpan="1" />
</Graphs>
</GraphTabItem>
<GraphTabItem Header="I B C" ColumnCount="1" RowCount="1">
<ColumnDefinitions>
<Boolean value="False" />
</ColumnDefinitions>
<RowDefinitions>
<Boolean value="False" />
<Boolean value="False" />
</RowDefinitions>
<Graphs>
<GraphComponent ID="65203096" Module="FLY.IBC.UI.Client.UIModule.UIModule_Main" Row="0" Column="0" RowSpan="1" ColumnSpan="1" />
</Graphs>
</GraphTabItem>
<GraphTabItem Header="风 环" ColumnCount="1" RowCount="4">
<ColumnDefinitions>
<Boolean value="False" />
......@@ -55,6 +89,7 @@
</RowDefinitions>
<Graphs>
<GraphComponent ID="56082556" Module="trendgraph" Row="0" Column="0" RowSpan="1" ColumnSpan="1" />
<GraphComponent ID="36196647" Module="FLY.Weight.UI.Client.UIModule.UIModule_FlowGraph" Row="1" Column="0" RowSpan="1" ColumnSpan="1" />
</Graphs>
</GraphTabItem>
<GraphTabItem Header="定 点" ColumnCount="1" RowCount="2">
......@@ -77,5 +112,8 @@
</ControllerStates>
<DynAreaItems>
<DynAreaComponent ID="43395070" Module="FLY.FeedbackRenZiJia.UI.Client.UIModule.UIModule_DynAreaFB" />
<DynAreaComponent ID="55011311" Module="FLY.IBC.UI.Client.UIModule.UIModule_DynArea" />
<DynAreaComponent ID="25339754" Module="FLY.Weight.UI.Client.UIModule.UIModule_DynArea" />
<DynAreaComponent ID="26731201" Module="FLY.Winder.UI.Client.UIModule.UIModule_DynArea" />
</DynAreaItems>
</FLYLayout>
\ No newline at end of file
<?xml version="1.0"?>
<ArrayOfUIModuleParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UIModuleParam>
<dll_filename>FLY.Weight.UI.Client.dll</dll_filename>
<assembly_name>FLY.Weight.UI.Client.UIModule</assembly_name>
<class_name>UIModule_Main</class_name>
<IsDynAreaComponent>false</IsDynAreaComponent>
<IsGraphCompnonent>true</IsGraphCompnonent>
<IsMenuCompnonent>false</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
<UIModuleParam>
<dll_filename>FLY.Weight.UI.Client.dll</dll_filename>
<assembly_name>FLY.Weight.UI.Client.UIModule</assembly_name>
<class_name>UIModule_FlowGraph</class_name>
<IsDynAreaComponent>false</IsDynAreaComponent>
<IsGraphCompnonent>true</IsGraphCompnonent>
<IsMenuCompnonent>false</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
<UIModuleParam>
<dll_filename>FLY.Weight.UI.Client.dll</dll_filename>
<assembly_name>FLY.Weight.UI.Client.UIModule</assembly_name>
<class_name>UIModule_DynArea</class_name>
<IsDynAreaComponent>true</IsDynAreaComponent>
<IsGraphCompnonent>false</IsGraphCompnonent>
<IsMenuCompnonent>false</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
<UIModuleParam>
<dll_filename>FLY.Weight.UI.Client.dll</dll_filename>
<assembly_name>FLY.Weight.UI.Client.UIModule</assembly_name>
<class_name>UIModule_Menu</class_name>
<IsDynAreaComponent>false</IsDynAreaComponent>
<IsGraphCompnonent>false</IsGraphCompnonent>
<IsMenuCompnonent>true</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
</ArrayOfUIModuleParam>
\ No newline at end of file
<?xml version="1.0"?>
<ArrayOfUIModuleParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UIModuleParam>
<dll_filename>FLY.Winder.UI.Client.dll</dll_filename>
<assembly_name>FLY.Winder.UI.Client.UIModule</assembly_name>
<class_name>UIModule_Main</class_name>
<IsDynAreaComponent>false</IsDynAreaComponent>
<IsGraphCompnonent>true</IsGraphCompnonent>
<IsMenuCompnonent>false</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
<UIModuleParam>
<dll_filename>FLY.Winder.UI.Client.dll</dll_filename>
<assembly_name>FLY.Winder.UI.Client.UIModule</assembly_name>
<class_name>UIModule_DynArea</class_name>
<IsDynAreaComponent>true</IsDynAreaComponent>
<IsGraphCompnonent>false</IsGraphCompnonent>
<IsMenuCompnonent>false</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
<UIModuleParam>
<dll_filename>FLY.Winder.UI.Client.dll</dll_filename>
<assembly_name>FLY.Winder.UI.Client.UIModule</assembly_name>
<class_name>UIModule_Menu</class_name>
<IsDynAreaComponent>false</IsDynAreaComponent>
<IsGraphCompnonent>false</IsGraphCompnonent>
<IsMenuCompnonent>true</IsMenuCompnonent>
<IsUnique>true</IsUnique>
</UIModuleParam>
</ArrayOfUIModuleParam>
\ No newline at end of file
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