sc 10 months ago
parent
commit
ac3d12b899
  1. 36
      ControlUse/Timeline/Properties/AssemblyInfo.cs
  2. 73
      ControlUse/Timeline/Timeline.csproj
  3. 6
      SunlightCentralizedControlManagement(SCCM).sln
  4. 24
      SunlightCentralizedControlManagement_SCCM_.csproj
  5. 5
      View/ProductionPlanningView.xaml
  6. 28
      View/ProductionPlanningView.xaml.cs

36
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")]

73
ControlUse/Timeline/Timeline.csproj

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{77D9FB0A-D628-4002-A118-B3D6E6601092}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Timeline</RootNamespace>
<AssemblyName>Timeline</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ChartConstants.cs" />
<Compile Include="Model\BarModel.cs" />
<Compile Include="Model\HeaderModel.cs" />
<Compile Include="Model\ItemModel.cs" />
<Compile Include="Processor\BarChartProcessor.cs" />
<Compile Include="Timeline.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Timeline.Designer.cs">
<DependentUpon>Timeline.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Timeline.resx">
<DependentUpon>Timeline.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

6
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

24
SunlightCentralizedControlManagement_SCCM_.csproj

@ -79,17 +79,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="ControlUse\Timeline\ChartConstants.cs" />
<Compile Include="ControlUse\Timeline\Model\BarModel.cs" />
<Compile Include="ControlUse\Timeline\Model\HeaderModel.cs" />
<Compile Include="ControlUse\Timeline\Model\ItemModel.cs" />
<Compile Include="ControlUse\Timeline\Processor\BarChartProcessor.cs" />
<Compile Include="ControlUse\Timeline\Timeline.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ControlUse\Timeline\Timeline.Designer.cs">
<DependentUpon>Timeline.cs</DependentUpon>
</Compile>
<Compile Include="ConvertMoels\BoolRBConvert.cs" />
<Compile Include="UserClass\AsyncTcpClient.cs" />
<Compile Include="UserClass\ClsLock.cs" />
@ -267,9 +256,6 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="ControlUse\Timeline\Timeline.resx">
<DependentUpon>Timeline.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.en-US.resx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
@ -358,7 +344,9 @@
<Version>3.0.7</Version>
</PackageReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="ControlUse\" />
</ItemGroup>
<ItemGroup>
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.css" />
<Content Include="Fonts\font-awesome-4.7.0\css\font-awesome.min.css" />
@ -398,6 +386,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="ControlUse\Timeline\Timeline.csproj">
<Project>{77d9fb0a-d628-4002-a118-b3d6e6601092}</Project>
<Name>Timeline</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterResolveReferences">
<ItemGroup>

5
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 @@
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<lvc:CartesianChart x:Name="ch" XAxes="{Binding XAxes}" YAxes="{Binding YAxes}" Series="{Binding Series}" />
<!-- <lvc:CartesianChart x:Name="ch" XAxes="{Binding XAxes}" YAxes="{Binding YAxes}" Series="{Binding Series}" />-->
<wfi:WindowsFormsHost>
<wf:Label x:Name="wfLabel" Text="winForm控件在此" />
<UserTimeline:Timeline Name="Q"/>
</wfi:WindowsFormsHost>
</Grid>
<StackPanel x:Name="scr" Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal">

28
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; //定义数据库
@ -53,7 +56,30 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
private void UserControl_Loaded(object sender, RoutedEventArgs e)//打开页面时的操作
{
var randomVar = new Random();
var testList = new List<ItemModel>();
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)//退出事件

Loading…
Cancel
Save