Skip to content

Commit

Permalink
Merge 1.2.1.0 to master
Browse files Browse the repository at this point in the history
  • Loading branch information
TriggerAu committed Dec 24, 2014
2 parents 978a868 + 1d2a68f commit ef174d4
Show file tree
Hide file tree
Showing 29 changed files with 2,560 additions and 498 deletions.
Binary file added Images/PNG/img_buttonCalendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions KSPDateTimeUnitTests/KSPDateTimeUnitTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5EB393E9-C2DA-469B-AAC6-E89032EFB4D4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KSPDateTimeUnitTests</RootNamespace>
<AssemblyName>KSPDateTimeUnitTests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
</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" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TransferWindowPlanner\TransferWindowPlanner.csproj">
<Project>{942b92f0-c682-424e-814e-c2ddd1e84e2f}</Project>
<Name>TransferWindowPlanner</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 36 additions & 0 deletions KSPDateTimeUnitTests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("KSPDateTimeUnitTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KSPDateTimeUnitTests")]
[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("66da5f46-d647-407a-ab1e-e800f24ad604")]

// 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")]
132 changes: 132 additions & 0 deletions KSPDateTimeUnitTests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using System.Collections.Generic;

using TransferWindowPlanner;
using KSPPluginFramework;

namespace KSPDateTimeUnitTests
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestDateTime()
{
Double DateUT = 301.123;

KSPDateTime dt = new KSPDateTime(DateUT);

Assert.AreEqual(5, dt.Minute);
Assert.AreEqual(1, dt.Second);
Assert.AreEqual(123, dt.Millisecond);
Assert.AreEqual(0, dt.Hour);
Assert.AreEqual(1, dt.DayOfYear);
Assert.AreEqual(1, dt.Year);

dt = dt.AddMilliSeconds(456);
Assert.AreEqual(5, dt.Minute);
Assert.AreEqual(1, dt.Second);
Assert.AreEqual(579, dt.Millisecond);

dt = new KSPDateTime(2, 50, 0, 6, 8,456);
Assert.AreEqual(6, dt.Minute);
Assert.AreEqual(8, dt.Second);
Assert.AreEqual(456, dt.Millisecond);
Assert.AreEqual(2, dt.Year,"Hello");
Assert.AreEqual(50, dt.DayOfYear);

}

[TestMethod]
public void TestEarthDateTime()
{
KSPDateStructure.SetEarthCalendar();
Double DateUT = 301.123;
KSPDateTime dt = new KSPDateTime(DateUT);
//Console.Write(dt.Day);

Assert.AreEqual(5, dt.Minute);
Assert.AreEqual(1, dt.Second);
Assert.AreEqual(123, dt.Millisecond);
Assert.AreEqual(0, dt.Hour);
Assert.AreEqual(1, dt.DayOfYear);
Assert.AreEqual(1951, dt.Year);

dt = dt.AddMilliSeconds(456);
Assert.AreEqual(5, dt.Minute);
Assert.AreEqual(1, dt.Second);
Assert.AreEqual(579, dt.Millisecond);

//dt.Second = 68;
//Assert.AreEqual(6, dt.Minute);
//Assert.AreEqual(8, dt.Second);
//Assert.AreEqual(456, dt.Millisecond);


//dt.Year = 1969;
//Assert.AreEqual(1969, dt.Year, "Hello");
//dt.DayOfYear = 50;
//Assert.AreEqual(50, dt.DayOfYear);

//KSPDateTimeStructure.SetCalendarTypeEarth(1951,1,1);
//dt = new KSPDateTime(1951, 50, 10, 20, 30);
//Assert.AreEqual(2, dt.Month);
//Assert.AreEqual(19, dt.Day);

}


[TestMethod]
public void TestMonths()
{
KSPDateStructure.SetCustomCalendar();

//empty months structure
KSPDateTime dt = new KSPDateTime(1, 100);
Assert.AreEqual(0, dt.Month);
Assert.AreEqual(100, dt.Day);

//set up some months
KSPDateStructure.Months.Add(new KSPMonth("Billtember", 200));
KSPDateStructure.Months.Add(new KSPMonth("Jebuary", 265));

Assert.AreEqual(1, dt.Month);
Assert.AreEqual(100, dt.Day);
dt = dt.AddDays(100);
Assert.AreEqual(1, dt.Month);
Assert.AreEqual(200, dt.Day);
dt = dt.AddDays(100);
Assert.AreEqual(2, dt.Month);
dt = dt.AddDays(100);
}

