@@ -82,7 +82,7 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
Value = value.ToString(), | Value = value.ToString(), | ||||
Time = DateTime.Now.ToString("HH:mm:ss"), | Time = DateTime.Now.ToString("HH:mm:ss"), | ||||
}; | }; | ||||
var res = Sqlite<Alarm>.GetInstance.Base.Add(tempAlarm); | var res = Sqlite<Alarm>.GetInstance.Base.Add(tempAlarm); | ||||
Sqlite<Alarm>.GetInstance.Save(); | Sqlite<Alarm>.GetInstance.Save(); | ||||
@@ -12,7 +12,8 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
{ | { | ||||
} | } | ||||
#region 180项目报警信息 | |||||
/// <summary> | /// <summary> | ||||
/// 1 号滚筒线故障 | /// 1 号滚筒线故障 | ||||
/// </summary> | /// </summary> | ||||
@@ -53,7 +54,86 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
/// </summary> | /// </summary> | ||||
[Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] | [Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)] | ||||
public ushort FryPotFiveRollerTrouble { get; set; } | public ushort FryPotFiveRollerTrouble { get; set; } | ||||
#region 滚筒是否运行状态监测 | |||||
/// <summary> | |||||
/// 1号滚筒线滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【1】号滚筒线未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort LineOneRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 2号滚筒线滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【2】号滚筒线未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort LineTwoRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 3号滚筒线滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【3】号滚筒线未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort LineThreeRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 1号炒锅进料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【1】号炒锅进料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotOneRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 2号炒锅进料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【2】号炒锅进料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotTwoRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 3号炒锅进料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【3】号炒锅进料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotThreeRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 4号炒锅进料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【4】号炒锅进料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotFourRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 5号炒锅进料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【5】号炒锅进料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotFiveRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 1号炒锅空桶出料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【1】号炒锅空桶出料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotOneEmptyRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 2号炒锅空桶出料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【2】号炒锅空桶出料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotTwoEmptyRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 3号炒锅空桶出料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【3】号炒锅空桶出料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotThreeEmptyRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 4号炒锅空桶出料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【4】号炒锅空桶出料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotFourEmptyRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 5号炒锅空桶出料滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("【5】号炒锅空桶出料滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort FryPotFiveEmptyRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 洗桶工位进桶滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("洗桶工位进桶滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort CleanEnterRollerRunning { get; set; } | |||||
/// <summary> | |||||
/// 洗桶工位出桶滚筒未运行 | |||||
/// </summary> | |||||
[Alarm("洗桶工位出桶滚筒未运行", AlarmTriggerType.Falling, AlarmLevel.一般报警)] | |||||
public ushort CleanOutputRollerRunning { get; set; } | |||||
#endregion | |||||
#endregion | |||||
} | } | ||||
} | } |
@@ -256,7 +256,7 @@ | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TitleFontColor}" | Foreground="{StaticResource TitleFontColor}" | ||||
Text="日期" /> | Text="日期" /> | ||||
<Grid Grid.Column="1"> | <Grid Grid.Column="1"> | ||||
<TextBlock | <TextBlock | ||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
@@ -264,11 +264,13 @@ | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TitleFontColor}" | Foreground="{StaticResource TitleFontColor}" | ||||
Text="时间" /> | Text="时间" /> | ||||
<Border | <Border | ||||
BorderBrush="{StaticResource TitleBorderColor}" | BorderBrush="{StaticResource TitleBorderColor}" | ||||
BorderThickness="1,0,1,0" | BorderThickness="1,0,1,0" | ||||
Cursor="SizeWE" /> | Cursor="SizeWE" /> | ||||
</Grid> | </Grid> | ||||
<TextBlock | <TextBlock | ||||
Grid.Column="2" | Grid.Column="2" | ||||
@@ -277,6 +279,7 @@ | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TitleFontColor}" | Foreground="{StaticResource TitleFontColor}" | ||||
Text="操作权限" /> | Text="操作权限" /> | ||||
<Grid Grid.Column="3"> | <Grid Grid.Column="3"> | ||||
<TextBlock | <TextBlock | ||||
@@ -285,6 +288,7 @@ | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TitleFontColor}" | Foreground="{StaticResource TitleFontColor}" | ||||
Text="用户名" /> | Text="用户名" /> | ||||
<Border | <Border | ||||
BorderBrush="{StaticResource TitleBorderColor}" | BorderBrush="{StaticResource TitleBorderColor}" | ||||
BorderThickness="1,0,1,0" | BorderThickness="1,0,1,0" | ||||
@@ -340,7 +344,7 @@ | |||||
<Grid Grid.Column="3"> | <Grid Grid.Column="3"> | ||||
<TextBlock | <TextBlock | ||||
Margin="10,0,0,0" | Margin="10,0,0,0" | ||||
HorizontalAlignment="Left" | |||||
HorizontalAlignment="Center" | |||||
Style="{StaticResource DataTextBlockStyle}" | Style="{StaticResource DataTextBlockStyle}" | ||||
Text="{Binding UserName}" /> | Text="{Binding UserName}" /> | ||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | ||||
@@ -317,11 +317,84 @@ | |||||
</Trigger> | </Trigger> | ||||
</ControlTemplate.Triggers> | </ControlTemplate.Triggers> | ||||
</ControlTemplate> | </ControlTemplate> | ||||
<Style x:Key="FocusVisual"> | |||||
<Setter Property="Control.Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate> | |||||
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<SolidColorBrush x:Key="Button.Static.Background1" Color="#FFDDDDDD"/> | |||||
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/> | |||||
<SolidColorBrush x:Key="Button.MouseOver.Background1" Color="#FF2AB2E7"/> | |||||
<SolidColorBrush x:Key="Button.MouseOver.Border1" Color="#FF3C7FB1"/> | |||||
<SolidColorBrush x:Key="Button.Pressed.Background1" Color="#FFC4E5F6"/> | |||||
<SolidColorBrush x:Key="Button.Pressed.Border1" Color="#FF2C628B"/> | |||||
<SolidColorBrush x:Key="Button.Disabled.Background1" Color="#FFF4F4F4"/> | |||||
<SolidColorBrush x:Key="Button.Disabled.Border1" Color="#FFADB2B5"/> | |||||
<SolidColorBrush x:Key="Button.Disabled.Foreground1" Color="#FF838383"/> | |||||
<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> | |||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> | |||||
<Setter Property="Background" Value="{StaticResource Button.Static.Background1}"/> | |||||
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/> | |||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> | |||||
<Setter Property="BorderThickness" Value="1"/> | |||||
<Setter Property="HorizontalContentAlignment" Value="Center"/> | |||||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||||
<Setter Property="Padding" Value="1"/> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="{x:Type Button}"> | |||||
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> | |||||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | |||||
</Border> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsDefaulted" Value="true"> | |||||
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsMouseOver" Value="true"> | |||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background1}"/> | |||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border1}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsPressed" Value="true"> | |||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background1}"/> | |||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border1}"/> | |||||
</Trigger> | |||||
<Trigger Property="IsEnabled" Value="false"> | |||||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background1}"/> | |||||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border1}"/> | |||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground1}"/> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
</UserControl.Resources> | </UserControl.Resources> | ||||
<Grid> | <Grid> | ||||
<ScrollViewer VerticalScrollBarVisibility="Hidden"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="40"/> | |||||
<RowDefinition/> | |||||
</Grid.RowDefinitions> | |||||
<StackPanel x:Name="btn" Orientation="Horizontal" HorizontalAlignment="Right"> | |||||
<!--<Button HorizontalAlignment="Right" Width="100" Height="30" Content="保存数据" BorderThickness="1" BorderBrush="Cyan" Background="Transparent" Foreground="Aqua" FontSize="16" Command="{Binding SaveDataCommand}" Margin="0,0,10,0"></Button>--> | |||||
<Button Style="{DynamicResource ButtonStyle1}" Width="105" Height="30" Background="Transparent" Foreground="Aqua" Command="{Binding AddUserInfoCommand}" Margin="0,0,10,0"> | |||||
<Button.Content> | |||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> | |||||
<TextBlock x:Name="t1" Width="auto" Height="auto" FontFamily="../../Fonts/font/#iconfont" Text="" VerticalAlignment="Center" FontSize="18" Margin="0,0,6,0"/> | |||||
<TextBlock x:Name="t2" Width="auto" Height="auto" Text="添加账号" FontSize="17" VerticalAlignment="Center"/> | |||||
</StackPanel> | |||||
</Button.Content> | |||||
</Button> | |||||
</StackPanel> | |||||
<ScrollViewer VerticalScrollBarVisibility="Hidden" Grid.Row="1"> | |||||
<DataGrid ItemsSource="{Binding usersInfo}" GridLinesVisibility="All" Background="Transparent" | <DataGrid ItemsSource="{Binding usersInfo}" GridLinesVisibility="All" Background="Transparent" | ||||
AutoGenerateColumns="False" | AutoGenerateColumns="False" | ||||
CanUserAddRows="False" | |||||
IsReadOnly="False" Style="{StaticResource dataGrid }" | IsReadOnly="False" Style="{StaticResource dataGrid }" | ||||
ColumnHeaderStyle="{StaticResource columsHeader}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}"> | ColumnHeaderStyle="{StaticResource columsHeader}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}"> | ||||
<DataGrid.Columns> | <DataGrid.Columns> | ||||
@@ -418,7 +491,7 @@ | |||||
<Button Command="{Binding DataContext.SaveCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" | <Button Command="{Binding DataContext.SaveCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" | ||||
CommandParameter="{Binding UserName}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Foreground="Cyan" Content="Save" Margin="5,0"></Button> | CommandParameter="{Binding UserName}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Foreground="Cyan" Content="Save" Margin="5,0"></Button> | ||||
<!--<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Update" Grid.Column="1" Margin="5,0"></Button>--> | <!--<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Update" Grid.Column="1" Margin="5,0"></Button>--> | ||||
<Button Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Delete" Grid.Column="1" Foreground="Cyan" Margin="5,0"></Button> | |||||
<Button Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding Id}" Template="{DynamicResource ButtonTemplate1}" Style="{StaticResource btnStyle}" Content="Delete" Grid.Column="1" Foreground="Cyan" Margin="5,0" ></Button> | |||||
</Grid> | </Grid> | ||||
</DataTemplate> | </DataTemplate> | ||||
</DataGridTemplateColumn.CellTemplate> | </DataGridTemplateColumn.CellTemplate> | ||||
@@ -25,6 +25,7 @@ namespace BPASmartClient.CustomResource.Pages.View | |||||
public UserManageView() | public UserManageView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
//this.DataContext = UserManageViewModel.GetInstance; | |||||
} | } | ||||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||||
@@ -32,15 +33,21 @@ namespace BPASmartClient.CustomResource.Pages.View | |||||
ComboBox cbo = sender as ComboBox; | ComboBox cbo = sender as ComboBox; | ||||
var id = cbo.Tag; | var id = cbo.Tag; | ||||
var per = cbo.SelectedItem; | var per = cbo.SelectedItem; | ||||
if (id == null) | |||||
if (id != null) | |||||
{ | { | ||||
var a = UserManageViewModel.GetInstance.usersInfo.FirstOrDefault(p => p.Id == id); | |||||
var a = UserManageViewModel.usersInfo.FirstOrDefault(p => p.Id == id.ToString()); | |||||
if (a != null && per != null) | if (a != null && per != null) | ||||
{ | { | ||||
a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); | a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); | ||||
} | } | ||||
} | } | ||||
else | |||||
{ | |||||
UserManageViewModel.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -374,13 +374,15 @@ | |||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | ||||
<ComboBox ItemsSource="{Binding DeviceName}" SelectedValue="滚筒输送线" Style="{StaticResource ComboBoxStyle1}" | <ComboBox ItemsSource="{Binding DeviceName}" SelectedValue="滚筒输送线" Style="{StaticResource ComboBoxStyle1}" | ||||
VerticalContentAlignment="Center" SelectionChanged="ComboBox_SelectionChanged" FontSize="20" Foreground="#FF2AB2E7" Width="130" Height="40" Margin="0,0,10,0"></ComboBox> | |||||
VerticalContentAlignment="Center" | |||||
SelectionChanged="ComboBox_SelectionChanged" FontSize="20" Foreground="#FF2AB2E7" Width="130" Height="40" Margin="0,0,10,0"></ComboBox> | |||||
<Button HorizontalAlignment="Right" Width="120" Height="40" Margin="0,0,10,0" Background="Transparent" Content="保存配置" Foreground="#FF2AB2E7" FontSize="20" BorderBrush="LightSkyBlue" BorderThickness="1" Command="{Binding SaveDataCommand}"></Button> | <Button HorizontalAlignment="Right" Width="120" Height="40" Margin="0,0,10,0" Background="Transparent" Content="保存配置" Foreground="#FF2AB2E7" FontSize="20" BorderBrush="LightSkyBlue" BorderThickness="1" Command="{Binding SaveDataCommand}"></Button> | ||||
</StackPanel> | </StackPanel> | ||||
<!--变量配置--> | <!--变量配置--> | ||||
<DataGrid Name="GT" Grid.Row="1" ItemsSource="{Binding Variables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False" | <DataGrid Name="GT" Grid.Row="1" ItemsSource="{Binding Variables}" GridLinesVisibility="All" Background="Transparent" EnableRowVirtualization="False" | ||||
AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}" | AutoGenerateColumns="False" IsReadOnly="False" Style="{StaticResource dataGrid}" | ||||
LoadingRow="DataGrid_LoadingRow" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}"> | |||||
LoadingRow="DataGrid_LoadingRow" | |||||
CanUserDeleteRows="True" ColumnHeaderStyle="{StaticResource ColumHeaderStyle}" RowStyle="{StaticResource rowStyle}" CellStyle="{StaticResource cellStyle}"> | |||||
<DataGrid.Columns> | <DataGrid.Columns> | ||||
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID"> | <DataGridTemplateColumn IsReadOnly="True" Width="0.1*" Header="ID"> | ||||
<DataGridTemplateColumn.CellTemplate> | <DataGridTemplateColumn.CellTemplate> | ||||
@@ -64,8 +64,8 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
} | } | ||||
}); | }); | ||||
AlarmInfos = MessageLog.GetInstance.alarmLogs; | |||||
//AlarmInfos = MessageLog.GetInstance.alarmLogs; | |||||
AlarmInfos = AlarmHelper<AlarmInfo>.Alarms; | |||||
} | } | ||||
private void GetHistoryAlarm() | private void GetHistoryAlarm() | ||||
@@ -130,7 +130,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
private DateTime _mEndDateTime = DateTime.Now; | private DateTime _mEndDateTime = DateTime.Now; | ||||
public ObservableCollection<Alarm> AlarmInfos { get; set; } | |||||
public ObservableCollection<Alarm> AlarmInfos { get; set; } | |||||
public ObservableCollection<Alarm> HistoryAlarm { get; set; } = new ObservableCollection<Alarm>(); | public ObservableCollection<Alarm> HistoryAlarm { get; set; } = new ObservableCollection<Alarm>(); | ||||
} | } | ||||
@@ -59,58 +59,58 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
if (res != null) | if (res != null) | ||||
{ | { | ||||
Global.userInfo = res; | Global.userInfo = res; | ||||
Global.userInfo.LastLogInTime = DateTime.Now.ToString(); | |||||
res.LastLogInTime = DateTime.Now.ToString(); | |||||
Config.GetInstance.SaveUser(); | |||||
if(res.permission == Enums.Permission.管理员) | |||||
{ | |||||
foreach( var items in MenuManage.GetInstance.menuModels) | |||||
{ | |||||
foreach(var item in items.subMenumodels) | |||||
{ | |||||
item.SubMenuVisibility = Visibility.Visible; | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
if (res.userTreeViewModels != null) | |||||
{ | |||||
if (res.userTreeViewModels.Count > 0) | |||||
{ | |||||
foreach (var items in MenuManage.GetInstance.menuModels) | |||||
{ | |||||
foreach (var item in items.subMenumodels) | |||||
{ | |||||
if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) | |||||
{ | |||||
item.SubMenuVisibility = Visibility.Visible; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
//for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++) | |||||
//Global.userInfo.LastLogInTime = DateTime.Now.ToString(); | |||||
//res.LastLogInTime = DateTime.Now.ToString(); | |||||
//Config.GetInstance.SaveUser(); | |||||
//if(res.permission == Enums.Permission.管理员) | |||||
//{ | //{ | ||||
// if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission)) | |||||
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible; | |||||
// else | |||||
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; | |||||
// if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null) | |||||
// MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; | |||||
// for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++) | |||||
// foreach( var items in MenuManage.GetInstance.menuModels) | |||||
// { | // { | ||||
// if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission)) | |||||
// MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible; | |||||
// else | |||||
// MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed; | |||||
// foreach(var item in items.subMenumodels) | |||||
// { | |||||
// item.SubMenuVisibility = Visibility.Visible; | |||||
// } | |||||
// } | // } | ||||
//} | //} | ||||
//else | |||||
//{ | |||||
// if (res.userTreeViewModels != null) | |||||
// { | |||||
// if (res.userTreeViewModels.Count > 0) | |||||
// { | |||||
// foreach (var items in MenuManage.GetInstance.menuModels) | |||||
// { | |||||
// foreach (var item in items.subMenumodels) | |||||
// { | |||||
// if (res.userTreeViewModels.FirstOrDefault(p => p.Name == item.SubMenuName) != null) | |||||
// { | |||||
// item.SubMenuVisibility = Visibility.Visible; | |||||
// } | |||||
// } | |||||
// } | |||||
// } | |||||
// } | |||||
//} | |||||
for (int i = 0; i < MenuManage.GetInstance.menuModels.Count; i++) | |||||
{ | |||||
if (MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuPermission.Contains(res.permission)) | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Visible; | |||||
else | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; | |||||
if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.FirstOrDefault(p => p.SubMenuPermission.Contains(res.permission)) == null) | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).MainMenuVisibility = Visibility.Collapsed; | |||||
for (int m = 0; m < MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.Count; m++) | |||||
{ | |||||
if (MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuPermission.Contains(res.permission)) | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Visible; | |||||
else | |||||
MenuManage.GetInstance.menuModels.ElementAt(i).subMenumodels.ElementAt(m).SubMenuVisibility = Visibility.Collapsed; | |||||
} | |||||
} | |||||
ActionManage.GetInstance.Send("PermissionChange"); | ActionManage.GetInstance.Send("PermissionChange"); | ||||
ActionManage.GetInstance.Send("LoginOk"); | ActionManage.GetInstance.Send("LoginOk"); | ||||
@@ -17,14 +17,18 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
{ | { | ||||
internal class UserManageViewModel:ObservableObject | internal class UserManageViewModel:ObservableObject | ||||
{ | { | ||||
private static UserManageViewModel _instance; | |||||
public static UserManageViewModel GetInstance => _instance ??= new UserManageViewModel(); | |||||
public ObservableCollection<UserInfo> usersInfo { get; set; } = new ObservableCollection<UserInfo>(); | |||||
//private static UserManageViewModel _instance; | |||||
//public static UserManageViewModel GetInstance => _instance ??= new UserManageViewModel(); | |||||
public static ObservableCollection<UserInfo> usersInfo { get; set; } = new ObservableCollection<UserInfo>(); | |||||
//public List<Permission> Authorities { get; set; } = new List<Permission>() { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }; | //public List<Permission> Authorities { get; set; } = new List<Permission>() { Permission.管理员, Permission.操作员, Permission.观察员, Permission.技术员 }; | ||||
public List<string> Authorities { get; set; } = new List<string>(); | public List<string> Authorities { get; set; } = new List<string>(); | ||||
public RelayCommand<string> SaveCommand { get; set; } | public RelayCommand<string> SaveCommand { get; set; } | ||||
public RelayCommand<string> DeleteCommand { get; set; } | public RelayCommand<string> DeleteCommand { get; set; } | ||||
public RelayCommand AddUserInfoCommand { get; set; } | |||||
public RelayCommand SaveDataCommand { get; set; } | |||||
public UserManageViewModel() | public UserManageViewModel() | ||||
{ | { | ||||
var userManager = JsonConvert.DeserializeObject<UserManager>(File.ReadAllText("up.hbl").AESDecrypt()); | var userManager = JsonConvert.DeserializeObject<UserManager>(File.ReadAllText("up.hbl").AESDecrypt()); | ||||
@@ -52,7 +56,10 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
MessageBox.Show("保存成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information); | MessageBox.Show("保存成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information); | ||||
} | } | ||||
} | |||||
else | |||||
{ | |||||
MessageBox.Show("用户名为空或输入后未回车确认", "提示", MessageBoxButton.OK, MessageBoxImage.Information); | |||||
} | } | ||||
}); | }); | ||||
DeleteCommand = new RelayCommand<string>((str) => | DeleteCommand = new RelayCommand<string>((str) => | ||||
@@ -73,6 +80,26 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel | |||||
MessageBox.Show("未找到对应记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information); | MessageBox.Show("未找到对应记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information); | ||||
} | } | ||||
} | } | ||||
else | |||||
{ | |||||
usersInfo.Remove(usersInfo.Last()); | |||||
Global.userManager.userInfos = usersInfo; | |||||
File.WriteAllText("up.hbl", JsonConvert.SerializeObject(Global.userManager).AESEncrypt()); | |||||
} | |||||
}); | |||||
AddUserInfoCommand = new RelayCommand( ()=> | |||||
{ | |||||
usersInfo.Add(new UserInfo()); | |||||
}); | |||||
SaveDataCommand = new RelayCommand(() => | |||||
{ | |||||
Global.userManager.userInfos = usersInfo; | |||||
File.WriteAllText("up.hbl", JsonConvert.SerializeObject(Global.userManager).AESEncrypt()); | |||||
MessageBox.Show("保存成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information); | |||||
}); | }); | ||||
} | } | ||||
@@ -80,7 +80,7 @@ namespace BPASmartClient.MorkF | |||||
/// </summary> | /// </summary> | ||||
public bool MaterialArriveComplete { get; set; } | public bool MaterialArriveComplete { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 机器人空闲状态 | |||||
/// 机器人空闲状态 1:忙碌 0:空闲 | |||||
/// </summary> | /// </summary> | ||||
public bool RoobotIdle { get; set; } | public bool RoobotIdle { get; set; } | ||||
/// <summary> | /// <summary> | ||||
@@ -291,6 +291,14 @@ namespace BPASmartClient.MorkF | |||||
/// 辅流程所执行的锅位置 | /// 辅流程所执行的锅位置 | ||||
/// </summary> | /// </summary> | ||||
public int MinorProcessPotLoc { get; set; } | public int MinorProcessPotLoc { get; set; } | ||||
#region 单口锅逻辑变量 | |||||
/// <summary> | |||||
/// 订单唯一ID | |||||
/// </summary> | |||||
public string CurrentOrderId { get; set; } | |||||
#endregion | |||||
} | } | ||||
} | } | ||||
@@ -38,6 +38,7 @@ namespace FryPot_DosingSystem | |||||
if (res != null && res == true) | if (res != null && res == true) | ||||
{ | { | ||||
mv.Show(); | mv.Show(); | ||||
MessageLog.GetInstance.ShowUserLog("用户登录"); | |||||
DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 | DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 | ||||
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 | ||||
HubHelper.GetInstance.Connect("192.168.1.40", 8089); | HubHelper.GetInstance.Connect("192.168.1.40", 8089); | ||||
@@ -105,7 +106,7 @@ namespace FryPot_DosingSystem | |||||
InfoLog.Add(new SubMenumodel() | InfoLog.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "操作日志", | SubMenuName = "操作日志", | ||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员,Permission.观察员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.UserLogView" | ToggleWindowPath = "Pages.View.UserLogView" | ||||
}); | }); | ||||
@@ -113,7 +114,7 @@ namespace FryPot_DosingSystem | |||||
InfoLog.Add(new SubMenumodel() | InfoLog.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "运行日志", | SubMenuName = "运行日志", | ||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.观察员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.RunLogView" | ToggleWindowPath = "Pages.View.RunLogView" | ||||
}); | }); | ||||
@@ -121,14 +122,14 @@ namespace FryPot_DosingSystem | |||||
InfoLog.Add(new SubMenumodel() | InfoLog.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "报警记录", | SubMenuName = "报警记录", | ||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.观察员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.AlarmView" | ToggleWindowPath = "Pages.View.AlarmView" | ||||
}); | }); | ||||
InfoLog.Add(new SubMenumodel() | InfoLog.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "炒锅状态记录", | SubMenuName = "炒锅状态记录", | ||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.观察员 }, | |||||
AssemblyName = "FryPot_DosingSystem", | AssemblyName = "FryPot_DosingSystem", | ||||
ToggleWindowPath = "View.SqliteDataView" | ToggleWindowPath = "View.SqliteDataView" | ||||
}); | }); | ||||
@@ -138,7 +139,7 @@ namespace FryPot_DosingSystem | |||||
MainMenuIcon = "", | MainMenuIcon = "", | ||||
MainMenuName = "消息日志", | MainMenuName = "消息日志", | ||||
Alias = "Message Log", | Alias = "Message Log", | ||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员, Permission.观察员 }, | |||||
subMenumodels = InfoLog, | subMenumodels = InfoLog, | ||||
}); | }); | ||||
#endregion | #endregion | ||||
@@ -155,7 +156,7 @@ namespace FryPot_DosingSystem | |||||
DeviceMonitor.Add(new SubMenumodel() | DeviceMonitor.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "PLC变量配置", | SubMenuName = "PLC变量配置", | ||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.VariableConfigView" | ToggleWindowPath = "Pages.View.VariableConfigView" | ||||
}); | }); | ||||
@@ -180,7 +181,7 @@ namespace FryPot_DosingSystem | |||||
DeviceMonitor.Add(new SubMenumodel() | DeviceMonitor.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "AGV视图", | SubMenuName = "AGV视图", | ||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员, Permission.观察员 }, | |||||
AssemblyName = "FryPot_DosingSystem", | AssemblyName = "FryPot_DosingSystem", | ||||
ToggleWindowPath = "View.AgvView" | ToggleWindowPath = "View.AgvView" | ||||
}); | }); | ||||
@@ -200,7 +201,7 @@ namespace FryPot_DosingSystem | |||||
UserManager.Add(new SubMenumodel() | UserManager.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "用户登录", | SubMenuName = "用户登录", | ||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.SubPagLoginView" | ToggleWindowPath = "Pages.View.SubPagLoginView" | ||||
}); | }); | ||||
@@ -208,7 +209,7 @@ namespace FryPot_DosingSystem | |||||
UserManager.Add(new SubMenumodel() | UserManager.Add(new SubMenumodel() | ||||
{ | { | ||||
SubMenuName = "密码修改", | SubMenuName = "密码修改", | ||||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||||
AssemblyName = "BPASmartClient.CustomResource", | AssemblyName = "BPASmartClient.CustomResource", | ||||
ToggleWindowPath = "Pages.View.PasswordChangeView" | ToggleWindowPath = "Pages.View.PasswordChangeView" | ||||
}); | }); | ||||
@@ -231,7 +232,7 @@ namespace FryPot_DosingSystem | |||||
MainMenuIcon = "", | MainMenuIcon = "", | ||||
MainMenuName = "用户管理", | MainMenuName = "用户管理", | ||||
Alias = "User Management", | Alias = "User Management", | ||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, | |||||
MainMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||||
subMenumodels = UserManager, | subMenumodels = UserManager, | ||||
}); | }); | ||||
#endregion | #endregion | ||||
@@ -1372,9 +1372,11 @@ namespace FryPot_DosingSystem.Control | |||||
globalVar.rollerLineOne.OutMaterialingSingle = data[3]; | globalVar.rollerLineOne.OutMaterialingSingle = data[3]; | ||||
globalVar.rollerLineTwo.OutMaterialingSingle = data[4]; | globalVar.rollerLineTwo.OutMaterialingSingle = data[4]; | ||||
globalVar.rollerLineThree.OutMaterialingSingle = data[5]; | globalVar.rollerLineThree.OutMaterialingSingle = data[5]; | ||||
//globalVar.rollerLineOne.OutMaterialingTroubleSingle = data[6]; | |||||
//globalVar.rollerLineTwo.OutMaterialingTroubleSingle = data[7]; | |||||
//globalVar.rollerLineThree.OutMaterialingTroubleSingle = data[8]; | |||||
AlarmHelper<AlarmInfo>.Alarm.LineOneRollerRunning = data[3]; | |||||
AlarmHelper<AlarmInfo>.Alarm.LineTwoRollerRunning = data[4]; | |||||
AlarmHelper<AlarmInfo>.Alarm.LineThreeRollerRunning = data[5]; | |||||
AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble = data[6]; | AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble = data[6]; | ||||
AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble = data[7]; | AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble = data[7]; | ||||
AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble = data[8]; | AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble = data[8]; | ||||
@@ -1387,6 +1389,13 @@ namespace FryPot_DosingSystem.Control | |||||
globalVar.fryPotThree.InputMaterialRollerRunningSingle = data[2]; | globalVar.fryPotThree.InputMaterialRollerRunningSingle = data[2]; | ||||
globalVar.fryPotFour.InputMaterialRollerRunningSingle = data[3]; | globalVar.fryPotFour.InputMaterialRollerRunningSingle = data[3]; | ||||
globalVar.fryPotFive.InputMaterialRollerRunningSingle = data[4]; | globalVar.fryPotFive.InputMaterialRollerRunningSingle = data[4]; | ||||
AlarmHelper<AlarmInfo>.Alarm.FryPotOneRollerRunning= data[0]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotTwoRollerRunning = data[1]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotThreeRollerRunning = data[2]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotFourRollerRunning = data[3]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotFiveRollerRunning = data[4]; | |||||
})); | })); | ||||
GetAddressData("D2045", new Action<ushort[]>((data) => | GetAddressData("D2045", new Action<ushort[]>((data) => | ||||
{ | { | ||||
@@ -1411,6 +1420,12 @@ namespace FryPot_DosingSystem.Control | |||||
globalVar.fryPotThree.EmptyBarrelRollerRunningSingle = data[2]; | globalVar.fryPotThree.EmptyBarrelRollerRunningSingle = data[2]; | ||||
globalVar.fryPotFour.EmptyBarrelRollerRunningSingle = data[3]; | globalVar.fryPotFour.EmptyBarrelRollerRunningSingle = data[3]; | ||||
globalVar.fryPotFive.EmptyBarrelRollerRunningSingle = data[4]; | globalVar.fryPotFive.EmptyBarrelRollerRunningSingle = data[4]; | ||||
AlarmHelper<AlarmInfo>.Alarm.FryPotOneEmptyRollerRunning = data[0]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotTwoEmptyRollerRunning = data[1]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotThreeEmptyRollerRunning = data[2]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotFourEmptyRollerRunning = data[3]; | |||||
AlarmHelper<AlarmInfo>.Alarm.FryPotFiveEmptyRollerRunning = data[4]; | |||||
})); | })); | ||||
GetAddressData("D2070", new Action<ushort[]>((data) => | GetAddressData("D2070", new Action<ushort[]>((data) => | ||||
{ | { | ||||
@@ -1433,7 +1448,7 @@ namespace FryPot_DosingSystem.Control | |||||
})); | })); | ||||
GetAddressData("D2075", new Action<ushort[]>(data => | GetAddressData("D2075", new Action<ushort[]>(data => | ||||
{ | { | ||||
AlarmHelper<AlarmInfo>.Alarm.CleanEnterRollerRunning = data[0]; | |||||
globalVar.CleadBarrelEnterSingle = data[0]; | globalVar.CleadBarrelEnterSingle = data[0]; | ||||
})); | })); | ||||
GetAddressData("2076", new Action<ushort[]>(data => | GetAddressData("2076", new Action<ushort[]>(data => | ||||
@@ -1443,7 +1458,7 @@ namespace FryPot_DosingSystem.Control | |||||
})); | })); | ||||
GetAddressData("D2077", new Action<ushort[]>(data => | GetAddressData("D2077", new Action<ushort[]>(data => | ||||
{ | { | ||||
AlarmHelper<AlarmInfo>.Alarm.CleanOutputRollerRunning = data[0]; | |||||
globalVar.CleadBarrelExitSingle = data[0]; | globalVar.CleadBarrelExitSingle = data[0]; | ||||
})); | })); | ||||
//炒锅1状态数据 | //炒锅1状态数据 | ||||
@@ -2056,7 +2071,10 @@ namespace FryPot_DosingSystem.Control | |||||
WritePlcData("D1066", 1);//AGV空桶出桶就位信号下发PlC | WritePlcData("D1066", 1);//AGV空桶出桶就位信号下发PlC | ||||
MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置"); | MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置"); | ||||
// MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); | // MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); | ||||
if (globalVar.CleadBarrelExitSingle == 0) | |||||
{ | |||||
MessageLog.GetInstance.ShowRunLog("警告:清洗台出桶滚筒未运行!!"); | |||||
} | |||||
} | } | ||||
} | } | ||||
@@ -2158,10 +2176,12 @@ namespace FryPot_DosingSystem.Control | |||||
{ | { | ||||
globalVar.rollerLineOne.agvArriveCleanUnLoad = false; | globalVar.rollerLineOne.agvArriveCleanUnLoad = false; | ||||
MessageLog.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶"); | MessageLog.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶"); | ||||
//plc交互 | //plc交互 | ||||
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC | WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC | ||||
// MessageLog.GetInstance.ShowRunLog("卸桶完成"); | |||||
if (globalVar.CleadBarrelEnterSingle == 0) | |||||
{ | |||||
MessageLog.GetInstance.ShowRunLog("警告:清洗台进桶滚筒未运行!!"); | |||||
} | |||||
} | } | ||||
if (globalVar.rollerLineTwo.agvArriveCleanUnLoad) | if (globalVar.rollerLineTwo.agvArriveCleanUnLoad) | ||||
{ | { | ||||
@@ -2170,7 +2190,10 @@ namespace FryPot_DosingSystem.Control | |||||
//plc交互 | //plc交互 | ||||
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC | WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC | ||||
// MessageLog.GetInstance.ShowRunLog("卸桶完成"); | |||||
if (globalVar.CleadBarrelEnterSingle == 0) | |||||
{ | |||||
MessageLog.GetInstance.ShowRunLog("警告:清洗台进桶滚筒未运行!!"); | |||||
} | |||||
} | } | ||||
if (globalVar.rollerLineThree.agvArriveCleanUnLoad) | if (globalVar.rollerLineThree.agvArriveCleanUnLoad) | ||||
{ | { | ||||
@@ -2179,8 +2202,12 @@ namespace FryPot_DosingSystem.Control | |||||
//plc交互 | //plc交互 | ||||
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC | WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC | ||||
// MessageLog.GetInstance.ShowRunLog("卸桶完成"); | |||||
if (globalVar.CleadBarrelEnterSingle == 0) | |||||
{ | |||||
MessageLog.GetInstance.ShowRunLog("警告:清洗台进桶滚筒未运行!!"); | |||||
} | |||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -2313,7 +2340,7 @@ namespace FryPot_DosingSystem.Control | |||||
//Sqlite<PotFiveStatus>.GetInstance.Save();//保存数据 | //Sqlite<PotFiveStatus>.GetInstance.Save();//保存数据 | ||||
} | } | ||||
globalVar.LTwoCurrentRecipeName = string.Empty; | globalVar.LTwoCurrentRecipeName = string.Empty; | ||||
Task.Run(() => { Thread.Sleep(2000); fryTwoRecipe = string.Empty; fryFiveRecipe = string.Empty; }); | |||||
Task.Run(() => { Thread.Sleep(1500); fryTwoRecipe = string.Empty; fryFiveRecipe = string.Empty; }); | |||||
} | } | ||||
} | } | ||||
@@ -2377,9 +2404,6 @@ namespace FryPot_DosingSystem.Control | |||||
globalVar.rollerLineTwo.RecipeComMidSingle = 0; | globalVar.rollerLineTwo.RecipeComMidSingle = 0; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -3053,82 +3077,8 @@ namespace FryPot_DosingSystem.Control | |||||
} | } | ||||
///// <summary> | |||||
///// 2号线体对应空桶清洗 | |||||
///// </summary> | |||||
//public void LTwoEmptyRollerToLineFour() | |||||
//{ | |||||
// if (globalVar.LTwoEmptyRollerUnLoadcCom)//agv在4号线体下料完成 | |||||
// { | |||||
// globalVar.AllowAgvToLineTwoLoadRoller = true; | |||||
// globalVar.LTwoLoadRoller = false; | |||||
// globalVar.LTwoAgvToFryPot = false; | |||||
// globalVar.LTwoPotInputMaterialArrive = false; | |||||
// globalVar.LTwoPotOutputRollerArrive = false; | |||||
// globalVar.LTwoAgvArrivePot = false; | |||||
// } | |||||
//} | |||||
///// <summary> | |||||
///// 3号线体对应空桶清洗 | |||||
///// </summary> | |||||
//public void LThreeEmptyRollerToLinFour() | |||||
//{ | |||||
// if (globalVar.LThreeEmptyRollerUnLoadcCom)//agv在4号线体下料完成 | |||||
// { | |||||
// globalVar.AllowAgvToLineThreeLoadRoller = true; | |||||
// globalVar.LThreeLoadRoller = false; | |||||
// globalVar.LThreeAgvToFryPot = false; | |||||
// globalVar.LThreePotInputMaterialArrive = false; | |||||
// globalVar.LThreePotOutputRollerArrive = false; | |||||
// globalVar.LThreeAgvArrivePot = false; | |||||
// } | |||||
//} | |||||
/// <summary> | |||||
/// 炒锅滚筒进料运行到位处理 | |||||
/// </summary> | |||||
//public void FryPotInputMaterialRollerOperate(ConcurrentQueue<MaterialInfo> queue) | |||||
//{ | |||||
// switch (queue.ElementAt(0).materialType.MaterialLoc / 100) | |||||
// { | |||||
// case 1: | |||||
// while (globalVar.fryPotOne.InputMaterialArrivedSingle == 0) | |||||
// { | |||||
// Thread.Sleep(5); if (globalVar.ExitMainTask) | |||||
// return; | |||||
// } | |||||
// MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; | |||||
// case 2: | |||||
// while (globalVar.fryPotTwo.InputMaterialArrivedSingle == 0) | |||||
// { | |||||
// Thread.Sleep(5); if (globalVar.ExitMainTask) | |||||
// return; | |||||
// } | |||||
// MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; | |||||
// case 3: | |||||
// while (globalVar.fryPotThree.InputMaterialArrivedSingle == 0) | |||||
// { | |||||
// Thread.Sleep(5); if (globalVar.ExitMainTask) | |||||
// return; | |||||
// } | |||||
// MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; | |||||
// case 4: | |||||
// while (globalVar.fryPotFour.InputMaterialArrivedSingle == 0) | |||||
// { | |||||
// Thread.Sleep(5); if (globalVar.ExitMainTask) | |||||
// return; | |||||
// } | |||||
// MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; | |||||
// case 5: | |||||
// while (globalVar.fryPotFive.InputMaterialArrivedSingle == 0) | |||||
// { | |||||
// Thread.Sleep(5); if (globalVar.ExitMainTask) | |||||
// return; | |||||
// } | |||||
// MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; | |||||
// } | |||||
//} | |||||
/// <summary> | /// <summary> | ||||
/// 炒锅1,4滚筒进料运行到位处理 | /// 炒锅1,4滚筒进料运行到位处理 | ||||
/// </summary> | /// </summary> | ||||
@@ -197,7 +197,7 @@ namespace FryPot_DosingSystem.Control | |||||
public bool agvArriveLineOneLoadCom { get; set; } //agv线体1空桶上料完成 | public bool agvArriveLineOneLoadCom { get; set; } //agv线体1空桶上料完成 | ||||
public bool agvArriveLineTwoLoadCom { get; set; } //agv线体2空桶上料完成 | public bool agvArriveLineTwoLoadCom { get; set; } //agv线体2空桶上料完成 | ||||
public bool agvArriveLineThreeLoadCom { get; set; }//agv线体3空桶上料完成 | public bool agvArriveLineThreeLoadCom { get; set; }//agv线体3空桶上料完成 | ||||
//空桶清洗流程锁 | |||||
#endregion | #endregion | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -263,10 +263,12 @@ namespace FryPot_DosingSystem.Control | |||||
public ushort EmptyRollerNum { get; set; } | public ushort EmptyRollerNum { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 上一个桶是否是空桶 | |||||
/// 上一个桶是否是空桶,空桶上料结束后,配方料桶AGV才能去1号线装桶 | |||||
/// </summary> | /// </summary> | ||||
public bool IsEpmtyBefore { get; set; } //空桶上料结束后,配方料桶AGV才能去1号线装桶 | public bool IsEpmtyBefore { get; set; } //空桶上料结束后,配方料桶AGV才能去1号线装桶 | ||||
/// <summary> | |||||
/// 配方料桶上料结束后,线体空桶AGV才能1号线装桶 | |||||
/// </summary> | |||||
public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶 | public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶 | ||||
/// <summary> | /// <summary> | ||||
/// 线体1上所有空桶的编号集合 | /// 线体1上所有空桶的编号集合 | ||||
@@ -280,6 +282,8 @@ namespace FryPot_DosingSystem.Control | |||||
/// AGV从线体1到达清洗台 | /// AGV从线体1到达清洗台 | ||||
/// </summary> | /// </summary> | ||||
public bool agvArriveCleanUnLoad { get; set; } | public bool agvArriveCleanUnLoad { get; set; } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 滚筒线2相关变量 | /// 滚筒线2相关变量 | ||||
@@ -3,8 +3,8 @@ | |||||
<head> | <head> | ||||
<meta charset="utf-8"/> | <meta charset="utf-8"/> | ||||
<title>iconfont Demo</title> | <title>iconfont Demo</title> | ||||
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/> | |||||
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/> | |||||
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/> | |||||
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/> | |||||
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css"> | <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css"> | ||||
<link rel="stylesheet" href="demo.css"> | <link rel="stylesheet" href="demo.css"> | ||||
<link rel="stylesheet" href="iconfont.css"> | <link rel="stylesheet" href="iconfont.css"> | ||||
@@ -88,6 +88,12 @@ | |||||
<div class="code-name">&#xe695;</div> | <div class="code-name">&#xe695;</div> | ||||
</li> | </li> | ||||
<li class="dib"> | |||||
<span class="icon iconfont"></span> | |||||
<div class="name">加号</div> | |||||
<div class="code-name">&#xe602;</div> | |||||
</li> | |||||
<li class="dib"> | <li class="dib"> | ||||
<span class="icon iconfont"></span> | <span class="icon iconfont"></span> | ||||
<div class="name">密码</div> | <div class="name">密码</div> | ||||
@@ -166,7 +172,7 @@ | |||||
<pre><code class="language-css" | <pre><code class="language-css" | ||||
>@font-face { | >@font-face { | ||||
font-family: 'iconfont'; | font-family: 'iconfont'; | ||||
src: url('iconfont.ttf?t=1659942239310') format('truetype'); | |||||
src: url('iconfont.ttf?t=1660817438136') format('truetype'); | |||||
} | } | ||||
</code></pre> | </code></pre> | ||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> | <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> | ||||
@@ -246,6 +252,15 @@ | |||||
</div> | </div> | ||||
</li> | </li> | ||||
<li class="dib"> | |||||
<span class="icon iconfont icon-jiahao"></span> | |||||
<div class="name"> | |||||
加号 | |||||
</div> | |||||
<div class="code-name">.icon-jiahao | |||||
</div> | |||||
</li> | |||||
<li class="dib"> | <li class="dib"> | ||||
<span class="icon iconfont icon-mima"></span> | <span class="icon iconfont icon-mima"></span> | ||||
<div class="name"> | <div class="name"> | ||||
@@ -411,6 +426,14 @@ | |||||
<div class="code-name">#icon-window-max_line</div> | <div class="code-name">#icon-window-max_line</div> | ||||
</li> | </li> | ||||
<li class="dib"> | |||||
<svg class="icon svg-icon" aria-hidden="true"> | |||||
<use xlink:href="#icon-jiahao"></use> | |||||
</svg> | |||||
<div class="name">加号</div> | |||||
<div class="code-name">#icon-jiahao</div> | |||||
</li> | |||||
<li class="dib"> | <li class="dib"> | ||||
<svg class="icon svg-icon" aria-hidden="true"> | <svg class="icon svg-icon" aria-hidden="true"> | ||||
<use xlink:href="#icon-mima"></use> | <use xlink:href="#icon-mima"></use> | ||||
@@ -8,9 +8,9 @@ | |||||
mc:Ignorable="d" | mc:Ignorable="d" | ||||
d:DesignHeight="450" d:DesignWidth="800" | d:DesignHeight="450" d:DesignWidth="800" | ||||
xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"> | xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"> | ||||
<UserControl.DataContext> | |||||
<!--<UserControl.DataContext> | |||||
<vm:UserManageViewModel/> | <vm:UserManageViewModel/> | ||||
</UserControl.DataContext> | |||||
</UserControl.DataContext>--> | |||||
<UserControl.Resources> | <UserControl.Resources> | ||||
<Style x:Key="dgCell" TargetType="TextBlock"> | <Style x:Key="dgCell" TargetType="TextBlock"> | ||||
<Setter Property="HorizontalAlignment" Value="Center"/> | <Setter Property="HorizontalAlignment" Value="Center"/> | ||||
@@ -29,6 +29,7 @@ namespace FryPot_DosingSystem.View | |||||
public UserManageView() | public UserManageView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
this.DataContext = UserManageViewModel.GetInstance; | |||||
} | } | ||||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||||
@@ -38,13 +39,17 @@ namespace FryPot_DosingSystem.View | |||||
var per = cbo.SelectedItem; | var per = cbo.SelectedItem; | ||||
if (id != null) | if (id != null) | ||||
{ | { | ||||
var a = UserManageViewModel.GetInstance.usersInfo.FirstOrDefault(p => p.Id == id); | |||||
var a = UserManageViewModel.GetInstance.usersInfo.FirstOrDefault(p => p.Id == id.ToString()); | |||||
if (a != null && per != null) | if (a != null && per != null) | ||||
{ | { | ||||
a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); | a.permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); | ||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
UserManageViewModel.GetInstance.usersInfo.Last().permission = (Permission)Enum.Parse(typeof(Permission), per.ToString()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||