From 41a2c845693799584edc482bb3772a0b3e4a5001 Mon Sep 17 00:00:00 2001 From: dangorlov Date: Sun, 25 Nov 2018 17:57:59 +0300 Subject: [PATCH] Delete Telemachus Test --- Telemachus.sln | 15 -- TelemachusTest/App.config | 6 - TelemachusTest/Properties/AssemblyInfo.cs | 36 ----- .../Properties/Resources.Designer.cs | 63 -------- TelemachusTest/Properties/Resources.resx | 101 ------------- TelemachusTest/TelemachusTest.csproj | 137 ------------------ TelemachusTest/TelemachusTest.csproj.user | 19 --- TelemachusTest/src/DummyKSPAPI.cs | 50 ------- .../src/GenerateAPIDocumentation.cs | 92 ------------ TelemachusTest/src/Program.cs | 39 ----- TelemachusTest/src/TelemachusWebServerTest.cs | 48 ------ 11 files changed, 606 deletions(-) delete mode 100644 TelemachusTest/App.config delete mode 100644 TelemachusTest/Properties/AssemblyInfo.cs delete mode 100644 TelemachusTest/Properties/Resources.Designer.cs delete mode 100644 TelemachusTest/Properties/Resources.resx delete mode 100644 TelemachusTest/TelemachusTest.csproj delete mode 100644 TelemachusTest/TelemachusTest.csproj.user delete mode 100644 TelemachusTest/src/DummyKSPAPI.cs delete mode 100644 TelemachusTest/src/GenerateAPIDocumentation.cs delete mode 100644 TelemachusTest/src/Program.cs delete mode 100644 TelemachusTest/src/TelemachusWebServerTest.cs diff --git a/Telemachus.sln b/Telemachus.sln index 43d3a36..b922f0d 100644 --- a/Telemachus.sln +++ b/Telemachus.sln @@ -5,11 +5,6 @@ VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Telemachus", "Telemachus\Telemachus.csproj", "{AF7DF6B2-7D88-4399-92FC-E21EC15231DE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelemachusTest", "TelemachusTest\TelemachusTest.csproj", "{CA747DD4-ED3A-44D9-9866-4E0946138676}" - ProjectSection(ProjectDependencies) = postProject - {AF7DF6B2-7D88-4399-92FC-E21EC15231DE} = {AF7DF6B2-7D88-4399-92FC-E21EC15231DE} - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -30,16 +25,6 @@ Global {AF7DF6B2-7D88-4399-92FC-E21EC15231DE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {AF7DF6B2-7D88-4399-92FC-E21EC15231DE}.Release|Mixed Platforms.Build.0 = Release|Any CPU {AF7DF6B2-7D88-4399-92FC-E21EC15231DE}.Release|x86.ActiveCfg = Release|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Debug|x86.ActiveCfg = Debug|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Release|Any CPU.Build.0 = Release|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {CA747DD4-ED3A-44D9-9866-4E0946138676}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TelemachusTest/App.config b/TelemachusTest/App.config deleted file mode 100644 index d3d2996..0000000 --- a/TelemachusTest/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TelemachusTest/Properties/AssemblyInfo.cs b/TelemachusTest/Properties/AssemblyInfo.cs deleted file mode 100644 index 4c18077..0000000 --- a/TelemachusTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -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("TelemachusTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TelemachusTest")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("377cbcdc-1493-40d3-9226-0bbf6609a8bc")] - -// 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/TelemachusTest/Properties/Resources.Designer.cs b/TelemachusTest/Properties/Resources.Designer.cs deleted file mode 100644 index 5dbe8bd..0000000 --- a/TelemachusTest/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18444 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TelemachusTest.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [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() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [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("TelemachusTest.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/TelemachusTest/Properties/Resources.resx b/TelemachusTest/Properties/Resources.resx deleted file mode 100644 index 4fdb1b6..0000000 --- a/TelemachusTest/Properties/Resources.resx +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/TelemachusTest/TelemachusTest.csproj b/TelemachusTest/TelemachusTest.csproj deleted file mode 100644 index 3ce456e..0000000 --- a/TelemachusTest/TelemachusTest.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - - Debug - AnyCPU - {CA747DD4-ED3A-44D9-9866-4E0946138676} - Exe - Properties - TelemachusTest - TelemachusTest - v3.5 - 512 - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - False - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\KSPAssets.dll - - - - - - - - - False - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.Analytics.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.Networking.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.Timeline.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityScript.Lang.dll - - - - - True - True - Resources.resx - - - - - - - - - - - - - {af7df6b2-7d88-4399-92fc-e21ec15231de} - Telemachus - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - \ No newline at end of file diff --git a/TelemachusTest/TelemachusTest.csproj.user b/TelemachusTest/TelemachusTest.csproj.user deleted file mode 100644 index 16eeb8e..0000000 --- a/TelemachusTest/TelemachusTest.csproj.user +++ /dev/null @@ -1,19 +0,0 @@ - - - - GenerateAPIDocumentation - - - publish\ - - - - - - en-US - false - - - WebSocketServiceSubscriptionAndStream - - \ No newline at end of file diff --git a/TelemachusTest/src/DummyKSPAPI.cs b/TelemachusTest/src/DummyKSPAPI.cs deleted file mode 100644 index ba22055..0000000 --- a/TelemachusTest/src/DummyKSPAPI.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Telemachus; - -namespace TelemachusTest -{ - public class DummyKSPAPI : IKSPAPI - { - public DummyKSPAPI(FormatterProvider formatters, VesselChangeDetector vesselChangeDetector, - ServerConfiguration serverConfiguration) - { - APIHandlers.Add(new DummyHandler(formatters)); - } - - public override Vessel getVessel() - { - return null; - } - - public override object ProcessAPIString(string apistring) - { - throw new NotImplementedException(); - } - } - - public class DummyHandler : DataLinkHandler - { - Random r = new Random(DateTime.Now.Second); - - #region Initialisation - - public DummyHandler(FormatterProvider formatters) - : base(formatters) - { - registerAPI(new PlotableAPIEntry( - dataSources => { return r.NextDouble(); }, - "d.unitless", "Unitless", formatters.Default, APIEntry.UnitType.UNITLESS)); - registerAPI(new PlotableAPIEntry( - dataSources => { return r.NextDouble(); }, - "d.string", "String", formatters.Default, APIEntry.UnitType.STRING)); - registerAPI(new PlotableAPIEntry( - dataSources => { return r.NextDouble(); }, - "d.run", "String", formatters.Default, APIEntry.UnitType.UNITLESS)); - } - - #endregion - } -} diff --git a/TelemachusTest/src/GenerateAPIDocumentation.cs b/TelemachusTest/src/GenerateAPIDocumentation.cs deleted file mode 100644 index 7e3c677..0000000 --- a/TelemachusTest/src/GenerateAPIDocumentation.cs +++ /dev/null @@ -1,92 +0,0 @@ -//Author: Richard Bunt -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; -using Telemachus; - -namespace TelemachusTest -{ - class GenerateAPIDocumentation : ITest - { - public GenerateAPIDocumentation() - { - - } - - public void run() - { - ServerConfiguration config = new ServerConfiguration(); - Telemachus.VesselChangeDetector vesselChangeDetector = new Telemachus.VesselChangeDetector(false); - Telemachus.KSPAPI api = new Telemachus.KSPAPI(Telemachus.JSONFormatterProvider.Instance, vesselChangeDetector, config, null); - - List apiList = new List(); - api.getAPIList(ref apiList); - - writeToMarkdownWiki(Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName, "Telemachus.wiki"), - "API-String.md", ref apiList); - } - - private void writeToMarkdownWiki(string wikiPath, string fileName, ref List apiList) - { - MDFile file = new MDFile(Path.Combine(wikiPath, fileName)); - - string intro = "_API strings_ are used to identify values or functions within KSP, such as" + - "v.altitude which is mapped to the altitude of the vessel you are currently flying." + - "The API strings which are currently supported are listed below."; - - file.write(intro); - foreach (Telemachus.APIEntry apiEntry in apiList) - { - file.writeHeading(apiEntry.APIString); - file.writeBody(apiEntry.name); - file.writeBody(apiEntry.plotable ? "Plotable" : "Not Plotable"); - } - - file.close(); - } - } - - public class MDFile - { - private StreamWriter mdFile = null; - - private const string TITLE_MARKER = "# "; - private const string SUB_MARKER = "## "; - private const string SUB_SUB_MARKER = "### "; - - public MDFile(string fileName) - { - mdFile = new StreamWriter(fileName); - } - - public void close() - { - mdFile.Close(); - } - - public void writeTitle(string s) - { - mdFile.WriteLine(TITLE_MARKER + s); - } - - public void writeHeading(string s) - { - mdFile.WriteLine("\n" + SUB_SUB_MARKER + s); - } - - public void writeBody(string s) - { - mdFile.WriteLine("* " + s); - } - - public void write(string s) - { - mdFile.WriteLine(s); - } - - } -} diff --git a/TelemachusTest/src/Program.cs b/TelemachusTest/src/Program.cs deleted file mode 100644 index c4a05a4..0000000 --- a/TelemachusTest/src/Program.cs +++ /dev/null @@ -1,39 +0,0 @@ -//Author: Richard Bunt -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Text; - -namespace TelemachusTest -{ - class Program - { - static Dictionary tests = new Dictionary(); - - public static int Main(String[] args) - { - buildTests(); - - foreach (string s in args) - { - tests[s].run(); - } - - Console.Read(); - return 0; - } - - private static void buildTests() - { - tests["HTTPTimeTest"] = new HTTPTimeTest(500); - tests["GenerateAPIDocumentation"] = new GenerateAPIDocumentation(); - } - } - - public interface ITest - { - void run(); - } -} diff --git a/TelemachusTest/src/TelemachusWebServerTest.cs b/TelemachusTest/src/TelemachusWebServerTest.cs deleted file mode 100644 index ba93405..0000000 --- a/TelemachusTest/src/TelemachusWebServerTest.cs +++ /dev/null @@ -1,48 +0,0 @@ -//Author: Richard Bunt -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Text; - -namespace TelemachusTest -{ - class HTTPTimeTest : ITest - { - private int numberOfSamples = 0; - - public HTTPTimeTest(int numberOfSamples) - { - this.numberOfSamples = numberOfSamples; - } - - public void run() - { - Console.WriteLine("Starting time test: " + numberOfSamples); - Stopwatch timer = new Stopwatch(); - try - { - string address = string.Format( - "http://127.0.0.1:8085/telemachus/datalink?alt={0}", - Uri.EscapeDataString("v.altitude")); - string text; - using (WebClient client = new WebClient()) - { - timer.Start(); - for (int i = 0; i < numberOfSamples; i++) - { - text = client.DownloadString(address); - } - timer.Stop(); - } - - Console.WriteLine("Average request time: " + timer.ElapsedMilliseconds / ((double)(numberOfSamples)) + " milliseconds."); - } - catch (Exception d) - { - Console.WriteLine(d.Message); - } - } - } -}