diff --git a/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/.suo b/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/.suo index bdbcb34..0f1f400 100644 Binary files a/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/.suo and b/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/.suo differ diff --git a/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/Server/sqlite3/storage.ide b/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/Server/sqlite3/storage.ide index a1ec5a5..a9c123b 100644 Binary files a/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/Server/sqlite3/storage.ide and b/WindowsFormsApp01/.vs/WindowsFormsApp01/v16/Server/sqlite3/storage.ide differ diff --git a/WindowsFormsApp01/WindowsFormsApp01/Form1.Designer.cs b/WindowsFormsApp01/WindowsFormsApp01/Form1.Designer.cs index e587e43..49e0d87 100644 --- a/WindowsFormsApp01/WindowsFormsApp01/Form1.Designer.cs +++ b/WindowsFormsApp01/WindowsFormsApp01/Form1.Designer.cs @@ -41,6 +41,7 @@ this.button4 = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); + this.button5 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); @@ -173,6 +174,16 @@ this.label5.TabIndex = 12; this.label5.Text = "label5"; // + // button5 + // + this.button5.Location = new System.Drawing.Point(68, 396); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(75, 23); + this.button5.TabIndex = 13; + this.button5.Text = "store"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.Button5_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -180,6 +191,7 @@ this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.BackColor = System.Drawing.SystemColors.ActiveCaptionText; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.button5); this.Controls.Add(this.label5); this.Controls.Add(this.label4); this.Controls.Add(this.button4); @@ -221,6 +233,7 @@ private System.Windows.Forms.Button button4; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; + private System.Windows.Forms.Button button5; } } diff --git a/WindowsFormsApp01/WindowsFormsApp01/Form1.cs b/WindowsFormsApp01/WindowsFormsApp01/Form1.cs index dc14c34..db45617 100644 --- a/WindowsFormsApp01/WindowsFormsApp01/Form1.cs +++ b/WindowsFormsApp01/WindowsFormsApp01/Form1.cs @@ -76,12 +76,10 @@ namespace WindowsFormsApp01 var f = new CalcEventArgs(res); //trigger handler - // if (CalcFinished != null) - // { - CalcFinished(f); - // } - - + // if (CalcFinished != null) + // { + CalcFinished(f); + // } } @@ -91,11 +89,46 @@ namespace WindowsFormsApp01 Pen _pen = new ClassLibrary01.Class1().getPen(); + using (var p = _pen) + { + draw(graphics); + } + + Brush aBrush = (Brush) Brushes.Red; + + + for (int i = 10; i < (502); i++) + { + int y = (int) (246 - (((Math.Log(i) * 10) - 23) * _scale)); + + graphics.FillRectangle(aBrush, i, y, 2, 2); + } + } + + private void storeToFile() + { + Bitmap bmp = new Bitmap(100, 200); + + var graphics = Graphics.FromImage(bmp); + + draw(graphics); + + bmp.Save(@"C:\Temp\AI.png"); + } + + private void draw(Graphics graphics) + { + Pen _pen = new ClassLibrary01.Class1().getPen(); + + graphics.Clear(Color.Aqua); + + using (var p = _pen) { //y axis graphics.DrawLine(p, 10, 10, 10, 246); + //x axis graphics.DrawLine(p, 10, 246, 502, 246); @@ -107,19 +140,6 @@ namespace WindowsFormsApp01 graphics.DrawLine(p, 498, 241, 502, 246); graphics.DrawLine(p, 498, 251, 502, 246); } - - Brush aBrush = (Brush) Brushes.Red; - - - for (int i = 10; i < (502); i++) - { - int y = (int) (246 - (((Math.Log(i) * 10) - 23) * _scale)); - - graphics.FillRectangle(aBrush, i, y, 2, 2); - } - - - //graphics.DrawEllipse(new Pen(Color.Black), 70, 70, 30, 10); } private void Form1_Load(object sender, EventArgs e) @@ -204,11 +224,7 @@ namespace WindowsFormsApp01 } catch (Exception) { - - label4.Text = "Fehler"; - - } } @@ -216,6 +232,11 @@ namespace WindowsFormsApp01 { label4.Text = e.Result.ToString(); } + + private void Button5_Click(object sender, EventArgs e) + { + storeToFile(); + } } public class CalcEventArgs @@ -236,9 +257,6 @@ namespace WindowsFormsApp01 public static event CalcEventHandler CalcFinished; - - - public static void CalcIt() { int res = DateTime.Now.Second; diff --git a/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.exe b/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.exe index 2a047e8..7e3e7cc 100644 Binary files a/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.exe and b/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.exe differ diff --git a/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.pdb b/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.pdb index 0894f7a..947a95b 100644 Binary files a/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.pdb and b/WindowsFormsApp01/WindowsFormsApp01/bin/Debug/WindowsFormsApp01.pdb differ diff --git a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csproj.GenerateResource.cache b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csproj.GenerateResource.cache index a4d58a1..3199ccf 100644 Binary files a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csproj.GenerateResource.cache and b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csproj.GenerateResource.cache differ diff --git a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csprojAssemblyReference.cache b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csprojAssemblyReference.cache index 538f423..adc8293 100644 Binary files a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csprojAssemblyReference.cache and b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.csprojAssemblyReference.cache differ diff --git a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.exe b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.exe index 2a047e8..7e3e7cc 100644 Binary files a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.exe and b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.exe differ diff --git a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.pdb b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.pdb index 0894f7a..947a95b 100644 Binary files a/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.pdb and b/WindowsFormsApp01/WindowsFormsApp01/obj/Debug/WindowsFormsApp01.pdb differ diff --git a/winVCR/VCRlogic/SMvcr.cs b/winVCR/VCRlogic/SMvcr.cs index 292fa5d..b459fd4 100644 --- a/winVCR/VCRlogic/SMvcr.cs +++ b/winVCR/VCRlogic/SMvcr.cs @@ -201,6 +201,8 @@ public class SvcrPlay : StateVCR { Debug.Print("Play\n"); + + SMvcr.triggerUpdateLabel("Play"); SMvcr.evStopbutton += evStopbutton; diff --git a/winVCR/VCRlogicTests/Properties/AssemblyInfo.cs b/winVCR/VCRlogicTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a7124ae --- /dev/null +++ b/winVCR/VCRlogicTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VCRlogicTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("VCRlogicTests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2019")] +[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("368a9165-1e8f-4d98-b68f-84ce2a9baaed")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/winVCR/VCRlogicTests/SvcrPlayTests.cs b/winVCR/VCRlogicTests/SvcrPlayTests.cs new file mode 100644 index 0000000..5f8f4a5 --- /dev/null +++ b/winVCR/VCRlogicTests/SvcrPlayTests.cs @@ -0,0 +1,19 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tests +{ + [TestClass()] + public class SvcrPlayTests + { + [TestMethod()] + public void evStopbuttonTest() + { + Assert.IsTrue(true); + } + } +} \ No newline at end of file diff --git a/winVCR/VCRlogicTests/VCRlogicTests.csproj b/winVCR/VCRlogicTests/VCRlogicTests.csproj new file mode 100644 index 0000000..df3b56d --- /dev/null +++ b/winVCR/VCRlogicTests/VCRlogicTests.csproj @@ -0,0 +1,106 @@ + + + + + Debug + AnyCPU + {368A9165-1E8F-4D98-B68F-84CE2A9BAAED} + Library + Properties + VCRlogicTests + VCRlogicTests + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + + + + + + + + {74F418C8-F030-41C7-BA8D-8A9B57253E45} + VCRlogic + + + + + + + False + + + False + + + False + + + False + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/winVCR/VCRlogicTests/packages.config b/winVCR/VCRlogicTests/packages.config new file mode 100644 index 0000000..2f7c5a1 --- /dev/null +++ b/winVCR/VCRlogicTests/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/winVCR/winVCR.sln b/winVCR/winVCR.sln index d406c1f..1f30c3b 100644 --- a/winVCR/winVCR.sln +++ b/winVCR/winVCR.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "winVCR", "winVCR\winVCR.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCRlogic", "VCRlogic\VCRlogic.csproj", "{74F418C8-F030-41C7-BA8D-8A9B57253E45}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCRlogicTests", "VCRlogicTests\VCRlogicTests.csproj", "{368A9165-1E8F-4D98-B68F-84CE2A9BAAED}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {74F418C8-F030-41C7-BA8D-8A9B57253E45}.Debug|Any CPU.Build.0 = Debug|Any CPU {74F418C8-F030-41C7-BA8D-8A9B57253E45}.Release|Any CPU.ActiveCfg = Release|Any CPU {74F418C8-F030-41C7-BA8D-8A9B57253E45}.Release|Any CPU.Build.0 = Release|Any CPU + {368A9165-1E8F-4D98-B68F-84CE2A9BAAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {368A9165-1E8F-4D98-B68F-84CE2A9BAAED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {368A9165-1E8F-4D98-B68F-84CE2A9BAAED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {368A9165-1E8F-4D98-B68F-84CE2A9BAAED}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE