+ * Note: Goes CW from east (0) to south (PI/2) to west (PI) to north + * (PI*3/2), etc. + * + * @return the direction (in radians) + */ + public double getDirectionRAD() { + Point2D ep1 = center, ep2 = center; + if (connect1 != null) { + ep1 = layoutEditor.getCoords(connect1, getType1()); + } + if (connect2 != null) { + ep2 = layoutEditor.getCoords(connect2, getType2()); + } + return (Math.PI / 2.0) - MathUtil.computeAngleRAD(ep1, ep2); + } + + /** + * get the direction from end point 1 to 2 + *
+ * Note: Goes CW from east (0) to south (90) to west (180) to north (270), + * etc. + * + * @return the direction (in degrees) + */ + public double getDirectionDEG() { + return Math.toDegrees(getDirectionRAD()); + } + /** * Determine if we need to redraw a curved piece of track. Saves having to * recalculate the circle details each time. @@ -1042,8 +1074,8 @@ void changeType(int choice) { setCircle(true); setBezier(false); break; - case 2: - setArc(true); // arc + case 2: // arc + setArc(true); setAngle(90.0D); setCircle(false); setBezier(false); diff --git a/java/src/jmri/util/MathUtil.java b/java/src/jmri/util/MathUtil.java index 233da868421..438c1bbd2c7 100644 --- a/java/src/jmri/util/MathUtil.java +++ b/java/src/jmri/util/MathUtil.java @@ -451,6 +451,9 @@ public static double computeAngleDEG(@Nonnull Point2D p) { /** * compute the angle (direction in radians) from point 1 to point 2 + *
+ * Note: Goes CCW from south to east to north to west, etc. + * For JMRI subtract from PI/2 to get east, south, west, north * * @param p1 the first Point2D * @param p2 the second Point2D @@ -463,6 +466,9 @@ public static double computeAngleRAD(@Nonnull Point2D p1, @Nonnull Point2D p2) { /** * compute the angle (direction in degrees) from point 1 to point 2 + *
+ * Note: Goes CCW from south to east to north to west, etc.
+ * For JMRI subtract from 90.0 to get east, south, west, north
*
* @param p1 the first Point2D
* @param p2 the second Point2D
diff --git a/java/test/jmri/util/PipeListenerTest.java b/java/test/jmri/util/PipeListenerTest.java
index c7c13a3954a..cf1e92cfd9d 100644
--- a/java/test/jmri/util/PipeListenerTest.java
+++ b/java/test/jmri/util/PipeListenerTest.java
@@ -34,6 +34,7 @@ public void testWrite() throws java.io.IOException {
wr.write("Test String");
wr.flush();
jmri.util.JUnitUtil.waitFor(()->{return !(pr.ready());},"buffer empty");
+ new org.netbeans.jemmy.QueueTool().waitEmpty(100); // pause to let the JTextArea catch up.
Assert.assertEquals("text after character write","Test String",jta.getText());
t.stop();
}
diff --git a/release.properties b/release.properties
index e6be616f412..52f41ecc330 100644
--- a/release.properties
+++ b/release.properties
@@ -1,11 +1,11 @@
-#Mon, 20 Nov 2017 06:46:15 -0800
+#Tue, 05 Dec 2017 05:46:38 -0800
# Changes to this file are to be checked in by JMRI release pumpkins only
#
# these are the numbers for the NEXT release from this branch
release.major=4
release.minor=9
-release.build=7
+release.build=8
# additional release descriptor for a long-running expermimental difference
# from what is produced by building JMRI/master (e.g. "pjc"). Should not contain
diff --git a/scripts/HOWTO-distribution.md b/scripts/HOWTO-distribution.md
index 1f81c3513ba..13643a5bc28 100644
--- a/scripts/HOWTO-distribution.md
+++ b/scripts/HOWTO-distribution.md
@@ -60,7 +60,7 @@ If you're attempting to perform this on MS Windows, refer to the MS Windows note
- Update this note by (details in the update-HOWTO.sh comments; arguments when you run it should be last release, this release you're making, the next release; you may need to update):
```
- ./scripts/update-HOWTO.sh 4.9.6 4.9.7 4.9.8
+ ./scripts/update-HOWTO.sh 4.9.7 4.9.8 4.9.9
```
(and then manually update that line above to be last version release, this version being made today, next version to be made later; i.e. when starting to do *.4, the arguments are *.3 *.4 *.5)
@@ -155,7 +155,7 @@ We roll some general code maintenance items into the release process. They can
- If you fixed anything, commit it back. Also commit the current copy of these notes. Push directly back to master on GitHub.
```
-git commit -m"for 4.9.6" scripts/HOWTO-distribution.md
+git commit -m"for 4.9.7" scripts/HOWTO-distribution.md
git push github
```
@@ -172,13 +172,13 @@ git push github
```
cd (local web copy)/releasenotes
git pull
- cp jmri4.9.6.shtml jmri4.9.7.shtml
+ cp jmri4.9.7.shtml jmri4.9.8.shtml
(edit the new release note accordingly)
change numbers throughout
move new warnings to old
remove old-version change notes
- git add jmri4.9.6.shtml
- git commit -m"start new 4.9.7 release note" jmri4.9.7.shtml
+ git add jmri4.9.8.shtml
+ git commit -m"start new 4.9.8 release note" jmri4.9.8.shtml
git push github
cd (local JMRI copy)
```
@@ -213,13 +213,13 @@ where the date at the end should be the date (and optionally time) of the last r
- Put the following comment in the release GitHub item saying the branch exists, and all future changes should be documented in the new release note:
```
-The release-4.9.6 branch has been created.
+The release-4.9.7 branch has been created.
-From now on, please document your changes in the [jmri4.9.7.shtml](https://github.com/JMRI/website/blob/master/releasenotes/jmri4.9.7.shtml) release note file.
+From now on, please document your changes in the [jmri4.9.8.shtml](https://github.com/JMRI/website/blob/master/releasenotes/jmri4.9.8.shtml) release note file.
-Maintainers, please set the 4.9.7 milestone on pulls from now on, as that will be the next test release from the HEAD of the master branch.
+Maintainers, please set the 4.9.8 milestone on pulls from now on, as that will be the next test release from the HEAD of the master branch.
-Jenkins will be creating files shortly at the [CI server](http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.6/)
+Jenkins will be creating files shortly at the [CI server](http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.7/)
````
================================================================================
@@ -248,11 +248,11 @@ Jenkins will be creating files shortly at the [CI server](http://jmri.tagadab.co
- Change the release note to point to the just-built files (in CI or where you put them), commit, wait (or force via ["Build Now"](http://jmri.tagadab.com/jenkins/job/Web%20Site/job/Website%20from%20JMRI%20GitHub%20website%20repository/) update). Confirm visible on web.
-- Announce the file set via email to jmri-developers@lists.sf.net with a subject line "First 4.9.6 files available":
+- Announce the file set via email to jmri-developers@lists.sf.net with a subject line "First 4.9.7 files available":
-First JMRI 4.9.6 files are available in the usual way at:
+First JMRI 4.9.7 files are available in the usual way at:
-http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.6
+http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.7
Feedback appreciated. I would like to release this later today or tomorrow morning.
@@ -263,7 +263,7 @@ Feedback appreciated. I would like to release this later today or tomorrow morni
If anybody wants to add a change from here on in, they should
-- Ideally, start the work on either the release-4.9.6 branch (if working after that was started) or on a branch-from-master that's _before_ the release-4.9.6 branch was created. That way, the change can be cleanly included in the release branch, and also directly onto master.
+- Ideally, start the work on either the release-4.9.7 branch (if working after that was started) or on a branch-from-master that's _before_ the release-4.9.7 branch was created. That way, the change can be cleanly included in the release branch, and also directly onto master.
- Commit their changes to that branch, and push as needed to get it to their GitHub fork.
@@ -271,7 +271,7 @@ If anybody wants to add a change from here on in, they should
- One to master, as usual
- - One to the release branch e.g. "release-4.9.6". The comment on this PR should explain why this should be included instead of waiting for the next release.
+ - One to the release branch e.g. "release-4.9.7". The comment on this PR should explain why this should be included instead of waiting for the next release.
Merging the PR to the master makes those changes available on further developments forever; the one on the release, if accepted, includes the change and kicks off new runs of the various CI and build jobs.
@@ -279,7 +279,7 @@ If anybody wants to add a change from here on in, they should
If somebody has merged their change into master (or it's branched from master later than the release tag), you have two choices:
-- Merge master into the release-4.9.6 branch. This will bring _everything_ that's been merged in, so remember to update the version markers on those PRs. Effectively, you've just started the release process later. Note that the `release.properties` file will have the wrong minor number in it: You'll have to edit and commit that to get the right number in the release.
+- Merge master into the release-4.9.7 branch. This will bring _everything_ that's been merged in, so remember to update the version markers on those PRs. Effectively, you've just started the release process later. Note that the `release.properties` file will have the wrong minor number in it: You'll have to edit and commit that to get the right number in the release.
- `git cherrypick` just the changes you want. Read the documentation on that command carefully and double check your work. If possible, check the contents of the release branch on the GitHub web site to make sure only the changes you wanted were included.
@@ -311,13 +311,13 @@ This step uploads the Linux, Mac OS X and Windows files to the SourceForge file
(replace "user" below with your SourceForge.net user name; must have SSH keys for SourceForge.net set up)
- - (The "./testrelease 4.9.6" local script on shell.sf.net does the following steps, except for the edit, of course)
+ - (The "./testrelease 4.9.7" local script on shell.sf.net does the following steps, except for the edit, of course)
```
ssh user,jmri@shell.sf.net create
ssh user,jmri@shell.sf.net
- curl -o release.zip "http://jmri.tagadab.com/jenkins/job/Test%20Releases/job/4.9.6/ws/dist/release/*zip*/release.zip"
+ curl -o release.zip "http://jmri.tagadab.com/jenkins/job/Test%20Releases/job/4.9.7/ws/dist/release/*zip*/release.zip"
(use the following instead if building on second Jenkins server)
- curl -o release.zip "http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.6/ws/dist/release/*zip*/release.zip"
+ curl -o release.zip "http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.7/ws/dist/release/*zip*/release.zip"
rm release/JMRI*
unzip release.zip
cd release
@@ -366,28 +366,28 @@ Note: Unlike releasing files to SourceForge, once a GitHub Release is created it
- Fill out form:
- - "tag version field" gets v4.9.6 (e.g. leading lower-case "v")
- - @ branch: select the release-4.9.6 release branch
+ - "tag version field" gets v4.9.7 (e.g. leading lower-case "v")
+ - @ branch: select the release-4.9.7 release branch
```
-"Release title" field gets "Test/Prod Release 4.9.6"
+"Release title" field gets "Test/Prod Release 4.9.7"
```
- Description content (the testrelease script above proposed this!):
```
-[Release notes](http://jmri.org/releasenotes/jmri4.9.6.shtml)
+[Release notes](http://jmri.org/releasenotes/jmri4.9.7.shtml)
Checksums:
File | SHA256 checksum
---|---
-[JMRI.4.9.6.Re5a0179.dmg](https://github.com/JMRI/JMRI/releases/download/v4.9.6/JMRI.4.9.6.Re5a0179.dmg) | 9e7e4fcd9cfe6a5cadf50c2b1bdf6f1e838d524ff4ce5fd90191e254fd584525
-[JMRI.4.9.6.Re5a0179.exe](https://github.com/JMRI/JMRI/releases/download/v4.9.6/JMRI.4.9.6.Re5a0179.exe) | fd7a4b12d119761e44d2441e2a715ddbd9b6cf857d0418d5470303bd9aefd2e6
-[JMRI.4.9.6.Re5a0179.tgz](https://github.com/JMRI/JMRI/releases/download/v4.9.6/JMRI.4.9.6.Re5a0179.tgz) | 9e22b0dd001c8c541ad6899058d3e25140ddd3dac229098eece1899ff064dbfc
+[JMRI.4.9.7.Re5a0179.dmg](https://github.com/JMRI/JMRI/releases/download/v4.9.7/JMRI.4.9.7.Re5a0179.dmg) | 9e7e4fcd9cfe6a5cadf50c2b1bdf6f1e838d524ff4ce5fd90191e254fd584525
+[JMRI.4.9.7.Re5a0179.exe](https://github.com/JMRI/JMRI/releases/download/v4.9.7/JMRI.4.9.7.Re5a0179.exe) | fd7a4b12d119761e44d2441e2a715ddbd9b6cf857d0418d5470303bd9aefd2e6
+[JMRI.4.9.7.Re5a0179.tgz](https://github.com/JMRI/JMRI/releases/download/v4.9.7/JMRI.4.9.7.Re5a0179.tgz) | 9e22b0dd001c8c541ad6899058d3e25140ddd3dac229098eece1899ff064dbfc
```
- Attach files by selecting them or dragging them in (you might have to have downloaded them above via e.g. a separate
```
-curl -o release.zip "http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.6/lastSuccessfulBuild/artifact/dist/release/*zip*/release.zip""
+curl -o release.zip "http://jmri.tagadab.com/jenkins/job/TestReleases/job/4.9.7/lastSuccessfulBuild/artifact/dist/release/*zip*/release.zip""
```
and expansion; it's slow to upload from a typical home connection, though, so wish we had a way to cross-load from somewhere fast - if release.zip is still on SF.net, you can do
```
@@ -401,9 +401,9 @@ Note there's a little progress bar that has to go across & "Uploading your relea
Alternatively, if you have shell access to the Jenkins server, you perhaps can upload directly from there, once the initial draft release has been created (this hasn't been tested):
```
-github-release upload -s {github_secret} -u JMRI -r JMRI -t v4.9.6 -n "JMRI.4.9.6+Rd144052.dmg" -f /var/lib/jenkins/jobs/TestReleases/jobs/4.9.6/workspace/dist/release/JMRI.4.9.6+Rd144052.dmg
-github-release upload -s {github_secret} -u JMRI -r JMRI -t v4.9.6 -n "JMRI.4.9.6+Rd144052.exe" -f /var/lib/jenkins/jobs/TestReleases/jobs/4.7.5/workspace/dist/release/JMRI.4.9.6+Rd144052.exe
-github-release upload -s {github_secret} -u JMRI -r JMRI -t v4.9.6 -n "JMRI.4.9.6+Rd144052.tgz" -f /var/lib/jenkins/jobs/TestReleases/jobs/4.7.5/workspace/dist/release/JMRI.4.9.6+Rd144052.tgz
+github-release upload -s {github_secret} -u JMRI -r JMRI -t v4.9.7 -n "JMRI.4.9.7+Rd144052.dmg" -f /var/lib/jenkins/jobs/TestReleases/jobs/4.9.7/workspace/dist/release/JMRI.4.9.7+Rd144052.dmg
+github-release upload -s {github_secret} -u JMRI -r JMRI -t v4.9.7 -n "JMRI.4.9.7+Rd144052.exe" -f /var/lib/jenkins/jobs/TestReleases/jobs/4.7.5/workspace/dist/release/JMRI.4.9.7+Rd144052.exe
+github-release upload -s {github_secret} -u JMRI -r JMRI -t v4.9.7 -n "JMRI.4.9.7+Rd144052.tgz" -f /var/lib/jenkins/jobs/TestReleases/jobs/4.7.5/workspace/dist/release/JMRI.4.9.7+Rd144052.tgz
```
- Click "Publish Release"
@@ -421,7 +421,7 @@ git fetch
git checkout master
git pull
git checkout -b temp-master
-git merge origin/release-4.9.6
+git merge origin/release-4.9.7
```
Note that you're testing the merge of the release branch back onto master. This should report "Already up-to-date.", i.e. no changes, with the possible exception of some auto-generated files:
@@ -453,12 +453,12 @@ git checkout -b (release-n.n.n+1)
git push github
```
-- Create the next [GitHub Issue](https://github.com/JMRI/JMRI/issues) to hold discussion with conventional title "Create Test Release 4.9.7". Add the next release milestone (created above) to it. Typical text:
+- Create the next [GitHub Issue](https://github.com/JMRI/JMRI/issues) to hold discussion with conventional title "Create Test Release 4.9.8". Add the next release milestone (created above) to it. Typical text:
```
This is the third release of the 4.10 cycle. It's intended to be released around Novemebr 18 from HEAD of master.
```
-- Confirm that the tag for the current release (release-4.9.6) is in place, then manually delete the current release branch via the [GitHub UI](https://github.com/JMRI/JMRI/branches).
+- Confirm that the tag for the current release (release-4.9.7) is in place, then manually delete the current release branch via the [GitHub UI](https://github.com/JMRI/JMRI/branches).
- Go to the GitHub PR and Issues [labels list](https://github.com/JMRI/JMRI/labels) and remove any "afterNextTestRelease" (and "afterNextProductionRelease" if appropriate) labels from done items
@@ -488,27 +488,27 @@ If you don't, a bunch of Windows users are likely to whine
- Mail announcement to jmriusers@yahoogroups.com
- Subject is "Test version 4.9.6 of JMRI/DecoderPro is available for download" or "JMRI 4.8 is available for download"
+ Subject is "Test version 4.9.7 of JMRI/DecoderPro is available for download" or "JMRI 4.8 is available for download"
Content:
-Test version 4.9.6 of JMRI/DecoderPro is available for download.
+Test version 4.9.7 of JMRI/DecoderPro is available for download.
This is the next in a series of test releases that will culminate in a production release, hopefully in December 2017.
- Alt: There have been a lot of updates in this version, so it should be considered experimental.
- Alt: We're getting close to the end of the development series, so we'd appreciate feedback on whether or not this release works for your layout.
-If you use JMRI on Linux or Mac and are updating from JMRI 4.7.3 or earlier, there’s a necessary migration step. (Not needed on Windows) Please see the release note for details: