Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
b8e9f17d2b
4 files changed
+49
-56
No files matched your search
@@ -35,6 +35,9 @@ using LiveChartsCore.SkiaSharpView.WPF;
|
||||
using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
|
||||
using nGantt.GanttChart;
|
||||
using nGantt;
|
||||
using nGantt.PeriodSplitter;
|
||||
using ScottPlot.TickGenerators.TimeUnits;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
@@ -53,20 +56,60 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
|
||||
private SQLiteHelper SQLiteHelpers = null; //定义数据库
|
||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
|
||||
|
||||
private int GantLenght { get; set; }
|
||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作
|
||||
{
|
||||
List<string> qw = MainWindowViewModel.Machines.AsEnumerable().Select(row => row.Field<string>("name")).ToList();//转换列名为机台
|
||||
int asd = qw.Count();
|
||||
// List<string> qw = MainWindowViewModel.Machines.AsEnumerable().Select(row => row.Field<string>("name")).ToList();//转换列名为机台
|
||||
// int asd = qw.Count();
|
||||
GantLenght = 1;
|
||||
DateTime minDate = DateTime.Parse("2012-02-01").Date;
|
||||
DateTime maxDate = minDate.AddDays(GantLenght);
|
||||
|
||||
GanttChart.Initialize(minDate, maxDate);
|
||||
var gridLineTimeLine = GanttChart.CreateTimeLine(new PeriodDaySplitter(minDate, maxDate), FormatDay);
|
||||
|
||||
GanttChart.CreateTimeLine(new PeriodHourSplitter(minDate, maxDate), FormatHour);
|
||||
// GanttChart.CreateTimeLine(new PeriodDaySplitter(minDate, maxDate), FormatDayName);
|
||||
|
||||
// Set the timeline to atatch gridlines to
|
||||
GanttChart.SetGridLinesTimeline(gridLineTimeLine, DetermineBackground);
|
||||
|
||||
|
||||
var rowgroup1 = GanttChart.CreateGanttRowGroup("HeaderdGanttRowGroup");
|
||||
var row1 = GanttChart.CreateGanttRow(rowgroup1, "GanttRow 1");
|
||||
GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-02-01"), End = DateTime.Parse("2012-03-01"), Name = "GanttRow 1:GanttTask 1", TaskProgressVisibility = System.Windows.Visibility.Hidden });
|
||||
GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-03-05"), End = DateTime.Parse("2012-05-01"), Name = "GanttRow 1:GanttTask 2" });
|
||||
GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-06-01"), End = DateTime.Parse("2012-06-15"), Name = "GanttRow 1:GanttTask 3" });
|
||||
GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-02-01 00:30:00"), End = DateTime.Parse("2012-02-01 01:00:00"), Name = "GanttRow 1:GanttTask 1", TaskProgressVisibility = System.Windows.Visibility.Hidden });
|
||||
GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-02-01 06:00:00"), End = DateTime.Parse("2012-02-01 07:00:00"), Name = "GanttRow 1:GanttTask 2" });
|
||||
GanttChart.AddGanttTask(row1, new GanttTask() { Start = DateTime.Parse("2012-02-01 10:00:00"), End = DateTime.Parse("2012-02-01 20:00:00"), Name = "GanttRow 1:GanttTask 3" });
|
||||
|
||||
|
||||
}
|
||||
private string FormatYear(Period period)
|
||||
{
|
||||
return period.Start.Year.ToString();
|
||||
}
|
||||
private string FormatMonth(Period period)
|
||||
{
|
||||
return period.Start.Month.ToString();
|
||||
}
|
||||
private string FormatDay(Period period)
|
||||
{
|
||||
return period.Start.Day.ToString();
|
||||
}
|
||||
private string FormatDayName(Period period)
|
||||
{
|
||||
return period.Start.DayOfWeek.ToString();
|
||||
}
|
||||
private string FormatHour(Period period)
|
||||
{
|
||||
return period.Start.Hour.ToString();
|
||||
}
|
||||
private System.Windows.Media.Brush DetermineBackground(TimeLineItem timeLineItem)
|
||||
{
|
||||
if (timeLineItem.End.Date.DayOfWeek == DayOfWeek.Saturday || timeLineItem.End.Date.DayOfWeek == DayOfWeek.Sunday)
|
||||
return new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.LightBlue);
|
||||
else
|
||||
return new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Transparent);
|
||||
}
|
||||
|
||||
private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件
|
||||
{
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.Timeline"
|
||||
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:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,28 +0,0 @@
|
||||
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>
|
||||
/// Timeline.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Timeline : UserControl
|
||||
{
|
||||
public Timeline()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user