Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
fe99c73674
5 files changed
+54
-7
No files matched your search
@@ -16,7 +16,7 @@ namespace DyeingComputer.ConvertMoels
|
|||||||
// bool G = (bool)value;
|
// bool G = (bool)value;
|
||||||
if (G == "False")//判断单元格值是否为零
|
if (G == "False")//判断单元格值是否为零
|
||||||
{
|
{
|
||||||
return "white";//零返回
|
return "";//零返回
|
||||||
}
|
}
|
||||||
else
|
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>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
|
<Compile Include="ConvertMoels\IORBConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\BoolRBConvert.cs" />
|
<Compile Include="ConvertMoels\BoolRBConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\GramsSQLConvert.cs" />
|
<Compile Include="ConvertMoels\GramsSQLConvert.cs" />
|
||||||
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
<Compile Include="ConvertMoels\ProductTypeSQLConvert.cs" />
|
||||||
|
|||||||
+15
-2
@@ -11,6 +11,7 @@
|
|||||||
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ConvertMoels:BoolRBConvert x:Key="BoolRBConvert"/>
|
<ConvertMoels:BoolRBConvert x:Key="BoolRBConvert"/>
|
||||||
|
<ConvertMoels:IORBConvert x:Key="IORBConvert"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -55,7 +56,13 @@
|
|||||||
</DataGrid.CellStyle>
|
</DataGrid.CellStyle>
|
||||||
<DataGrid.Columns>
|
<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.Directives}" Width="*" Binding="{Binding IOName}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="100" Binding="{Binding DIO}" IsReadOnly="True">
|
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="100" Binding="{Binding DIO}" IsReadOnly="True">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
@@ -103,7 +110,13 @@
|
|||||||
</DataGrid.CellStyle>
|
</DataGrid.CellStyle>
|
||||||
<DataGrid.Columns>
|
<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.Directives}" Width="*" Binding="{Binding IOName}" IsReadOnly="True"/>
|
||||||
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="100" Binding="{Binding AIO}" IsReadOnly="True"/>
|
<DataGridTextColumn Header="{x:Static lang:Resources.ParameterSet}" Width="100" Binding="{Binding AIO}" IsReadOnly="True"/>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick
|
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick
|
||||||
{
|
{
|
||||||
Interval = TimeSpan.FromSeconds(0.5)//秒
|
Interval = TimeSpan.FromSeconds(1)//秒
|
||||||
};
|
};
|
||||||
timer1s.Tick += Tick_Event_1S;
|
timer1s.Tick += Tick_Event_1S;
|
||||||
timer1s.Start();
|
timer1s.Start();
|
||||||
@@ -130,7 +130,6 @@ namespace DyeingComputer.ViewModel
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IO_data()//刷新
|
void IO_data()//刷新
|
||||||
{
|
{
|
||||||
updata_dtm("1", lk);
|
updata_dtm("1", lk);
|
||||||
@@ -209,13 +208,15 @@ namespace DyeingComputer.ViewModel
|
|||||||
{
|
{
|
||||||
public string IOName { get; set; }
|
public string IOName { get; set; }
|
||||||
public int AIO { 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 class DATA_D
|
||||||
{
|
{
|
||||||
public string IOName { get; set; }
|
public string IOName { get; set; }
|
||||||
public bool DIO { 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
|
public class DATA_M
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user