diff --git a/ControlUse/Timeline/Properties/AssemblyInfo.cs b/ControlUse/Timeline/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..75997b8 --- /dev/null +++ b/ControlUse/Timeline/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Timeline")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Timeline")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("40f4c82a-50c5-4880-a19b-dec078fac398")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ControlUse/Timeline/Timeline.csproj b/ControlUse/Timeline/Timeline.csproj new file mode 100644 index 0000000..17b2bbd --- /dev/null +++ b/ControlUse/Timeline/Timeline.csproj @@ -0,0 +1,73 @@ + + + + + Debug + AnyCPU + {77D9FB0A-D628-4002-A118-B3D6E6601092} + Library + Properties + Timeline + Timeline + v4.7.2 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + UserControl + + + Timeline.cs + + + + + + + Timeline.cs + + + + + + \ No newline at end of file diff --git a/SunlightCentralizedControlManagement(SCCM).sln b/SunlightCentralizedControlManagement(SCCM).sln index 708ea7a..4bbc606 100644 --- a/SunlightCentralizedControlManagement(SCCM).sln +++ b/SunlightCentralizedControlManagement(SCCM).sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.11.35312.102 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SunlightCentralizedControlManagement_SCCM_", "SunlightCentralizedControlManagement_SCCM_.csproj", "{2CFE8A79-C7DC-47AC-8D0C-2E03010E2458}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Timeline", "ControlUse\Timeline\Timeline.csproj", "{77D9FB0A-D628-4002-A118-B3D6E6601092}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {2CFE8A79-C7DC-47AC-8D0C-2E03010E2458}.Debug|Any CPU.Build.0 = Debug|Any CPU {2CFE8A79-C7DC-47AC-8D0C-2E03010E2458}.Release|Any CPU.ActiveCfg = Release|Any CPU {2CFE8A79-C7DC-47AC-8D0C-2E03010E2458}.Release|Any CPU.Build.0 = Release|Any CPU + {77D9FB0A-D628-4002-A118-B3D6E6601092}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77D9FB0A-D628-4002-A118-B3D6E6601092}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77D9FB0A-D628-4002-A118-B3D6E6601092}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77D9FB0A-D628-4002-A118-B3D6E6601092}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj index fd5f819..01f4ac6 100644 --- a/SunlightCentralizedControlManagement_SCCM_.csproj +++ b/SunlightCentralizedControlManagement_SCCM_.csproj @@ -79,17 +79,6 @@ MSBuild:Compile Designer - - - - - - - UserControl - - - Timeline.cs - @@ -267,9 +256,6 @@ Settings.settings True - - Timeline.cs - PublicResXFileCodeGenerator @@ -358,7 +344,9 @@ 3.0.7 - + + + @@ -398,6 +386,12 @@ false + + + {77d9fb0a-d628-4002-a118-b3d6e6601092} + Timeline + + diff --git a/View/ProductionPlanningView.xaml b/View/ProductionPlanningView.xaml index c090046..afafbfa 100644 --- a/View/ProductionPlanningView.xaml +++ b/View/ProductionPlanningView.xaml @@ -10,6 +10,7 @@ xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF" xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel" xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" + xmlns:UserTimeline="clr-namespace:Timeline;assembly=Timeline" xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" d:DataContext="{d:DesignInstance Type=viewmodel:ProductionPlanningModel}" mc:Ignorable="d" Loaded="UserControl_Loaded" @@ -23,10 +24,10 @@ - + - + diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs index e78f0bc..3cea0d2 100644 --- a/View/ProductionPlanningView.xaml.cs +++ b/View/ProductionPlanningView.xaml.cs @@ -26,12 +26,15 @@ using System.Windows.Navigation; using System.Windows.Shapes; using System.Drawing.Drawing2D; using System.Xml.Linq; +using System.Drawing; using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; using static SunlightCentralizedControlManagement_SCCM_.WindowsView.ViewStep; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using SunlightCentralizedControlManagement_SCCM_.ViewModel; using LiveChartsCore.SkiaSharpView.WPF; using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder; +using Timeline.Model; +using Timeline; namespace SunlightCentralizedControlManagement_SCCM_.View { @@ -44,7 +47,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View { InitializeComponent(); DataContext = new ProductionPlanningModel(); - ch.ZoomMode = LiveChartsCore.Measure.ZoomAndPanMode.PanX | LiveChartsCore.Measure.ZoomAndPanMode.ZoomY; + //ch.ZoomMode = LiveChartsCore.Measure.ZoomAndPanMode.PanX | LiveChartsCore.Measure.ZoomAndPanMode.ZoomY; } private SQLiteHelper SQLiteHelpers = null; //定义数据库 @@ -52,8 +55,31 @@ namespace SunlightCentralizedControlManagement_SCCM_.View private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作 { - + var randomVar = new Random(); + + var testList = new List(); + + var startDate = new DateTime(2024, 12, 30, 10, 9, 0); + var endDate = new DateTime(2024, 12, 30, 22, 29, 0); + + for (var i = 0; i < 10; i++) + { + for (var d = startDate; d < endDate; d = d.AddSeconds(randomVar.Next(13000, 14000))) + { + var item1 = new ItemModel + { + ItemName = "Item" + "" + i, + Duration = TimeSpan.FromSeconds(randomVar.Next(8, 15000)), + StartDate = d, + ItemColor = System.Drawing.Color.PowderBlue + }; + + testList.Add(item1); + } + } + + // timeline1.ShowBarChart(startDate, endDate, testList); } private void ListViewItem_Quit(object sender, System.Windows.Input.MouseButtonEventArgs e)//退出事件