[TestMethod]
public void TestFormats()
{
KSPDateTime dt = new KSPDateTime(1, 100);

KSPDateStructure.Months = new List<KSPMonth>();

Assert.AreEqual("100/00/0001", dt.ToString("dd/MM/yyyy"));

Assert.AreEqual("Year 1, Day 100 - 0h, 0m",dt.ToString());


KSPDateStructure.SetEarthCalendar();
Assert.AreEqual("25/01/1951", dt.ToString("dd/MM/yyyy"));


dt = new KSPDateTime(1951,100);
Assert.AreEqual("10/04/1951",dt.ToString("dd/MM/yyyy"));

Assert.AreEqual("Hello there 1951",String.Format("Hello there {0:yyyy}",dt));




}

}
}
6 changes: 3 additions & 3 deletions PluginBuilder/BuildKSPTWPFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if($ChoiceRtn -eq 0)
(Get-Content "$($DestFullPath)\$($PluginName)_$($VersionString)\ReadMe-$($PluginName).txt") |
ForEach-Object {$_ -replace "%VERSIONSTRING%",$VersionString} |
Set-Content "$($DestFullPath)\$($PluginName)_$($VersionString)\ReadMe-$($PluginName).txt"
Move-Item "$($DestFullPath)\$($PluginName)_$($VersionString)\ReadMe-$($PluginName).txt" "$($DestFullPath)\$($PluginName)_$($VersionString)\GameData\TriggerTech\$($PluginName)\"
Move-Item "$($DestFullPath)\$($PluginName)_$($VersionString)\ReadMe-$($PluginName).txt" "$($DestFullPath)\$($PluginName)_$($VersionString)\GameData\TriggerTech\"

#Copy the source files
"Copying Source..."
Expand All @@ -75,9 +75,9 @@ if($ChoiceRtn -eq 0)

# Now Zip it up

& "$($7ZipPath)" a "$($DestFullPath)\$($PluginName)_$($VersionString).zip" "$($DestFullPath)\$($PluginName)_$($VersionString)" -xr!"info.txt"
& "$($7ZipPath)" a "$($DestFullPath)\$($PluginName)_$($VersionString).zip" "$($DestFullPath)\$($PluginName)_$($VersionString)\GameData" -xr!"info.txt"
& "$($7ZipPath)" a "$($DestFullPath)\$($PluginName)_$($VersionString).zip" "$($DestFullPath)\$($PluginName)_$($VersionString)\info.txt"
& "$($7ZipPath)" a "$($DestFullPath)\$($PluginName)_$($VersionString).zip" "$($DestFullPath)\$($PluginName)_$($VersionString)\GameData\TriggerTech\ReadMe-$($PluginName).txt"
#& "$($7ZipPath)" a "$($DestFullPath)\$($PluginName)_$($VersionString).zip" "$($DestFullPath)\$($PluginName)_$($VersionString)\GameData\TriggerTech\ReadMe-$($PluginName).txt"
& "$($7ZipPath)" a "$($DestFullPath)\$($PluginName)Source_$($VersionString).zip" "$($DestFullPath)\$($PluginName)Source_$($VersionString)"
}

Expand Down
10 changes: 9 additions & 1 deletion PluginBuilder/PublishKSPTWP.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function CreateKerbalStuffRelease() {
{
"Updating Mod at KerbalStuff"
$File = get-item "$($UploadDir)\v$($Version)\$($pluginname)_$($Version).zip"
& $KerbalStuffWrapper updatemod /m:$KerbalStuffModID /u:"$KerbalStuffLogin" /p:"$KerbalStuffPW" /k:"$KSPVersion" /v:"$Version" /f:"$($File.FullName)" /l:"$relKStuff" /n:true
& $KerbalStuffWrapper updatemod /m:$KerbalStuffModID /u:"$KerbalStuffLogin" /p:"$KerbalStuffPW" /k:"$KerbalStuffKSPVersion" /v:"$Version" /f:"$($File.FullName)" /l:"$relKStuff" /n:true
}
}

Expand Down Expand Up @@ -234,6 +234,10 @@ if($ChoiceRtn -eq 0)

$relKStuff = $reldescr.Replace("\r\n","`r`n")

$KerbalStuffKSPVersion = $KSPVersion.Split(":")[1].Trim(" ")
if ($KerbalStuffKSPVersion.EndsWith(".0")){
$KerbalStuffKSPVersion = $KerbalStuffKSPVersion.Substring(0,$KerbalStuffKSPVersion.Length-2)
}

"GitHub Description:"
"-------------------"
Expand All @@ -243,6 +247,10 @@ if($ChoiceRtn -eq 0)
"-------------------"
"$($relKStuff)`r`n"

"KStuff KSPVersion:"
"-------------------"
"$($KerbalStuffKSPVersion)`r`n"

"Forum Info:"
"-------------------"
"$($ForumHeader)`r`n"
Expand Down
10 changes: 10 additions & 0 deletions PluginFiles/ReadMe-TransferWindowPlanner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ LICENSE
This work is licensed under an MIT license as outlined at the OSI site. Visit the documentation site for more details and Attribution

VERSION HISTORY
Version 1.2.1.0 - KSP Version: 0.90
- Reworked the storage of input values to remove issues (Issue #25)
- Redid Input Locks to resolve interface lockups (Issue #27)
- Added Calendar options so RSS can show Earth Dates for things
- Added Fly-By checkbox
- Restructured Zip File
- Made ToolbarIcon relative (Issue #28)
- Bunch of other small stuff
- Built and included KSPDateTime Library (Issue #24)

Version 1.1.3.0 - KSP Version: 0.90
- Recompiled for 0.90 and checked code stuff
- Fixed some issues with KAC Integration (Issue #23)
Expand Down
1 change: 1 addition & 0 deletions TransferWindowPlanner/DateAndTimeTests.playlist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<Playlist Version="1.0"><Add Test="KSPDateTimeUnitTests.UnitTest1.TestDateTime" /></Playlist>
Loading

0 comments on commit ef174d4

Please sign in to comment.