Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
fe99c73674
6 files changed
+60
-13
No files matched your search
@@ -16,7 +16,7 @@ namespace DyeingComputer.ConvertMoels
|
||||
// bool G = (bool)value;
|
||||
if (G == "False")//判断单元格值是否为零
|
||||
{
|
||||
return "white";//零返回
|
||||
return "";//零返回
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DyeingComputer.ConvertMoels
|
||||
{
|
||||
internal class IORBConvert : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
String G = value.ToString();
|
||||
// bool G = (bool)value;
|
||||
if ((G == "AI")||(G == "DI"))//判断单元格值是否为零
|
||||
{
|
||||
return "green";//零返回
|
||||
}
|
||||
else
|
||||
{
|
||||
return "red";//非零返回红色
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,7 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="ConvertMoels\IORBConvert.cs" />
|
||||
<Compile Include="ConvertMoels\BoolRBConvert.cs" />
|
||||
<Compile Include="ConvertMoels\GramsSQLConvert.cs" />
|
||||
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
||||
|
||||
+15
-2
@@ -11,6 +11,7 @@
|
||||
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||
<UserControl.Resources>
|
||||
<ConvertMoels:BoolRBConvert x:Key="BoolRBConvert"/>
|
||||
<ConvertMoels:IORBConvert x:Key="IORBConvert"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -55,7 +56,13 @@
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding ID}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding ID}" IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="{Binding Path=type,Converter={StaticResource IORBConvert}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="*" Binding="{Binding IOName}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="100" Binding="{Binding DIO}" IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
@@ -103,7 +110,13 @@
|
||||
</DataGrid.CellStyle>
|
||||
<DataGrid.Columns>
|
||||
<!--列信息绑定-->
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding ID}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Code}" Width="100" Binding="{Binding ID}" IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="{Binding Path=type,Converter={StaticResource IORBConvert}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Directives}" Width="*" Binding="{Binding IOName}" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="100" Binding="{Binding AIO}" IsReadOnly="True"/>
|
||||
</DataGrid.Columns>
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<Button Content="{x:Static lang:Resources.Redye}" x:Name="WorkOrderView_redy" FontSize="20" HorizontalAlignment="Left" Height="40" Margin="600,0,0,0" VerticalAlignment="Top" Width="200" Background="White" Click="WorkOrderView_redy_Click"/>
|
||||
|
||||
<DataGrid x:Name="Grid" AlternationCount="2" IsReadOnly="True" SelectionChanged="Grid_SelectionChanged"
|
||||
Margin="0,340,0,0" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column"
|
||||
Background="White" SelectionMode="Single" FontSize="15" >
|
||||
Margin="0,340,0,0" d:ItemsSource="{d:SampleData ItemCount=20}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
|
||||
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" AllowDrop="False"
|
||||
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column"
|
||||
Background="White" SelectionMode="Single" FontSize="15" >
|
||||
<DataGrid.RowStyle >
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Height" Value="30" />
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace DyeingComputer.ViewModel
|
||||
{
|
||||
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick
|
||||
{
|
||||
Interval = TimeSpan.FromSeconds(0.5)//秒
|
||||
Interval = TimeSpan.FromSeconds(1)//秒
|
||||
};
|
||||
timer1s.Tick += Tick_Event_1S;
|
||||
timer1s.Start();
|
||||
@@ -130,7 +130,6 @@ namespace DyeingComputer.ViewModel
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IO_data()//刷新
|
||||
{
|
||||
updata_dtm("1", lk);
|
||||
@@ -209,13 +208,15 @@ namespace DyeingComputer.ViewModel
|
||||
{
|
||||
public string IOName { get; set; }
|
||||
public int AIO { get; set; }
|
||||
public String ID { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string type { get; set; }
|
||||
}
|
||||
public class DATA_D
|
||||
{
|
||||
public string IOName { get; set; }
|
||||
public bool DIO { get; set; }
|
||||
public String ID { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string type { get; set; }
|
||||
}
|
||||
public class DATA_M
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user