123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <Window x:Class="Yunda.SOMS.DataMonitoringServer.Viewport.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:converter="clr-namespace:Yunda.SOMS.DataMonitoringServer.Viewport.Domain.Converters"
- TextElement.Foreground="{StaticResource MaterialDesignBody}"
- TextElement.FontWeight="Regular"
- TextElement.FontFamily="微软雅黑"
- TextElement.FontSize="13"
- TextOptions.TextFormattingMode="Ideal"
- TextOptions.TextRenderingMode="Auto"
- Background="{DynamicResource MaterialDesignPaper}"
- WindowStartupLocation="CenterScreen"
- mc:Ignorable="d"
- Title="数据服务" Height="450" Width="1100">
- <Window.Resources>
- <converter:InverseBoolValueConverter x:Key="InverseBoolValueConverter"></converter:InverseBoolValueConverter>
- <converter:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converter:BooleanToVisibilityConverter>
- </Window.Resources>
- <Grid Background="{StaticResource WheatColor}">
- <DockPanel LastChildFill="True">
- <materialDesign:Card DockPanel.Dock="Top" Margin="10">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="6*"></ColumnDefinition>
- <ColumnDefinition Width="1*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <WrapPanel Margin="5,5,5,5" Grid.Column="0" Orientation="Horizontal" AllowDrop="True">
- <WrapPanel Margin="5" Width="210" Visibility="Collapsed">
- <TextBlock VerticalAlignment="Bottom" Text="Web服务IP:" />
- <TextBox Text="{Binding Path=SettingModel.WebIp}" Width="120" materialDesign:HintAssist.Hint="0" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="210" Visibility="Collapsed">
- <TextBlock VerticalAlignment="Bottom" Text="Web服务端口:" />
- <TextBox Text="{Binding Path=SettingModel.WebPort}" Width="60" materialDesign:HintAssist.Hint="0" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
-
- <WrapPanel Margin="5" Width="210" Visibility="Collapsed">
- <TextBlock VerticalAlignment="Bottom" Text="Websocket监听端口:" />
- <TextBox Text="{Binding Path=SettingModel.WebsocketPort}" Width="60" materialDesign:HintAssist.Hint="0" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
-
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="110">
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="远动机IP:" />
- <TextBox Text="{Binding Path=SettingModel.Dev_Ip}" Width="120" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="110">
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="远动机端口:" />
- <TextBox Text="{Binding Path=SettingModel.Dev_Port}" Width="60" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="110">
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="RTU地址:" />
- <TextBox Text="1" Width="60" VerticalContentAlignment="Bottom"
- IsEnabled="False" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="110">
- <TextBlock VerticalAlignment="Bottom" Text="数据保存间隔:" />
- <TextBox Text="{Binding Path=SettingModel.DataHandleInterval}" Width="50" materialDesign:HintAssist.Hint="0" VerticalContentAlignment="Center"
- IsEnabled="{Binding Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- <TextBlock Width="auto" Margin="0,0" VerticalAlignment="Center" Text="(秒)" />
- </WrapPanel>
- <WrapPanel Margin="5" VerticalAlignment="Center" Width="110">
- <TextBlock Margin="0" VerticalAlignment="Center" Text="自动启动:" />
- <ToggleButton IsChecked="{Binding Path=SettingModel.IsAutoStartup,
- Converter={StaticResource BoolPositiveConverter}}"
- IsEnabled="{Binding Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}"
- Style="{StaticResource MaterialDesignSwitchToggleButton}"
- ToolTip="" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="210" VerticalAlignment="Bottom" Visibility="Collapsed">
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="手动配置其他项:" />
- <CheckBox IsChecked="{Binding Path=IsManualSetting}" IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}"></CheckBox>
- </WrapPanel>
- <WrapPanel Margin="5" Width="210" Height="30" Visibility="Collapsed" >
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="装置地址:" />
- <TextBox Width="60" Text="{Binding Path=SettingModel.Dev_addr}" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="210" Height="30" Visibility="Collapsed" >
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="遥测起始地址:" />
- <TextBox Text="{Binding Path=SettingModel.Dev_yc_start}" Width="60" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="210" Height="30" Visibility="Collapsed" >
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="遥测数量:" />
- <TextBox Width="60" Text="{Binding Path=SettingModel.Dev_yc_num}" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Width="210" Height="30" Visibility="Collapsed" >
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="遥信起始地址:"></TextBlock>
- <TextBox Width="60" Text="{Binding Path=SettingModel.Dev_yx_start}" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" Height="30" Width="210" Visibility="Collapsed" >
- <TextBlock Margin="0" VerticalAlignment="Bottom" Text="遥信数量:" />
- <TextBox Width="60" Text="{Binding Path=SettingModel.Dev_yx_num}" x:Name="CommentTextBox" VerticalContentAlignment="Bottom"
- IsEnabled="{Binding
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}" />
- </WrapPanel>
- <WrapPanel Margin="5" VerticalAlignment="Center" Width="210">
- <TextBlock Margin="0" VerticalAlignment="Center" Text="联动摄像机权限:" />
- <ToggleButton IsChecked="{Binding Path=SettingModel.IsAuthority,
- Converter={StaticResource BoolPositiveConverter}}"
- Style="{StaticResource MaterialDesignSwitchToggleButton}"
- ToolTip="" />
- </WrapPanel>
- </WrapPanel>
- <StackPanel Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Right">
- <Button Command="{Binding Path=SaveCommand}"
- Background="#1ab394" Margin="5" Foreground="#000" Width="100" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="保存配置"
- IsEnabled="{Binding Path=IsRunning,Converter={StaticResource InverseBoolValueConverter }}"/>
- <Button
- Background="OrangeRed" Margin="5" Foreground="#fff" Width="100" Height="30" x:Name="restart"
- Click="restart_Click"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="重启服务"
- />
- </StackPanel>
- </Grid>
- </materialDesign:Card>
- <materialDesign:Card DockPanel.Dock="Top" Margin="10">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*"></ColumnDefinition>
- <ColumnDefinition Width="3*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <StackPanel Orientation="Horizontal" Margin="5" Grid.Column="0">
- <WrapPanel x:Name="stationSelect" Margin="5" Width="210">
- <TextBlock VerticalAlignment="Bottom" Text="变电所:" />
- <ComboBox Width="140" ItemsSource="{Binding Path=TransformerSubstations}"
- SelectedItem="{Binding Path=TransformerSubstation}"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding
-
- Path=IsRunning ,Converter={StaticResource InverseBoolValueConverter}}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Path=Text}"></TextBlock>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- </WrapPanel>
- <!--<TextBlock Margin="5" FontSize="17" Padding="5" Width="210" Foreground="Red" Background="Azure"></TextBlock>-->
- </StackPanel>
- <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
- <!--<Button DockPanel.Dock="Right" x:Name="ResetBtn" Visibility="{Binding Path=Is}" Command="{Binding ResetCommand}"
- Background="#FFB3471A" Margin="5" Foreground="#f3f3f3" Width="120" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="重新初始化"
- IsEnabled="{Binding Path=IsRunning,Converter={StaticResource BoolNegateConverter }}"/>-->
- <Button DockPanel.Dock="Right" Command="{Binding StartCommand}"
- Background="Red" Margin="5" Foreground="#fff" Width="90" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="{Binding StatBtnContent}"
- />
- <Button Visibility="Collapsed" Command="{Binding Path=StopCommand}"
- Margin="5" Background="Red" Foreground="#f3f3f3" Width="90" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="停止服务"
- IsEnabled="{Binding Path=IsRunning,Converter={StaticResource BoolPositiveConverter}}" Click="StopBtn_Click"/>
- <Button Command="{Binding Path=UpdateAllMenuCmd}"
- Margin="5" Background="BlueViolet" Foreground="#f3f3f3" Width="80" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="总召唤"
- IsEnabled="{Binding Path=IsRunning,Converter={StaticResource BoolPositiveConverter}}" />
- <Button Command="{Binding Path=CleanCommand}"
- Margin="5" Background="Wheat" Foreground="#000" Width="70" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="清屏"
- />
- <Button Command="{Binding Path=StopMenuCmd}"
- Margin="5" Background="BlueViolet" Foreground="#f3f3f3" Width="100" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="暂停报文"
- />
- <Button Command="{Binding Path=StartMenuCmd}"
- Margin="5" Background="LightYellow" Foreground="#000" Width="100" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="开始报文" Cursor=""
- />
- <Button Command="{Binding Path=UpdataLiveDataCommand}"
- Margin="5" Background="LightBlue" Foreground="#000" Width="120" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="刷新实时监视" Cursor=""
- />
- <Button Command="{Binding Path=ExportLiveDataCommand}"
- Margin="5" Background="LightBlue" Foreground="#000" Width="120" Height="30"
- Style="{StaticResource MaterialDesignRaisedLightButton}" Content="导出实时监视" Cursor=""
- />
- </StackPanel>
- </Grid>
- </materialDesign:Card>
- <TabControl DockPanel.Dock="Top">
- <TabItem Header="实时报文">
- <DockPanel Background="{StaticResource WheatColor}" LastChildFill="True" >
- <ProgressBar DockPanel.Dock="Top" Height="4" Padding="0" Margin="10,5" Background="LightGreen" BorderBrush="AliceBlue" Foreground="Green" IsIndeterminate="{Binding Path=IsRunning}" />
- <ScrollViewer VerticalScrollBarVisibility="Visible" MouseWheel="ScrollViewer_MouseWheel">
- <!--<RichTextBox x:Name="richTextBox" FontSize="12" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" />-->
- <ListView ItemsSource="{Binding Path=Recorders}" FontSize="12">
- <ListView.View>
- <GridView>
- <GridViewColumn Width="180" DisplayMemberBinding="{Binding Path=DateTime, StringFormat={}{0:MM-dd HH:mm:ss fff}}" Header="时间" />
- <GridViewColumn Width="120" DisplayMemberBinding="{Binding Path=MsgType}" Header="类别" />
- <GridViewColumn Width="500" DisplayMemberBinding="{Binding Path=Msg}" Header="信息" />
- </GridView>
- </ListView.View>
- <ListView.ContextMenu>
- <ContextMenu>
- <MenuItem Header="过滤报文" FontFamily="微软雅黑" FontWeight="Regular" Name="regMenu" Command="{Binding Path=RegMenuCmd}"></MenuItem>
- <MenuItem Header="暂停报文" FontFamily="微软雅黑" FontWeight="Regular" Name="stopMenu" Command="{Binding Path=StopMenuCmd}"></MenuItem>
- <MenuItem Header="开始报文" FontFamily="微软雅黑" FontWeight="Regular" Name="startMenu" Command="{Binding Path=StartMenuCmd}" ></MenuItem>
- <MenuItem Header="复制报文" FontFamily="微软雅黑" FontWeight="Regular" Name="copyMenu" Command="{Binding Path=CopyMenuCmd}" CommandParameter="{Binding ElementName=copyMenu }">
- </MenuItem>
- <MenuItem Header="更新三遥数据" FontFamily="微软雅黑" FontWeight="Regular" Command="{Binding Path=UpdateAllMenuCmd}">
- </MenuItem>
- <MenuItem Header="更新指定数据" FontFamily="微软雅黑" FontWeight="Regular" Command="{Binding Path=UpdateOneMenuCmd}" >
- </MenuItem>
- <MenuItem Header="更新联动数据" FontFamily="微软雅黑" FontWeight="Regular" Command="{Binding Path=UpdateLinkageDataCommand}" >
- </MenuItem>
- <MenuItem Header="清屏" FontFamily="微软雅黑" FontWeight="Regular" Command="{Binding Path=CleanCommand}" >
- </MenuItem>
- </ContextMenu>
- </ListView.ContextMenu>
- </ListView>
- </ScrollViewer>
- </DockPanel>
- </TabItem>
- <TabItem Header="实时监视" IsSelected="True">
- <ScrollViewer VerticalScrollBarVisibility="Visible" x:Name="liveDatasScrollViewer" MouseWheel="ScrollViewer_MouseWheel">
- <ListView ItemsSource="{Binding Path=InfoAddrLiveDatas}" FontSize="12" d:ItemsSource="{d:SampleData ItemCount=5}" >
- <ListView.View>
- <GridView>
- <GridViewColumn Width="180" DisplayMemberBinding="{Binding Path=DateTime, StringFormat={}{0:MM-dd HH:mm:ss fff}}" Header="更新时间" />
- <GridViewColumn Width="180" DisplayMemberBinding="{Binding Path=EquipmentName}" Header="设备名称" />
- <GridViewColumn Width="180" DisplayMemberBinding="{Binding Path=Name}" Header="名称" />
- <GridViewColumn Width="180" DisplayMemberBinding="{Binding Path=TypeName}" Header="类型" />
- <GridViewColumn Width="150" DisplayMemberBinding="{Binding Path=InfoAddr}" Header="调度地址" />
- <GridViewColumn Width="150" DisplayMemberBinding="{Binding Path=Value}" Header="数值" />
- </GridView>
- </ListView.View>
- </ListView>
- </ScrollViewer>
- </TabItem>
- </TabControl>
- </DockPanel>
- </Grid>
- </Window>
|