sc 10 months ago
parent
commit
6fbee6ed43
  1. 10
      View/ProductionPlanningView.xaml
  2. 10
      View/ProductionPlanningView.xaml.cs
  3. 2
      ViewModel/CurveDiagramViewModel.cs
  4. 43
      ViewModel/ProductionPlanningModel.cs

10
View/ProductionPlanningView.xaml

@ -7,9 +7,11 @@
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties" xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels" xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:planner="http://mindfusion.eu/scheduling/wpf" xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
d:DataContext="{d:DesignInstance Type=viewmodel:ProductionPlanningModel}"
mc:Ignorable="d" Loaded="UserControl_Loaded" mc:Ignorable="d" Loaded="UserControl_Loaded"
d:DesignHeight="630" d:DesignWidth="1280"> d:DesignHeight="630" d:DesignWidth="1280">
<UserControl.Resources> <UserControl.Resources>
<ConvertMoels:RowToIndexConverter x:Key="RowToIndexConverter"/> <ConvertMoels:RowToIndexConverter x:Key="RowToIndexConverter"/>
</UserControl.Resources> </UserControl.Resources>
@ -21,6 +23,10 @@
<Grid Grid.Row="0"> <Grid Grid.Row="0">
<lvc:CartesianChart Series="{Binding Series}" XAxes="{Binding XAxes}" TooltipPosition="Hidden">
</lvc:CartesianChart>
</Grid> </Grid>
<StackPanel x:Name="scr" Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal"> <StackPanel x:Name="scr" Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal">

10
View/ProductionPlanningView.xaml.cs

@ -29,6 +29,7 @@ using System.Xml.Linq;
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep; using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep;
using static System.Windows.Forms.VisualStyles.VisualStyleElement; using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
namespace SunlightCentralizedControlManagement_SCCM_.View namespace SunlightCentralizedControlManagement_SCCM_.View
{ {
@ -40,6 +41,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
public ProductionPlanningView() public ProductionPlanningView()
{ {
InitializeComponent(); InitializeComponent();
DataContext = new ProductionPlanningModel();
} }
private SQLiteHelper SQLiteHelpers = null; //定义数据库 private SQLiteHelper SQLiteHelpers = null; //定义数据库
@ -48,14 +50,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作 private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作
{ {
} }
private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件 private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件

2
ViewModel/CurveDiagramViewModel.cs

@ -200,7 +200,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
Series = new ISeries[] Series = new ISeries[]
{ {
new LineSeries<DateTimePoint> new LineSeries<DateTimePoint>
{ {
Name = Properties.Resources.MasterCylinder +"PH", Name = Properties.Resources.MasterCylinder +"PH",
Values = MTH_values, Values = MTH_values,

43
ViewModel/ProductionPlanningModel.cs

@ -32,6 +32,49 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
{ {
public partial class ProductionPlanningModel : ObservableObject//ViewModelBase public partial class ProductionPlanningModel : ObservableObject//ViewModelBase
{ {
public ISeries[] Series { get; set; }
public Axis[] XAxes { get; set; } =
{
new DateTimeAxis(TimeSpan.FromSeconds(5) , date => date.ToString("yyyy-MM-dd HH:mm"))
{
CrosshairLabelsBackground = SKColors.DarkGray.AsLvcColor(),
CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkSlateBlue, 1),
CrosshairPaint = new SolidColorPaint(SKColors.DarkSlateGray, 1),
},
};
public ProductionPlanningModel()
{
Series = new ISeries[]
{
new RowSeries<int>
{
Values = new List<int> { 3 },
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Middle
},
new RowSeries<int>
{
Values = new List<int> { 4},
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Middle
},
new RowSeries<int>
{
Values = new List<int> { -2 },
Stroke = null,
DataLabelsPaint = new SolidColorPaint(new SKColor(45, 45, 45)),
DataLabelsSize = 14,
DataLabelsPosition = DataLabelsPosition.Middle
} };
}
} }
} }

Loading…
Cancel
Save