GraphLib package added, an empty GraphsTabPageCtrl added, no tab control and menu changes in MainWnd, ver. 2.16.661
This commit is contained in:
parent
5ef1bcbdb6
commit
98f68d6b45
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,6 +4,8 @@ DeviceTest/bin/
|
|||||||
DeviceTest/obj/
|
DeviceTest/obj/
|
||||||
Dirichlet.Numerics/bin
|
Dirichlet.Numerics/bin
|
||||||
Dirichlet.Numerics/obj
|
Dirichlet.Numerics/obj
|
||||||
|
GraphLib/bin
|
||||||
|
GraphLib/obj
|
||||||
Results/bin/
|
Results/bin/
|
||||||
Results/obj/
|
Results/obj/
|
||||||
ResultsBrowser/bin/
|
ResultsBrowser/bin/
|
||||||
|
|||||||
87
GraphLib/BackBuffer.cs
Normal file
87
GraphLib/BackBuffer.cs
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
public class BackBuffer
|
||||||
|
{
|
||||||
|
private Graphics graphics;
|
||||||
|
private Bitmap memoryBitmap;
|
||||||
|
private int width;
|
||||||
|
private int height;
|
||||||
|
|
||||||
|
public BackBuffer()
|
||||||
|
{
|
||||||
|
width = 0;
|
||||||
|
height = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Init(Graphics g, int width, int height)
|
||||||
|
{
|
||||||
|
if (memoryBitmap != null)
|
||||||
|
{
|
||||||
|
memoryBitmap.Dispose();
|
||||||
|
memoryBitmap = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (graphics != null)
|
||||||
|
{
|
||||||
|
graphics.Dispose();
|
||||||
|
graphics = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (width == 0 || height == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ((width != this.width) || (height != this.height) || graphics == null)
|
||||||
|
{
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
|
|
||||||
|
memoryBitmap = new Bitmap(width, height);
|
||||||
|
graphics = Graphics.FromImage(memoryBitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Render(Graphics g)
|
||||||
|
{
|
||||||
|
if (memoryBitmap != null)
|
||||||
|
{
|
||||||
|
g.DrawImage(memoryBitmap,
|
||||||
|
new Rectangle(0, 0, width, height),
|
||||||
|
0, 0, width, height,
|
||||||
|
GraphicsUnit.Pixel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanDoubleBuffer() { return graphics != null; }
|
||||||
|
|
||||||
|
public Graphics Graphics { get { return graphics; } }
|
||||||
|
}
|
||||||
|
}
|
||||||
214
GraphLib/DataSource.cs
Normal file
214
GraphLib/DataSource.cs
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Runtime.Serialization.Formatters.Binary;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
public class DataSource
|
||||||
|
{
|
||||||
|
public delegate String OnDrawXAxisLabelEvent(DataSource src, int idx);
|
||||||
|
public delegate String OnDrawYAxisLabelEvent(DataSource src, float value);
|
||||||
|
|
||||||
|
public OnDrawXAxisLabelEvent OnRenderXAxisLabel = null;
|
||||||
|
public OnDrawYAxisLabelEvent OnRenderYAxisLabel = null;
|
||||||
|
|
||||||
|
private PointF[] samples = null;
|
||||||
|
private int length = 0;
|
||||||
|
|
||||||
|
private String name = String.Empty;
|
||||||
|
private int downSample = 1;
|
||||||
|
private Color color = Color.Black;
|
||||||
|
|
||||||
|
public float VisibleDataRange_X = 0;
|
||||||
|
public float DY = 0;
|
||||||
|
public float YD0 = -200;
|
||||||
|
public float YD1 = 200;
|
||||||
|
public float Cur_YD0 = -200;
|
||||||
|
public float Cur_YD1 = 200;
|
||||||
|
|
||||||
|
public float grid_distance_y = 200; // grid distance in units ( draw a horizontal line every 200 units )
|
||||||
|
|
||||||
|
public float off_Y = 0;
|
||||||
|
public float grid_off_y = 0;
|
||||||
|
|
||||||
|
public bool yFlip = true;
|
||||||
|
|
||||||
|
public bool Active = true;
|
||||||
|
|
||||||
|
public float XAutoScaleOffset = 100;
|
||||||
|
|
||||||
|
public float CurGraphHeight = 1.0f;
|
||||||
|
|
||||||
|
public float CurGraphWidth = 1.0f;
|
||||||
|
|
||||||
|
private bool autoScaleY = false;
|
||||||
|
private bool autoScaleX = false;
|
||||||
|
|
||||||
|
|
||||||
|
public bool AutoScaleY
|
||||||
|
{
|
||||||
|
get { return autoScaleY; }
|
||||||
|
set { autoScaleY = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AutoScaleX
|
||||||
|
{
|
||||||
|
get { return autoScaleX; }
|
||||||
|
set { autoScaleX = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public PointF[] Samples
|
||||||
|
{
|
||||||
|
get { return samples; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
samples = value;
|
||||||
|
length = samples.Length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float XMin
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
float x_min = float.MaxValue;
|
||||||
|
if (samples != null && samples.Length > 0)
|
||||||
|
{
|
||||||
|
foreach (PointF p in samples) if (p.X < x_min) x_min=p.X;
|
||||||
|
}
|
||||||
|
return x_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float XMax
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
float x_max = float.MinValue;
|
||||||
|
if (samples != null && samples.Length > 0)
|
||||||
|
{
|
||||||
|
foreach (PointF p in samples) if (p.X > x_max) x_max = p.X;
|
||||||
|
}
|
||||||
|
return x_max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float YMin
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
float y_min = float.MaxValue;
|
||||||
|
if (samples != null && samples.Length > 0)
|
||||||
|
{
|
||||||
|
foreach (PointF p in samples) if (p.Y < y_min) y_min = p.Y;
|
||||||
|
}
|
||||||
|
return y_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float YMax
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
float y_max = float.MinValue;
|
||||||
|
if (samples.Length > 0)
|
||||||
|
{
|
||||||
|
foreach (PointF p in samples) if (p.Y > y_max) y_max = p.Y;
|
||||||
|
}
|
||||||
|
return y_max;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetDisplayRangeY(float y_start, float y_end)
|
||||||
|
{
|
||||||
|
YD0 = y_start;
|
||||||
|
YD1 = y_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGridDistanceY(float grid_dist_y_units)
|
||||||
|
{
|
||||||
|
grid_distance_y = grid_dist_y_units;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGridOriginY(float off_y)
|
||||||
|
{
|
||||||
|
grid_off_y = off_y;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
|
||||||
|
[DefaultValue(typeof(string), "")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public String Name
|
||||||
|
{
|
||||||
|
get { return name; }
|
||||||
|
set { name = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
|
||||||
|
[DefaultValue(typeof(Color), "")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Color GraphColor
|
||||||
|
{
|
||||||
|
get { return color; }
|
||||||
|
set { color = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
|
||||||
|
[DefaultValue(typeof(int), "0")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public int Length
|
||||||
|
{
|
||||||
|
get { return length; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
length = value;
|
||||||
|
if (length != 0)
|
||||||
|
{
|
||||||
|
samples = new PointF[length];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// length is 0
|
||||||
|
if (samples != null)
|
||||||
|
{
|
||||||
|
samples = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")] // Take this out, and you will soon have problems with serialization;
|
||||||
|
[DefaultValue(typeof(int), "1")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public int Downsampling
|
||||||
|
{
|
||||||
|
get { return downSample; }
|
||||||
|
set { downSample = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
GraphLib/GraphLib.csproj
Normal file
116
GraphLib/GraphLib.csproj
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>8.0.50727</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>ClassLibrary1</RootNamespace>
|
||||||
|
<AssemblyName>GraphLib</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>2.0</OldToolsVersion>
|
||||||
|
</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.Data" />
|
||||||
|
<Reference Include="System.Design" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="PlotterGraphPaneEx.cs">
|
||||||
|
<SubType>UserControl</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PlotterGraphPaneEx.Designer.cs">
|
||||||
|
<DependentUpon>PlotterGraphPaneEx.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PlotterDisplayEx.cs">
|
||||||
|
<SubType>UserControl</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PlotterDisplayEx.designer.cs">
|
||||||
|
<DependentUpon>PlotterDisplayEx.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BackBuffer.cs" />
|
||||||
|
<Compile Include="PlotterGraphSelectCurvesForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PlotterGraphSelectCurvesForm.Designer.cs">
|
||||||
|
<DependentUpon>PlotterGraphSelectCurvesForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DataSource.cs" />
|
||||||
|
<Compile Include="PrintPreviewForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PrintPreviewForm.Designer.cs">
|
||||||
|
<DependentUpon>PrintPreviewForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="PrecisionTimer.cs" />
|
||||||
|
<Compile Include="Utils.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="PlotterGraphPaneEx.resx">
|
||||||
|
<DependentUpon>PlotterGraphPaneEx.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="PlotterDisplayEx.resx">
|
||||||
|
<DependentUpon>PlotterDisplayEx.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="PlotterGraphSelectCurvesForm.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<DependentUpon>PlotterGraphSelectCurvesForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="PrintPreviewForm.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<DependentUpon>PrintPreviewForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\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>
|
||||||
|
-->
|
||||||
|
<PropertyGroup>
|
||||||
|
<PostBuildEvent>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
20
GraphLib/GraphLib.sln
Normal file
20
GraphLib/GraphLib.sln
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||||
|
# Visual Studio 2005
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphLib", "GraphLib.csproj", "{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
433
GraphLib/PlotterDisplayEx.cs
Normal file
433
GraphLib/PlotterDisplayEx.cs
Normal file
@ -0,0 +1,433 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Data;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Threading;
|
||||||
|
using System.ComponentModel.Design;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
|
||||||
|
|
||||||
|
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
public partial class PlotterDisplayEx : UserControl
|
||||||
|
{
|
||||||
|
#region MEMBERS
|
||||||
|
|
||||||
|
delegate void InvokeVoidFuncDelegate();
|
||||||
|
|
||||||
|
PlotterGraphSelectCurvesForm GraphPropertiesForm = null;
|
||||||
|
PrintPreviewForm printPreviewForm = null;
|
||||||
|
|
||||||
|
private PrecisionTimer.Timer mTimer = null;
|
||||||
|
private float play_speed = 0.5f;
|
||||||
|
private float play_speed_max = 10f;
|
||||||
|
private float play_speed_min = 0.5f;
|
||||||
|
|
||||||
|
private bool paused = false;
|
||||||
|
private bool isRunning = false;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region CONSTRUCTOR
|
||||||
|
|
||||||
|
public PlotterDisplayEx()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
mTimer = new PrecisionTimer.Timer();
|
||||||
|
mTimer.Period = 50; // 20 fps
|
||||||
|
mTimer.Tick += new EventHandler(OnTimerTick);
|
||||||
|
play_speed = 0.5f; // 20x10 = 200 values per second == sample frequency
|
||||||
|
mTimer.Start();
|
||||||
|
isRunning = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
||||||
|
{
|
||||||
|
String text = e.ClickedItem.Text;
|
||||||
|
foreach (DataSource s in gPane.Sources)
|
||||||
|
{
|
||||||
|
if (s.Name == text)
|
||||||
|
{
|
||||||
|
s.Active ^= true;
|
||||||
|
gPane.Invalidate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region PROPERTIES
|
||||||
|
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||||
|
[Editor(typeof(System.ComponentModel.Design.CollectionEditor),
|
||||||
|
typeof(System.Drawing.Design.UITypeEditor))]
|
||||||
|
public IList<DataSource> DataSources
|
||||||
|
{
|
||||||
|
get { return gPane.Sources; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||||
|
[Editor(typeof(System.ComponentModel.Design.CollectionEditor),
|
||||||
|
typeof(System.Drawing.Design.UITypeEditor))]
|
||||||
|
public PlotterGraphPaneEx.LayoutMode PanelLayout
|
||||||
|
{
|
||||||
|
get { return gPane.layout; }
|
||||||
|
set { gPane.layout = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||||
|
[Editor(typeof(System.ComponentModel.Design.CollectionEditor),
|
||||||
|
typeof(System.Drawing.Design.UITypeEditor))]
|
||||||
|
public SmoothingMode Smoothing
|
||||||
|
{
|
||||||
|
get { return gPane.smoothing; }
|
||||||
|
set { gPane.smoothing = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Playback")]
|
||||||
|
[DefaultValue(typeof(float), "2")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public float PlaySpeed
|
||||||
|
{
|
||||||
|
get { return play_speed; }
|
||||||
|
set { play_speed = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Playback")]
|
||||||
|
[DefaultValue(typeof(bool), "true")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public bool ShowMovingGrid
|
||||||
|
{
|
||||||
|
get { return gPane.hasMovingGrid; }
|
||||||
|
set { gPane.hasMovingGrid = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Category("Properties")]
|
||||||
|
[DefaultValue(typeof(Color), "")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Color BackgroundColorTop
|
||||||
|
{
|
||||||
|
get { return gPane.BgndColorTop; }
|
||||||
|
set { gPane.BgndColorTop = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")]
|
||||||
|
[DefaultValue(typeof(Color), "")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Color BackgroundColorBot
|
||||||
|
{
|
||||||
|
get { return gPane.BgndColorBot; }
|
||||||
|
set { gPane.BgndColorBot = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")]
|
||||||
|
[DefaultValue(typeof(Color), "")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Color DashedGridColor
|
||||||
|
{
|
||||||
|
get { return gPane.MinorGridColor; }
|
||||||
|
set { gPane.MinorGridColor = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Properties")]
|
||||||
|
[DefaultValue(typeof(Color), "")]
|
||||||
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||||
|
public Color SolidGridColor
|
||||||
|
{
|
||||||
|
get { return gPane.MajorGridColor; }
|
||||||
|
set { gPane.MajorGridColor = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool DoubleBuffering
|
||||||
|
{
|
||||||
|
get { return gPane.useDoubleBuffer; }
|
||||||
|
set { gPane.useDoubleBuffer = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region PUBLIC METHODS
|
||||||
|
|
||||||
|
public void SetDisplayRangeX(float x_start, float x_end )
|
||||||
|
{
|
||||||
|
gPane.XD0 = x_start;
|
||||||
|
gPane.XD1 = x_end;
|
||||||
|
gPane.CurXD0 = gPane.XD0;
|
||||||
|
gPane.CurXD1 = gPane.XD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGridDistanceX(float grid_dist_x_samples)
|
||||||
|
{
|
||||||
|
gPane.grid_distance_x = grid_dist_x_samples;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGridOriginX(float off_x)
|
||||||
|
{
|
||||||
|
gPane.grid_off_x = off_x;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region PRIVATE METHODS
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
paused = true;
|
||||||
|
|
||||||
|
if (mTimer.IsRunning)
|
||||||
|
{
|
||||||
|
mTimer.Stop();
|
||||||
|
mTimer.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
if (isRunning == false && paused == false)
|
||||||
|
{
|
||||||
|
gPane.starting_idx = 0;
|
||||||
|
paused = false;
|
||||||
|
isRunning = true;
|
||||||
|
// mTimer.Start();
|
||||||
|
tb1.Buttons[0].ImageIndex = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (paused == false)
|
||||||
|
{
|
||||||
|
//mTimer.Stop();
|
||||||
|
paused = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// mTimer.Start();
|
||||||
|
paused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (paused)
|
||||||
|
{
|
||||||
|
|
||||||
|
tb1.Buttons[0].ImageIndex = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
tb1.Buttons[0].ImageIndex = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
if (isRunning)
|
||||||
|
{
|
||||||
|
// mTimer.Stop();
|
||||||
|
isRunning = false;
|
||||||
|
paused = false;
|
||||||
|
hScrollBar1.Value = 0;
|
||||||
|
tb1.Buttons[0].ImageIndex = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void tb1_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
|
||||||
|
{
|
||||||
|
bool pushed = e.Button.Pushed;
|
||||||
|
switch (e.Button.Tag.ToString().ToLower())
|
||||||
|
{
|
||||||
|
case "play":
|
||||||
|
|
||||||
|
Start();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "stop":
|
||||||
|
|
||||||
|
Stop();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "print":
|
||||||
|
|
||||||
|
// // todo implement print preview
|
||||||
|
ShowPrintPreview();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetPlayPanelVisible()
|
||||||
|
{
|
||||||
|
panel1.Visible = true;
|
||||||
|
tb1.Buttons[0].Visible = true;
|
||||||
|
tb1.Buttons[1].Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetPlayPanelInvisible()
|
||||||
|
{
|
||||||
|
panel1.Visible = false;
|
||||||
|
tb1.Buttons[0].Visible = false;
|
||||||
|
tb1.Buttons[1].Visible = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateControl()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool AllAutoscaled = true;
|
||||||
|
|
||||||
|
foreach (DataSource s in gPane.Sources)
|
||||||
|
{
|
||||||
|
AllAutoscaled &= s.AutoScaleX;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (AllAutoscaled == true)
|
||||||
|
{
|
||||||
|
if (panel1.Visible == true)
|
||||||
|
{
|
||||||
|
this.Invoke(new MethodInvoker(SetPlayPanelInvisible));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (panel1.Visible == false)
|
||||||
|
{
|
||||||
|
this.Invoke(new MethodInvoker(SetPlayPanelVisible));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdatePlayback()
|
||||||
|
{
|
||||||
|
if (!paused && isRunning == true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
gPane.starting_idx += play_speed;
|
||||||
|
UpdateScrollBar();
|
||||||
|
gPane.Invalidate();
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTimerTick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
UpdateControl();
|
||||||
|
|
||||||
|
UpdatePlayback();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateScrollBar()
|
||||||
|
{
|
||||||
|
if (InvokeRequired)
|
||||||
|
{
|
||||||
|
Invoke(new MethodInvoker(UpdateScrollBar));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (gPane.Sources.Count > 0)
|
||||||
|
{
|
||||||
|
if (gPane.starting_idx > gPane.Sources[0].Length)
|
||||||
|
{
|
||||||
|
hScrollBar1.Value = 10000;
|
||||||
|
}
|
||||||
|
else if (gPane.starting_idx >= 0)
|
||||||
|
{
|
||||||
|
hScrollBar1.Value = 10000 * (int)gPane.starting_idx / gPane.Sources[0].Length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hScrollBar1.Value = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hScrollBar1.Value = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnScrollbarScroll(object sender, ScrollEventArgs e)
|
||||||
|
{
|
||||||
|
if (gPane.Sources.Count > 0)
|
||||||
|
{
|
||||||
|
int val = hScrollBar1.Value;
|
||||||
|
gPane.starting_idx = (int)(gPane.Sources[0].Length * (float)val / 10000.0f);
|
||||||
|
gPane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnScrollBarSpeedScroll(object sender, ScrollEventArgs e)
|
||||||
|
{
|
||||||
|
float Percentage = hScrollBar2.Value / 10000.0f;
|
||||||
|
float delta = play_speed_max - play_speed_min;
|
||||||
|
play_speed = play_speed_min + Percentage * delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private void ShowPrintPreview()
|
||||||
|
{
|
||||||
|
if (printPreviewForm == null)
|
||||||
|
{
|
||||||
|
printPreviewForm = new PrintPreviewForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
printPreviewForm.GraphPanel = this.gPane;
|
||||||
|
printPreviewForm.Show();
|
||||||
|
printPreviewForm.TopMost = true;
|
||||||
|
printPreviewForm.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void selectGraphsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (GraphPropertiesForm == null)
|
||||||
|
{
|
||||||
|
GraphPropertiesForm = new PlotterGraphSelectCurvesForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
GraphPropertiesForm.GraphPanel = this.gPane;
|
||||||
|
GraphPropertiesForm.Show();
|
||||||
|
// GraphPropertiesForm.BringToFront();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
249
GraphLib/PlotterDisplayEx.designer.cs
generated
Normal file
249
GraphLib/PlotterDisplayEx.designer.cs
generated
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
partial class PlotterDisplayEx
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region Component Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlotterDisplayEx));
|
||||||
|
this.tb1 = new System.Windows.Forms.ToolBar();
|
||||||
|
this.tbbSave = new System.Windows.Forms.ToolBarButton();
|
||||||
|
this.tbbOpen = new System.Windows.Forms.ToolBarButton();
|
||||||
|
this.tbbSeparator3 = new System.Windows.Forms.ToolBarButton();
|
||||||
|
this.tbbPrint = new System.Windows.Forms.ToolBarButton();
|
||||||
|
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
|
||||||
|
this.imgList1 = new System.Windows.Forms.ImageList(this.components);
|
||||||
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.lb_Position = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.hScrollBar2 = new System.Windows.Forms.HScrollBar();
|
||||||
|
this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
|
||||||
|
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
|
this.selectGraphsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
this.panel1 = new System.Windows.Forms.Panel();
|
||||||
|
this.gPane = new GraphLib.PlotterGraphPaneEx();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.contextMenuStrip1.SuspendLayout();
|
||||||
|
this.panel1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// tb1
|
||||||
|
//
|
||||||
|
this.tb1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
|
||||||
|
this.tb1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
|
||||||
|
this.tbbSave,
|
||||||
|
this.tbbOpen,
|
||||||
|
this.tbbSeparator3,
|
||||||
|
this.tbbPrint,
|
||||||
|
this.toolBarButton2});
|
||||||
|
this.tb1.ButtonSize = new System.Drawing.Size(16, 16);
|
||||||
|
this.tb1.Divider = false;
|
||||||
|
this.tb1.Dock = System.Windows.Forms.DockStyle.None;
|
||||||
|
this.tb1.DropDownArrows = true;
|
||||||
|
this.tb1.ImageList = this.imgList1;
|
||||||
|
this.tb1.Location = new System.Drawing.Point(11, 5);
|
||||||
|
this.tb1.Name = "tb1";
|
||||||
|
this.tb1.ShowToolTips = true;
|
||||||
|
this.tb1.Size = new System.Drawing.Size(80, 26);
|
||||||
|
this.tb1.TabIndex = 1;
|
||||||
|
this.tb1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tb1_ButtonClick);
|
||||||
|
//
|
||||||
|
// tbbSave
|
||||||
|
//
|
||||||
|
this.tbbSave.ImageIndex = 0;
|
||||||
|
this.tbbSave.Name = "tbbSave";
|
||||||
|
this.tbbSave.Tag = "play";
|
||||||
|
//
|
||||||
|
// tbbOpen
|
||||||
|
//
|
||||||
|
this.tbbOpen.ImageIndex = 1;
|
||||||
|
this.tbbOpen.Name = "tbbOpen";
|
||||||
|
this.tbbOpen.Tag = "stop";
|
||||||
|
//
|
||||||
|
// tbbSeparator3
|
||||||
|
//
|
||||||
|
this.tbbSeparator3.Name = "tbbSeparator3";
|
||||||
|
this.tbbSeparator3.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
|
||||||
|
//
|
||||||
|
// tbbPrint
|
||||||
|
//
|
||||||
|
this.tbbPrint.ImageIndex = 3;
|
||||||
|
this.tbbPrint.Name = "tbbPrint";
|
||||||
|
this.tbbPrint.Tag = "print";
|
||||||
|
//
|
||||||
|
// toolBarButton2
|
||||||
|
//
|
||||||
|
this.toolBarButton2.Name = "toolBarButton2";
|
||||||
|
this.toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
|
||||||
|
//
|
||||||
|
// imgList1
|
||||||
|
//
|
||||||
|
this.imgList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList1.ImageStream")));
|
||||||
|
this.imgList1.TransparentColor = System.Drawing.Color.Transparent;
|
||||||
|
this.imgList1.Images.SetKeyName(0, "media-playback-start.png");
|
||||||
|
this.imgList1.Images.SetKeyName(1, "media-playback-stop.png");
|
||||||
|
this.imgList1.Images.SetKeyName(2, "media-playback-pause.png");
|
||||||
|
this.imgList1.Images.SetKeyName(3, "printer.png");
|
||||||
|
//
|
||||||
|
// splitContainer1
|
||||||
|
//
|
||||||
|
this.splitContainer1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||||
|
this.splitContainer1.IsSplitterFixed = true;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.tb1);
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.panel1);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.gPane);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(598, 339);
|
||||||
|
this.splitContainer1.SplitterDistance = 34;
|
||||||
|
this.splitContainer1.TabIndex = 2;
|
||||||
|
this.splitContainer1.TabStop = false;
|
||||||
|
//
|
||||||
|
// lb_Position
|
||||||
|
//
|
||||||
|
this.lb_Position.AutoSize = true;
|
||||||
|
this.lb_Position.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||||
|
this.lb_Position.Location = new System.Drawing.Point(6, 8);
|
||||||
|
this.lb_Position.Name = "lb_Position";
|
||||||
|
this.lb_Position.Size = new System.Drawing.Size(44, 13);
|
||||||
|
this.lb_Position.TabIndex = 3;
|
||||||
|
this.lb_Position.Text = "Position";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||||
|
this.label1.Location = new System.Drawing.Point(180, 8);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(85, 13);
|
||||||
|
this.label1.TabIndex = 2;
|
||||||
|
this.label1.Text = "Playback Speed";
|
||||||
|
//
|
||||||
|
// hScrollBar2
|
||||||
|
//
|
||||||
|
this.hScrollBar2.Location = new System.Drawing.Point(268, 10);
|
||||||
|
this.hScrollBar2.Maximum = 10000;
|
||||||
|
this.hScrollBar2.Name = "hScrollBar2";
|
||||||
|
this.hScrollBar2.Size = new System.Drawing.Size(111, 10);
|
||||||
|
this.hScrollBar2.TabIndex = 6;
|
||||||
|
this.hScrollBar2.Value = 1;
|
||||||
|
this.hScrollBar2.Scroll += new System.Windows.Forms.ScrollEventHandler(this.OnScrollBarSpeedScroll);
|
||||||
|
//
|
||||||
|
// hScrollBar1
|
||||||
|
//
|
||||||
|
this.hScrollBar1.Location = new System.Drawing.Point(57, 10);
|
||||||
|
this.hScrollBar1.Maximum = 10000;
|
||||||
|
this.hScrollBar1.Name = "hScrollBar1";
|
||||||
|
this.hScrollBar1.Size = new System.Drawing.Size(118, 10);
|
||||||
|
this.hScrollBar1.TabIndex = 4;
|
||||||
|
this.hScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.OnScrollbarScroll);
|
||||||
|
//
|
||||||
|
// contextMenuStrip1
|
||||||
|
//
|
||||||
|
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.selectGraphsToolStripMenuItem,
|
||||||
|
this.toolStripSeparator1});
|
||||||
|
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||||
|
this.contextMenuStrip1.Size = new System.Drawing.Size(117, 32);
|
||||||
|
//
|
||||||
|
// selectGraphsToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.selectGraphsToolStripMenuItem.Name = "selectGraphsToolStripMenuItem";
|
||||||
|
this.selectGraphsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
|
||||||
|
this.selectGraphsToolStripMenuItem.Text = "Options";
|
||||||
|
this.selectGraphsToolStripMenuItem.Click += new System.EventHandler(this.selectGraphsToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// toolStripSeparator1
|
||||||
|
//
|
||||||
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||||
|
this.toolStripSeparator1.Size = new System.Drawing.Size(113, 6);
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
this.panel1.Controls.Add(this.lb_Position);
|
||||||
|
this.panel1.Controls.Add(this.label1);
|
||||||
|
this.panel1.Controls.Add(this.hScrollBar1);
|
||||||
|
this.panel1.Controls.Add(this.hScrollBar2);
|
||||||
|
this.panel1.Location = new System.Drawing.Point(99, 3);
|
||||||
|
this.panel1.Name = "panel1";
|
||||||
|
this.panel1.Size = new System.Drawing.Size(496, 28);
|
||||||
|
this.panel1.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// gPane
|
||||||
|
//
|
||||||
|
this.gPane.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.gPane.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.gPane.Name = "gPane";
|
||||||
|
this.gPane.Size = new System.Drawing.Size(598, 301);
|
||||||
|
this.gPane.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// PlotterDisplayEx
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.ContextMenuStrip = this.contextMenuStrip1;
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.Name = "PlotterDisplayEx";
|
||||||
|
this.Size = new System.Drawing.Size(598, 339);
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel1.PerformLayout();
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.contextMenuStrip1.ResumeLayout(false);
|
||||||
|
this.panel1.ResumeLayout(false);
|
||||||
|
this.panel1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.ToolBar tb1;
|
||||||
|
private System.Windows.Forms.ToolBarButton tbbSeparator3;
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.ToolBarButton tbbSave;
|
||||||
|
private System.Windows.Forms.ToolBarButton tbbOpen;
|
||||||
|
private System.Windows.Forms.HScrollBar hScrollBar1;
|
||||||
|
private PlotterGraphPaneEx gPane;
|
||||||
|
private System.Windows.Forms.HScrollBar hScrollBar2;
|
||||||
|
private System.Windows.Forms.Label lb_Position;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
public System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem selectGraphsToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ImageList imgList1;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||||
|
private System.Windows.Forms.ToolBarButton tbbPrint;
|
||||||
|
private System.Windows.Forms.ToolBarButton toolBarButton2;
|
||||||
|
private System.Windows.Forms.Panel panel1;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
196
GraphLib/PlotterDisplayEx.resx
Normal file
196
GraphLib/PlotterDisplayEx.resx
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="imgList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<data name="imgList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>
|
||||||
|
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
|
||||||
|
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||||
|
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACO
|
||||||
|
DgAAAk1TRnQBSQFMAgEBBAEAAQwBAAEEAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
|
||||||
|
AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AKgADAQECwAABuAGV
|
||||||
|
AVEB/QHKAZgBWwH/AcoBlwFbAf8BygGXAVsB/wHKAZcBWwH/AcoBlwFaAf8ByQGXAVoB/wHJAZcBWgH/
|
||||||
|
AcoBmAFbAf8BuAGUAVEB/RQAAxQBHAMRARcDAgEDrAADTgGZA10B0gNOAf8BxwGVAVcB/wH5AfcB9gH/
|
||||||
|
AfkB8QHsAf8B+QHxAesB/wH4AfAB6QH/AfcB7QHmAf8B9AHqAeEB/wHyAegB3gH/AfoB+AH2Af8BxwGU
|
||||||
|
AVcB/wMaAf8DWAHRA0QBeggAAxUBHQFiAlgB6QM6AWEDDQESAwABASwAAxsBJgMbASYDGwEmAxsBJgMb
|
||||||
|
ASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmEAADGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEm
|
||||||
|
AxsBJgMbASYDGwEmAxsBJgMbASYIAANXAf0DpwH/A7UB/wOBAf8BrwGsAaoB/wHFAcABvQH/AcUBwAG9
|
||||||
|
Af8BxQHAAb0B/wHFAcABvQH/AcUBwAG9Af8BxQHAAb0B/wGtAaoBqAH/AyIB/wO1Af8DmwH/AxkB/wgA
|
||||||
|
AxUBHQNNAfoBPAIrAfwDXwHgAysBQgMNARIoAAMbASYBLAIrAfwBgAKBAf8BgAKBAf8BgAKBAf8BgAKB
|
||||||
|
Af8BgAKBAf8BgAKBAf8BgAKBAf8BgAKBAf8BgAKBAf8DGwEmEAADGwEmASwCKwH8AYACgQH/AYACgQH/
|
||||||
|
AYACgQH/AyMBNAMbASYBLAIrAfwBgAKBAf8BgAKBAf8BgAKBAf8DIwE0CAADZgH/A7UB/wO1Af8DlQH/
|
||||||
|
A4EB/wOBAf8DbwH/A2QB/wNXAf8DSAH/AzkB/wM4Af8DZAH/A7UB/wO1Af8DGwH/CAADFQEdAV8CSgH7
|
||||||
|
AfkB+gH5Af8DfwH+AV8BUwFSAfsDVQGyAx0BKgMIAQsgAAMbASYDQAH9IP8DQAH9AxsBJgMAAQEMAAMb
|
||||||
|
ASYDQAH9AfwB/QH8Bf8DQAH9AxsBJgMbASYDQAH9AfwB/QH8Bf8DQAH9AxsBJgMAAQEEAANrAf8DuwH/
|
||||||
|
A7sB/wONAf8D1AH/A7kB/wO5Af8DuQH/A7kB/wO5Af8DuQH/A9MB/wODAf8DuwH/A7sB/wMgAf8IAAMV
|
||||||
|
AR0DKwH8AfoC+wH/AfUC9gH/AfkC+gH/AT0BMAEvAfwBbQJRAfcDQgF2AxYBHgMFAQcYAAMbASYDQAH9
|
||||||
|
BP8B1QHbAdgB/wHUAdsB1wH/AdQB2wHYAf8B0wHbAdcB/wHRAdkB1QH/Ac8B1wHTBf8DQAH9AxsBJgMB
|
||||||
|
AQIMAAMbASYDQAH9AeIB5QHkAf8B2AHfAdwB/wNAAf0DGwEmAxsBJgNAAf0D8wH/AfcB+AH3Af8DQAH9
|
||||||
|
AxsBJgMBAQIEAANwAf8D1wH/A9cB/wOXAf8D2AH/A78B/wO/Af8DvwH/A78B/wO/Af8DvwH/A9cB/wOO
|
||||||
|
Af8D1wH/A9cB/wM1Af8IAAMWAR4DKwH8A/sB/wHTAdoB1wH/AdoB3wHcAf8B9gH3AfYB/wHyAvMB/wE8
|
||||||
|
AisB/AFgAlkB6wMzAVMDEgEZAwQBBRAAAxsBJgNAAf0E/wHaAeAB3QH/AdsB4QHeAf8B3QHiAeAB/wHd
|
||||||
|
AeIB4AH/AdsB4QHeAf8B2AHeAdsF/wNAAf0DGwEmAwEBAgwAAxsBJgNAAf0B4gHmAeQB/wHcAeIB3wH/
|
||||||
|
A0AB/QMbASYDGwEmA0AB/QHvAfEB8AH/AfAB8wHxAf8DQAH9AxsBJgMBAQIEAAN0Af8D+QH/A/kB/wOr
|
||||||
|
Af8D3wH/A8sB/wPLAf8DywH/A8sB/wPLAf8DywH/A98B/wOjAf8D+QH/A/kB/wNXAf8IAAMWAR4DKwH8
|
||||||
|
A/sB/wHfAeQB4QH/Ad4B4wHhAf8B3gHjAeAB/wHjAecB5QH/AfQC9QH/A38B/gGRAkAB/QNWAbYDJgE5
|
||||||
|
AxABFQwAAxsBJgNAAf0E/wHdAeMB4AH/AeEB5gHjAf8B5AHpAecB/wHmAeoB6AH/AeUB6QHnAf8B4gHn
|
||||||
|
AeQF/wNAAf0DGwEmAwEBAgwAAxsBJgNAAf0B5AHoAeUB/wHeAeMB4QH/A0AB/QMbASYDGwEmA0AB/QHs
|
||||||
|
Ae8B7gH/AecB6wHpAf8DQAH9AxsBJgMBAQIEAANqAfkD/AH/A/wB/wPLAf8D8gH/A/IB/wPyAf8D8gH/
|
||||||
|
A/IB/wPyAf8D8gH/A/IB/wPGAf8D/AH/A/wB/wNwAf4IAAMWAR4DKwH8A/sB/wHqAe4B7AH/AewB7wHu
|
||||||
|
Af8B7AHvAe4B/wHrAe4B7QH/AekB7AHrAf8DfwH+ATwCKwH8AVgCVgG7Ax0BKgMGAQgMAAMbASYDQAH9
|
||||||
|
BP8B3wHkAeEB/wHkAekB5gH/AeoB7QHrAf8B7gHxAe8B/wHvAfEB8AH/AewB7wHuBf8DQAH9AxsBJgMB
|
||||||
|
AQIMAAMbASYDQAH9AesB7QHsAf8B3QHjAeAB/wNAAf0DGwEmAxsBJgNAAf0B7QHwAe8B/wHfAeQB4QH/
|
||||||
|
A0AB/QMbASYDAQECBAADXQTSAf8D6AH/A3MB/wNzAf8DcwH/A3MB/wNzAf8DcwH/A3MB/wNzAf8DcwH/
|
||||||
|
A3MB/wPoAf8DxAH/A1wB3AgAAxYBHgMrAfwD+wH/AfUC9gH/AfoB+wH6Af8D+QH/Ad0C3gH/AWoCRwH5
|
||||||
|
A10B7QE6AjkBYAMNAREUAAMbASYDQAH9BP8B3AHiAd8B/wHkAegB5gH/AesB7gHtAf8B8gH0AfMB/wH3
|
||||||
|
AvgB/wH2AfgB9wX/A0AB/QMbASYDAQECDAADGwEmA0AB/QHyAfQB8wH/AdoB3wHdAf8DQAH9AxsBJgMc
|
||||||
|
ASgDQAH9AfMB9QH0Af8B1gHdAdkB/wNAAf0DGwEmAwEBAgQAAy0BRQOaAf8DzAH/AccBiwFEAf8B+QH0
|
||||||
|
Ae0B/wH+AegB2AH/Af4B6AHXAf8B/QHlAdMB/wH8AeQB0QH/AfoB4AHHAf8B+QHdAcMB/wH6AfQB7QH/
|
||||||
|
AccBhQFAAf8DwwH/A2oB/wMtAUUIAAMWAR4DKwH8A/sB/wHwAfMB8gH/AeYC6AH/A00B+gFiAlIB9AFR
|
||||||
|
Ak8BpQMUARwDAAEBGAADGwEmA0AB/QT/AdgB3wHcAf8B4AHlAeMB/wHoAesB6gH/Ae8B8gHwAf8B9wH4
|
||||||
|
AfcB/wP9Bf8DQAH9AxsBJgMBAQIMAAMbASYDQAH9A/wB/wHVAdsB2AH/A0AB/QMbASYDHAEoA0AB/QP8
|
||||||
|
Af8B0gHaAdYB/wNAAf0DGwEmAwEBAggAAzsBYwNsAfMBxQGJAUIB/wH5AfQB7wH/Af4B5wHXAf8B/QHn
|
||||||
|
AdUB/wH8AeYB0gH/AfsB4QHMAf8B+AHcAcIB/wH2AdoBvQH/AfoB9AHvAf8BxAGDAT4B/wNdAfMDOwFj
|
||||||
|
DAADFgEeAysB/AP7Af8BQQI0AfwDTQH6AVoCVwG9AxgBIgMCAQMgAAMbASYDQAH9IP8DQAH9AxsBJgMB
|
||||||
|
AQIMAAMbASYDQAH9CP8DQAH9AxsBJgMcASgDQAH9CP8DQAH9AxsBJgMBAQIMAAMHAQkBngF/AUcC+QH0
|
||||||
|
AfAB/wH8AeYB0wH/Af0B5wHTAf8B+wHjAc0B/wH6AeAByAH/AfUB1gG7Af8B8wHUAbUB/wH4AfQB8AH/
|
||||||
|
AZ0BawFHAfkDBwEJEAADFgEeA0AB/QFbAjIB+wFgAlwB1AMjATMDBwEKKAADGwEmAysB/AErAS8BLQH/
|
||||||
|
ASsBLwEtAf8BKwEvAS0B/wErAS8BLQH/ASsBLwEtAf8BKwEvAS0B/wErAS8BLQH/ASsBLwEtAf8BKwEv
|
||||||
|
AS0B/wMbASYDAQECDAADGwEmAWMBVwFVAf4BKwEvAS0B/wErAS8BLQH/ASsBLwEtAf8DGwEmAxwBKAFj
|
||||||
|
AVcBVQH+ASsBLwEtAf8BKwEvAS0B/wErAS8BLQH/AxsBJgMBAQIQAAGaAX8BUQH3AfkB9QHxAf8B/AHj
|
||||||
|
Ac8B/wH8AeQBzwH/AfoB4QHKAf8B+QHdAcQB/wH0AekB3wH/AfcB8gHsAf8B9QHvAekB/wGdAWIBRQH7
|
||||||
|
FAADFgEfAV4CWgHYAygBPQMNAREwAAMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMb
|
||||||
|
ASYDGwEmAxsBJgMAAQEMAAMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEmAxsBJgMbASYDGwEm
|
||||||
|
AxsBJgMAAQEQAAGQAXABSQH2AfkB9QHxAf8B/AHjAc0B/wH7AeMBzQH/AfkB4AHIAf8B+AHcAcIB/wH9
|
||||||
|
AfsB+AH/AfwB5gHNAf8B4gG2AYQB/wJUAVIBphQAAxYBHwMRARcDAgEDuAABogF3AU0B+gH3AfIB7AH/
|
||||||
|
AfgB9AHuAf8B+AHzAe0B/wH4AfMB7QH/AfgB8gHsAf8B8gHmAdcB/wHiAbIBcwH/AZcBdQFiAfYDBQEH
|
||||||
|
FAADAwEEwAADOgFgAlgBVgG7AbUBfwFPAf4ByAGMAUUB/wGaAYEBUQH3AZoBgQFRAfcBsgF/AUwB/gNO
|
||||||
|
AZQUAAFCAU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYAAQEWAAP/gQAB3wX/AeABBwHHBf8CAAHB
|
||||||
|
Af8BwAEDAcABAwIAAcAB/wHAAQMBwAEDAgABwAE/AcABAQHAAQECAAHAAQ8BwAEBAcABAQIAAcABAwHA
|
||||||
|
AQEBwAEBAgABwAEBAcABAQHAAQECAAHAAQEBwAEBAcABAQIAAcABBwHAAQEBwAEBAgABwAEPAcABAQHA
|
||||||
|
AQEBgAEBAcABPwHAAQEBwAEBAcABAwHAAf8BwAEBAcABAQHgAQcBwwH/AcABAQHAAQEB4AEHAccF/wHg
|
||||||
|
AQcB3wX/AeABHws=
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>84, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
||||||
46
GraphLib/PlotterGraphPaneEx.Designer.cs
generated
Normal file
46
GraphLib/PlotterGraphPaneEx.Designer.cs
generated
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
partial class PlotterGraphPaneEx
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Component Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// PlotterGraphPane
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Name = "PlotterGraphPane";
|
||||||
|
this.Size = new System.Drawing.Size(409, 150);
|
||||||
|
this.Load += new System.EventHandler(this.OnLoadControl);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
1062
GraphLib/PlotterGraphPaneEx.cs
Normal file
1062
GraphLib/PlotterGraphPaneEx.cs
Normal file
File diff suppressed because it is too large
Load Diff
120
GraphLib/PlotterGraphPaneEx.resx
Normal file
120
GraphLib/PlotterGraphPaneEx.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
365
GraphLib/PlotterGraphSelectCurvesForm.Designer.cs
generated
Normal file
365
GraphLib/PlotterGraphSelectCurvesForm.Designer.cs
generated
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
partial class PlotterGraphSelectCurvesForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.lb_Graphs = new System.Windows.Forms.CheckedListBox();
|
||||||
|
this.gB_SelectedGraph = new System.Windows.Forms.GroupBox();
|
||||||
|
this.cb_X_AutoScale = new System.Windows.Forms.CheckBox();
|
||||||
|
this.tb_GraphName = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.cbDownSampling = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.btn_GraphColor = new System.Windows.Forms.Button();
|
||||||
|
this.cb_Y_AutoScale = new System.Windows.Forms.CheckBox();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.bt_MinorGridColor = new System.Windows.Forms.Button();
|
||||||
|
this.bt_bg_col_bot = new System.Windows.Forms.Button();
|
||||||
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.bt_MajorGridColor = new System.Windows.Forms.Button();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.bt_bg_col_top = new System.Windows.Forms.Button();
|
||||||
|
this.btn_AutoScaleAll = new System.Windows.Forms.Button();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.cb_Layout = new System.Windows.Forms.ComboBox();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.gB_SelectedGraph.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// splitContainer1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.lb_Graphs);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.gB_SelectedGraph);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.button1);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(395, 431);
|
||||||
|
this.splitContainer1.SplitterDistance = 171;
|
||||||
|
this.splitContainer1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// lb_Graphs
|
||||||
|
//
|
||||||
|
this.lb_Graphs.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.lb_Graphs.FormattingEnabled = true;
|
||||||
|
this.lb_Graphs.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.lb_Graphs.Name = "lb_Graphs";
|
||||||
|
this.lb_Graphs.Size = new System.Drawing.Size(171, 424);
|
||||||
|
this.lb_Graphs.TabIndex = 0;
|
||||||
|
this.lb_Graphs.SelectedIndexChanged += new System.EventHandler(this.checkedListBox1_SelectedIndexChanged_1);
|
||||||
|
//
|
||||||
|
// gB_SelectedGraph
|
||||||
|
//
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.cb_X_AutoScale);
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.tb_GraphName);
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.label3);
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.cbDownSampling);
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.label2);
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.btn_GraphColor);
|
||||||
|
this.gB_SelectedGraph.Controls.Add(this.cb_Y_AutoScale);
|
||||||
|
this.gB_SelectedGraph.Location = new System.Drawing.Point(6, 232);
|
||||||
|
this.gB_SelectedGraph.Name = "gB_SelectedGraph";
|
||||||
|
this.gB_SelectedGraph.Size = new System.Drawing.Size(206, 158);
|
||||||
|
this.gB_SelectedGraph.TabIndex = 6;
|
||||||
|
this.gB_SelectedGraph.TabStop = false;
|
||||||
|
this.gB_SelectedGraph.Text = "Selected Graph Options";
|
||||||
|
this.gB_SelectedGraph.Visible = false;
|
||||||
|
//
|
||||||
|
// cb_X_AutoScale
|
||||||
|
//
|
||||||
|
this.cb_X_AutoScale.AutoSize = true;
|
||||||
|
this.cb_X_AutoScale.Location = new System.Drawing.Point(12, 102);
|
||||||
|
this.cb_X_AutoScale.Name = "cb_X_AutoScale";
|
||||||
|
this.cb_X_AutoScale.Size = new System.Drawing.Size(93, 17);
|
||||||
|
this.cb_X_AutoScale.TabIndex = 8;
|
||||||
|
this.cb_X_AutoScale.Text = "X AutoScaling";
|
||||||
|
this.cb_X_AutoScale.UseVisualStyleBackColor = true;
|
||||||
|
this.cb_X_AutoScale.CheckedChanged += new System.EventHandler(this.cb_X_AutoScale_CheckedChanged);
|
||||||
|
//
|
||||||
|
// tb_GraphName
|
||||||
|
//
|
||||||
|
this.tb_GraphName.Location = new System.Drawing.Point(12, 24);
|
||||||
|
this.tb_GraphName.Name = "tb_GraphName";
|
||||||
|
this.tb_GraphName.Size = new System.Drawing.Size(167, 20);
|
||||||
|
this.tb_GraphName.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(52, 133);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(76, 13);
|
||||||
|
this.label3.TabIndex = 6;
|
||||||
|
this.label3.Text = "Downsampling";
|
||||||
|
//
|
||||||
|
// cbDownSampling
|
||||||
|
//
|
||||||
|
this.cbDownSampling.FormattingEnabled = true;
|
||||||
|
this.cbDownSampling.Items.AddRange(new object[] {
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4",
|
||||||
|
"5",
|
||||||
|
"6"});
|
||||||
|
this.cbDownSampling.Location = new System.Drawing.Point(7, 130);
|
||||||
|
this.cbDownSampling.Name = "cbDownSampling";
|
||||||
|
this.cbDownSampling.Size = new System.Drawing.Size(39, 21);
|
||||||
|
this.cbDownSampling.TabIndex = 5;
|
||||||
|
this.cbDownSampling.Text = "1";
|
||||||
|
this.cbDownSampling.SelectedIndexChanged += new System.EventHandler(this.OnDownsamplingChanged);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(57, 55);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(63, 13);
|
||||||
|
this.label2.TabIndex = 4;
|
||||||
|
this.label2.Text = "Graph Color";
|
||||||
|
//
|
||||||
|
// btn_GraphColor
|
||||||
|
//
|
||||||
|
this.btn_GraphColor.Location = new System.Drawing.Point(11, 50);
|
||||||
|
this.btn_GraphColor.Name = "btn_GraphColor";
|
||||||
|
this.btn_GraphColor.Size = new System.Drawing.Size(26, 23);
|
||||||
|
this.btn_GraphColor.TabIndex = 3;
|
||||||
|
this.btn_GraphColor.UseVisualStyleBackColor = true;
|
||||||
|
this.btn_GraphColor.Click += new System.EventHandler(this.btn_GraphColor_Click);
|
||||||
|
//
|
||||||
|
// cb_Y_AutoScale
|
||||||
|
//
|
||||||
|
this.cb_Y_AutoScale.AutoSize = true;
|
||||||
|
this.cb_Y_AutoScale.Location = new System.Drawing.Point(12, 79);
|
||||||
|
this.cb_Y_AutoScale.Name = "cb_Y_AutoScale";
|
||||||
|
this.cb_Y_AutoScale.Size = new System.Drawing.Size(93, 17);
|
||||||
|
this.cb_Y_AutoScale.TabIndex = 2;
|
||||||
|
this.cb_Y_AutoScale.Text = "Y AutoScaling";
|
||||||
|
this.cb_Y_AutoScale.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.label7);
|
||||||
|
this.groupBox1.Controls.Add(this.label5);
|
||||||
|
this.groupBox1.Controls.Add(this.bt_MinorGridColor);
|
||||||
|
this.groupBox1.Controls.Add(this.bt_bg_col_bot);
|
||||||
|
this.groupBox1.Controls.Add(this.label6);
|
||||||
|
this.groupBox1.Controls.Add(this.bt_MajorGridColor);
|
||||||
|
this.groupBox1.Controls.Add(this.label4);
|
||||||
|
this.groupBox1.Controls.Add(this.bt_bg_col_top);
|
||||||
|
this.groupBox1.Controls.Add(this.btn_AutoScaleAll);
|
||||||
|
this.groupBox1.Controls.Add(this.label1);
|
||||||
|
this.groupBox1.Controls.Add(this.cb_Layout);
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(6, 5);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(206, 221);
|
||||||
|
this.groupBox1.TabIndex = 4;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "General Options";
|
||||||
|
//
|
||||||
|
// label7
|
||||||
|
//
|
||||||
|
this.label7.AutoSize = true;
|
||||||
|
this.label7.Location = new System.Drawing.Point(57, 194);
|
||||||
|
this.label7.Name = "label7";
|
||||||
|
this.label7.Size = new System.Drawing.Size(82, 13);
|
||||||
|
this.label7.TabIndex = 10;
|
||||||
|
this.label7.Text = "Minor Grid Color";
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(57, 136);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(128, 13);
|
||||||
|
this.label5.TabIndex = 8;
|
||||||
|
this.label5.Text = "Background Color Bottom";
|
||||||
|
//
|
||||||
|
// bt_MinorGridColor
|
||||||
|
//
|
||||||
|
this.bt_MinorGridColor.Location = new System.Drawing.Point(11, 189);
|
||||||
|
this.bt_MinorGridColor.Name = "bt_MinorGridColor";
|
||||||
|
this.bt_MinorGridColor.Size = new System.Drawing.Size(26, 23);
|
||||||
|
this.bt_MinorGridColor.TabIndex = 9;
|
||||||
|
this.bt_MinorGridColor.UseVisualStyleBackColor = true;
|
||||||
|
this.bt_MinorGridColor.Click += new System.EventHandler(this.bt_MinorGridColor_Click);
|
||||||
|
//
|
||||||
|
// bt_bg_col_bot
|
||||||
|
//
|
||||||
|
this.bt_bg_col_bot.Location = new System.Drawing.Point(11, 131);
|
||||||
|
this.bt_bg_col_bot.Name = "bt_bg_col_bot";
|
||||||
|
this.bt_bg_col_bot.Size = new System.Drawing.Size(26, 23);
|
||||||
|
this.bt_bg_col_bot.TabIndex = 7;
|
||||||
|
this.bt_bg_col_bot.UseVisualStyleBackColor = true;
|
||||||
|
this.bt_bg_col_bot.Click += new System.EventHandler(this.bt_bg_col_bot_Click);
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
this.label6.AutoSize = true;
|
||||||
|
this.label6.Location = new System.Drawing.Point(57, 165);
|
||||||
|
this.label6.Name = "label6";
|
||||||
|
this.label6.Size = new System.Drawing.Size(82, 13);
|
||||||
|
this.label6.TabIndex = 8;
|
||||||
|
this.label6.Text = "Major Grid Color";
|
||||||
|
//
|
||||||
|
// bt_MajorGridColor
|
||||||
|
//
|
||||||
|
this.bt_MajorGridColor.Location = new System.Drawing.Point(11, 160);
|
||||||
|
this.bt_MajorGridColor.Name = "bt_MajorGridColor";
|
||||||
|
this.bt_MajorGridColor.Size = new System.Drawing.Size(26, 23);
|
||||||
|
this.bt_MajorGridColor.TabIndex = 7;
|
||||||
|
this.bt_MajorGridColor.UseVisualStyleBackColor = true;
|
||||||
|
this.bt_MajorGridColor.Click += new System.EventHandler(this.bt_MajorGridColor_Click);
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(57, 107);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(114, 13);
|
||||||
|
this.label4.TabIndex = 6;
|
||||||
|
this.label4.Text = "Background Color Top";
|
||||||
|
//
|
||||||
|
// bt_bg_col_top
|
||||||
|
//
|
||||||
|
this.bt_bg_col_top.Location = new System.Drawing.Point(11, 102);
|
||||||
|
this.bt_bg_col_top.Name = "bt_bg_col_top";
|
||||||
|
this.bt_bg_col_top.Size = new System.Drawing.Size(26, 23);
|
||||||
|
this.bt_bg_col_top.TabIndex = 5;
|
||||||
|
this.bt_bg_col_top.UseVisualStyleBackColor = true;
|
||||||
|
this.bt_bg_col_top.Click += new System.EventHandler(this.bt_bg_col_top_Click);
|
||||||
|
//
|
||||||
|
// btn_AutoScaleAll
|
||||||
|
//
|
||||||
|
this.btn_AutoScaleAll.Location = new System.Drawing.Point(11, 69);
|
||||||
|
this.btn_AutoScaleAll.Name = "btn_AutoScaleAll";
|
||||||
|
this.btn_AutoScaleAll.Size = new System.Drawing.Size(167, 25);
|
||||||
|
this.btn_AutoScaleAll.TabIndex = 4;
|
||||||
|
this.btn_AutoScaleAll.Text = "Auto Scale All";
|
||||||
|
this.btn_AutoScaleAll.UseVisualStyleBackColor = true;
|
||||||
|
this.btn_AutoScaleAll.Click += new System.EventHandler(this.OnButtonAutoScallOnClicked);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(9, 26);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(39, 13);
|
||||||
|
this.label1.TabIndex = 3;
|
||||||
|
this.label1.Text = "Layout";
|
||||||
|
//
|
||||||
|
// cb_Layout
|
||||||
|
//
|
||||||
|
this.cb_Layout.FormattingEnabled = true;
|
||||||
|
this.cb_Layout.Items.AddRange(new object[] {
|
||||||
|
"Normal",
|
||||||
|
"Stacked",
|
||||||
|
"Tiles - Fill Vertical",
|
||||||
|
"Tiles - Fill Horizontal",
|
||||||
|
"Vertically"});
|
||||||
|
this.cb_Layout.Location = new System.Drawing.Point(11, 42);
|
||||||
|
this.cb_Layout.Name = "cb_Layout";
|
||||||
|
this.cb_Layout.Size = new System.Drawing.Size(168, 21);
|
||||||
|
this.cb_Layout.TabIndex = 2;
|
||||||
|
this.cb_Layout.Text = "Select";
|
||||||
|
this.cb_Layout.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(66, 396);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(68, 23);
|
||||||
|
this.button1.TabIndex = 0;
|
||||||
|
this.button1.Text = "Exit";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// PlotterGraphSelectCurvesForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(395, 431);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.MinimumSize = new System.Drawing.Size(16, 246);
|
||||||
|
this.Name = "PlotterGraphSelectCurvesForm";
|
||||||
|
this.Text = "Graph Properties";
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.gB_SelectedGraph.ResumeLayout(false);
|
||||||
|
this.gB_SelectedGraph.PerformLayout();
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.groupBox1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.CheckedListBox lb_Graphs;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.ComboBox cb_Layout;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Button btn_GraphColor;
|
||||||
|
private System.Windows.Forms.CheckBox cb_Y_AutoScale;
|
||||||
|
private System.Windows.Forms.Button btn_AutoScaleAll;
|
||||||
|
private System.Windows.Forms.GroupBox gB_SelectedGraph;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.ComboBox cbDownSampling;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Button bt_bg_col_top;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Button bt_bg_col_bot;
|
||||||
|
private System.Windows.Forms.Label label7;
|
||||||
|
private System.Windows.Forms.Button bt_MinorGridColor;
|
||||||
|
private System.Windows.Forms.Label label6;
|
||||||
|
private System.Windows.Forms.Button bt_MajorGridColor;
|
||||||
|
private System.Windows.Forms.TextBox tb_GraphName;
|
||||||
|
private System.Windows.Forms.CheckBox cb_X_AutoScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
369
GraphLib/PlotterGraphSelectCurvesForm.cs
Normal file
369
GraphLib/PlotterGraphSelectCurvesForm.cs
Normal file
@ -0,0 +1,369 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
|
||||||
|
/* Copyright (c) 2008-2014 DI Zimmermann Stephan (stefan.zimmermann@tele2.at)
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
public partial class PlotterGraphSelectCurvesForm : Form
|
||||||
|
{
|
||||||
|
private int selectetGraphIndex = -1;
|
||||||
|
|
||||||
|
private PlotterGraphPaneEx gpane = null;
|
||||||
|
|
||||||
|
public PlotterGraphSelectCurvesForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
FormClosing += new FormClosingEventHandler(OnFormClosing);
|
||||||
|
lb_Graphs.SelectedIndexChanged += new EventHandler(OnSelectedGraphIndexChanged);
|
||||||
|
VisibleChanged += new EventHandler(OnVisibleChanged);
|
||||||
|
tb_GraphName.TextChanged += new EventHandler(tb_GraphName_TextChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tb_GraphName_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
|
||||||
|
{
|
||||||
|
DataSource src = gpane.Sources[selectetGraphIndex];
|
||||||
|
String Text = tb_GraphName.Text;
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(Text) == false)
|
||||||
|
{
|
||||||
|
src.Name = Text;
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlotterGraphPaneEx GraphPanel
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
gpane = value;
|
||||||
|
if (gpane != null)
|
||||||
|
{
|
||||||
|
this.lb_Graphs.Items.Clear();
|
||||||
|
|
||||||
|
foreach (DataSource s in gpane.Sources)
|
||||||
|
{
|
||||||
|
if (s.Active)
|
||||||
|
{
|
||||||
|
this.lb_Graphs.Items.Add(s.Name, CheckState.Checked);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.lb_Graphs.Items.Add(s.Name, CheckState.Unchecked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateAllCheckedState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateAllCheckedState()
|
||||||
|
{
|
||||||
|
int AutoScaleOn = 0;
|
||||||
|
|
||||||
|
foreach (DataSource src in gpane.Sources)
|
||||||
|
{
|
||||||
|
if (src.AutoScaleY)
|
||||||
|
{
|
||||||
|
AutoScaleOn++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AutoScaleOn == 0)
|
||||||
|
{
|
||||||
|
btn_AutoScaleAll.Visible = true;
|
||||||
|
btn_AutoScaleAll.Text = "Auto Y-Scale all Graphs";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btn_AutoScaleAll.Visible = true;
|
||||||
|
btn_AutoScaleAll.Text = "Normal Y-Scale all Graphs";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnVisibleChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (this.Visible == true)
|
||||||
|
{
|
||||||
|
selectetGraphIndex = -1;
|
||||||
|
gB_SelectedGraph.Visible = false;
|
||||||
|
|
||||||
|
if (gpane != null)
|
||||||
|
{
|
||||||
|
UpdateAllCheckedState();
|
||||||
|
|
||||||
|
if (gpane.layout == PlotterGraphPaneEx.LayoutMode.NORMAL)
|
||||||
|
{
|
||||||
|
cb_Layout.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.STACKED)
|
||||||
|
{
|
||||||
|
cb_Layout.SelectedIndex = 1;
|
||||||
|
}
|
||||||
|
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.TILES_HOR)
|
||||||
|
{
|
||||||
|
cb_Layout.SelectedIndex = 2;
|
||||||
|
}
|
||||||
|
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.TILES_VER)
|
||||||
|
{
|
||||||
|
cb_Layout.SelectedIndex = 3;
|
||||||
|
}
|
||||||
|
else if (gpane.layout == PlotterGraphPaneEx.LayoutMode.VERTICAL_ARRANGED)
|
||||||
|
{
|
||||||
|
cb_Layout.SelectedIndex = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
bt_bg_col_top.BackColor = gpane.BgndColorTop;
|
||||||
|
bt_bg_col_bot.BackColor = gpane.BgndColorBot;
|
||||||
|
bt_MajorGridColor.BackColor = gpane.MajorGridColor;
|
||||||
|
bt_MinorGridColor.BackColor = gpane.MinorGridColor;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OnSelectedGraphIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (gpane != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < gpane.Sources.Count; i++)
|
||||||
|
{
|
||||||
|
if (lb_Graphs.CheckedIndices.Contains(i))
|
||||||
|
{
|
||||||
|
gpane.Sources[i].Active = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gpane.Sources[i].Active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnFormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
this.Hide();
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (cb_Layout.SelectedIndex == 0)
|
||||||
|
{
|
||||||
|
gpane.layout = PlotterGraphPaneEx.LayoutMode.NORMAL;
|
||||||
|
}
|
||||||
|
if (cb_Layout.SelectedIndex == 1)
|
||||||
|
{
|
||||||
|
gpane.layout = PlotterGraphPaneEx.LayoutMode.STACKED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cb_Layout.SelectedIndex == 2)
|
||||||
|
{
|
||||||
|
gpane.layout = PlotterGraphPaneEx.LayoutMode.TILES_VER;
|
||||||
|
}
|
||||||
|
if (cb_Layout.SelectedIndex == 3)
|
||||||
|
{
|
||||||
|
gpane.layout = PlotterGraphPaneEx.LayoutMode.TILES_HOR;
|
||||||
|
}
|
||||||
|
if (cb_Layout.SelectedIndex == 4)
|
||||||
|
{
|
||||||
|
gpane.layout = PlotterGraphPaneEx.LayoutMode.VERTICAL_ARRANGED;
|
||||||
|
}
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkedListBox1_SelectedIndexChanged_1(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
selectetGraphIndex = lb_Graphs.SelectedIndex;
|
||||||
|
|
||||||
|
UpdateSelectedGraphInfo();
|
||||||
|
gB_SelectedGraph.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateSelectedGraphInfo()
|
||||||
|
{
|
||||||
|
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
|
||||||
|
{
|
||||||
|
DataSource src = gpane.Sources[selectetGraphIndex];
|
||||||
|
btn_GraphColor.BackColor = src.GraphColor;
|
||||||
|
|
||||||
|
cb_Y_AutoScale.Checked = src.AutoScaleY;
|
||||||
|
cb_X_AutoScale.Checked = src.AutoScaleX;
|
||||||
|
|
||||||
|
cbDownSampling.SelectedIndex = (src.Downsampling - 1);
|
||||||
|
tb_GraphName.Text = src.Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btn_GraphColor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
|
||||||
|
{
|
||||||
|
DataSource src = gpane.Sources[selectetGraphIndex];
|
||||||
|
ColorDialog d = new ColorDialog();
|
||||||
|
if (d.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
btn_GraphColor.BackColor = d.Color;
|
||||||
|
src.GraphColor = d.Color;
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void OnButtonAutoScallOnClicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int AutoScaleOn = 0;
|
||||||
|
|
||||||
|
foreach (DataSource src in gpane.Sources)
|
||||||
|
{
|
||||||
|
if (src.AutoScaleY)
|
||||||
|
{
|
||||||
|
AutoScaleOn++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AutoScaleOn == 0)
|
||||||
|
{
|
||||||
|
btn_AutoScaleAll.Text = "Normal scale for all graphs";
|
||||||
|
foreach (DataSource src in gpane.Sources)
|
||||||
|
{
|
||||||
|
src.AutoScaleY = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btn_AutoScaleAll.Text = "Auto scale for all graphs";
|
||||||
|
foreach (DataSource src in gpane.Sources)
|
||||||
|
{
|
||||||
|
src.AutoScaleY = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateSelectedGraphInfo();
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDownsamplingChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
|
||||||
|
{
|
||||||
|
DataSource src = gpane.Sources[selectetGraphIndex];
|
||||||
|
|
||||||
|
src.Downsampling = (cbDownSampling.SelectedIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_bg_col_top_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ColorDialog d = new ColorDialog();
|
||||||
|
if (d.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
bt_bg_col_top.BackColor = d.Color;
|
||||||
|
gpane.BgndColorTop = d.Color;
|
||||||
|
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_bg_col_bot_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ColorDialog d = new ColorDialog();
|
||||||
|
if (d.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
bt_bg_col_bot.BackColor = d.Color;
|
||||||
|
gpane.BgndColorBot = d.Color;
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_MajorGridColor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ColorDialog d = new ColorDialog();
|
||||||
|
if (d.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
bt_MajorGridColor.BackColor = d.Color;
|
||||||
|
gpane.MajorGridColor = d.Color;
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_MinorGridColor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ColorDialog d = new ColorDialog();
|
||||||
|
if (d.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
bt_MinorGridColor.BackColor = d.Color;
|
||||||
|
gpane.MinorGridColor = d.Color;
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cb_Y_AutoScale_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
|
||||||
|
{
|
||||||
|
DataSource src = gpane.Sources[selectetGraphIndex];
|
||||||
|
|
||||||
|
src.AutoScaleY = cb_Y_AutoScale.Checked;
|
||||||
|
|
||||||
|
UpdateAllCheckedState();
|
||||||
|
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cb_X_AutoScale_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (selectetGraphIndex >= 0 && selectetGraphIndex < gpane.Sources.Count)
|
||||||
|
{
|
||||||
|
DataSource src = gpane.Sources[selectetGraphIndex];
|
||||||
|
|
||||||
|
src.AutoScaleX = cb_X_AutoScale.Checked;
|
||||||
|
|
||||||
|
UpdateAllCheckedState();
|
||||||
|
|
||||||
|
gpane.Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
GraphLib/PlotterGraphSelectCurvesForm.resx
Normal file
120
GraphLib/PlotterGraphSelectCurvesForm.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
490
GraphLib/PrecisionTimer.cs
Normal file
490
GraphLib/PrecisionTimer.cs
Normal file
@ -0,0 +1,490 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
#region License
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Based on the work of Leslie Sanford
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
namespace PrecisionTimer
|
||||||
|
{
|
||||||
|
public enum Mode
|
||||||
|
{
|
||||||
|
OneShot,
|
||||||
|
Periodic
|
||||||
|
};
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct TimerCaps
|
||||||
|
{
|
||||||
|
public int periodMin;
|
||||||
|
public int periodMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public sealed class Timer : IComponent
|
||||||
|
{
|
||||||
|
private delegate void TimeProc(int id, int msg, int user, int param1, int param2);
|
||||||
|
|
||||||
|
private delegate void EventRaiser(EventArgs e);
|
||||||
|
|
||||||
|
[DllImport("winmm.dll")]
|
||||||
|
private static extern int timeGetDevCaps(ref TimerCaps caps,
|
||||||
|
int sizeOfTimerCaps);
|
||||||
|
|
||||||
|
[DllImport("winmm.dll")]
|
||||||
|
private static extern int timeSetEvent(int delay,
|
||||||
|
int resolution,
|
||||||
|
TimeProc proc,
|
||||||
|
int user,
|
||||||
|
int mode);
|
||||||
|
|
||||||
|
[DllImport("winmm.dll")]
|
||||||
|
private static extern int timeKillEvent(int id);
|
||||||
|
|
||||||
|
private const int TIMERR_NOERROR = 0;
|
||||||
|
|
||||||
|
private int timerID;
|
||||||
|
|
||||||
|
private volatile Mode mode;
|
||||||
|
|
||||||
|
private volatile int period;
|
||||||
|
|
||||||
|
private volatile int resolution;
|
||||||
|
|
||||||
|
private TimeProc timeProcPeriodic;
|
||||||
|
|
||||||
|
private TimeProc timeProcOneShot;
|
||||||
|
|
||||||
|
private EventRaiser tickRaiser;
|
||||||
|
|
||||||
|
private bool running = false;
|
||||||
|
|
||||||
|
private volatile bool disposed = false;
|
||||||
|
|
||||||
|
private ISynchronizeInvoke synchronizingObject = null;
|
||||||
|
|
||||||
|
private ISite site = null;
|
||||||
|
|
||||||
|
private static TimerCaps caps;
|
||||||
|
|
||||||
|
public event EventHandler Started;
|
||||||
|
|
||||||
|
public event EventHandler Stopped;
|
||||||
|
|
||||||
|
public event EventHandler Tick;
|
||||||
|
|
||||||
|
static Timer()
|
||||||
|
{
|
||||||
|
// Get multimedia timer capabilities.
|
||||||
|
timeGetDevCaps(ref caps, Marshal.SizeOf(caps));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Timer(IContainer container)
|
||||||
|
{
|
||||||
|
|
||||||
|
container.Add(this);
|
||||||
|
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Timer()
|
||||||
|
{
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
~Timer()
|
||||||
|
{
|
||||||
|
if(IsRunning)
|
||||||
|
{
|
||||||
|
// Stop and destroy timer.
|
||||||
|
timeKillEvent(timerID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Initialize()
|
||||||
|
{
|
||||||
|
this.mode = Mode.Periodic;
|
||||||
|
this.period = Capabilities.periodMin;
|
||||||
|
this.resolution = 1;
|
||||||
|
|
||||||
|
running = false;
|
||||||
|
|
||||||
|
timeProcPeriodic = new TimeProc(TimerPeriodicEventCallback);
|
||||||
|
timeProcOneShot = new TimeProc(TimerOneShotEventCallback);
|
||||||
|
tickRaiser = new EventRaiser(OnTick);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IsRunning)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Mode == Mode.Periodic)
|
||||||
|
{
|
||||||
|
timerID = timeSetEvent(Period, Resolution, timeProcPeriodic, 0, (int)Mode);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
timerID = timeSetEvent(Period, Resolution, timeProcOneShot, 0, (int)Mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timerID != 0)
|
||||||
|
{
|
||||||
|
running = true;
|
||||||
|
|
||||||
|
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
|
||||||
|
{
|
||||||
|
SynchronizingObject.BeginInvoke(
|
||||||
|
new EventRaiser(OnStarted),
|
||||||
|
new object[] { EventArgs.Empty });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnStarted(EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new TimerException("Unable to start timer.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!running)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int result = timeKillEvent(timerID);
|
||||||
|
|
||||||
|
Debug.Assert(result == TIMERR_NOERROR);
|
||||||
|
|
||||||
|
running = false;
|
||||||
|
|
||||||
|
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
|
||||||
|
{
|
||||||
|
SynchronizingObject.BeginInvoke(
|
||||||
|
new EventRaiser(OnStopped),
|
||||||
|
new object[] { EventArgs.Empty });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnStopped(EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void TimerPeriodicEventCallback(int id, int msg, int user, int param1, int param2)
|
||||||
|
{
|
||||||
|
if(synchronizingObject != null)
|
||||||
|
{
|
||||||
|
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnTick(EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TimerOneShotEventCallback(int id, int msg, int user, int param1, int param2)
|
||||||
|
{
|
||||||
|
if(synchronizingObject != null)
|
||||||
|
{
|
||||||
|
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
|
||||||
|
Stop();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnTick(EventArgs.Empty);
|
||||||
|
Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Raises the Disposed event.
|
||||||
|
private void OnDisposed(EventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler handler = Disposed;
|
||||||
|
|
||||||
|
if(handler != null)
|
||||||
|
{
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Raises the Started event.
|
||||||
|
private void OnStarted(EventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler handler = Started;
|
||||||
|
|
||||||
|
if(handler != null)
|
||||||
|
{
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Raises the Stopped event.
|
||||||
|
private void OnStopped(EventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler handler = Stopped;
|
||||||
|
|
||||||
|
if(handler != null)
|
||||||
|
{
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Raises the Tick event.
|
||||||
|
private void OnTick(EventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler handler = Tick;
|
||||||
|
|
||||||
|
if(handler != null)
|
||||||
|
{
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the object used to marshal event-handler calls.
|
||||||
|
/// </summary>
|
||||||
|
public ISynchronizeInvoke SynchronizingObject
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
#region Require
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
return synchronizingObject;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
#region Require
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
synchronizingObject = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int Period
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
#region Require
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
return period;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
#region Require
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
else if(value < Capabilities.periodMin || value > Capabilities.periodMax)
|
||||||
|
{
|
||||||
|
throw new ArgumentOutOfRangeException("Period", value,
|
||||||
|
"Multimedia Timer period out of range.");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
period = value;
|
||||||
|
|
||||||
|
if(IsRunning)
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int Resolution
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
return resolution;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
else if(value < 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentOutOfRangeException("Resolution", value,
|
||||||
|
"timer resolution out of range.");
|
||||||
|
}
|
||||||
|
|
||||||
|
resolution = value;
|
||||||
|
|
||||||
|
if(IsRunning)
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mode Mode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
throw new ObjectDisposedException("Timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mode = value;
|
||||||
|
|
||||||
|
if(IsRunning)
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the Timer is running.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsRunning
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return running;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the timer capabilities.
|
||||||
|
/// </summary>
|
||||||
|
public static TimerCaps Capabilities
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return caps;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public event System.EventHandler Disposed;
|
||||||
|
|
||||||
|
public ISite Site
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return site;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
site = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(disposed)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IsRunning)
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
disposed = true;
|
||||||
|
|
||||||
|
OnDisposed(EventArgs.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TimerException : ApplicationException
|
||||||
|
{
|
||||||
|
public TimerException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
264
GraphLib/PrintPreviewForm.Designer.cs
generated
Normal file
264
GraphLib/PrintPreviewForm.Designer.cs
generated
Normal file
@ -0,0 +1,264 @@
|
|||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
partial class PrintPreviewForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.printPreviewCtrl = new System.Windows.Forms.PrintPreviewControl();
|
||||||
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.rb_Unscaled = new System.Windows.Forms.RadioButton();
|
||||||
|
this.rb_BestFit = new System.Windows.Forms.RadioButton();
|
||||||
|
this.rb_Scale = new System.Windows.Forms.RadioButton();
|
||||||
|
this.cb_PrintBackground = new System.Windows.Forms.CheckBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.cb_Printer = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.cb_Orientation = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.cb_PaperSize = new System.Windows.Forms.ComboBox();
|
||||||
|
this.bt_Cancel = new System.Windows.Forms.Button();
|
||||||
|
this.bt_print = new System.Windows.Forms.Button();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// printPreviewCtrl
|
||||||
|
//
|
||||||
|
this.printPreviewCtrl.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||||
|
this.printPreviewCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.printPreviewCtrl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.printPreviewCtrl.Name = "printPreviewCtrl";
|
||||||
|
this.printPreviewCtrl.Size = new System.Drawing.Size(453, 501);
|
||||||
|
this.printPreviewCtrl.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// splitContainer1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||||
|
this.splitContainer1.IsSplitterFixed = true;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.printPreviewCtrl);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.cb_PrintBackground);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.label3);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.cb_Printer);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.label2);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.cb_Orientation);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.label1);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.cb_PaperSize);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.bt_Cancel);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.bt_print);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(681, 501);
|
||||||
|
this.splitContainer1.SplitterDistance = 453;
|
||||||
|
this.splitContainer1.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.rb_Unscaled);
|
||||||
|
this.groupBox1.Controls.Add(this.rb_BestFit);
|
||||||
|
this.groupBox1.Controls.Add(this.rb_Scale);
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(18, 188);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(93, 93);
|
||||||
|
this.groupBox1.TabIndex = 12;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "Scaling";
|
||||||
|
//
|
||||||
|
// rb_Unscaled
|
||||||
|
//
|
||||||
|
this.rb_Unscaled.AutoSize = true;
|
||||||
|
this.rb_Unscaled.Location = new System.Drawing.Point(13, 19);
|
||||||
|
this.rb_Unscaled.Name = "rb_Unscaled";
|
||||||
|
this.rb_Unscaled.Size = new System.Drawing.Size(70, 17);
|
||||||
|
this.rb_Unscaled.TabIndex = 8;
|
||||||
|
this.rb_Unscaled.TabStop = true;
|
||||||
|
this.rb_Unscaled.Text = "Unscaled";
|
||||||
|
this.rb_Unscaled.UseVisualStyleBackColor = true;
|
||||||
|
this.rb_Unscaled.CheckedChanged += new System.EventHandler(this.rb_Unscaled_CheckedChanged);
|
||||||
|
//
|
||||||
|
// rb_BestFit
|
||||||
|
//
|
||||||
|
this.rb_BestFit.AutoSize = true;
|
||||||
|
this.rb_BestFit.Location = new System.Drawing.Point(13, 65);
|
||||||
|
this.rb_BestFit.Name = "rb_BestFit";
|
||||||
|
this.rb_BestFit.Size = new System.Drawing.Size(60, 17);
|
||||||
|
this.rb_BestFit.TabIndex = 6;
|
||||||
|
this.rb_BestFit.TabStop = true;
|
||||||
|
this.rb_BestFit.Text = "Best Fit";
|
||||||
|
this.rb_BestFit.UseVisualStyleBackColor = true;
|
||||||
|
this.rb_BestFit.CheckedChanged += new System.EventHandler(this.rb_BestFit_CheckedChanged);
|
||||||
|
//
|
||||||
|
// rb_Scale
|
||||||
|
//
|
||||||
|
this.rb_Scale.AutoSize = true;
|
||||||
|
this.rb_Scale.Location = new System.Drawing.Point(13, 42);
|
||||||
|
this.rb_Scale.Name = "rb_Scale";
|
||||||
|
this.rb_Scale.Size = new System.Drawing.Size(52, 17);
|
||||||
|
this.rb_Scale.TabIndex = 7;
|
||||||
|
this.rb_Scale.TabStop = true;
|
||||||
|
this.rb_Scale.Text = "Scale";
|
||||||
|
this.rb_Scale.UseVisualStyleBackColor = true;
|
||||||
|
this.rb_Scale.CheckedChanged += new System.EventHandler(this.rb_Scale_CheckedChanged);
|
||||||
|
//
|
||||||
|
// cb_PrintBackground
|
||||||
|
//
|
||||||
|
this.cb_PrintBackground.AutoSize = true;
|
||||||
|
this.cb_PrintBackground.Location = new System.Drawing.Point(22, 321);
|
||||||
|
this.cb_PrintBackground.Name = "cb_PrintBackground";
|
||||||
|
this.cb_PrintBackground.Size = new System.Drawing.Size(108, 17);
|
||||||
|
this.cb_PrintBackground.TabIndex = 11;
|
||||||
|
this.cb_PrintBackground.Text = "Print Background";
|
||||||
|
this.cb_PrintBackground.UseVisualStyleBackColor = true;
|
||||||
|
this.cb_PrintBackground.Visible = false;
|
||||||
|
this.cb_PrintBackground.CheckedChanged += new System.EventHandler(this.cb_PrintBackground_CheckedChanged);
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(19, 29);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(37, 13);
|
||||||
|
this.label3.TabIndex = 10;
|
||||||
|
this.label3.Text = "Printer";
|
||||||
|
//
|
||||||
|
// cb_Printer
|
||||||
|
//
|
||||||
|
this.cb_Printer.FormattingEnabled = true;
|
||||||
|
this.cb_Printer.Location = new System.Drawing.Point(18, 45);
|
||||||
|
this.cb_Printer.Name = "cb_Printer";
|
||||||
|
this.cb_Printer.Size = new System.Drawing.Size(195, 21);
|
||||||
|
this.cb_Printer.TabIndex = 9;
|
||||||
|
this.cb_Printer.SelectedIndexChanged += new System.EventHandler(this.cb_Printer_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(19, 134);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(58, 13);
|
||||||
|
this.label2.TabIndex = 5;
|
||||||
|
this.label2.Text = "Orientation";
|
||||||
|
//
|
||||||
|
// cb_Orientation
|
||||||
|
//
|
||||||
|
this.cb_Orientation.FormattingEnabled = true;
|
||||||
|
this.cb_Orientation.Items.AddRange(new object[] {
|
||||||
|
"Portrait",
|
||||||
|
"Landscape"});
|
||||||
|
this.cb_Orientation.Location = new System.Drawing.Point(18, 150);
|
||||||
|
this.cb_Orientation.Name = "cb_Orientation";
|
||||||
|
this.cb_Orientation.Size = new System.Drawing.Size(93, 21);
|
||||||
|
this.cb_Orientation.TabIndex = 4;
|
||||||
|
this.cb_Orientation.SelectedIndexChanged += new System.EventHandler(this.cb_Orientation_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(19, 81);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(58, 13);
|
||||||
|
this.label1.TabIndex = 3;
|
||||||
|
this.label1.Text = "Paper Size";
|
||||||
|
//
|
||||||
|
// cb_PaperSize
|
||||||
|
//
|
||||||
|
this.cb_PaperSize.FormattingEnabled = true;
|
||||||
|
this.cb_PaperSize.Location = new System.Drawing.Point(18, 97);
|
||||||
|
this.cb_PaperSize.Name = "cb_PaperSize";
|
||||||
|
this.cb_PaperSize.Size = new System.Drawing.Size(93, 21);
|
||||||
|
this.cb_PaperSize.TabIndex = 2;
|
||||||
|
this.cb_PaperSize.SelectedIndexChanged += new System.EventHandler(this.cb_PaperSize_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// bt_Cancel
|
||||||
|
//
|
||||||
|
this.bt_Cancel.Location = new System.Drawing.Point(118, 450);
|
||||||
|
this.bt_Cancel.Name = "bt_Cancel";
|
||||||
|
this.bt_Cancel.Size = new System.Drawing.Size(69, 26);
|
||||||
|
this.bt_Cancel.TabIndex = 1;
|
||||||
|
this.bt_Cancel.Text = "Cancel";
|
||||||
|
this.bt_Cancel.UseVisualStyleBackColor = true;
|
||||||
|
this.bt_Cancel.Click += new System.EventHandler(this.bt_Cancel_Click);
|
||||||
|
//
|
||||||
|
// bt_print
|
||||||
|
//
|
||||||
|
this.bt_print.Location = new System.Drawing.Point(22, 450);
|
||||||
|
this.bt_print.Name = "bt_print";
|
||||||
|
this.bt_print.Size = new System.Drawing.Size(69, 26);
|
||||||
|
this.bt_print.TabIndex = 0;
|
||||||
|
this.bt_print.Text = "Print";
|
||||||
|
this.bt_print.UseVisualStyleBackColor = true;
|
||||||
|
this.bt_print.Click += new System.EventHandler(this.bt_print_Click);
|
||||||
|
//
|
||||||
|
// PrintPreviewForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(681, 501);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.MaximumSize = new System.Drawing.Size(697, 537);
|
||||||
|
this.MinimumSize = new System.Drawing.Size(697, 537);
|
||||||
|
this.Name = "PrintPreviewForm";
|
||||||
|
this.Text = "PrintPreviewForm";
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.PerformLayout();
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.groupBox1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.PrintPreviewControl printPreviewCtrl;
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.Button bt_Cancel;
|
||||||
|
private System.Windows.Forms.Button bt_print;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.ComboBox cb_PaperSize;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.ComboBox cb_Orientation;
|
||||||
|
private System.Windows.Forms.RadioButton rb_Scale;
|
||||||
|
private System.Windows.Forms.RadioButton rb_BestFit;
|
||||||
|
private System.Windows.Forms.RadioButton rb_Unscaled;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.ComboBox cb_Printer;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.CheckBox cb_PrintBackground;
|
||||||
|
}
|
||||||
|
}
|
||||||
336
GraphLib/PrintPreviewForm.cs
Normal file
336
GraphLib/PrintPreviewForm.cs
Normal file
@ -0,0 +1,336 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Drawing.Printing;
|
||||||
|
|
||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
public partial class PrintPreviewForm : Form
|
||||||
|
{
|
||||||
|
private PrintDocument printDoc = new PrintDocument();
|
||||||
|
private PlotterGraphPaneEx gpane = null;
|
||||||
|
private String strDefaultPrinter = String.Empty;
|
||||||
|
|
||||||
|
private bool bBestScale = false;
|
||||||
|
private bool bPageScale = false;
|
||||||
|
private bool bUnscaled = false;
|
||||||
|
private bool bLandscape = false;
|
||||||
|
private int selPrinterIndex = -1;
|
||||||
|
|
||||||
|
public PrintPreviewForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
printPreviewCtrl.Zoom = 1;
|
||||||
|
rb_BestFit.Checked = true;
|
||||||
|
rb_Scale.Checked = false;
|
||||||
|
rb_Unscaled.Checked = false;
|
||||||
|
cb_Orientation.SelectedIndex = 0;
|
||||||
|
printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage);
|
||||||
|
this.VisibleChanged += new EventHandler(OnVisibleChanged);
|
||||||
|
FormClosing += new FormClosingEventHandler(OnFormClosing);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FillInInstalledPrinters()
|
||||||
|
{
|
||||||
|
strDefaultPrinter = printDoc.PrinterSettings.PrinterName;
|
||||||
|
cb_Printer.Items.Clear();
|
||||||
|
foreach (String strPrinter in PrinterSettings.InstalledPrinters)
|
||||||
|
{
|
||||||
|
cb_Printer.Items.Add(strPrinter);
|
||||||
|
|
||||||
|
if (strPrinter == strDefaultPrinter)
|
||||||
|
{
|
||||||
|
cb_Printer.SelectedIndex = cb_Printer.Items.IndexOf(strPrinter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnVisibleChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (this.Visible)
|
||||||
|
{
|
||||||
|
bLandscape = cb_Orientation.SelectedIndex == 1;
|
||||||
|
|
||||||
|
FillInInstalledPrinters();
|
||||||
|
|
||||||
|
FillInPaperSizes();
|
||||||
|
|
||||||
|
UpdateScaleRadioButtons();
|
||||||
|
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnFormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
this.Hide();
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateScaleRadioButtons()
|
||||||
|
{
|
||||||
|
bBestScale = rb_BestFit.Checked;
|
||||||
|
bPageScale = rb_Scale.Checked;
|
||||||
|
bUnscaled = rb_Unscaled.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
double AutoZoomPreview()
|
||||||
|
{
|
||||||
|
float zoom = 1.0f;
|
||||||
|
float step = 0.05f;
|
||||||
|
|
||||||
|
float PaperWidth = printDoc.DefaultPageSettings.PaperSize.Width;
|
||||||
|
float PaperHeight = printDoc.DefaultPageSettings.PaperSize.Height;
|
||||||
|
|
||||||
|
if (bLandscape)
|
||||||
|
{
|
||||||
|
PaperHeight = printDoc.DefaultPageSettings.PaperSize.Width * zoom;
|
||||||
|
PaperWidth = printDoc.DefaultPageSettings.PaperSize.Height * zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (zoom > 0.1f)
|
||||||
|
{
|
||||||
|
double CurW = PaperWidth * zoom;
|
||||||
|
double CurH = PaperHeight * zoom;
|
||||||
|
|
||||||
|
if (splitContainer1.Panel1.Width < (CurW+10) || splitContainer1.Panel1.Height < (CurH+10))
|
||||||
|
{
|
||||||
|
zoom -= step;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FillInPaperSizes()
|
||||||
|
{
|
||||||
|
cb_PaperSize.Items.Clear();
|
||||||
|
|
||||||
|
foreach (PaperSize s in printDoc.PrinterSettings.PaperSizes)
|
||||||
|
{
|
||||||
|
cb_PaperSize.Items.Add(s.PaperName.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cb_PaperSize.SelectedIndex == -1 || cb_PaperSize.SelectedIndex >= cb_PaperSize.Items.Count)
|
||||||
|
{
|
||||||
|
int idx = cb_PaperSize.Items.IndexOf(printDoc.DefaultPageSettings.PaperSize.PaperName);
|
||||||
|
|
||||||
|
if (idx >= 0 && idx < cb_PaperSize.Items.Count)
|
||||||
|
{
|
||||||
|
cb_PaperSize.SelectedIndex = idx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cb_PaperSize.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void InvalidatePrintPreview()
|
||||||
|
{
|
||||||
|
printDoc.DefaultPageSettings.Landscape = bLandscape;
|
||||||
|
printPreviewCtrl.Document = printDoc;
|
||||||
|
printPreviewCtrl.Document.DocumentName = "Preview";
|
||||||
|
printPreviewCtrl.Zoom = AutoZoomPreview();
|
||||||
|
printPreviewCtrl.InvalidatePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PlotterGraphPaneEx GraphPanel
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
gpane = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoScaleDocument(ref float w, ref float h, ref float x, ref float y)
|
||||||
|
{
|
||||||
|
float CurGraphWidth = gpane.Width;
|
||||||
|
float CurGraphHeight = gpane.Height;
|
||||||
|
float CurPaperWidth = printDoc.DefaultPageSettings.PaperSize.Width;
|
||||||
|
float CurPaperHeight = printDoc.DefaultPageSettings.PaperSize.Height;
|
||||||
|
|
||||||
|
if (bLandscape)
|
||||||
|
{
|
||||||
|
CurPaperWidth = printDoc.DefaultPageSettings.PaperSize.Height;
|
||||||
|
CurPaperHeight = printDoc.DefaultPageSettings.PaperSize.Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bUnscaled)
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bPageScale) // scale to page
|
||||||
|
{
|
||||||
|
CurGraphWidth = CurPaperWidth;
|
||||||
|
CurGraphHeight = CurPaperHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bBestScale) // scale to best fit
|
||||||
|
{
|
||||||
|
float zoom = 1.0f;
|
||||||
|
float step = 0.05f;
|
||||||
|
|
||||||
|
if (CurGraphWidth > (CurPaperWidth ) || CurGraphHeight > (CurPaperHeight ))
|
||||||
|
{
|
||||||
|
// scale down
|
||||||
|
while ((zoom * gpane.Width > CurPaperWidth || zoom * gpane.Height > CurPaperHeight) && zoom > step)
|
||||||
|
{
|
||||||
|
zoom -= step;
|
||||||
|
}
|
||||||
|
zoom -= step;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (CurGraphWidth < CurPaperWidth && CurGraphHeight < CurPaperHeight)
|
||||||
|
{
|
||||||
|
// scale up
|
||||||
|
while (((zoom+step) * gpane.Width < CurPaperWidth && (zoom+step) * gpane.Height < CurPaperHeight) && zoom > step)
|
||||||
|
{
|
||||||
|
zoom += step;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
CurGraphWidth = zoom * gpane.Width;
|
||||||
|
CurGraphHeight = zoom * gpane.Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
w = CurGraphWidth;
|
||||||
|
h = CurGraphHeight;
|
||||||
|
|
||||||
|
// center print
|
||||||
|
x = (CurPaperWidth - w) / 2.0f;
|
||||||
|
y = (CurPaperHeight - h) / 2.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printDoc_PrintPage(object sender, PrintPageEventArgs e)
|
||||||
|
{
|
||||||
|
if (gpane != null)
|
||||||
|
{
|
||||||
|
float x=0, y=0, w=gpane.Width, h=gpane.Height;
|
||||||
|
|
||||||
|
AutoScaleDocument(ref w, ref h, ref x, ref y);
|
||||||
|
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||||
|
//gpane.PaintControl(e.Graphics, w, h,x,y,cb_PrintBackground.Checked);
|
||||||
|
gpane.PaintControl(e.Graphics, w, h, x, y, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_print_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (printDoc != null)
|
||||||
|
{
|
||||||
|
printDoc.Print();
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_Cancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cb_PaperSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (cb_PaperSize.SelectedIndex >= 0 && cb_PaperSize.SelectedIndex < cb_PaperSize.Items.Count)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (PaperSize s in printDoc.PrinterSettings.PaperSizes)
|
||||||
|
{
|
||||||
|
if (s.PaperName == (string)cb_PaperSize.Items[cb_PaperSize.SelectedIndex])
|
||||||
|
{
|
||||||
|
printDoc.DefaultPageSettings.PaperSize = s;
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void rb_BestFit_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (rb_BestFit.Checked)
|
||||||
|
{
|
||||||
|
rb_Scale.Checked = !rb_BestFit.Checked;
|
||||||
|
rb_Unscaled.Checked = !rb_BestFit.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateScaleRadioButtons();
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void rb_Scale_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (rb_Scale.Checked)
|
||||||
|
{
|
||||||
|
rb_BestFit.Checked = !rb_Scale.Checked;
|
||||||
|
rb_Unscaled.Checked = !rb_Scale.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateScaleRadioButtons();
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void rb_Unscaled_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (rb_Unscaled.Checked)
|
||||||
|
{
|
||||||
|
rb_Scale.Checked = !rb_Unscaled.Checked;
|
||||||
|
rb_BestFit.Checked = !rb_Unscaled.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateScaleRadioButtons();
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cb_Printer_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
selPrinterIndex = cb_Printer.SelectedIndex;
|
||||||
|
|
||||||
|
if (selPrinterIndex >= 0 && selPrinterIndex < cb_Printer.Items.Count)
|
||||||
|
{
|
||||||
|
printDoc.PrinterSettings.PrinterName = (string)cb_Printer.Items[selPrinterIndex];
|
||||||
|
this.Text = "Print Preview - " + printDoc.PrinterSettings.PrinterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
FillInPaperSizes();
|
||||||
|
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cb_Orientation_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (cb_Orientation.SelectedIndex == 0)
|
||||||
|
{
|
||||||
|
bLandscape = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bLandscape = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cb_PrintBackground_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
InvalidatePrintPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
120
GraphLib/PrintPreviewForm.resx
Normal file
120
GraphLib/PrintPreviewForm.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
35
GraphLib/Properties/AssemblyInfo.cs
Normal file
35
GraphLib/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
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("GraphLibrary")]
|
||||||
|
[assembly: AssemblyDescription("Library for easy and simple graph drawing")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("GraphLibrary")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2008-2014 ZIMMERMANN STEPHAN")]
|
||||||
|
[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("b23e30ac-c4b8-4863-90d0-cf0ad837c050")]
|
||||||
|
|
||||||
|
// 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 Revision and Build Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
[assembly: AssemblyVersion("1.0.0.1")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.1")]
|
||||||
63
GraphLib/Properties/Resources.Designer.cs
generated
Normal file
63
GraphLib/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Dieser Code wurde von einem Tool generiert.
|
||||||
|
// Laufzeitversion:4.0.30319.18408
|
||||||
|
//
|
||||||
|
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
|
// der Code erneut generiert wird.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ClassLibrary1.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||||
|
/// </summary>
|
||||||
|
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||||
|
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||||
|
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||||
|
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClassLibrary1.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||||
|
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
GraphLib/Properties/Resources.resx
Normal file
120
GraphLib/Properties/Resources.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
45
GraphLib/Utils.cs
Normal file
45
GraphLib/Utils.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GraphLib
|
||||||
|
{
|
||||||
|
public class Utilities
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// returns the most significant decimal digit
|
||||||
|
/// 250 -> 100
|
||||||
|
/// 350 -> 100
|
||||||
|
/// 12 -> 10
|
||||||
|
/// 5 -> 1
|
||||||
|
/// 0.5 .> 0.1
|
||||||
|
/// .....
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Value"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
static public float MostSignificantDigit(float Value)
|
||||||
|
{
|
||||||
|
float n = 1;
|
||||||
|
|
||||||
|
float val_abs = Math.Abs(Value);
|
||||||
|
float sig = 1.0f * Math.Sign(Value);
|
||||||
|
|
||||||
|
if (val_abs > 1)
|
||||||
|
{
|
||||||
|
while (n < val_abs)
|
||||||
|
{
|
||||||
|
n *= 10.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (float)((int)(sig * n / 10));
|
||||||
|
}
|
||||||
|
else // n <= 1
|
||||||
|
{
|
||||||
|
while (n > val_abs)
|
||||||
|
{
|
||||||
|
n /= 10.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sig * n;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,9 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
# Visual Studio 2010
|
# Visual Studio 2010
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TestBenchFramework\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TestBenchFramework\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA} = {0C0A1F4D-1363-4544-A7C5-196C76D26CCA}
|
||||||
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "TBFSetup", "TBFSetup\TBFSetup.vdproj", "{4890DE5C-9F68-40D7-B075-92C8EAB79833}"
|
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "TBFSetup", "TBFSetup\TBFSetup.vdproj", "{4890DE5C-9F68-40D7-B075-92C8EAB79833}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -30,6 +33,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserManagement", "UserManag
|
|||||||
{743DF7DB-C7B6-42EB-986D-0F485E5588E4} = {743DF7DB-C7B6-42EB-986D-0F485E5588E4}
|
{743DF7DB-C7B6-42EB-986D-0F485E5588E4} = {743DF7DB-C7B6-42EB-986D-0F485E5588E4}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphLib", "GraphLib\GraphLib.csproj", "{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -126,6 +131,16 @@ Global
|
|||||||
{B2CD81B3-AF09-4978-996C-02EDB5F819B7}.Release|Mixed Platforms.Build.0 = Release|x86
|
{B2CD81B3-AF09-4978-996C-02EDB5F819B7}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||||
{B2CD81B3-AF09-4978-996C-02EDB5F819B7}.Release|x86.ActiveCfg = Release|x86
|
{B2CD81B3-AF09-4978-996C-02EDB5F819B7}.Release|x86.ActiveCfg = Release|x86
|
||||||
{B2CD81B3-AF09-4978-996C-02EDB5F819B7}.Release|x86.Build.0 = Release|x86
|
{B2CD81B3-AF09-4978-996C-02EDB5F819B7}.Release|x86.Build.0 = Release|x86
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
|
{0C0A1F4D-1363-4544-A7C5-196C76D26CCA}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.16.660.1")]
|
[assembly: AssemblyVersion("2.16.661.1")]
|
||||||
[assembly: AssemblyFileVersion("2.16.660.1")]
|
[assembly: AssemblyFileVersion("2.16.661.1")]
|
||||||
|
|||||||
38
TestBenchFramework/Screens/GraphsTabPageCtrl.cs
Normal file
38
TestBenchFramework/Screens/GraphsTabPageCtrl.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2017 Sensus Metering Systems
|
||||||
|
///
|
||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using TBF.Resources;
|
||||||
|
using TBF.UiBridge;
|
||||||
|
|
||||||
|
namespace TBF.Screens
|
||||||
|
{
|
||||||
|
public partial class GraphsTabPageCtrl : UserControl
|
||||||
|
{
|
||||||
|
public GraphsTabPageCtrl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
button1.Text = Strings.ClearBtnText;
|
||||||
|
|
||||||
|
Bridge.ProcessDataHandler += delegate(object sender, ProcessDataEventArgs args)
|
||||||
|
{
|
||||||
|
if (InvokeRequired)
|
||||||
|
{
|
||||||
|
Invoke(new EventHandler<ProcessDataEventArgs>(OnProcessData), sender, args);
|
||||||
|
}
|
||||||
|
else OnProcessData(sender, args);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
/// TODO: implement
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnProcessData(object sender, ProcessDataEventArgs args)
|
||||||
|
{
|
||||||
|
/// TODO: implement
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
79
TestBenchFramework/Screens/GraphsTabPageCtrl.designer.cs
generated
Normal file
79
TestBenchFramework/Screens/GraphsTabPageCtrl.designer.cs
generated
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
///
|
||||||
|
/// Copyright (c) 2017 Sensus Metering Systems
|
||||||
|
///
|
||||||
|
namespace TBF.Screens
|
||||||
|
{
|
||||||
|
partial class GraphsTabPageCtrl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Component Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GraphsTabPageCtrl));
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.splitContainer = new System.Windows.Forms.SplitContainer();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||||
|
this.splitContainer.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.button1, "button1");
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// splitContainer
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.splitContainer, "splitContainer");
|
||||||
|
this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||||
|
this.splitContainer.Name = "splitContainer";
|
||||||
|
//
|
||||||
|
// splitContainer.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.splitContainer.Panel1.Controls.Add(this.button1);
|
||||||
|
//
|
||||||
|
// GraphsTabPageCtrl
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this, "$this");
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.Silver;
|
||||||
|
this.Controls.Add(this.splitContainer);
|
||||||
|
this.Name = "GraphsTabPageCtrl";
|
||||||
|
this.splitContainer.Panel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
|
||||||
|
this.splitContainer.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer;
|
||||||
|
}
|
||||||
|
}
|
||||||
228
TestBenchFramework/Screens/GraphsTabPageCtrl.resx
Normal file
228
TestBenchFramework/Screens/GraphsTabPageCtrl.resx
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="button1.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Microsoft Sans Serif, 8.25pt</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="button1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||||
|
<value>NoControl</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>12, 34</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||||
|
<value>2, 2, 2, 2</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>42, 30</value>
|
||||||
|
</data>
|
||||||
|
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="button1.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="button1.Text" xml:space="preserve">
|
||||||
|
<value>&Btn1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.Name" xml:space="preserve">
|
||||||
|
<value>button1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer.Panel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>button1.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<data name="splitContainer.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||||
|
<value>Fill</value>
|
||||||
|
</data>
|
||||||
|
<data name="splitContainer.IsSplitterFixed" type="System.Boolean, mscorlib">
|
||||||
|
<value>True</value>
|
||||||
|
</data>
|
||||||
|
<data name="splitContainer.Location" type="System.Drawing.Point, System.Drawing">
|
||||||
|
<value>0, 0</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel1.Name" xml:space="preserve">
|
||||||
|
<value>splitContainer.Panel1</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel1.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel1.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel1.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel2.Name" xml:space="preserve">
|
||||||
|
<value>splitContainer.Panel2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel2.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel2.Parent" xml:space="preserve">
|
||||||
|
<value>splitContainer</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Panel2.ZOrder" xml:space="preserve">
|
||||||
|
<value>1</value>
|
||||||
|
</data>
|
||||||
|
<data name="splitContainer.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>965, 689</value>
|
||||||
|
</data>
|
||||||
|
<data name="splitContainer.SplitterDistance" type="System.Int32, mscorlib">
|
||||||
|
<value>65</value>
|
||||||
|
</data>
|
||||||
|
<data name="splitContainer.TabIndex" type="System.Int32, mscorlib">
|
||||||
|
<value>2</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Name" xml:space="preserve">
|
||||||
|
<value>splitContainer</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.Parent" xml:space="preserve">
|
||||||
|
<value>$this</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>splitContainer.ZOrder" xml:space="preserve">
|
||||||
|
<value>0</value>
|
||||||
|
</data>
|
||||||
|
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||||
|
<value>6, 13</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.Font" type="System.Drawing.Font, System.Drawing">
|
||||||
|
<value>Microsoft Sans Serif, 8.25pt</value>
|
||||||
|
</data>
|
||||||
|
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
|
<value>965, 689</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>$this.Name" xml:space="preserve">
|
||||||
|
<value>GraphsTabPageCtrl</value>
|
||||||
|
</data>
|
||||||
|
<data name=">>$this.Type" xml:space="preserve">
|
||||||
|
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
@ -58,7 +58,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
<OutputPath>bin\x86\Release\</OutputPath>
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
@ -1420,6 +1420,12 @@
|
|||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Strings.zh-CN.resx</DependentUpon>
|
<DependentUpon>Strings.zh-CN.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Screens\GraphsTabPageCtrl.cs">
|
||||||
|
<SubType>UserControl</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Screens\GraphsTabPageCtrl.designer.cs">
|
||||||
|
<DependentUpon>GraphsTabPageCtrl.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Screens\PicturesTabPageCtrl.cs">
|
<Compile Include="Screens\PicturesTabPageCtrl.cs">
|
||||||
<SubType>UserControl</SubType>
|
<SubType>UserControl</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -2327,6 +2333,9 @@
|
|||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Strings.zh-CN.Designer.cs</LastGenOutput>
|
<LastGenOutput>Strings.zh-CN.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Screens\GraphsTabPageCtrl.resx">
|
||||||
|
<DependentUpon>GraphsTabPageCtrl.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Screens\PicturesTabPageCtrl.resx">
|
<EmbeddedResource Include="Screens\PicturesTabPageCtrl.resx">
|
||||||
<DependentUpon>PicturesTabPageCtrl.cs</DependentUpon>
|
<DependentUpon>PicturesTabPageCtrl.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
@ -4,6 +4,8 @@ rmdir /s /q DeviceTest\bin
|
|||||||
rmdir /s /q DeviceTest\obj
|
rmdir /s /q DeviceTest\obj
|
||||||
rmdir /s /q Dirichlet.Numerics\bin
|
rmdir /s /q Dirichlet.Numerics\bin
|
||||||
rmdir /s /q Dirichlet.Numerics\obj
|
rmdir /s /q Dirichlet.Numerics\obj
|
||||||
|
rmdir /s /q GraphLib\bin
|
||||||
|
rmdir /s /q GraphLib\obj
|
||||||
rmdir /s /q Results\bin
|
rmdir /s /q Results\bin
|
||||||
rmdir /s /q Results\obj
|
rmdir /s /q Results\obj
|
||||||
rmdir /s /q ResultsBrowser\bin
|
rmdir /s /q ResultsBrowser\bin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user