图表全局刷新
This commit is contained in:
commit
db8d0af797
6 files changed
+67
-13
No files matched your search
@@ -98,6 +98,9 @@
|
|||||||
<Compile Include="ViewModel\CurveDiagramViewModel.cs" />
|
<Compile Include="ViewModel\CurveDiagramViewModel.cs" />
|
||||||
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
||||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||||
|
<Compile Include="View\CurveDiagram.xaml.cs">
|
||||||
|
<DependentUpon>CurveDiagram.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="View\CurveView.xaml.cs">
|
<Compile Include="View\CurveView.xaml.cs">
|
||||||
<DependentUpon>CurveView.xaml</DependentUpon>
|
<DependentUpon>CurveView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -149,6 +152,10 @@
|
|||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Page Include="View\CurveDiagram.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="View\CurveView.xaml">
|
<Page Include="View\CurveView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.CurveDiagram"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
||||||
|
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
|
||||||
|
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
|
||||||
|
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{d:DesignInstance Type=viewmodel:CurveDiagramViewModel}"
|
||||||
|
d:DesignHeight="300" d:DesignWidth="400">
|
||||||
|
<Grid>
|
||||||
|
<lvc:CartesianChart x:Name="OscChart" MinWidth="400" MinHeight="300" EasingFunction="{x:Null}" ZoomMode="X"
|
||||||
|
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,0,0,0"/>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CurveDiagram.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class CurveDiagram : UserControl
|
||||||
|
{
|
||||||
|
public CurveDiagram()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = new CurveDiagramViewModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
-4
@@ -11,7 +11,7 @@
|
|||||||
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
|
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Loaded="UserControl_Loaded"
|
Loaded="UserControl_Loaded"
|
||||||
d:DataContext="{d:DesignInstance Type=viewmodel:CurveDiagramViewModel}"
|
|
||||||
d:DesignHeight="900" d:DesignWidth="1800">
|
d:DesignHeight="900" d:DesignWidth="1800">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ConvertMoels:StateToColorConvert x:Key="StateToColorConvert"/>
|
<ConvertMoels:StateToColorConvert x:Key="StateToColorConvert"/>
|
||||||
@@ -108,9 +108,6 @@
|
|||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
<lvc:CartesianChart x:Name="OscChart" MinWidth="400" MinHeight="300" EasingFunction="{x:Null}" ZoomMode="X"
|
|
||||||
Series="{Binding Series}" YAxes="{Binding YAxes}" XAxes="{Binding XAxes}" Margin="0,500,300,60"/>
|
|
||||||
|
|
||||||
<StackPanel x:Name="s1cr" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal">
|
<StackPanel x:Name="s1cr" VerticalAlignment="Bottom" Height="60" Background="#FF00204E" Orientation="Horizontal">
|
||||||
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
||||||
<ListViewItem Height="60" VerticalAlignment="Center">
|
<ListViewItem Height="60" VerticalAlignment="Center">
|
||||||
@@ -157,5 +154,10 @@
|
|||||||
</ListViewItem>
|
</ListViewItem>
|
||||||
</ListView>
|
</ListView>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
<Grid Background="White" Margin="0,500,300,60">
|
||||||
|
<ContentControl x:Name="Picture"/>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -30,14 +30,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
{
|
{
|
||||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
||||||
public static DataTable WorkOrder = new DataTable(); //设备表缓存
|
public static DataTable WorkOrder = new DataTable(); //物料缓存
|
||||||
|
public static string CurveDiagram;
|
||||||
private readonly UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
|
private readonly UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
|
||||||
private string SYS_machines =null;
|
private string SYS_machines =null;
|
||||||
|
|
||||||
public CurveView()
|
public CurveView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = new CurveDiagramViewModel();
|
|
||||||
|
|
||||||
Sdatepicker.Language = XmlLanguage.GetLanguage(Configini.IniReadvalue("SYS", "Language"));
|
Sdatepicker.Language = XmlLanguage.GetLanguage(Configini.IniReadvalue("SYS", "Language"));
|
||||||
}
|
}
|
||||||
@@ -66,13 +66,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
|
|
||||||
Sdatepicker.Text = DateTime.Now.ToString("yyyy/MM/dd");
|
Sdatepicker.Text = DateTime.Now.ToString("yyyy/MM/dd");
|
||||||
|
|
||||||
CurveDiagramViewModel.Curve("738891980000");
|
Picture.Content = new View.CurveDiagram();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)
|
private void WorkOrderNumder_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
CurveDiagramViewModel.Curve(Select_WorkOrderNumder.Text);
|
CurveDiagram =Select_WorkOrderNumder.Text;
|
||||||
// OscChart.CoreChart..;
|
Picture.Content = new View.CurveDiagram();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ListViewItem_Before(object sender, MouseButtonEventArgs e)//前一天
|
private void ListViewItem_Before(object sender, MouseButtonEventArgs e)//前一天
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ using TouchSocket.Core;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using SunlightCentralizedControlManagement_SCCM_.View;
|
||||||
|
|
||||||
namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||||
{
|
{
|
||||||
@@ -128,7 +129,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
|
|
||||||
public CurveDiagramViewModel()
|
public CurveDiagramViewModel()
|
||||||
{
|
{
|
||||||
Curve("");
|
Curve(CurveView.CurveDiagram);
|
||||||
}
|
}
|
||||||
public static void Curve(string SYSWorkNumder)
|
public static void Curve(string SYSWorkNumder)
|
||||||
{
|
{
|
||||||
@@ -197,9 +198,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
STLC_values = new ObservableCollection<DateTimePoint>(STLC_items);
|
STLC_values = new ObservableCollection<DateTimePoint>(STLC_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Series = new ISeries[]
|
Series = new ISeries[]
|
||||||
{
|
{
|
||||||
new LineSeries<DateTimePoint>
|
new LineSeries<DateTimePoint>
|
||||||
|
|||||||
Reference in new issue
Block a user