From b428cf4b1e0f963ae3eddddb4d1394ad44866b59 Mon Sep 17 00:00:00 2001 From: Lisa Malenfant Date: Sat, 30 Sep 2023 16:17:18 -0700 Subject: [PATCH 1/3] Updated the MCPP project to use the same command line file as the MCCL application Remove the UnitTestCoverage because it did not work for the code coverage Remove the SonarCloudAnalysis file because this is handled in a action --- .gitignore | 3 + SonarCloudAnalysis.ps1 | 7 - UnitTestCoverage.html | 31 -- UnitTestCoverage/css/dotcover.report.css | 183 -------- UnitTestCoverage/css/dotcover.report.gen.css | 122 ------ UnitTestCoverage/css/jquery.dynatree.css | 221 ---------- UnitTestCoverage/images/dotcover-icon.svg | 1 - UnitTestCoverage/images/dynatree-icons.svg | 1 - UnitTestCoverage/images/metadata-icons.svg | 1 - .../images/percentbar-background.svg | 14 - UnitTestCoverage/js/dotcover.report.js | 105 ----- UnitTestCoverage/js/dotcover.sourceview.js | 123 ------ UnitTestCoverage/js/jquery-1.3.2.min.js | 19 - .../js/jquery.cookie-1.3.1.min.js | 4 - .../js/jquery.dynatree-1.2.4.min.js | 4 - .../js/jquery.splitter-1.5.1.min.js | 4 - .../js/jquery.ui.custom-1.8.7.min.js | 271 ------------ UnitTestCoverage/src/11.html | 79 ---- UnitTestCoverage/src/12.html | 225 ---------- UnitTestCoverage/src/13.html | 51 --- UnitTestCoverage/src/14.html | 396 ------------------ UnitTestCoverage/src/17.html | 262 ------------ UnitTestCoverage/src/18.html | 202 --------- UnitTestCoverage/src/nosource.html | 12 - .../CommandLineTests.cs | 10 +- .../ParameterSweepTests.cs | 2 +- .../ProgramTests.cs | 4 +- .../Vts.MonteCarlo.Application.Test.csproj | 2 - .../CommandLine.cs | 20 +- .../MonteCarloSetup.cs | 12 +- .../Program.cs | 179 ++++---- .../CommandLineTests.cs | 34 ++ .../PostProcessorSetupTests.cs | 24 ++ .../ProgramTests.cs | 8 +- ...arlo.PostProcessor.Application.Test.csproj | 2 - .../PostProcessorSetup.cs | 9 +- Vts.MonteCarlo.PostProcessor/Program.cs | 113 ++--- ...onteCarlo.PostProcessor.Application.csproj | 4 + 38 files changed, 211 insertions(+), 2553 deletions(-) delete mode 100644 SonarCloudAnalysis.ps1 delete mode 100644 UnitTestCoverage.html delete mode 100644 UnitTestCoverage/css/dotcover.report.css delete mode 100644 UnitTestCoverage/css/dotcover.report.gen.css delete mode 100644 UnitTestCoverage/css/jquery.dynatree.css delete mode 100644 UnitTestCoverage/images/dotcover-icon.svg delete mode 100644 UnitTestCoverage/images/dynatree-icons.svg delete mode 100644 UnitTestCoverage/images/metadata-icons.svg delete mode 100644 UnitTestCoverage/images/percentbar-background.svg delete mode 100644 UnitTestCoverage/js/dotcover.report.js delete mode 100644 UnitTestCoverage/js/dotcover.sourceview.js delete mode 100644 UnitTestCoverage/js/jquery-1.3.2.min.js delete mode 100644 UnitTestCoverage/js/jquery.cookie-1.3.1.min.js delete mode 100644 UnitTestCoverage/js/jquery.dynatree-1.2.4.min.js delete mode 100644 UnitTestCoverage/js/jquery.splitter-1.5.1.min.js delete mode 100644 UnitTestCoverage/js/jquery.ui.custom-1.8.7.min.js delete mode 100644 UnitTestCoverage/src/11.html delete mode 100644 UnitTestCoverage/src/12.html delete mode 100644 UnitTestCoverage/src/13.html delete mode 100644 UnitTestCoverage/src/14.html delete mode 100644 UnitTestCoverage/src/17.html delete mode 100644 UnitTestCoverage/src/18.html delete mode 100644 UnitTestCoverage/src/nosource.html create mode 100644 Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs create mode 100644 Vts.MonteCarlo.PostProcessor.Test/PostProcessorSetupTests.cs diff --git a/.gitignore b/.gitignore index a99724b..add2128 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,6 @@ Vts.Mgrte.Console/ VtsLibrary.sln .sonarqube/ DotCover/ +Vts.Scripting/ +*.DotSettings +Vts.Scripting.Test/ diff --git a/SonarCloudAnalysis.ps1 b/SonarCloudAnalysis.ps1 deleted file mode 100644 index ed3dcf8..0000000 --- a/SonarCloudAnalysis.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -#We have to rerun the coverage results and export to HTML to get the coverage percentage -#Run the coverage results in Visual Studio and export the snapshot TestResultCoverage.html -dotnet sonarscanner begin -k:"Vts.MonteCarlo" /o:"lmalenfant" /d:sonar.host.url=https://sonarcloud.io /d:sonar.login="464ae516e59fb7c8f6add06984f1f9e8b711d5ce" /d:sonar.c.file.suffixes=- /d:sonar.cpp.file.suffixes=- /d:sonar.objc.file.suffixes=- /d:sonar.cs.nunit.reportsPaths=TestResult.trx /d:sonar.cs.dotcover.reportsPaths=TestResultCoverage.html -dotnet build $PWD\Vts.MonteCarlo.sln /t:Rebuild /p:Configuration=Release -dotnet test $PWD\Vts.MonteCarlo.sln -c:Release -l:"trx;LogFileName=TestResult.trx" -dotnet sonarscanner end /d:sonar.login="464ae516e59fb7c8f6add06984f1f9e8b711d5ce" -Read-Host -Prompt "Press Enter to exit" \ No newline at end of file diff --git a/UnitTestCoverage.html b/UnitTestCoverage.html deleted file mode 100644 index 03cd5da..0000000 --- a/UnitTestCoverage.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - UnitTestCoverage - - - - - - - - - - - - - - -
UnitTestCoverage Coverage ReportGenerated: Thursday, July 27, 2023 7:52:40 AM
-
- - - - - \ No newline at end of file diff --git a/UnitTestCoverage/css/dotcover.report.css b/UnitTestCoverage/css/dotcover.report.css deleted file mode 100644 index bc7de67..0000000 --- a/UnitTestCoverage/css/dotcover.report.css +++ /dev/null @@ -1,183 +0,0 @@ -html -{ - height: 100%; - margin: 0; - padding: 0 6px; - font-family: verdana, helvetica, arial, sans-serif; - font-size: 11px; - color: #333333; -} - -html.main -{ - background-color: #d7dbde; - background-image: linear-gradient(#f1f3f4 0px, #d7dbde 45px); -} - -body -{ - margin: 0; - padding: 0; -} - -html.main body -{ - height: 100%; -} - -div.header -{ - background-image: url("../images/dotcover-icon.svg"); - background-repeat: no-repeat; - background-position: 1px 3px; - - height: 45px; - width: 100%; - vertical-align: middle; - padding-top: 10px; -} - -div.header span.title -{ - display: block; - font-size: 15px; - font-weight: bold; - color: #2f2f2f; - margin-left: 60px; -} - -div.header span.info -{ - margin-left: 60px; -} - -div.content -{ - height: 100%; - width: 100%; - background: white; -} - -div.content ul.dynatree-container -{ - height: 100%; - padding: 0; - background: #F2F4F8; -} - -div.footer -{ - height: 15px; - width: 100%; - text-align: center; - padding-top: 1px; -} - -.vsplitbar -{ - width: 6px; - background: #d7dbde; -} - -.vsplitbar.active -{ - background: #bbbbbb; - opacity: 0.7; -} - -.vsplitbarmask -{ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - overflow: hidden; - z-index: 20000; -} - -span.p -{ - display: inline-block; - width: 40px; - height: 13px; - border: 1px solid black; - background-image: url("../images/percentbar-background.svg"); - margin-left: 3px; - margin-right: 3px; - text-align: center; - vertical-align: middle; - font-family: tahoma, arial, helvetica; - font-size: 10px; -} - -span.i -{ - display: inline-block; - width: 16px; - height: 16px; - border: 0; - background-image: url("../images/metadata-icons.svg"); - margin-left: 1px; - margin-right: 1px; -} - -div.footer a -{ - color: #0066cc; - border: none; -} - -span.dynatree-active a -{ - background-color: #f2f4f8; -} - -ul.dynatree-container a.n -{ - vertical-align: middle; -} - -ul.dynatree-container a.nws -{ - vertical-align: middle; - text-decoration: underline; - color: #0066cc; -} - -ul.dynatree-container span.dynatree-connector -{ - background-image: none; -} - -iframe -{ - background: white; - border: 0; - overflow: auto; -} - -html.no-source body -{ - height: 100%; -} - -html.no-source table -{ - width: 100%; - height: 100%; - text-align: center; - vertical-align: middle; - background-color: white; -} - -pre.source-code -{ - width: 100%; - font-family: monospace; - font-size: 14px; - margin: 0; -} - -a.covered { background-color: #e3fbc9; } -a.uncovered { background-color: #ffbebe; } \ No newline at end of file diff --git a/UnitTestCoverage/css/dotcover.report.gen.css b/UnitTestCoverage/css/dotcover.report.gen.css deleted file mode 100644 index b7373b6..0000000 --- a/UnitTestCoverage/css/dotcover.report.gen.css +++ /dev/null @@ -1,122 +0,0 @@ -span.p0 { background-position: 0px 0; } -span.p1 { background-position: 1px 0; } -span.p2 { background-position: 1px 0; } -span.p3 { background-position: 1px 0; } -span.p4 { background-position: 1px 0; } -span.p5 { background-position: 2px 0; } -span.p6 { background-position: 2px 0; } -span.p7 { background-position: 2px 0; } -span.p8 { background-position: 3px 0; } -span.p9 { background-position: 3px 0; } -span.p10 { background-position: 4px 0; } -span.p11 { background-position: 4px 0; } -span.p12 { background-position: 4px 0; } -span.p13 { background-position: 5px 0; } -span.p14 { background-position: 5px 0; } -span.p15 { background-position: 6px 0; } -span.p16 { background-position: 6px 0; } -span.p17 { background-position: 6px 0; } -span.p18 { background-position: 7px 0; } -span.p19 { background-position: 7px 0; } -span.p20 { background-position: 8px 0; } -span.p21 { background-position: 8px 0; } -span.p22 { background-position: 8px 0; } -span.p23 { background-position: 9px 0; } -span.p24 { background-position: 9px 0; } -span.p25 { background-position: 10px 0; } -span.p26 { background-position: 10px 0; } -span.p27 { background-position: 10px 0; } -span.p28 { background-position: 11px 0; } -span.p29 { background-position: 11px 0; } -span.p30 { background-position: 12px 0; } -span.p31 { background-position: 12px 0; } -span.p32 { background-position: 12px 0; } -span.p33 { background-position: 13px 0; } -span.p34 { background-position: 13px 0; } -span.p35 { background-position: 14px 0; } -span.p36 { background-position: 14px 0; } -span.p37 { background-position: 14px 0; } -span.p38 { background-position: 15px 0; } -span.p39 { background-position: 15px 0; } -span.p40 { background-position: 16px 0; } -span.p41 { background-position: 16px 0; } -span.p42 { background-position: 16px 0; } -span.p43 { background-position: 17px 0; } -span.p44 { background-position: 17px 0; } -span.p45 { background-position: 18px 0; } -span.p46 { background-position: 18px 0; } -span.p47 { background-position: 18px 0; } -span.p48 { background-position: 19px 0; } -span.p49 { background-position: 19px 0; } -span.p50 { background-position: 20px 0; } -span.p51 { background-position: 20px 0; } -span.p52 { background-position: 20px 0; } -span.p53 { background-position: 21px 0; } -span.p54 { background-position: 21px 0; } -span.p55 { background-position: 22px 0; } -span.p56 { background-position: 22px 0; } -span.p57 { background-position: 22px 0; } -span.p58 { background-position: 23px 0; } -span.p59 { background-position: 23px 0; } -span.p60 { background-position: 24px 0; } -span.p61 { background-position: 24px 0; } -span.p62 { background-position: 24px 0; } -span.p63 { background-position: 25px 0; } -span.p64 { background-position: 25px 0; } -span.p65 { background-position: 26px 0; } -span.p66 { background-position: 26px 0; } -span.p67 { background-position: 26px 0; } -span.p68 { background-position: 27px 0; } -span.p69 { background-position: 27px 0; } -span.p70 { background-position: 28px 0; } -span.p71 { background-position: 28px 0; } -span.p72 { background-position: 28px 0; } -span.p73 { background-position: 29px 0; } -span.p74 { background-position: 29px 0; } -span.p75 { background-position: 30px 0; } -span.p76 { background-position: 30px 0; } -span.p77 { background-position: 30px 0; } -span.p78 { background-position: 31px 0; } -span.p79 { background-position: 31px 0; } -span.p80 { background-position: 32px 0; } -span.p81 { background-position: 32px 0; } -span.p82 { background-position: 32px 0; } -span.p83 { background-position: 33px 0; } -span.p84 { background-position: 33px 0; } -span.p85 { background-position: 34px 0; } -span.p86 { background-position: 34px 0; } -span.p87 { background-position: 34px 0; } -span.p88 { background-position: 35px 0; } -span.p89 { background-position: 35px 0; } -span.p90 { background-position: 36px 0; } -span.p91 { background-position: 36px 0; } -span.p92 { background-position: 36px 0; } -span.p93 { background-position: 37px 0; } -span.p94 { background-position: 37px 0; } -span.p95 { background-position: 38px 0; } -span.p96 { background-position: 38px 0; } -span.p97 { background-position: 38px 0; } -span.p98 { background-position: 39px 0; } -span.p99 { background-position: 39px 0; } -span.p100 { background-position: 40px 0; } - -span.i0 { background-position: 0 0; } -span.i1 { background-position: -18px 0; } -span.i2 { background-position: -36px 0; } -span.i3 { background-position: -54px 0; } -span.i4 { background-position: -72px 0; } -span.i5 { background-position: -90px 0; } -span.i6 { background-position: -108px 0; } -span.i7 { background-position: -126px 0; } -span.i8 { background-position: -144px 0; } -span.i9 { background-position: -162px 0; } -span.i10 { background-position: 0 -18px; } -span.i11 { background-position: -18px -18px; } -span.i12 { background-position: -36px -18px; } -span.i13 { background-position: -54px -18px; } -span.i14 { background-position: -72px -18px; } -span.i15 { background-position: -90px -18px; } -span.i16 { background-position: -108px -18px; } -span.i17 { background-position: -126px -18px; } -span.i18 { background-position: -144px -18px; } -span.i19 { background-position: -162px -18px; } diff --git a/UnitTestCoverage/css/jquery.dynatree.css b/UnitTestCoverage/css/jquery.dynatree.css deleted file mode 100644 index 92e1bc9..0000000 --- a/UnitTestCoverage/css/jquery.dynatree.css +++ /dev/null @@ -1,221 +0,0 @@ -/******************************************************************************* - * Tree container - */ -ul.dynatree-container -{ - font-family: tahoma, arial, helvetica; - font-size: 10pt; /* font size should not be too big */ - white-space: nowrap; - padding: 3px; - margin: 0; - overflow: auto; -} - -ul.dynatree-container ul -{ - padding: 0 0 0 16px; - margin: 0; -} - -ul.dynatree-container li -{ - list-style-image: none; - list-style-position: outside; - list-style-type: none; - -moz-background-clip: border; - -moz-background-inline-policy: continuous; - -moz-background-origin: padding; - background-attachment: scroll; - background-color: transparent; - background-repeat: repeat-y; - background-position: 0 0; - margin: 0; - padding: 1px 0 0 0; -} -/* Suppress lines for last child node */ -ul.dynatree-container li.dynatree-lastsib -{ - background-image: none; -} -/* Suppress lines if level is fixed expanded (option minExpandLevel) */ -ul.dynatree-no-connector > li -{ - background-image: none; -} - -/* Style, when control is disabled */ -.ui-dynatree-disabled ul.dynatree-container -{ - opacity: 0.5; -/* filter: alpha(opacity=50); /* Yields a css warning */ - background-color: silver; -} - - -/******************************************************************************* - * Common icon definitions - */ -span.dynatree-empty, -span.dynatree-vline, -span.dynatree-connector, -span.dynatree-expander, -span.dynatree-icon, -span.dynatree-checkbox, -span.dynatree-radio, -span.dynatree-drag-helper-img, -#dynatree-drop-marker -{ - width: 16px; - height: 16px; - display: -moz-inline-box; /* @ FF 1+2 */ - display: inline-block; /* Required to make a span sizeable */ - vertical-align: top; - background-repeat: no-repeat; - background-position: left; - background-image: url("../images/dynatree-icons.svg"); - background-position: 0 0; -} - -/** Used by 'icon' node option: */ -ul.dynatree-container img -{ - width: 16px; - height: 16px; - margin-left: 3px; - vertical-align: top; - border-style: none; -} - -/******************************************************************************* - * Expander icon - * Note: IE6 doesn't correctly evaluate multiples class names, - * so we create combined class names that can be used in the CSS. - * - * Prefix: dynatree-exp- - * 1st character: 'e': expanded, 'c': collapsed - * 2nd character (optional): 'd': lazy (Delayed) - * 3rd character (optional): 'l': Last sibling - */ - -span.dynatree-expander -{ - background-position: 0px -80px; - cursor: pointer; -} -.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */ -{ - background-position: 0px -96px; -} -.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */ -{ - background-position: -64px -80px; -} -.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */ -{ - background-position: -64px -96px; -} -.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */ -.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */ -{ - background-position: -32px -80px; -} -.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */ -.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */ -{ - background-position: -32px -96px; -} - - - -/******************************************************************************* - * Node type icon - * Note: IE6 doesn't correctly evaluate multiples class names, - * so we create combined class names that can be used in the CSS. - * - * Prefix: dynatree-ico- - * 1st character: 'e': expanded, 'c': collapsed - * 2nd character (optional): 'f': folder - */ - -span.dynatree-icon /* Default icon */ -{ - margin-left: 3px; - background-position: 0px 0px; -} - -.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ -{ - background-position: 0px -16px; -} - -.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ -{ - background-position: -64px -16px; -} - -/* Status node icons */ - - -.dynatree-statusnode-error span.dynatree-icon -{ - background-position: 0px -112px; -/* background-image: url("ltError.gif");*/ -} - -/******************************************************************************* - * Node titles - */ - -/* @Chrome: otherwise hit area of node titles is broken (issue 133) - Removed again for issue 165; (133 couldn't be reproduced) */ -span.dynatree-node -{ -/* display: -moz-inline-box; /* @ FF 1+2 */ -/* display: inline-block; /* Required to make a span sizeable */ -} - -/* Remove blue color and underline from title links */ -ul.dynatree-container a -/*, ul.dynatree-container a:visited*/ -{ - color: black; /* inherit doesn't work on IE */ - text-decoration: none; - vertical-align: top; - margin: 0px; - margin-left: 3px; - /* outline: 0; /* @ Firefox, prevent dotted border after click */ -} - -ul.dynatree-container a:hover -{ -/* text-decoration: underline; */ - background: #F2F7FD; /* light blue */ - border-color: #B8D6FB; /* darker light blue */ -} - -span.dynatree-node a -{ - display: inline-block; /* Better alignment, when title contains
*/ -/* vertical-align: top;*/ - padding-left: 3px; - padding-right: 3px; /* Otherwise italic font will be outside bounds */ - /* line-height: 16px; /* should be the same as img height, in case 16 px */ -} -span.dynatree-folder a -{ - font-weight: bold; -} - -ul.dynatree-container a:focus, -span.dynatree-focused a:link /* @IE */ -{ - background-color: #EFEBDE; /* gray */ -} - -span.dynatree-has-children a -{ -} - -span.dynatree-expanded a -{ -} \ No newline at end of file diff --git a/UnitTestCoverage/images/dotcover-icon.svg b/UnitTestCoverage/images/dotcover-icon.svg deleted file mode 100644 index 53986a1..0000000 --- a/UnitTestCoverage/images/dotcover-icon.svg +++ /dev/null @@ -1 +0,0 @@ -dotcover-icon \ No newline at end of file diff --git a/UnitTestCoverage/images/dynatree-icons.svg b/UnitTestCoverage/images/dynatree-icons.svg deleted file mode 100644 index 4b5dcec..0000000 --- a/UnitTestCoverage/images/dynatree-icons.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/UnitTestCoverage/images/metadata-icons.svg b/UnitTestCoverage/images/metadata-icons.svg deleted file mode 100644 index 5b897c3..0000000 --- a/UnitTestCoverage/images/metadata-icons.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/UnitTestCoverage/images/percentbar-background.svg b/UnitTestCoverage/images/percentbar-background.svg deleted file mode 100644 index be84df0..0000000 --- a/UnitTestCoverage/images/percentbar-background.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/UnitTestCoverage/js/dotcover.report.js b/UnitTestCoverage/js/dotcover.report.js deleted file mode 100644 index 558d209..0000000 --- a/UnitTestCoverage/js/dotcover.report.js +++ /dev/null @@ -1,105 +0,0 @@ -$(document).ready(function() { - resizeContent(); - $(window).bind("resize", resizeContent); - $("#content").splitter({ - type: "v", - outline: true, - minLeft: 200, - resizeToWidth: true, - cookie: "splitter" - }); - $("#coverageTree").dynatree({ - minExpandLevel: 2, - onPostInit: initializeTree, - onLazyRead: loadChildren, - onCustomRender: createNodePresentation, - onActivate: navigateToNode - }); -}); - -function initializeTree() { - var rootNode = $("#coverageTree").dynatree("getRoot"); - rootNode.data.firstChildIndex = 0; - loadChildren(rootNode); - - var realRootNode = rootNode.childList[0]; - loadChildren(realRootNode); - realRootNode.focus(); -} - -function loadChildren(node) { - var firstChildIndex = node.data.firstChildIndex; - if (firstChildIndex == undefined) - return true; - - var childrenNumber = node.data.childrenNumber; - if (childrenNumber == undefined) - childrenNumber = 1; - - var children = new Array(); - for (var i = 0; i < childrenNumber; i++) { - var childIndex = firstChildIndex + i; - var child = getNode(childIndex); - child.key = childIndex; - child.isLazy = child.firstChildIndex != undefined; - child.isFolder = false; - child.icon = false; - children[i] = child; - } - node.addChild(children); - return true; -} - -function getNode(index) { - var blockIndex = div(index, blockSize); - var block = coverageData[blockIndex]; - if (!block) - throw "Incorrect index"; - - var itemIndex = index % blockSize; - var data = block[itemIndex]; - if (!data) - throw "No data for the given index"; - - var node = {}; - node.name = data[0]; - node.percent = data[1]; - node.iconIndex = data[2]; - node.fileNameIndex = data[3]; - node.line = data[4]; - node.column = data[5]; - node.firstChildIndex = data[6]; - node.childrenNumber = data[7]; - return node; -} - -function createNodePresentation(node) { - var presentation = ""; - if (node.data.iconIndex >= 0) - presentation += " "; - if (node.data.percent >= 0) - presentation += "" + node.data.percent + "%"; - var clazz = node.data.fileNameIndex ? "nws" : "n"; //node with sources or regular node - presentation += "" + node.data.name + ""; - return presentation; -} - -function navigateToNode(node) { - var data = node.data; - var url = resourceFolder + "/src/" + (data.fileNameIndex ? (data.fileNameIndex + ".html#s" + data.line + "." + data.column) : "nosource.html"); - $("#sourceCode").attr("src", url); -} - -function resizeContent() { - var contentHeight = ($(window).height() - 72) + "px"; - $("#content").css("height", contentHeight); -} - -function div(x, y) { - var d = x / y; - // since js has no integer division - if (d >= 0) - return Math.floor(d); - else - return Math.ceil(d); -} \ No newline at end of file diff --git a/UnitTestCoverage/js/dotcover.sourceview.js b/UnitTestCoverage/js/dotcover.sourceview.js deleted file mode 100644 index 7d13c3f..0000000 --- a/UnitTestCoverage/js/dotcover.sourceview.js +++ /dev/null @@ -1,123 +0,0 @@ - -function highlightRanges(rawRanges) { - if (!rawRanges.length) - return; - - var ranges = new Array(); - for (var i = 0; i < rawRanges.length; i++) - ranges[i] = convertRange(rawRanges[i]); - ranges.sort(compareRanges); - - var content = document.getElementById("content"); - var source = content.innerHTML; - var result = ""; - - var position = 0; - var previousPosition = 0; - var line = 1; - var column = 1; - - var currentRangeIndex = 0; - var currentRange = ranges[currentRangeIndex]; - var previousCoverageStatus = null; - - var escapeSequenceRegularExpression = /^(&|<|>|")/; - var maxEscapeSequenceLength = getMaxStringLength(escapeSequenceRegularExpression.source.match(new RegExp(escapeSequenceRegularExpression.source.substr(1), "g"))); - - while (position < source.length) { - // testing for exact beginning of the next range - if (line == currentRange.line && column == currentRange.column) { - if (previousCoverageStatus == null) { - previousCoverageStatus = currentRange.covered; - result = result.concat(source.substring(previousPosition, position), ""); - previousPosition = position; - } else { - throw "invalid state"; - } - } - // testing for the end of the range, but taking into account possible wrong range that goes beyound end of line - else if (line > currentRange.endLine || line == currentRange.endLine && column >= currentRange.endColumn) { - if (previousCoverageStatus != null) { - result = result.concat(source.substring(previousPosition, position), ""); - previousPosition = position; - previousCoverageStatus = null; - do { - do { - currentRangeIndex++; - currentRange = currentRangeIndex < ranges.length ? ranges[currentRangeIndex] : null; - } // skipping duplicates - while (currentRange != null && compareRanges(currentRange, ranges[currentRangeIndex - 1]) == 0); - } // skipping (overlapping) ranges that already passed - while (currentRange != null && (line > currentRange.endLine || line == currentRange.endLine && column >= currentRange.endColumn)); - if (currentRange == null) { - break; - } - // adjusting (overlapping) ranges that not yet passed, so they are started at current pos - if (line > currentRange.line || line == currentRange.line && column >= currentRange.column) { - currentRange.line = line; - currentRange.column = column; - continue; - } - } else { - throw "invalid state"; - } - } - if (source.charAt(position) == '\r') { - position++; - } - if (source.charAt(position) == '\n') { - position++; - line++; - column = 1; - } else { - // shift according to found escape sequence - var matches = source.substr(position, maxEscapeSequenceLength).match(escapeSequenceRegularExpression); - if (matches != null && matches.length > 0) - position += matches[0].length; - else - position++; - - column++; - } - } - result = result.concat(source.substring(previousPosition), (previousCoverageStatus == null) ? "" : ""); - content.outerHTML = "
" + result + "
"; -} - -function convertRange(rawRange) { - var range = {}; - range.line = rawRange[0]; - range.column = rawRange[1]; - range.endLine = rawRange[2]; - range.endColumn = rawRange[3]; - range.covered = rawRange[4]; - return range; -} - -function compareRanges(a, b) { - var result; - if (result = compareValues(a.line, b.line)) - return result; - if (result = compareValues(a.column, b.column)) - return result; - if (result = compareValues(a.endLine, b.endLine)) - return result; - if (result = compareValues(a.endColumn, b.endColumn)) - return result; - return 0; -} - -function compareValues(a, b) { - if (a == b) - return 0; - return (a < b) ? -1 : 1; -} - -function getMaxStringLength(stringArray) { - var maxLength = 0; - for (var i = 0; i < stringArray.length; ++i) - if (stringArray[i].length > maxLength) - maxLength = stringArray[i].length; - return maxLength; -} - diff --git a/UnitTestCoverage/js/jquery-1.3.2.min.js b/UnitTestCoverage/js/jquery-1.3.2.min.js deleted file mode 100644 index 003c313..0000000 --- a/UnitTestCoverage/js/jquery-1.3.2.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/UnitTestCoverage/js/jquery.cookie-1.3.1.min.js b/UnitTestCoverage/js/jquery.cookie-1.3.1.min.js deleted file mode 100644 index bdde12d..0000000 --- a/UnitTestCoverage/js/jquery.cookie-1.3.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Cookie Plugin v1.3.1 -* https://github.com/carhartl/jquery-cookie -* Copyright (c) 2013 Klaus Hartl; Licensed MIT */ -(function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){function n(e){return e}function r(e){return decodeURIComponent(e.replace(t," "))}function i(e){if(e.indexOf('"')===0){e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{return s.json?JSON.parse(e):e}catch(t){}}var t=/\+/g;var s=e.cookie=function(t,o,u){if(o!==undefined){u=e.extend({},s.defaults,u);if(typeof u.expires==="number"){var a=u.expires,f=u.expires=new Date;f.setDate(f.getDate()+a)}o=s.json?JSON.stringify(o):String(o);return document.cookie=[s.raw?t:encodeURIComponent(t),"=",s.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}var l=s.raw?n:r;var c=document.cookie.split("; ");var h=t?undefined:{};for(var p=0,d=c.length;po?1:s
"},start:function(e,t){var n=t.helper.data("dtSourceNode");return!!n},_last:null}),t&&t.onDrop&&e.$tree.droppable({addClasses:!1,tolerance:"intersect",greedy:!1,_last:null})}var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}},DynaTreeNode=Class.create();DynaTreeNode.prototype={initialize:function(e,t,n){this.parent=e,this.tree=t,typeof n=="string"&&(n={title:n}),n.key?n.key=""+n.key:n.key="_"+t._nodeCount++,this.data=$.extend({},$.ui.dynatree.nodedatadefaults,n),this.li=null,this.span=null,this.ul=null,this.childList=null,this._isLoading=!1,this.hasSubSel=!1,this.bExpanded=!1,this.bSelected=!1},toString:function(){return"DynaTreeNode<"+this.data.key+">: '"+this.data.title+"'"},toDict:function(e,t){var n=$.extend({},this.data);n.activate=this.tree.activeNode===this,n.focus=this.tree.focusNode===this,n.expand=this.bExpanded,n.select=this.bSelected,t&&t(n);if(e&&this.childList){n.children=[];for(var r=0,i=this.childList.length;r1&&(s+=n.tagConnector):this.hasChildren()!==!1?s+=n.tagExpander:s+=n.tagConnector,t.checkbox&&i.hideCheckbox!==!0&&!i.isStatusNode&&(s+=n.tagCheckbox),i.icon?(i.icon.charAt(0)==="/"?o=i.icon:o=t.imagePath+i.icon,s+=""):i.icon!==!1&&(i.iconClass?s+="":s+=n.tagNodeIcon);var u="";t.onCustomRender&&(u=t.onCustomRender.call(e,this)||"");if(!u){var a=i.tooltip?' title="'+i.tooltip.replace(/\"/g,""")+'"':"",f=i.href||"#";t.noLink||i.noLink?u='"+i.title+"":u='"+i.title+""}return s+=u,s},_fixOrder:function(){var e=this.childList;if(!e||!this.ul)return;var t=this.ul.firstChild;for(var n=0,r=e.length-1;n1?this.ul.className=o.container+" "+o.noConnector:this.ul.className=o.container;else if(r){this.li||(a=!0,this.li=document.createElement("li"),this.li.dtnode=this,i.key&&s.generateIds&&(this.li.id=s.idPrefix+i.key),this.span=document.createElement("span"),this.span.className=o.title,this.li.appendChild(this.span),r.ul||(r.ul=document.createElement("ul"),r.ul.style.display="none",r.li.appendChild(r.ul)),r.ul.appendChild(this.li)),this.span.innerHTML=this._getInnerHtml();var f=[];f.push(o.node),i.isFolder&&f.push(o.folder),this.bExpanded&&f.push(o.expanded),this.hasChildren()!==!1&&f.push(o.hasChildren),i.isLazy&&this.childList===null&&f.push(o.lazy),u&&f.push(o.lastsib),this.bSelected&&f.push(o.selected),this.hasSubSel&&f.push(o.partsel),n.activeNode===this&&f.push(o.active),i.addClass&&f.push(i.addClass),f.push(o.combinedExpanderPrefix+(this.bExpanded?"e":"c")+(i.isLazy&&this.childList===null?"d":"")+(u?"l":"")),f.push(o.combinedIconPrefix+(this.bExpanded?"e":"c")+(i.isFolder?"f":"")),this.span.className=f.join(" "),this.li.className=u?o.lastsib:"",a&&s.onCreate&&s.onCreate.call(n,this,this.span),s.onRender&&s.onRender.call(n,this,this.span)}if((this.bExpanded||t===!0)&&this.childList){for(var l=0,c=this.childList.length;lr?1:-1},n.sort(e);if(t)for(var r=0,i=n.length;r0?this.childList[0].focus():this.focus());break;case DTNodeStatus_Loading:this._isLoading=!0,$(this.span).addClass(this.tree.options.classNames.nodeLoading),this.parent||this._setStatusNode({title:this.tree.options.strings.loading+r,tooltip:n,addClass:this.tree.options.classNames.nodeWait});break;case DTNodeStatus_Error:this._isLoading=!1,this._setStatusNode({title:this.tree.options.strings.loadError+r,tooltip:n,addClass:this.tree.options.classNames.nodeError});break;default:throw"Bad LazyNodeStatus: '"+e+"'."}},_parentList:function(e,t){var n=[],r=t?this:this.parent;while(r)(e||r.parent)&&n.unshift(r),r=r.parent;return n},getLevel:function(){var e=0,t=this.parent;while(t)e++,t=t.parent;return e},_getTypeForOuterNodeEvent:function(e){var t=this.tree.options.classNames,n=e.target;if(n.className.indexOf(t.node)<0)return null;var r=e.pageX-n.offsetLeft,i=e.pageY-n.offsetTop;for(var s=0,o=n.childNodes.length;s=a&&r<=a+l&&i>=f&&i<=f+c){if(u.className==t.title)return"title";if(u.className==t.expander)return"expander";if(u.className==t.checkbox)return"checkbox";if(u.className==t.nodeIcon)return"icon"}}return"prefix"},getEventTargetType:function(e){var t=e&&e.target?e.target.className:"",n=this.tree.options.classNames;return t===n.title?"title":t===n.expander?"expander":t===n.checkbox?"checkbox":t===n.nodeIcon?"icon":t===n.empty||t===n.vline||t===n.connector?"prefix":t.indexOf(n.node)>=0?this._getTypeForOuterNodeEvent(e):null},isVisible:function(){var e=this._parentList(!0,!1);for(var t=0,n=e.length;ta").focus()}catch(e){}},isFocused:function(){return this.tree.tnFocused===this},_activate:function(e,t){this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o",e,t,this);var n=this.tree.options;if(this.data.isStatusNode)return;if(t&&n.onQueryActivate&&n.onQueryActivate.call(this.tree,e,this)===!1)return;if(e){if(this.tree.activeNode){if(this.tree.activeNode===this)return;this.tree.activeNode.deactivate()}n.activeVisible&&this.makeVisible(),this.tree.activeNode=this,n.persist&&$.cookie(n.cookieId+"-active",this.data.key,n.cookie),this.tree.persistence.activeKey=this.data.key,$(this.span).addClass(n.classNames.active),t&&n.onActivate&&n.onActivate.call(this.tree,this)}else if(this.tree.activeNode===this){if(n.onQueryActivate&&n.onQueryActivate.call(this.tree,!1,this)===!1)return;$(this.span).removeClass(n.classNames.active),n.persist&&$.cookie(n.cookieId+"-active","",n.cookie),this.tree.persistence.activeKey=null,this.tree.activeNode=null,t&&n.onDeactivate&&n.onDeactivate.call(this.tree,this)}},activate:function(){this._activate(!0,!0)},activateSilently:function(){this._activate(!0,!1)},deactivate:function(){this._activate(!1,!0)},isActive:function(){return this.tree.activeNode===this},_userActivate:function(){var e=!0,t=!1;if(this.data.isFolder)switch(this.tree.options.clickFolderMode){case 2:e=!1,t=!0;break;case 3:e=t=!0}this.parent===null&&(t=!1),t&&(this.toggleExpand(),this.focus()),e&&this.activate()},_setSubSel:function(e){e?(this.hasSubSel=!0,$(this.span).addClass(this.tree.options.classNames.partsel)):(this.hasSubSel=!1,$(this.span).removeClass(this.tree.options.classNames.partsel))},_updatePartSelectionState:function(){var e;if(!this.hasChildren())return e=this.bSelected&&!this.data.unselectable&&!this.data.isStatusNode,this._setSubSel(!1),e;var t,n,r=this.childList,i=!0,s=!0;for(t=0,n=r.length;t=0;i--){n=r[i].getNextSibling();if(n)break}}n&&n.focus();break;default:t=!1}t&&e.preventDefault()},_onKeypress:function(e){},_onFocus:function(e){var t=this.tree.options;if(e.type=="blur"||e.type=="focusout")t.onBlur&&t.onBlur.call(this.tree,this),this.tree.tnFocused&&$(this.tree.tnFocused.span).removeClass(t.classNames.focused),this.tree.tnFocused=null,t.persist&&$.cookie(t.cookieId+"-focus","",t.cookie);else if(e.type=="focus"||e.type=="focusin")this.tree.tnFocused&&this.tree.tnFocused!==this&&(this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o",this.tree.tnFocused),$(this.tree.tnFocused.span).removeClass(t.classNames.focused)),this.tree.tnFocused=this,t.onFocus&&t.onFocus.call(this.tree,this),$(this.tree.tnFocused.span).addClass(t.classNames.focused),t.persist&&$.cookie(t.cookieId+"-focus",this.data.key,t.cookie)},visit:function(e,t){var n=!0;if(t===!0){n=e(this);if(n===!1||n=="skip")return n}if(this.childList)for(var r=0,i=this.childList.length;r reloading %s...",this,e,u);var a=this;u.reloadChildren(function(i,s){s?(n.logDebug("%s._loadKeyPath(%s) -> reloaded %s.",i,e,i),t.call(n,u,"loaded"),i._loadKeyPath(r.join(n.options.keyPathSeparator),t)):(n.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.",a,e),t.call(n,u,"error"))})}return}}t.call(n,undefined,"notfound",i,r.length===0),n.logWarning("Node not found: "+i);return},resetLazy:function(){if(this.parent===null)throw"Use tree.reload() instead";if(!this.data.isLazy)throw"node.resetLazy() requires lazy nodes.";this.expand(!1),this.removeChildren()},_addChildNode:function(e,t){var n=this.tree,r=n.options,i=n.persistence;e.parent=this,this.childList===null?this.childList=[]:t||this.childList.length>0&&$(this.childList[this.childList.length-1].span).removeClass(r.classNames.lastsib);if(t){var s=$.inArray(t,this.childList);if(s<0)throw" must be a child of ";this.childList.splice(s,0,e)}else this.childList.push(e);var o=n.isInitializing();r.persist&&i.cookiesFound&&o?(i.activeKey===e.data.key&&(n.activeNode=e),i.focusedKey===e.data.key&&(n.focusNode=e),e.bExpanded=$.inArray(e.data.key,i.expandedKeyList)>=0,e.bSelected=$.inArray(e.data.key,i.selectedKeyList)>=0):(e.data.activate&&(n.activeNode=e,r.persist&&(i.activeKey=e.data.key)),e.data.focus&&(n.focusNode=e,r.persist&&(i.focusedKey=e.data.key)),e.bExpanded=e.data.expand===!0,e.bExpanded&&r.persist&&i.addExpand(e.data.key),e.bSelected=e.data.select===!0,e.bSelected&&r.persist&&i.addSelect(e.data.key)),r.minExpandLevel>=e.getLevel()&&(this.bExpanded=!0);if(e.bSelected&&r.selectMode==3){var u=this;while(u)u.hasSubSel||u._setSubSel(!0),u=u.parent}return n.bEnableUpdate&&this.render(),e},addChild:function(e,t){if(typeof e=="string")throw"Invalid data type for "+e;if(!e||e.length===0)return;if(e instanceof DynaTreeNode)return this._addChildNode(e,t);e.length||(e=[e]);var n=this.tree.enableUpdate(!1),r=null;for(var i=0,s=e.length;i=0&&(this.expandedKeyList.splice(t,1),$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},addSelect:function(e){$.inArray(e,this.selectedKeyList)<0&&(this.selectedKeyList.push(e),$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},clearSelect:function(e){var t=$.inArray(e,this.selectedKeyList);t>=0&&(this.selectedKeyList.splice(t,1),$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},isReloading:function(){return this.cookiesFound===!0},toDict:function(){return{cookiesFound:this.cookiesFound,activeKey:this.activeKey,focusedKey:this.activeKey,expandedKeyList:this.expandedKeyList,selectedKeyList:this.selectedKeyList}},lastentry:undefined};var DynaTree=Class.create();DynaTree.version="$Version:$",DynaTree.prototype={initialize:function(e){this.phase="init",this.$widget=e,this.options=e.options,this.$tree=e.element,this.timer=null,this.divTree=this.$tree.get(0),_initDragAndDrop(this)},_load:function(e){var t=this.$widget,n=this.options,r=this;this.bEnableUpdate=!0,this._nodeCount=1,this.activeNode=null,this.focusNode=null,n.rootVisible!==undefined&&this.logWarning("Option 'rootVisible' is no longer supported."),n.minExpandLevel<1&&(this.logWarning("Option 'minExpandLevel' must be >= 1."),n.minExpandLevel=1),n.classNames!==$.ui.dynatree.prototype.options.classNames&&(n.classNames=$.extend({},$.ui.dynatree.prototype.options.classNames,n.classNames)),n.ajaxDefaults!==$.ui.dynatree.prototype.options.ajaxDefaults&&(n.ajaxDefaults=$.extend({},$.ui.dynatree.prototype.options.ajaxDefaults,n.ajaxDefaults)),n.dnd!==$.ui.dynatree.prototype.options.dnd&&(n.dnd=$.extend({},$.ui.dynatree.prototype.options.dnd,n.dnd)),n.imagePath||$("script").each(function(){var e=/.*dynatree[^\/]*\.js$/i;if(this.src.search(e)>=0)return this.src.indexOf("/")>=0?n.imagePath=this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/":n.imagePath="skin/",r.logDebug("Guessing imagePath from '%s': '%s'",this.src,n.imagePath),!1}),this.persistence=new DynaTreeStatus(n.cookieId,n.cookie),n.persist&&($.cookie||_log("warn","Please include jquery.cookie.js to use persistence."),this.persistence.read()),this.logDebug("DynaTree.persistence: %o",this.persistence.toDict()),this.cache={tagEmpty:"",tagVline:"",tagExpander:"",tagConnector:"",tagNodeIcon:"",tagCheckbox:"",lastentry:undefined},(n.children||n.initAjax&&n.initAjax.url||n.initId)&&$(this.divTree).empty();var i=this.$tree.find(">ul:first").hide();this.tnRoot=new DynaTreeNode(null,this,{}),this.tnRoot.bExpanded=!0,this.tnRoot.render(),this.divTree.appendChild(this.tnRoot.ul);var s=this.tnRoot,o=n.persist&&this.persistence.isReloading(),u=!1,a=this.enableUpdate(!1);this.logDebug("Dynatree._load(): read tree structure..."),n.children?s.addChild(n.children):n.initAjax&&n.initAjax.url?(u=!0,s.data.isLazy=!0,this._reloadAjax(e)):n.initId?this._createFromTag(s,$("#"+n.initId)):(this._createFromTag(s,i),i.remove()),this._checkConsistency(),!u&&n.selectMode==3&&s._updatePartSelectionState(),this.logDebug("Dynatree._load(): render nodes..."),this.enableUpdate(a),this.logDebug("Dynatree._load(): bind events..."),this.$widget.bind(),this.logDebug("Dynatree._load(): postInit..."),this.phase="postInit",n.persist&&this.persistence.write(),this.focusNode&&this.focusNode.isVisible()&&(this.logDebug("Focus on init: %o",this.focusNode),this.focusNode.focus()),u||(n.onPostInit&&n.onPostInit.call(this,o,!1),e&&e.call(this,"ok")),this.phase="idle"},_reloadAjax:function(e){var t=this.options;if(!t.initAjax||!t.initAjax.url)throw"tree.reload() requires 'initAjax' mode.";var n=this.persistence,r=$.extend({},t.initAjax);r.addActiveKey&&(r.data.activeKey=n.activeKey),r.addFocusedKey&&(r.data.focusedKey=n.focusedKey),r.addExpandedKeyList&&(r.data.expandedKeyList=n.expandedKeyList.join(",")),r.addSelectedKeyList&&(r.data.selectedKeyList=n.selectedKeyList.join(",")),r.success&&this.logWarning("initAjax: success callback is ignored; use onPostInit instead."),r.error&&this.logWarning("initAjax: error callback is ignored; use onPostInit instead.");var i=n.isReloading();r.success=function(n,r,s){t.selectMode==3&&n.tree.tnRoot._updatePartSelectionState(),t.onPostInit&&t.onPostInit.call(n.tree,i,!1),e&&e.call(n.tree,"ok")},r.error=function(n,r,s,o){t.onPostInit&&t.onPostInit.call(n.tree,i,!0,r,s,o),e&&e.call(n.tree,"error",r,s,o)},this.logDebug("Dynatree._init(): send Ajax request..."),this.tnRoot.appendAjax(r)},toString:function(){return"Dynatree '"+this.$tree.attr("id")+"'"},toDict:function(){return this.tnRoot.toDict(!0)},serializeArray:function(e){var t=this.getSelectedNodes(e),n=this.$tree.attr("name")||this.$tree.attr("id"),r=[];for(var i=0,s=t.length;i=2&&(Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments))},logInfo:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.apply(arguments,["info"]),_log.apply(this,arguments))},logWarning:function(e){Array.prototype.unshift.apply(arguments,["warn"]),_log.apply(this,arguments)},isInitializing:function(){return this.phase=="init"||this.phase=="postInit"},isReloading:function(){return(this.phase=="init"||this.phase=="postInit")&&this.options.persist&&this.persistence.cookiesFound},isUserEvent:function(){return this.phase=="userEvent"},redraw:function(){this.tnRoot.render(!1,!1)},renderInvisibleNodes:function(){this.tnRoot.render(!1,!0)},reload:function(e){this._load(e)},getRoot:function(){return this.tnRoot},enable:function(){this.$widget.enable()},disable:function(){this.$widget.disable()},getNodeByKey:function(e){var t=document.getElementById(this.options.idPrefix+e);if(t)return t.dtnode?t.dtnode:null;var n=null;return this.visit(function(t){if(t.data.key===e)return n=t,!1},!0),n},getActiveNode:function(){return this.activeNode},reactivate:function(e){var t=this.activeNode;t&&(this.activeNode=null,t.activate(),e&&t.focus())},getSelectedNodes:function(e){var t=[];return this.tnRoot.visit(function(n){if(n.bSelected){t.push(n);if(e===!0)return"skip"}}),t},activateKey:function(e){var t=e===null?null:this.getNodeByKey(e);return t?(t.focus(),t.activate(),t):(this.activeNode&&this.activeNode.deactivate(),this.activeNode=null,null)},loadKeyPath:function(e,t){var n=e.split(this.options.keyPathSeparator);return n[0]===""&&n.shift(),n[0]==this.tnRoot.data.key&&(this.logDebug("Removed leading root key."),n.shift()),e=n.join(this.options.keyPathSeparator),this.tnRoot._loadKeyPath(e,t)},selectKey:function(e,t){var n=this.getNodeByKey(e);return n?(n.select(t),n):null},enableUpdate:function(e){return this.bEnableUpdate==e?e:(this.bEnableUpdate=e,e&&this.redraw(),!e)},count:function(){return this.tnRoot.countChildren()},visit:function(e,t){return this.tnRoot.visit(e,t)},_createFromTag:function(parentTreeNode,$ulParent){var self=this;$ulParent.find(">li").each(function(){var $li=$(this),$liSpan=$li.find(">span:first"),$liA=$li.find(">a:first"),title,href=null,target=null,tooltip;if($liSpan.length)title=$liSpan.html();else if($liA.length)title=$liA.html(),href=$liA.attr("href"),target=$liA.attr("target"),tooltip=$liA.attr("title");else{title=$li.html();var iPos=title.search(/
    =0?title=$.trim(title.substring(0,iPos)):title=$.trim(title)}var data={title:title,tooltip:tooltip,isFolder:$li.hasClass("folder"),isLazy:$li.hasClass("lazy"),expand:$li.hasClass("expanded"),select:$li.hasClass("selected"),activate:$li.hasClass("active"),focus:$li.hasClass("focused"),noLink:$li.hasClass("noLink")};href&&(data.href=href,data.target=target),$li.attr("title")&&(data.tooltip=$li.attr("title")),$li.attr("id")&&(data.key=""+$li.attr("id"));if($li.attr("data")){var dataAttr=$.trim($li.attr("data"));if(dataAttr){dataAttr.charAt(0)!="{"&&(dataAttr="{"+dataAttr+"}");try{$.extend(data,eval("("+dataAttr+")"))}catch(e){throw"Error parsing node data: "+e+"\ndata:\n'"+dataAttr+"'"}}}var childNode=parentTreeNode.addChild(data),$ul=$li.find(">ul:first");$ul.length&&self._createFromTag(childNode,$ul)})},_checkConsistency:function(){},_setDndStatus:function(e,t,n,r,i){var s=e?$(e.span):null,o=$(t.span);this.$dndMarker||(this.$dndMarker=$("
    ").hide().css({"z-index":1e3}).prependTo($(this.divTree).parent()));if(r==="after"||r==="before"||r==="over"){var u="0 0";switch(r){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-before"),u="0 -8";break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-after"),u="0 8";break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before"),this.$dndMarker.addClass("dynatree-drop-over"),o.addClass("dynatree-drop-target"),u="8 0"}this.$dndMarker.show().position({my:"left top",at:"left top",of:o,offset:u})}else o.removeClass("dynatree-drop-target"),this.$dndMarker.hide();r==="after"?o.addClass("dynatree-drop-after"):o.removeClass("dynatree-drop-after"),r==="before"?o.addClass("dynatree-drop-before"):o.removeClass("dynatree-drop-before"),i===!0?(s&&s.addClass("dynatree-drop-accept"),o.addClass("dynatree-drop-accept"),n.addClass("dynatree-drop-accept")):(s&&s.removeClass("dynatree-drop-accept"),o.removeClass("dynatree-drop-accept"),n.removeClass("dynatree-drop-accept")),i===!1?(s&&s.addClass("dynatree-drop-reject"),o.addClass("dynatree-drop-reject"),n.addClass("dynatree-drop-reject")):(s&&s.removeClass("dynatree-drop-reject"),o.removeClass("dynatree-drop-reject"),n.removeClass("dynatree-drop-reject"))},_onDragEvent:function(e,t,n,r,i,s){var o=this.options,u=this.options.dnd,a=null,f=$(t.span),l,c;switch(e){case"helper":var h=$("
    ").append($(r.target).closest(".dynatree-title").clone());$("ul.dynatree-container",t.tree.divTree).append(h),h.data("dtSourceNode",t),a=h;break;case"start":t.isStatusNode()?a=!1:u.onDragStart&&(a=u.onDragStart(t)),a===!1?(this.logDebug("tree.onDragStart() cancelled"),i.helper.trigger("mouseup"),i.helper.hide()):f.addClass("dynatree-drag-source");break;case"enter":a=u.onDragEnter?u.onDragEnter(t,n):null,a?a={over:a===!0||a==="over"||$.inArray("over",a)>=0,before:a===!0||a==="before"||$.inArray("before",a)>=0,after:a===!0||a==="after"||$.inArray("after",a)>=0}:a=!1,i.helper.data("enterResponse",a);break;case"over":c=i.helper.data("enterResponse"),l=null;if(c!==!1)if(typeof c=="string")l=c;else{var p=f.offset(),d={x:r.pageX-p.left,y:r.pageY-p.top},v={x:d.x/f.width(),y:d.y/f.height()};c.after&&v.y>.75?l="after":!c.over&&c.after&&v.y>.5?l="after":c.before&&v.y<=.25?l="before":!c.over&&c.before&&v.y<=.5?l="before":c.over&&(l="over"),u.preventVoidMoves&&(t===n?l=null:l==="before"&&n&&t===n.getNextSibling()?l=null:l==="after"&&n&&t===n.getPrevSibling()?l=null:l==="over"&&n&&n.parent===t&&n.isLastSibling()&&(l=null)),i.helper.data("hitMode",l)}l==="over"&&u.autoExpandMS&&t.hasChildren()!==!1&&!t.bExpanded&&t.scheduleAction("expand",u.autoExpandMS);if(l&&u.onDragOver){a=u.onDragOver(t,n,l);if(a==="over"||a==="before"||a==="after")l=a}this._setDndStatus(n,t,i.helper,l,a!==!1&&l!==null);break;case"drop":var m=i.helper.hasClass("dynatree-drop-reject");l=i.helper.data("hitMode"),l&&u.onDrop&&!m&&u.onDrop(t,n,l,i,s);break;case"leave":t.scheduleAction("cancel"),i.helper.data("enterResponse",null),i.helper.data("hitMode",null),this._setDndStatus(n,t,i.helper,"out",undefined),u.onDragLeave&&u.onDragLeave(t,n);break;case"stop":f.removeClass("dynatree-drag-source"),u.onDragStop&&u.onDragStop(t);break;default:throw"Unsupported drag event: "+e}return a},cancelDrag:function(){var e=$.ui.ddmanager.current;e&&e.cancel()},lastentry:undefined},$.widget("ui.dynatree",{_init:function(){if(versionCompare($.ui.version,"1.8")<0)return this.options.debugLevel>=0&&_log("warn","ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."),this._create();this.options.debugLevel>=2&&_log("debug","ui.dynatree._init() was called; no current default functionality.")},_create:function(){var e=this.options;e.debugLevel>=1&&logMsg("Dynatree._create(): version='%s', debugLevel=%o.",$.ui.dynatree.version,this.options.debugLevel),this.options.event+=".dynatree";var t=this.element.get(0);this.tree=new DynaTree(this),this.tree._load(),this.tree.logDebug("Dynatree._init(): done.")},bind:function(){function t(e){e=$.event.fix(e||window.event);var t=$.ui.dynatree.getNode(e.target);return t?t._onFocus(e):!1}this.unbind();var e="click.dynatree dblclick.dynatree";this.options.keyboard&&(e+=" keypress.dynatree keydown.dynatree"),this.element.bind(e,function(e){var t=$.ui.dynatree.getNode(e.target);if(!t)return!0;var n=t.tree,r=n.options;n.logDebug("event(%s): dtnode: %s",e.type,t);var i=n.phase;n.phase="userEvent";try{switch(e.type){case"click":return r.onClick&&r.onClick.call(n,t,e)===!1?!1:t._onClick(e);case"dblclick":return r.onDblClick&&r.onDblClick.call(n,t,e)===!1?!1:t._onDblClick(e);case"keydown":return r.onKeydown&&r.onKeydown.call(n,t,e)===!1?!1:t._onKeydown(e);case"keypress":return r.onKeypress&&r.onKeypress.call(n,t,e)===!1?!1:t._onKeypress(e)}}catch(s){var o=null;n.logWarning("bind(%o): dtnode: %o, error: %o",e,t,s)}finally{n.phase=i}});var n=this.tree.divTree;n.addEventListener?(n.addEventListener("focus",t,!0),n.addEventListener("blur",t,!0)):n.onfocusin=n.onfocusout=t},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind(),$.Widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind(),$.Widget.prototype.disable.apply(this,arguments)},getTree:function(){return this.tree},getRoot:function(){return this.tree.getRoot()},getActiveNode:function(){return this.tree.getActiveNode()},getSelectedNodes:function(){return this.tree.getSelectedNodes()},lastentry:undefined}),versionCompare($.ui.version,"1.8")<0&&($.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes"),$.ui.dynatree.version="$Version:$",$.ui.dynatree.getNode=function(e){if(e instanceof DynaTreeNode)return e;e.selector!==undefined&&(e=e[0]);while(e){if(e.dtnode)return e.dtnode;e=e.parentNode}return null},$.ui.dynatree.getPersistData=DynaTreeStatus._getTreePersistData,$.ui.dynatree.prototype.options={title:"Dynatree",minExpandLevel:1,imagePath:null,children:null,initId:null,initAjax:null,autoFocus:!0,keyboard:!0,persist:!1,autoCollapse:!1,clickFolderMode:3,activeVisible:!0,checkbox:!1,selectMode:2,fx:null,noLink:!1,onClick:null,onDblClick:null,onKeydown:null,onKeypress:null,onFocus:null,onBlur:null,onQueryActivate:null,onQuerySelect:null,onQueryExpand:null,onPostInit:null,onActivate:null,onDeactivate:null,onSelect:null,onExpand:null,onLazyRead:null,onCustomRender:null,onCreate:null,onRender:null,postProcess:null,dnd:{onDragStart:null,onDragStop:null,autoExpandMS:1e3,preventVoidMoves:!0,onDragEnter:null,onDragOver:null,onDrop:null,onDragLeave:null},ajaxDefaults:{cache:!1,timeout:0,dataType:"json"},strings:{loading:"Loading…",loadError:"Load error!"},generateIds:!1,idPrefix:"dynatree-id-",keyPathSeparator:"/",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"dynatree-container",node:"dynatree-node",folder:"dynatree-folder",empty:"dynatree-empty",vline:"dynatree-vline",expander:"dynatree-expander",connector:"dynatree-connector",checkbox:"dynatree-checkbox",nodeIcon:"dynatree-icon",title:"dynatree-title",noConnector:"dynatree-no-connector",nodeError:"dynatree-statusnode-error",nodeWait:"dynatree-statusnode-wait",hidden:"dynatree-hidden",combinedExpanderPrefix:"dynatree-exp-",combinedIconPrefix:"dynatree-ico-",nodeLoading:"dynatree-loading",hasChildren:"dynatree-has-children",active:"dynatree-active",selected:"dynatree-selected",expanded:"dynatree-expanded",lazy:"dynatree-lazy",focused:"dynatree-focused",partsel:"dynatree-partsel",lastsib:"dynatree-lastsib"},debugLevel:2,lastentry:undefined},versionCompare($.ui.version,"1.8")<0&&($.ui.dynatree.defaults=$.ui.dynatree.prototype.options),$.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:!1,isLazy:!1,tooltip:null,href:null,icon:null,addClass:null,noLink:!1,activate:!1,focus:!1,expand:!1,select:!1,hideCheckbox:!1,unselectable:!1,children:null,lastentry:undefined};var didRegisterDnd=!1,_registerDnd=function(){if(didRegisterDnd)return;$.ui.plugin.add("draggable","connectToDynatree",{start:function(e,t){var n=$(this).data("ui-draggable")||$(this).data("draggable"),r=t.helper.data("dtSourceNode")||null;if(r)return n.offset.click.top=-2,n.offset.click.left=16,r.tree._onDragEvent("start",r,null,e,t,n)},drag:function(e,t){var n=$(this).data("ui-draggable")||$(this).data("draggable"),r=t.helper.data("dtSourceNode")||null,i=t.helper.data("dtTargetNode")||null,s=$.ui.dynatree.getNode(e.target);if(e.target&&!s){var o=$(e.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0;if(o)return}t.helper.data("dtTargetNode",s),i&&i!==s&&i.tree._onDragEvent("leave",i,r,e,t,n),s&&(!s.tree.options.dnd.onDrop||(s===i?s.tree._onDragEvent("over",s,r,e,t,n):s.tree._onDragEvent("enter",s,r,e,t,n)))},stop:function(e,t){var n=$(this).data("ui-draggable")||$(this).data("draggable"),r=t.helper.data("dtSourceNode")||null,i=t.helper.data("dtTargetNode")||null,s=n._mouseDownEvent,o=e.type,u=o=="mouseup"&&e.which==1;logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s",i,t.helper.data("dtTargetNode")),u||logMsg("Drag was cancelled"),i&&(u&&i.tree._onDragEvent("drop",i,r,e,t,n),i.tree._onDragEvent("leave",i,r,e,t,n)),r&&r.tree._onDragEvent("stop",r,null,e,t,n)}}),didRegisterDnd=!0}})(jQuery); \ No newline at end of file diff --git a/UnitTestCoverage/js/jquery.splitter-1.5.1.min.js b/UnitTestCoverage/js/jquery.splitter-1.5.1.min.js deleted file mode 100644 index fbdf8d6..0000000 --- a/UnitTestCoverage/js/jquery.splitter-1.5.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery Splitter Plugin v1.51 -* http://methvin.com/splitter/ -* Dave Methvin; Licensed MIT, GPL */ -(function(e){e.fn.splitter=function(t){t=t||{};return this.each(function(){function r(t){if(f.outline)n=n||v.clone(false).insertAfter(h);c.css("-webkit-user-select","none");v.addClass(f.activeClass);e('
    ').insertAfter(v);h._posSplit=h[0][f.pxSplit]-t[f.eventPos];e(document).bind("mousemove",i).bind("mouseup",s)}function i(e){var t=h._posSplit+e[f.eventPos];if(f.outline){t=Math.max(0,Math.min(t,l._DA-v._DA));v.css(f.origin,t)}else o(t)}function s(t){e("div.vsplitbarmask").remove();v.removeClass(f.activeClass);var r=h._posSplit+t[f.eventPos];if(f.outline){n.remove();n=null;o(r)}c.css("-webkit-user-select","text");e(document).unbind("mousemove",i).unbind("mouseup",s)}function o(t){t=Math.max(h._min,l._DA-p._max,Math.min(t,h._max,l._DA-v._DA-p._min));v._DA=v[0][f.pxSplit];v.css(f.origin,t).css(f.fixed,l._DF);h.css(f.origin,0).css(f.split,t).css(f.fixed,l._DF);p.css(f.origin,t+v._DA).css(f.split,l._DA-v._DA-t).css(f.fixed,l._DF);if(!e.browser.msie)c.trigger("resize")}function u(e,t){var n=0;for(var r=1;r*",l[0]).css({position:"absolute","z-index":"1","-moz-outline-style":"none"});var h=e(c[0]);var p=e(c[1]);var d=e('').attr({accessKey:f.accessKey,tabIndex:f.tabIndex,title:f.splitbarClass}).bind(e.browser.opera?"click":"focus",function(){this.focus();v.addClass(f.activeClass)}).bind("keydown",function(e){var t=e.which||e.keyCode;var n=t==f["key"+f.side1]?1:t==f["key"+f.side2]?-1:0;if(n)o(h[0][f.pxSplit]+n*f.pxPerKey,false)}).bind("blur",function(){v.removeClass(f.activeClass)});var v=e(c[2]||"
    ").insertAfter(h).css("z-index","100").append(d).attr({"class":f.splitbarClass,unselectable:"on"}).css({position:"absolute","user-select":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none",top:"0px"}).bind("mousedown",r);if(/^(auto|default|)$/.test(v.css("cursor")))v.css("cursor",f.cursor);v._DA=v[0][f.pxSplit];l._PBF=e.boxModel?u(l,"border"+f.side3+"Width","border"+f.side4+"Width"):0;l._PBA=e.boxModel?u(l,"border"+f.side1+"Width","border"+f.side2+"Width"):0;h._pane=f.side1;p._pane=f.side2;e.each([h,p],function(){this._min=f["min"+this._pane]||u(this,"min-"+f.split);this._max=f["max"+this._pane]||u(this,"max-"+f.split)||9999;this._init=f["size"+this._pane]===true?parseInt(e.curCSS(this[0],f.split)):f["size"+this._pane]});var m=h._init;if(!isNaN(p._init))m=l[0][f.pxSplit]-l._PBA-p._init-v._DA;if(f.cookie){if(!e.cookie)alert("jQuery.splitter(): jQuery cookie plugin required");var g=parseInt(e.cookie(f.cookie));if(!isNaN(g))m=g;e(window).bind("unload",function(){var t=String(v.css(f.origin));e.cookie(f.cookie,t,{expires:f.cookieExpires||365,path:f.cookiePath||document.location.pathname})})}if(isNaN(m))m=Math.round((l[0][f.pxSplit]-l._PBA-v._DA)/2);if(f.anchorToWindow){l._hadjust=u(l,"borderTopWidth","borderBottomWidth","marginBottom");l._hmin=Math.max(u(l,"minHeight"),20);e(window).bind("resize",function(){var t=l.offset().top;var n=e(window).height();l.css("height",Math.max(n-t-l._hadjust,l._hmin)+"px");if(!e.browser.msie)l.trigger("resize")}).trigger("resize")}else if(f.resizeToWidth&&!e.browser.msie)e(window).bind("resize",function(){l.trigger("resize")});l.bind("resize",function(e,t){if(e.target!=this)return;l._DF=l[0][f.pxFixed]-l._PBF;l._DA=l[0][f.pxSplit]-l._PBA;if(l._DF<=0||l._DA<=0)return;o(!isNaN(t)?t:!(f.sizeRight||f.sizeBottom)?h[0][f.pxSplit]:l._DA-p[0][f.pxSplit]-v._DA)}).trigger("resize",[m])})}})(jQuery) \ No newline at end of file diff --git a/UnitTestCoverage/js/jquery.ui.custom-1.8.7.min.js b/UnitTestCoverage/js/jquery.ui.custom-1.8.7.min.js deleted file mode 100644 index d3347d8..0000000 --- a/UnitTestCoverage/js/jquery.ui.custom-1.8.7.min.js +++ /dev/null @@ -1,271 +0,0 @@ -/*! - * jQuery UI 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.7",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, -NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, -"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); -if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, -"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, -d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); -c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); -return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", -true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=m/2; -i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, -b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? -0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), -10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== -Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): -f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; -if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ -b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, -stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= -document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), -d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", -b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; -f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", -b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= -a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, -k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ -a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, -arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, -{version:"1.8.7"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, -function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= -(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= -false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- -a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", -b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", -"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, -f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= -a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ -a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& -e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", -height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= -d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); -;/* - * jQuery UI Selectable 1.8.7 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", -c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= -this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", -null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): -d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute|| -"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")}, -_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!= -this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a= -this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable"); -if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h= -0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width= -this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f}, -update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b= -null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this)); -this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])? -g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive", -g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over= -0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e - - - - C:\Users\lisa\Documents\Projects\UCI\VTS_Release\Vts.MonteCarlo\Vts.MonteCarlo.CommandLineApplication\CommandLine.cs - - - - -
    -using System;
    -using System.Collections.Generic;
    -using System.Linq;
    -using System.Text.RegularExpressions;
    -
    -namespace Vts.MonteCarlo.CommandLineApplication;
    -
    -internal static class CommandLine
    -{
    -    public class Switch // Class that encapsulates switch data.
    -    {
    -        public Switch(string name, string shortForm, Action<IEnumerable<string>> handler)
    -        {
    -            Name = name;
    -            ShortForm = shortForm;
    -            Handler = handler;
    -        }
    -
    -        public Switch(string name, Action<IEnumerable<string>> handler)
    -        {
    -            Name = name;
    -            ShortForm = null;
    -            Handler = handler;
    -        }
    -
    -        public string Name { get; private set; }
    -        public string ShortForm { get; private set; }
    -        public Action<IEnumerable<string>> Handler { get; private set; }
    -
    -        public int InvokeHandler(string[] values)
    -        {
    -            Handler(values);
    -            return 1;
    -        }
    -    }
    -
    -    /* The regex that extracts names and comma-separated values for switches 
    -        in the form (<switch>[="value 1",value2,...])+ */
    -    private static readonly Regex ArgRegex =
    -        new Regex(@"(?<name>[^=]+)=?((?<quoted>\""?)(?<value>(?(quoted)[^\""]+|[^,]+))\""?,?)*",
    -            RegexOptions.Compiled | RegexOptions.CultureInvariant |
    -            RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
    -
    -    private const string NameGroup = "name"; // Names of capture groups
    -    private const string ValueGroup = "value";
    -
    -    public static void Process(this string[] args, Action printUsage, params Switch[] switches)
    -    {
    -        /* Run through all matches in the argument list and if any of the switches 
    -            match, get the values and invoke the handler we were given. We do a Sum() 
    -            here for 2 reasons; a) To actually run the handlers
    -            and b) see if any were invoked at all (each returns 1 if invoked).
    -            If none were invoked, we simply invoke the printUsage handler. */
    -        if ((from arg in args
    -                from Match match in ArgRegex.Matches(arg)
    -                from s in switches
    -                where match.Success &&
    -                      ((string.Compare(match.Groups[NameGroup].Value, s.Name, true) == 0) ||
    -                       (string.Compare(match.Groups[NameGroup].Value, s.ShortForm, true) == 0))
    -                select s.InvokeHandler(match.Groups[ValueGroup].Value.Split(','))).Sum() == 0)
    -            printUsage(); // We didn't find any switches
    -    }
    -}
    -    
    - - - \ No newline at end of file diff --git a/UnitTestCoverage/src/12.html b/UnitTestCoverage/src/12.html deleted file mode 100644 index a10038a..0000000 --- a/UnitTestCoverage/src/12.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - C:\Users\lisa\Documents\Projects\UCI\VTS_Release\Vts.MonteCarlo\Vts.MonteCarlo.CommandLineApplication\MonteCarloSetup.cs - - - - -
    -using System;
    -using System.Collections.Generic;
    -using System.IO;
    -using System.Linq;
    -using System.Threading.Tasks;
    -using Vts.Common;
    -using Vts.Common.Logging;
    -using Vts.Extensions;
    -using Vts.MonteCarlo.DataStructuresValidation;
    -using Vts.MonteCarlo.Extensions;
    -using Vts.MonteCarlo.IO;
    -
    -namespace Vts.MonteCarlo.CommandLineApplication
    -{
    -    public static class MonteCarloSetup
    -    {
    -        private static readonly ILogger Logger = LoggerFactoryLocator.GetDefaultNLogFactory().Create(typeof(MonteCarloSetup));
    -
    -        /// <summary>
    -        /// method to read the simulation input from a specified or default file
    -        /// </summary>
    -        public static SimulationInput ReadSimulationInputFromFile(string inputFile)
    -        {
    -            try
    -            {
    -                if (string.IsNullOrEmpty(inputFile))
    -                {
    -                    Logger.Info(" *** No input file specified ***\n\nDefine an input file using mc.exe infile=infile_name.txt");
    -                    return null;
    -                }
    -
    -                //get the full path for the input file
    -                var fullFilePath = Path.GetFullPath(inputFile);
    -
    -                if (File.Exists(fullFilePath))
    -                {
    -                    return SimulationInput.FromFile(fullFilePath);       
    -                }
    -
    -                if (File.Exists(fullFilePath + ".txt"))
    -                {
    -                    return SimulationInput.FromFile(fullFilePath + ".txt");
    -                }
    -
    -                //throw a file not found exception
    -                throw new FileNotFoundException("\nThe following input file could not be found: " + fullFilePath + " - type mc help=infile for correct syntax");
    -            }
    -            catch (Exception e)
    -            {
    -                Console.WriteLine(e.Message);
    -                return null;
    -            }
    -        }
    -
    -        public static ParameterSweep CreateParameterSweep(string[] parameterSweepString, ParameterSweepType type) // check for null returns?
    -        {
    -            if ((type == ParameterSweepType.Count || type == ParameterSweepType.Delta))
    -            {
    -                if (parameterSweepString.Length != 4)
    -                {
    -                    
    -                    var message =
    -                        " *** Invalid sweep parameter ***" +
    -                        "\n\t\tsweep parameters should have 4 values in the format:";
    -                    if (type == ParameterSweepType.Delta)
    -                    {
    -                        message += "\n\t\tparamsweepdelta=<Parameter>,Start,Stop,Delta";
    -                    }
    -                    else
    -                    {
    -                        message += "\n\t\tparamsweep=<Parameter>,Start,Stop,Count";
    -                    }
    -                    message += "\n\t\tIgnoring this sweep parameter\n";
    -                    Logger.Warn(() => message);
    -                    return null;
    -                    
    -                }
    -            }
    -            else // type==ParameterSweepType.List
    -            {
    -                var number = double.Parse(parameterSweepString[1]);
    -                // check that number is an integer and that number of parameters is 2 more than number
    -                if ((number == Math.Floor(number)) && (parameterSweepString.Length != number + 2))
    -                {
    -                    var message =
    -                        " *** Invalid sweep parameter: either Number or number of Vals is in error ***" +
    -                        "\n\t\tsweep parameters should have format paramsweeplist=<Parameter>,NumVals,Val1,...,ValN";
    -                    message += "\n\t\tIgnoring this sweep parameter\n";
    -                    Logger.Warn(() => message);
    -                    return null;
    -                }
    -            }
    -
    -            try
    -            {
    -                var inputParameterType = parameterSweepString[0];
    -                double start, stop;
    -                DoubleRange sweepRange;
    -                switch (type)
    -                {
    -                    // batch parameter values should come in fours for Delta and Count
    -                    case ParameterSweepType.Delta:
    -                        // eg. paramsweepdelta=mua1,0.0,4.0,0.05 paramsweepdelta=mus1,0.5,1.5,0.1 paramsweepdelta=mus2,0.5,1.5,0.1 ...
    -                        start = double.Parse(parameterSweepString[1]);
    -                        stop = double.Parse(parameterSweepString[2]);
    -                        var delta = double.Parse(parameterSweepString[3]);
    -                        // use Math.Round to make sure floating point precision doesn't reduce/increase count
    -                        sweepRange = new DoubleRange(start, stop, (int)(Math.Round((stop - start) / delta)) + 1);
    -                        return new ParameterSweep(inputParameterType, sweepRange);
    -                    case ParameterSweepType.Count: 
    -                        // eg. paramsweep=mua1,0.01,4.0,101 paramsweep=mus1,0.5,1.5,3 paramsweep=mus2,0.5,1.5,3 ...
    -                        start = double.Parse(parameterSweepString[1]);
    -                        stop = double.Parse(parameterSweepString[2]);
    -                        var count = int.Parse(parameterSweepString[3]);
    -                        sweepRange = new DoubleRange(start, stop, count);
    -                        return new ParameterSweep(inputParameterType, sweepRange);
    -                    case ParameterSweepType.List:
    -                        // eg. paramsweeplist=mua1,2,0.01,0.02
    -                        var number = int.Parse(parameterSweepString[1]);
    -                        var sweepList = new double[number];
    -                        for (var i = 0; i < number; i++)
    -                        { 
    -                            sweepList[i]=double.Parse(parameterSweepString[i + 2]);
    -                        }
    -                        return new ParameterSweep(inputParameterType, sweepList);
    -                }
    -                return null;
    -            }
    -            catch
    -            {
    -                Logger.Error(() => "Could not parse the input arguments.\n\tIgnoring the following input parameter sweep: " + parameterSweepString);
    -                return null;
    -            }
    -        }
    -
    -        public static IEnumerable<SimulationInput> ApplyParameterSweeps(SimulationInput input, IEnumerable<ParameterSweep> parameterSweeps)
    -        {
    -            var batchInputs = input.AsEnumerable();
    -
    -            foreach (var parameterSweep in parameterSweeps)
    -            {
    -                var sweepValues = parameterSweep.Values.ToEnumerable<double>();
    -
    -                batchInputs = batchInputs.WithParameterSweep(sweepValues, parameterSweep.Name.ToLower());
    -            }
    -
    -            return batchInputs.ToArray();
    -        }
    -
    -        public static ValidationResult ValidateSimulationInput(SimulationInput input)
    -        {
    -            return SimulationInputValidation.ValidateInput(input);
    -        }
    -
    -        public static void RunSimulation(SimulationInput input, string outputFolderPath, int numberOfCPUs)
    -        {
    -            // locate root folder for output, creating it if necessary
    -            var path = string.IsNullOrEmpty(outputFolderPath)
    -                ? Path.GetFullPath(Directory.GetCurrentDirectory())
    -                : Path.GetFullPath(outputFolderPath);
    -            if (!Directory.Exists(path))
    -            {
    -                Directory.CreateDirectory(path);
    -            }
    -
    -            // locate destination folder for output, creating it if necessary
    -            var resultsFolder = Path.Combine(path, input.OutputName);
    -            if (!Directory.Exists(resultsFolder))
    -            {
    -                Directory.CreateDirectory(resultsFolder);
    -            }
    -            SimulationOutput detectorResults;
    -            if (numberOfCPUs > 1)
    -            {
    -                var parallelMC = new ParallelMonteCarloSimulation(input, numberOfCPUs);
    -                //parallelMC.SetOutputPathForDatabases(path); // no inheritance of MonteCarloSimulation class
    -                detectorResults = parallelMC.RunSingleInParallel();
    -            }
    -            else
    -            {
    -                var mc = new MonteCarloSimulation(input);
    -                mc.SetOutputPathForDatabases(path);
    -                detectorResults = mc.Run();
    -            }
    -
    -            input.ToFile(Path.Combine(resultsFolder, input.OutputName + ".txt"));
    -
    -            foreach (var result in detectorResults.ResultsDictionary.Values)
    -            {
    -                // save all detector data to the specified folder
    -                DetectorIO.WriteDetectorToFile(result, resultsFolder);
    -            }
    -        }
    -
    -        /// <summary>
    -        /// Runs multiple Monte Carlo simulations in parallel using all available CPU cores
    -        /// </summary>
    -        public static void RunSimulations(IEnumerable<SimulationInput> inputs, string outputFolderPath, int numberOfCPUs)
    -        {
    -            var options = new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount };
    -            Parallel.ForEach(inputs, options, (input, state, index) =>
    -            {
    -                input.Options.SimulationIndex = (int)index;
    -                RunSimulation(input, outputFolderPath, numberOfCPUs);
    -            });
    -        }
    -    }
    -}
    -
    -    
    - - - \ No newline at end of file diff --git a/UnitTestCoverage/src/13.html b/UnitTestCoverage/src/13.html deleted file mode 100644 index c4662f1..0000000 --- a/UnitTestCoverage/src/13.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - C:\Users\lisa\Documents\Projects\UCI\VTS_Release\Vts.MonteCarlo\Vts.MonteCarlo.CommandLineApplication\ParameterSweep.cs - - - - -
    -using Vts.Common;
    -
    -namespace Vts.MonteCarlo.CommandLineApplication
    -{
    -    public class ParameterSweep
    -    {
    -        public string Name { get; set; }
    -        public DoubleRange Range { get; set; }
    -        // Values are the individual values defined by Range or by paramsweeplist
    -        public double[] Values { get; set; }
    -
    -        public ParameterSweep(string name, DoubleRange range)
    -        {
    -            Name = name;
    -            Range = range;
    -            Values = new double[range.Count];
    -            for (var i = 0; i < range.Count; i++)
    -            {
    -                Values[i] = range.Start + i * range.Delta;
    -            }
    -        }
    -
    -        public ParameterSweep(string name, double[] values)
    -        {
    -            Name = name;
    -            Values = values;
    -        }
    -
    -        public ParameterSweep()
    -            : this("mua1", new DoubleRange(0.01, 0.05, 5))
    -        {
    -        }
    -    }
    -}
    -
    -    
    - - - \ No newline at end of file diff --git a/UnitTestCoverage/src/14.html b/UnitTestCoverage/src/14.html deleted file mode 100644 index 7569601..0000000 --- a/UnitTestCoverage/src/14.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - C:\Users\lisa\Documents\Projects\UCI\VTS_Release\Vts.MonteCarlo\Vts.MonteCarlo.CommandLineApplication\Program.cs - - - - -
    -//#define PROCESS_ATTACH_DEBUG
    -
    -using System;
    -using System.Collections.Generic;
    -using System.Linq;
    -using System.Reflection;
    -using System.Runtime.CompilerServices;
    -using NLog;
    -using Vts.Common.Logging;
    -
    -[assembly: InternalsVisibleTo("Vts.MonteCarlo.CommandLineApplication.Test")]
    -
    -namespace Vts.MonteCarlo.CommandLineApplication
    -{
    -
    -    #region CommandLine Arguments Parser
    -
    -    /* Simple commandline argument parser written by Ananth B. http://www.ananthonline.net */
    -
    -    #endregion
    -    /// <summary>
    -    /// Monte Carlo command line application program.  Type "mc help" for
    -    /// a description of the different command line parameters.
    -    /// </summary>
    -    public static class Program
    -    {
    -        private static readonly Common.Logging.ILogger Logger = LoggerFactoryLocator.GetDefaultNLogFactory().Create(typeof(Program));
    -
    -        /// <summary>
    -        /// main Monte Carlo CommandLine (MCCL) application
    -        /// </summary>
    -        /// <param name="args"></param>
    -        /// <returns>int = 0 (successful completion)</returns>
    -        /// <returns>int = 1 (infile null or missing)</returns>
    -        /// <returns>int = 2 (infile exists but does not pass validation)</returns>
    -        public static int Main(string[] args)
    -        {
    -#if PROCESS_ATTACH_DEBUG
    -            Console.Read();
    -#endif
    -            var inFile = "";
    -            var inFiles = new List<string>();
    -            var outName = "";
    -            var outPath = "";
    -            var CPUCount = "1"; // default is to use 1
    -            var infoOnlyOption = false;
    -            IList<ParameterSweep> paramSweep = new List<ParameterSweep>();
    -
    -            args.Process(() =>
    -               {
    -                   Logger.Info($"\nVirtual Photonics MC {GetVersionNumber(3)}\n");
    -                   Logger.Info("For more information type mc help");
    -                   Logger.Info("For help on a specific topic type dotnet mc.dll help=<topicname>\n");
    -            },
    -               new CommandLine.Switch("help", val =>
    -               {
    -                   var helpTopic = val.First();
    -                   if (helpTopic != "")
    -                       ShowHelp(helpTopic);
    -                   else
    -                       ShowHelp();
    -                   infoOnlyOption = true;
    -               }),
    -               new CommandLine.Switch("geninfiles", val =>
    -               {
    -                   GenerateDefaultInputFiles();
    -                   infoOnlyOption = true;
    -               }),
    -               new CommandLine.Switch("infile", val =>
    -               {
    -                   inFile = val.First();
    -                   Logger.Info(() => "input file specified as " + inFile);
    -               }),
    -               new CommandLine.Switch("infiles", val =>
    -               {
    -                   inFiles.AddRange(val);
    -                   foreach (var file in inFiles)
    -                   {
    -                       Logger.Info(() => "input file specified as " + file);
    -                   }
    -               }),
    -               new CommandLine.Switch("outname", val =>
    -               {
    -                   outName = val.First();
    -                   Logger.Info(() => "output name overridden as " + outName);
    -               }),
    -               new CommandLine.Switch("outpath", val =>
    -               {
    -                   outPath = val.First();
    -                   Logger.Info(() => "output path specified as " + outPath);
    -               }),
    -               new CommandLine.Switch("cpucount", val =>
    -               {
    -                    CPUCount = val.First();
    -                    if (CPUCount == "all")
    -                    {
    -                        CPUCount = Environment.ProcessorCount.ToString();
    -                        Logger.Info(() => "changed to maximum CPUs on system " + CPUCount);
    -                    }
    -                    else
    -                    {
    -                        if (!int.TryParse(CPUCount, out var CPUCountInt))
    -                        {
    -                            Logger.Info(() => "unknown cpucount option " + CPUCount);
    -                        }
    -                        else
    -                        {
    -                            Logger.Info(() => "number of CPUs specified as " + CPUCount);
    -                        }
    -                    }
    -               }),
    -               new CommandLine.Switch("paramsweep", val =>
    -               {
    -                   var sweepString = val.ToArray();
    -                   var sweep = MonteCarloSetup.CreateParameterSweep(sweepString, ParameterSweepType.Count);
    -                   if (sweep == null) return;
    -                   paramSweep.Add(sweep);
    -                   Logger.Info(() => "parameter sweep specified as " + sweepString[0] + " from " + sweepString[1] + " to " + sweepString[2] + ", with a count of " + sweepString[3]);
    -               }),
    -               new CommandLine.Switch("paramsweepdelta", val =>
    -               {
    -                   var sweepString = val.ToArray();
    -                   var sweep = MonteCarloSetup.CreateParameterSweep(sweepString, ParameterSweepType.Delta);
    -                   if (sweep == null) return;
    -                   paramSweep.Add(sweep);
    -                   Logger.Info(() => "parameter sweep specified as " + sweepString[0] + " from " + sweepString[1] + " to " + sweepString[2] + ", with a delta of " + sweepString[3]);
    -               }),
    -                new CommandLine.Switch("paramsweeplist", val =>
    -                {
    -                    var sweepString = val.ToArray();
    -                    var sweep = MonteCarloSetup.CreateParameterSweep(sweepString, ParameterSweepType.List);
    -                    if (sweep == null) return;
    -                    paramSweep.Add(sweep);
    -                    Logger.Info(() => "parameter sweep specified as " + sweepString[0] + " values");
    -                }));
    -
    -            if (!infoOnlyOption)
    -            {
    -                Func<SimulationInput, bool> checkValid = simInput =>
    -                    {
    -                        var validationResult = MonteCarloSetup.ValidateSimulationInput(simInput);
    -                        if (validationResult.IsValid) return true;
    -                        Console.Write("\nSimulation(s) contained one or more errors. Details:");
    -                        Console.Write("\nValidation rule:" + validationResult.ValidationRule);
    -                        Console.Write("\nRemarks:" + validationResult.Remarks);
    -                        return false;
    -                    };
    -                SimulationInput input;
    -                if (paramSweep.Any() || inFiles.Any())
    -                {
    -                    IList<SimulationInput> inputs;
    -                    if (paramSweep.Any())
    -                    {
    -                        input = MonteCarloSetup.ReadSimulationInputFromFile(inFile);
    -                        if (input == null)
    -                        {
    -                            return 1;
    -                        }
    -                        if (!string.IsNullOrEmpty(outName))
    -                        {
    -                            input.OutputName = outName;
    -                        }
    -
    -                        inputs = MonteCarloSetup.ApplyParameterSweeps(input, paramSweep).ToList();
    -                    }
    -                    else // if infiles.Count() > 0
    -                    {
    -                        inputs = inFiles.Select(file => MonteCarloSetup.ReadSimulationInputFromFile(file)).ToList();
    -                        if (!inputs.Any())
    -                        {
    -                            return 1;
    -                        }
    -                    }
    -                    // validate input 
    -                    if (inputs.Any(simulationInput => !checkValid(simulationInput)))
    -                    {
    -                        return 2;
    -                    }
    -                    // make sure input does not specify Database if CPUCount>1
    -                    if (int.Parse(CPUCount) > 1 && (inputs.First().Options.Databases != null && inputs.First().Options.Databases.Count != 0))
    -                    {
    -                        CPUCount = 1.ToString();
    -                        Logger.Info(() => "parallel processing cannot be performed when a Database is specified, changed CPUCount to 1");
    -                    }
    -
    -                    MonteCarloSetup.RunSimulations(inputs, outPath, int.Parse(CPUCount));
    -                    Logger.Info("\nSimulations complete.");
    -                    return 0;
    -                }
    -
    -                input = MonteCarloSetup.ReadSimulationInputFromFile(inFile);
    -                if (input == null)
    -                {
    -                    return 1;
    -                }
    -
    -                if (!checkValid(input))
    -                    return 2;
    -
    -                if (!string.IsNullOrEmpty(outName))
    -                {
    -                    input.OutputName = outName;
    -                }
    -
    -                // make sure input does not specify Database if CPUCount>1
    -                if (int.Parse(CPUCount) > 1 && (input.Options.Databases != null && input.Options.Databases?.Count != 0))
    -                {
    -                    CPUCount = 1.ToString();
    -                    Logger.Info(() =>
    -                        "parallel processing cannot be performed when a Database is specified, changed CPUCount to 1");
    -                }
    -
    -                MonteCarloSetup.RunSimulation(input, outPath, int.Parse(CPUCount));
    -                Logger.Info("\nSimulation complete.");
    -                return 0;
    -            }
    -
    -            LogManager.Configuration = null;
    -            return 0;
    -        }
    -        
    -        private static void GenerateDefaultInputFiles()
    -        {
    -            try
    -            {
    -                var inputFiles = SimulationInputProvider.GenerateAllSimulationInputs();
    -                foreach (var input in inputFiles)
    -                {
    -                    input.ToFile("infile_" + input.OutputName + ".txt"); // write json to .txt files 
    -                }
    -            }
    -            catch (Exception e)
    -            {
    -                Logger.Error($"There was an error generating infiles, check your permissions - {e.Message}");
    -            }
    -        }
    -
    -        /// <summary>
    -        /// Displays the help text for detailed usage of the application
    -        /// </summary>
    -        private static void ShowHelp()
    -        {
    -            Logger.Info($"Virtual Photonics MC {GetVersionNumber(3)}");
    -            Logger.Info("\nFor more detailed help type dotnet mc.dll help=<topicname>");
    -            Logger.Info("\ntopics:");
    -            Logger.Info("\ninfile");
    -            Logger.Info("outpath");
    -            Logger.Info("outname");
    -            Logger.Info("cpucount");
    -            Logger.Info("paramsweep");
    -            Logger.Info("paramsweepdelta");
    -            Logger.Info("paramsweeplist");
    -            Logger.Info("\nlist of arguments:");
    -            Logger.Info("\ninfile\t\tthe input file, accepts relative and absolute paths");
    -            Logger.Info("outpath\t\tthe output path, accepts relative and absolute paths");
    -            Logger.Info("outname\t\toutput name, this value is appended for a parameter sweep");
    -            Logger.Info("cpucount\tnumber of CPUs, default is 1");
    -            Logger.Info("paramsweep\ttakes the sweep parameter name and values in the format:");
    -            Logger.Info("\t\tparamsweep=<SweepParameterType>,Start,Stop,Count");
    -            Logger.Info("paramsweepdelta\ttakes the sweep parameter name and values in the format:");
    -            Logger.Info("\t\tparamsweepdelta=<SweepParameterType>,Start,Stop,Delta");
    -            Logger.Info("paramsweeplist\ttakes the sweep parameter name and values in the format:");
    -            Logger.Info("\t\tparamsweeplist=<SweepParameterType>,NumVals,Val1,Val2,...");
    -            Logger.Info("\ngeninfiles\tgenerates example infiles and names them infile_XXX.txt");
    -            Logger.Info("\t\tinfile_XXX.txt where XXX describes the type of input specified");
    -            Logger.Info("\nlist of sweep parameters (SweepParameterType):");
    -            Logger.Info("\nmua1\t\tabsorption coefficient for tissue layer 1");
    -            Logger.Info("mus1\t\tscattering coefficient for tissue layer 1");
    -            Logger.Info("n1\t\trefractive index for tissue layer 1");
    -            Logger.Info("g1\t\tanisotropy for tissue layer 1");
    -            Logger.Info("\nmua2\t\tabsorption coefficient for tissue layer 2");
    -            Logger.Info("mus2\t\tscattering coefficient for tissue layer 2");
    -            Logger.Info("n2\t\trefractive index for tissue layer 2");
    -            Logger.Info("g2\t\tanisotropy for tissue layer 2");
    -            Logger.Info("\nmuai\t\tabsorption coefficient for tissue layer i");
    -            Logger.Info("musi\t\tscattering coefficient for tissue layer i");
    -            Logger.Info("ni\t\trefractive index for tissue layer i");
    -            Logger.Info("gi\t\tanisotropy for tissue layer i");
    -            Logger.Info("\nnphot\t\tnumber of photons to launch from the source");
    -            Logger.Info("\nseed\t\tseed of random number generator");
    -            Logger.Info("\nsample usage:");
    -            Logger.Info("dotnet mc.dll infile=myinput outname=myoutput paramsweep=mua1,0.01,0.04,4 paramsweep=mus1,10,20,2 paramsweep=nphot,1000000,2000000,2\n");
    -        }
    -
    -        /// <summary>
    -        /// Displays the help text for the topic passed as a parameter
    -        /// </summary>
    -        /// <param name="helpTopic">Help topic</param>
    -        private static void ShowHelp(string helpTopic)
    -        {
    -            switch (helpTopic.ToLower())
    -            {
    -                case "infile":
    -                    Logger.Info("\nINFILE");
    -                    Logger.Info("This is the name of the input file, it can be a relative or absolute path.");
    -                    Logger.Info("If the path name has any spaces enclose it in double quotes.");
    -                    Logger.Info("For relative paths, omit the leading slash.");
    -                    Logger.Info("EXAMPLES for .txt (json) files:");
    -                    Logger.Info("\tinfile=C:\\MonteCarlo\\InputFiles\\myinfile.txt");
    -                    Logger.Info("\tinfile=\"C:\\Monte Carlo\\InputFiles\\myinfile.txt\"");
    -                    Logger.Info("\tinfile=InputFiles\\myinfile.txt");
    -                    Logger.Info("\tinfile=myinfile.txt");
    -                    break;
    -                case "outpath":
    -                    Logger.Info("\nOUTPATH");
    -                    Logger.Info("This is the name of the output path, it can be a relative or absolute path.");
    -                    Logger.Info("If the path name has any spaces enclose it in double quotes.");
    -                    Logger.Info("For relative paths, omit the leading slash.");
    -                    Logger.Info("EXAMPLES:");
    -                    Logger.Info("\toutpath=C:\\MonteCarlo\\OutputFiles");
    -                    Logger.Info("\toutpath=OutputFiles");
    -                    break;
    -                case "outname":
    -                    Logger.Info("\nOUTNAME");
    -                    Logger.Info("The outname is appended to the folder names if there is a parameter sweep.");
    -                    Logger.Info("EXAMPLE:");
    -                    Logger.Info("\toutname=mcResults");
    -                    break;
    -                case "cpucount":
    -                    Logger.Info("\nCPUCOUNT");
    -                    Logger.Info("The cpucount specifies the number of CPUs utilized to process a single simulation.");
    -                    Logger.Info($"The number of CPUs on this computer: {Environment.ProcessorCount}");
    -                    Logger.Info("EXAMPLE:");
    -                    Logger.Info("\tcpucount=4");
    -                    break;
    -                case "paramsweep":
    -                    Logger.Info("\nPARAMSWEEP");
    -                    Logger.Info("Defines the parameter sweep and its values.");
    -                    Logger.Info("FORMAT:");
    -                    Logger.Info("\tparamsweep=<SweepParameterType>,Start,Stop,Count");
    -                    Logger.Info("EXAMPLES:");
    -                    Logger.Info("\tparamsweep=mua1,0.01,0.04,4");
    -                    Logger.Info("\tparamsweep=mus1,10,20,2");
    -                    break;
    -                case "paramsweepdelta":
    -                    Logger.Info("\nPARAMSWEEPDELTA");
    -                    Logger.Info("Defines the parameter sweep and its values.");
    -                    Logger.Info("FORMAT:");
    -                    Logger.Info("\tparamsweepdelta=<SweepParameterType>,Start,Stop,Delta");
    -                    Logger.Info("EXAMPLES:");
    -                    Logger.Info("\tparamsweepdelta=mua1,0.01,0.04,0.01");
    -                    Logger.Info("\tparamsweepdelta=mus1,10,20,5");
    -                    break;
    -                case "paramsweeplist":
    -                    Logger.Info("\nPARAMSWEEPLIST");
    -                    Logger.Info("Defines the parameter sweep and its values.");
    -                    Logger.Info("FORMAT:");
    -                    Logger.Info("\tparamsweeplist=<SweepParameterType>,NumValues,Val1,Val2,Val3,...");
    -                    Logger.Info("EXAMPLES:");
    -                    Logger.Info("\tparamsweeplist=mua1,3,0.01,0.03,0.04");
    -                    Logger.Info("\tparamsweeplist=mus1,5,0.01,1,10,100,1000");
    -                    break;
    -                default:
    -                    ShowHelp();
    -                    break;
    -            }
    -        }
    -        
    -        /// <summary>
    -        /// Gets the version number of the application
    -        /// </summary>
    -        /// <param name="limiter">Determines how many levels of the version to return</param>
    -        /// <returns>A string with the version</returns>
    -        internal static string GetVersionNumber(uint limiter = 0)
    -        {
    -            var currentAssembly = Assembly.GetExecutingAssembly().GetName();
    -            if (currentAssembly.Version == null) return null;
    -            return limiter switch
    -            {
    -                1 => $"{currentAssembly.Version.Major}",
    -                2 => $"{currentAssembly.Version.Major}.{currentAssembly.Version.Minor}",
    -                3 => $"{currentAssembly.Version.Major}.{currentAssembly.Version.Minor}.{currentAssembly.Version.Build}",
    -                _ => $"{currentAssembly.Version}"
    -            };
    -        }
    -    }
    -}
    -
    -
    -
    -    
    - - - \ No newline at end of file diff --git a/UnitTestCoverage/src/17.html b/UnitTestCoverage/src/17.html deleted file mode 100644 index 7379590..0000000 --- a/UnitTestCoverage/src/17.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - C:\Users\lisa\Documents\Projects\UCI\VTS_Release\Vts.MonteCarlo\Vts.MonteCarlo.PostProcessor\PostProcessorSetup.cs - - - - -
    -using System;
    -using System.Collections.Generic;
    -using System.IO;
    -using System.Linq;
    -using System.Threading.Tasks;
    -using Vts.MonteCarlo.DataStructuresValidation;
    -using Vts.MonteCarlo.Factories;
    -using Vts.MonteCarlo.IO;
    -using Vts.MonteCarlo.PostProcessing;
    -
    -namespace Vts.MonteCarlo.PostProcessor
    -{
    -    public static class PostProcessorSetup
    -    {
    -        /// <summary>
    -        /// method to read the post processor input from a specified or default files
    -        /// </summary>
    -        public static PostProcessorInput ReadPostProcessorInputFromFile(string inputFile)
    -        {
    -            try
    -            {
    -                // read input file then read in elements of input file
    -                if (string.IsNullOrEmpty(inputFile))
    -                {
    -                        Console.WriteLine("\nNo input file specified. Using infile.txt from root mc_post.exe folder... ");
    -                        return ReadPostProcessorInputFromFile("infile.txt");
    -                }
    -            
    -                //get the full path for the input file
    -                var fullFilePath = Path.GetFullPath(inputFile);
    -
    -                if (File.Exists(fullFilePath))
    -                {
    -                    return PostProcessorInput.FromFile(fullFilePath);
    -                }
    -
    -                if (File.Exists(fullFilePath + ".txt"))
    -                {
    -                    return PostProcessorInput.FromFile(fullFilePath + ".txt");
    -                }
    -
    -                //throw a file not found exception
    -                throw new FileNotFoundException("\nThe following input file could not be found: " + fullFilePath + " - type mc_post help=infile for correct syntax");
    -            }
    -            catch (Exception e)
    -            {
    -                Console.WriteLine(e.Message);
    -                return null;
    -            }
    -        }
    -        /// <summary>
    -        /// Validate PostProcessor input with optional overriding command line "infile" option
    -        /// </summary>
    -        /// <param name="input">PostProcessor infile</param>
    -        /// <param name="inpath">command line path for inpath (where database resides)</param>
    -        /// <returns></returns>
    -        public static ValidationResult ValidatePostProcessorInput(PostProcessorInput input, string inpath)
    -        {
    -            return PostProcessorInputValidation.ValidateInput(input, inpath);
    -        }
    -
    -        // need to work on following
    -        /// <summary>
    -        /// Runs the Monte Carlo Post-processor
    -        /// </summary>
    -        public static void RunPostProcessor(PostProcessorInput input, string inputFolderPath, string outputFolderPath)
    -        {
    -            // locate root folder for input, should already be created
    -            var inPath = string.IsNullOrEmpty(inputFolderPath)
    -                ? Path.GetFullPath(Directory.GetCurrentDirectory())
    -                : Path.GetFullPath(inputFolderPath);
    -            if (Directory.Exists(inPath))
    -            {
    -                var inputFolder = Path.Combine(inPath, input.InputFolder);
    -
    -                // locate root folder for output, creating it if necessary
    -                var outPath = string.IsNullOrEmpty(outputFolderPath)
    -                    ? Path.GetFullPath(Directory.GetCurrentDirectory())
    -                    : Path.GetFullPath(outputFolderPath);
    -                if (!Directory.Exists(outPath))
    -                {
    -                    Directory.CreateDirectory(outPath);
    -                }
    -
    -                // locate destination folder for output, creating it if necessary
    -                var resultsFolder = Path.Combine(outPath, input.OutputName);
    -                if (!Directory.Exists(resultsFolder))
    -                {
    -                    Directory.CreateDirectory(resultsFolder);
    -                }
    -
    -                SimulationOutput postProcessedOutput = null;
    -
    -                var databaseGenerationInputFile = SimulationInput.FromFile(Path.Combine(inputFolder,
    -                    input.DatabaseSimulationInputFilename + ".txt"));
    -                // check for pMC tallies first because could have ReflectanceTallies mixed in and want to load CollisionInfo
    -
    -                // put stop watch start here because several ifs below could get processed
    -                var stopwatch = System.Diagnostics.Stopwatch.StartNew();
    -
    -                IList<IDetectorInput> detectorInputs;
    -                if (input.DetectorInputs.Any(di => di.TallyDetails.IspMCReflectanceTally))
    -                {
    -                    detectorInputs = input.DetectorInputs.Where(
    -                            di => di.TallyDetails.IspMCReflectanceTally).ToList();
    -                    var postProcessor = new PhotonDatabasePostProcessor(
    -                        VirtualBoundaryType.pMCDiffuseReflectance,
    -                        detectorInputs,
    -                        PhotonDatabaseFactory.GetpMCDatabase( // database filenames are assumed to be convention
    -                            VirtualBoundaryType.pMCDiffuseReflectance,
    -                            inputFolder),
    -                        databaseGenerationInputFile
    -                    );
    -                    postProcessedOutput = postProcessor.Run();
    -                    if (postProcessedOutput != null)
    -                    {
    -                        foreach (var result in postProcessedOutput.ResultsDictionary.Values)
    -                        {
    -                            // save all detector data to the specified folder
    -                            DetectorIO.WriteDetectorToFile(result, resultsFolder);
    -                        }
    -                    }
    -                }
    -                if (input.DetectorInputs.Any(di => di.TallyDetails.IsReflectanceTally))
    -                {
    -                    detectorInputs = input.DetectorInputs.Where(
    -                        di => di.TallyDetails.IsReflectanceTally).ToList();
    -                    var postProcessor = new PhotonDatabasePostProcessor(
    -                        VirtualBoundaryType.DiffuseReflectance,
    -                        detectorInputs,
    -                        PhotonDatabaseFactory.GetPhotonDatabase( //database filenames are assumed to be convention
    -                            VirtualBoundaryType.DiffuseReflectance,
    -                            inputFolder),
    -                        databaseGenerationInputFile
    -                    );
    -                    postProcessedOutput = postProcessor.Run();
    -                    if (postProcessedOutput != null)
    -                    {
    -                        foreach (var result in postProcessedOutput.ResultsDictionary.Values)
    -                        {
    -                            // save all detector data to the specified folder
    -                            DetectorIO.WriteDetectorToFile(result, resultsFolder);
    -                        }
    -                    }
    -                }
    -                if (input.DetectorInputs.Any(di => di.TallyDetails.IspMCTransmittanceTally))
    -                {
    -                    detectorInputs = input.DetectorInputs.Where(
    -                        di => di.TallyDetails.IspMCTransmittanceTally).ToList();
    -                    var postProcessor = new PhotonDatabasePostProcessor(
    -                        VirtualBoundaryType.pMCDiffuseTransmittance,
    -                        detectorInputs,
    -                        PhotonDatabaseFactory.GetpMCDatabase( //database filenames are assumed to be convention
    -                            VirtualBoundaryType.pMCDiffuseTransmittance,
    -                            inputFolder),
    -                        databaseGenerationInputFile
    -                    );
    -                    postProcessedOutput = postProcessor.Run();
    -                    if (postProcessedOutput != null)
    -                    {
    -                        foreach (var result in postProcessedOutput.ResultsDictionary.Values)
    -                        {
    -                            // save all detector data to the specified folder
    -                            DetectorIO.WriteDetectorToFile(result, resultsFolder);
    -                        }
    -                    }
    -                }
    -                if (input.DetectorInputs.Any(di => di.TallyDetails.IsTransmittanceTally))
    -                {
    -                    detectorInputs = input.DetectorInputs.Where(
    -                        di => di.TallyDetails.IsTransmittanceTally).ToList();
    -                    var postProcessor = new PhotonDatabasePostProcessor(
    -                        VirtualBoundaryType.DiffuseTransmittance,
    -                        detectorInputs,
    -                        PhotonDatabaseFactory.GetPhotonDatabase( //database filenames are assumed to be convention
    -                            VirtualBoundaryType.DiffuseTransmittance,
    -                            inputFolder),
    -                        databaseGenerationInputFile
    -                    );
    -                    postProcessedOutput = postProcessor.Run();
    -                    if (postProcessedOutput != null)
    -                    {
    -                        foreach (var result in postProcessedOutput.ResultsDictionary.Values)
    -                        {
    -                            // save all detector data to the specified folder
    -                            DetectorIO.WriteDetectorToFile(result, resultsFolder);
    -                        }
    -                    }
    -                }
    -                if (input.DetectorInputs.Any(di => di.TallyDetails.IsSpecularReflectanceTally))
    -                { 
    -                    detectorInputs = input.DetectorInputs.Where(
    -                        di => di.TallyDetails.IsSpecularReflectanceTally).ToList();
    -                    var postProcessor = new PhotonDatabasePostProcessor(
    -                        VirtualBoundaryType.SpecularReflectance,
    -                        detectorInputs,
    -                        PhotonDatabaseFactory.GetPhotonDatabase( //database filenames are assumed to be convention
    -                            VirtualBoundaryType.SpecularReflectance,
    -                            inputFolder),
    -                        databaseGenerationInputFile
    -                    );
    -                    postProcessedOutput = postProcessor.Run();
    -                    if (postProcessedOutput != null)
    -                    {
    -                        foreach (var result in postProcessedOutput.ResultsDictionary.Values)
    -                        {
    -                            // save all detector data to the specified folder
    -                            DetectorIO.WriteDetectorToFile(result, resultsFolder);
    -                        }
    -                    }
    -                }
    -
    -                // save input file to output folder with results
    -                input.ToFile(Path.Combine(resultsFolder, input.OutputName + ".txt"));
    -
    -                // save database generation input file to output folder
    -                databaseGenerationInputFile.ToFile(Path.Combine(resultsFolder,
    -                    input.OutputName + "_database_infile.txt"));
    -
    -                stopwatch.Stop();
    -
    -                Console.WriteLine("Monte Carlo Post Processor complete (time ="
    -                                  + stopwatch.ElapsedMilliseconds / 1000f + " seconds).\r");
    -            }
    -            else
    -            {
    -                Console.WriteLine("input path {0} does not exist", inPath);
    -            }
    -        }
    -
    -        /// <summary>
    -        /// Runs multiple Post-Processor tasks in parallel using all available CPU cores
    -        /// </summary>
    -        public static void RunPostProcessors(IEnumerable<PostProcessorInput> inputs, string inputFolderPath, string outputFolderPath)
    -        {
    -            var options = new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount };
    -            Parallel.ForEach(inputs, options, (input, state, index) =>
    -            {
    -                RunPostProcessor(input, inputFolderPath, outputFolderPath);
    -            });
    -        }
    -    }
    -}
    -
    -
    -
    -    
    - - - \ No newline at end of file diff --git a/UnitTestCoverage/src/18.html b/UnitTestCoverage/src/18.html deleted file mode 100644 index 07e4d25..0000000 --- a/UnitTestCoverage/src/18.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - C:\Users\lisa\Documents\Projects\UCI\VTS_Release\Vts.MonteCarlo\Vts.MonteCarlo.PostProcessor\Program.cs - - - - -
    -//#define PROCESS_ATTACH_DEBUG
    -
    -using System;
    -using System.Collections.Generic;
    -using System.Linq;
    -using System.Text.RegularExpressions;
    -
    -namespace Vts.MonteCarlo.PostProcessor
    -{
    -    #region CommandLine Arguments Parser
    -
    -    /* Simple commandline argument parser written by Ananth B. http://www.ananthonline.net */
    -    internal static class CommandLine
    -    {
    -        public class Switch // Class that encapsulates switch data.
    -        {
    -            public Switch(string name, string shortForm, Action<IEnumerable<string>> handler)
    -            {
    -                Name = name;
    -                ShortForm = shortForm;
    -                Handler = handler;
    -            }
    -
    -            public Switch(string name, Action<IEnumerable<string>> handler)
    -            {
    -                Name = name;
    -                ShortForm = null;
    -                Handler = handler;
    -            }
    -
    -            public string Name { get; private set; }
    -            public string ShortForm { get; private set; }
    -            public Action<IEnumerable<string>> Handler { get; private set; }
    -
    -            public int InvokeHandler(string[] values)
    -            {
    -                Handler(values);
    -                return 1;
    -            }
    -        }
    -
    -        /* The regex that extracts names and comma-separated values for switches 
    -        in the form (<switch>[="value 1",value2,...])+ */
    -        private static readonly Regex ArgRegex =
    -            new Regex(@"(?<name>[^=]+)=?((?<quoted>\""?)(?<value>(?(quoted)[^\""]+|[^,]+))\""?,?)*",
    -                RegexOptions.Compiled | RegexOptions.CultureInvariant |
    -                RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
    -
    -        private const string NameGroup = "name"; // Names of capture groups
    -        private const string ValueGroup = "value";
    -
    -        public static void Process(this string[] args, Action printUsage, params Switch[] switches)
    -        {
    -            /* Run through all matches in the argument list and if any of the switches 
    -            match, get the values and invoke the handler we were given. We do a Sum() 
    -            here for 2 reasons; a) To actually run the handlers
    -            and b) see if any were invoked at all (each returns 1 if invoked).
    -            If none were invoked, we simply invoke the printUsage handler. */
    -            if ((from arg in args
    -                 from Match match in ArgRegex.Matches(arg)
    -                 from s in switches
    -                 where match.Success &&
    -                     ((string.Compare(match.Groups[NameGroup].Value, s.Name, true) == 0) ||
    -                     (string.Compare(match.Groups[NameGroup].Value, s.ShortForm, true) == 0))
    -                 select s.InvokeHandler(match.Groups[ValueGroup].Value.Split(','))).Sum() == 0)
    -                printUsage(); // We didn't find any switches
    -        }
    -    }
    -
    -    #endregion
    -
    -    public static class Program
    -    {
    -        /// <summary>
    -        /// main Monte Carlo Post Processor (MCPP) application
    -        /// </summary>
    -        /// <returns>int = 0 (successful completion)</returns>
    -        /// <returns>int = 1 (infile null or missing)</returns>
    -        /// <returns>int = 2 (infile exists but does not pass validation)</returns>
    -        public static int Main(string[] args)
    -        {
    -#if PROCESS_ATTACH_DEBUG
    -            Console.Read();
    -#endif
    -            var inFile = "infile.txt";
    -            var inPath = "";
    -            var outName = "";
    -            var outPath = "";
    -            var infoOnlyOption = false;
    -            args.Process(() =>
    -                {
    -                    Console.WriteLine("Virtual Photonics MC Post-Processor 1.0");
    -                    Console.WriteLine();
    -                    Console.WriteLine("For more information type mc_post help");
    -                    Console.WriteLine();
    -                },
    -                new CommandLine.Switch("help", val =>
    -                {
    -                    infoOnlyOption = true;
    -                    ShowHelp();
    -                }),
    -                new CommandLine.Switch("geninfiles", val =>
    -                {
    -                    GenerateDefaultInputFiles();
    -                    infoOnlyOption = true;
    -                }),
    -                new CommandLine.Switch("infile", val =>
    -                {
    -                    inFile = val.First();
    -                    Console.WriteLine("input file specified as {0}", inFile);
    -                }),
    -                new CommandLine.Switch("inpath", val =>
    -                {
    -                    inPath = val.First();
    -                    Console.WriteLine("input path specified as {0}", inPath);
    -                }),
    -                new CommandLine.Switch("outname", val =>
    -                {
    -                    outName = val.First();
    -                    Console.WriteLine("output file specified as {0}", outName);
    -                }),
    -                new CommandLine.Switch("outpath", val =>
    -                {
    -                    outPath = val.First();
    -                    Console.WriteLine("output path specified as {0}", outPath);
    -                })
    -            );
    -
    -            if (infoOnlyOption) return 0;
    -            var input = PostProcessorSetup.ReadPostProcessorInputFromFile(inFile);
    -            if (input == null)
    -            {
    -                return 1;
    -            }
    -
    -            var validationResult = PostProcessorSetup.ValidatePostProcessorInput(input, inPath);
    -            if (!validationResult.IsValid)
    -            {
    -                Console.Write("\nPost-processor) completed with errors. Press enter key to exit.");
    -                Console.Read();
    -                return 2;
    -            }
    -            // override the output name with the user-specified name
    -            if (!string.IsNullOrEmpty(outName))
    -            {
    -                input.OutputName = outName;
    -            }
    -            PostProcessorSetup.RunPostProcessor(input, inPath, outPath);
    -            Console.WriteLine("\nPost-processing complete.");
    -            return 0;
    -        }
    -
    -        private static void GenerateDefaultInputFiles()
    -        {
    -            var infiles = PostProcessorInputProvider.GenerateAllPostProcessorInputs();
    -            foreach (var file in infiles)
    -            {
    -                file.ToFile("infile_" + file.OutputName + ".txt");
    -            }
    -        }
    -
    -        /// <summary>
    -        /// Displays the help text for detailed usage of the application
    -        /// </summary>
    -        private static void ShowHelp()
    -        {
    -            Console.WriteLine("Virtual Photonics MC Post-Processor 1.0");
    -            Console.WriteLine();
    -            Console.WriteLine("list of arguments:");
    -            Console.WriteLine();
    -            Console.WriteLine("infile\t\tthe input file, accepts relative and absolute paths");
    -            Console.WriteLine("inpath\t\tthe input path, accepts relative and absolute paths");
    -            Console.WriteLine("outpath\t\tthe output path, accepts relative and absolute paths");
    -            Console.WriteLine("outname\t\toutput name, this overwrites output name in input file");
    -            Console.WriteLine();
    -            Console.WriteLine("geninfiles\t\tgenerates example infiles and names them infile_XXX.txt");
    -            Console.WriteLine();
    -            Console.WriteLine("sample usage:");
    -            Console.WriteLine();
    -            Console.WriteLine("mc_post infile=myinput outname=myoutput");
    -        }
    -    }
    -}
    -
    -
    -
    -    
    - - - \ No newline at end of file diff --git a/UnitTestCoverage/src/nosource.html b/UnitTestCoverage/src/nosource.html deleted file mode 100644 index dbbb6bc..0000000 --- a/UnitTestCoverage/src/nosource.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - No source available - - - - - -
    No source available.
    - - \ No newline at end of file diff --git a/Vts.MonteCarlo.CommandLineApplication.Test/CommandLineTests.cs b/Vts.MonteCarlo.CommandLineApplication.Test/CommandLineTests.cs index 46e7dad..9b1f1ff 100644 --- a/Vts.MonteCarlo.CommandLineApplication.Test/CommandLineTests.cs +++ b/Vts.MonteCarlo.CommandLineApplication.Test/CommandLineTests.cs @@ -1,5 +1,5 @@ -using System; -using NUnit.Framework; +using NUnit.Framework; +using System; using System.Linq; namespace Vts.MonteCarlo.CommandLineApplication.Test @@ -10,8 +10,8 @@ internal class CommandLineTests [Test] public void CommandLine_switch_test() { - var arguments = new [] { "h=topic" }; - arguments.Process(() => Console.WriteLine("Usage"), + var arguments = new[] { "h=topic" }; + arguments.Process(() => Console.WriteLine(@"Usage"), new CommandLine.Switch("help", "h", arg => { var helpTopic = arg.First(); @@ -23,7 +23,7 @@ public void CommandLine_switch_test() public void CommandLine_no_switches_test() { var arguments = new[] { "undefined=true" }; - arguments.Process(() => Console.WriteLine("Usage"), + arguments.Process(() => Console.WriteLine(@"Usage"), new CommandLine.Switch("help", "h", arg => { var undefined = arg.First(); diff --git a/Vts.MonteCarlo.CommandLineApplication.Test/ParameterSweepTests.cs b/Vts.MonteCarlo.CommandLineApplication.Test/ParameterSweepTests.cs index 8ebe073..d4dc38e 100644 --- a/Vts.MonteCarlo.CommandLineApplication.Test/ParameterSweepTests.cs +++ b/Vts.MonteCarlo.CommandLineApplication.Test/ParameterSweepTests.cs @@ -29,7 +29,7 @@ public void ParameterSweep_constructor_with_DoubleRange_test() [Test] public void ParameterSweep_constructor_with_double_array_test() { - var parameterSweep = new ParameterSweep("mua2", new [] { 0.1, 0.2, 0.3 }); + var parameterSweep = new ParameterSweep("mua2", new[] { 0.1, 0.2, 0.3 }); Assert.AreEqual(0.1, parameterSweep.Values[0]); Assert.AreEqual("mua2", parameterSweep.Name); } diff --git a/Vts.MonteCarlo.CommandLineApplication.Test/ProgramTests.cs b/Vts.MonteCarlo.CommandLineApplication.Test/ProgramTests.cs index e48ddea..1c5ce50 100644 --- a/Vts.MonteCarlo.CommandLineApplication.Test/ProgramTests.cs +++ b/Vts.MonteCarlo.CommandLineApplication.Test/ProgramTests.cs @@ -1,9 +1,9 @@ -using System; +using NUnit.Framework; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using NUnit.Framework; using Vts.IO; namespace Vts.MonteCarlo.CommandLineApplication.Test diff --git a/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.Application.Test.csproj b/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.Application.Test.csproj index 3c1511e..2151e7b 100644 --- a/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.Application.Test.csproj +++ b/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.Application.Test.csproj @@ -2,9 +2,7 @@ net6.0 - false - Vts.MonteCarlo.CommandLineApplication.Test diff --git a/Vts.MonteCarlo.CommandLineApplication/CommandLine.cs b/Vts.MonteCarlo.CommandLineApplication/CommandLine.cs index 9fddc31..9b249f7 100644 --- a/Vts.MonteCarlo.CommandLineApplication/CommandLine.cs +++ b/Vts.MonteCarlo.CommandLineApplication/CommandLine.cs @@ -23,9 +23,9 @@ public Switch(string name, Action> handler) Handler = handler; } - public string Name { get; private set; } - public string ShortForm { get; private set; } - public Action> Handler { get; private set; } + public string Name { get; } + public string ShortForm { get; } + public Action> Handler { get; } public int InvokeHandler(string[] values) { @@ -37,7 +37,7 @@ public int InvokeHandler(string[] values) /* The regex that extracts names and comma-separated values for switches in the form ([="value 1",value2,...])+ */ private static readonly Regex ArgRegex = - new Regex(@"(?[^=]+)=?((?\""?)(?(?(quoted)[^\""]+|[^,]+))\""?,?)*", + new(@"(?[^=]+)=?((?\""?)(?(?(quoted)[^\""]+|[^,]+))\""?,?)*", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase, TimeSpan.FromSeconds(10)); @@ -52,12 +52,12 @@ public static void Process(this string[] args, Action printUsage, params Switch[ and b) see if any were invoked at all (each returns 1 if invoked). If none were invoked, we simply invoke the printUsage handler. */ if ((from arg in args - from Match match in ArgRegex.Matches(arg) - from s in switches - where match.Success && - ((string.Compare(match.Groups[NameGroup].Value, s.Name, true) == 0) || - (string.Compare(match.Groups[NameGroup].Value, s.ShortForm, true) == 0)) - select s.InvokeHandler(match.Groups[ValueGroup].Value.Split(','))).Sum() == 0) + from Match match in ArgRegex.Matches(arg) + from s in switches + where match.Success && + ((string.Compare(match.Groups[NameGroup].Value, s.Name, true) == 0) || + (string.Compare(match.Groups[NameGroup].Value, s.ShortForm, true) == 0)) + select s.InvokeHandler(match.Groups[ValueGroup].Value.Split(','))).Sum() == 0) printUsage(); // We didn't find any switches } } \ No newline at end of file diff --git a/Vts.MonteCarlo.CommandLineApplication/MonteCarloSetup.cs b/Vts.MonteCarlo.CommandLineApplication/MonteCarloSetup.cs index 058fa93..7f26903 100644 --- a/Vts.MonteCarlo.CommandLineApplication/MonteCarloSetup.cs +++ b/Vts.MonteCarlo.CommandLineApplication/MonteCarloSetup.cs @@ -34,7 +34,7 @@ public static SimulationInput ReadSimulationInputFromFile(string inputFile) if (File.Exists(fullFilePath)) { - return SimulationInput.FromFile(fullFilePath); + return SimulationInput.FromFile(fullFilePath); } if (File.Exists(fullFilePath + ".txt")) @@ -58,7 +58,7 @@ public static SimulationInput ReadSimulationInputFromFile(string inputFile) { if (parameterSweepString.Length != 4) { - + var message = " *** Invalid sweep parameter ***" + "\n\t\tsweep parameters should have 4 values in the format:"; @@ -73,7 +73,7 @@ public static SimulationInput ReadSimulationInputFromFile(string inputFile) message += "\n\t\tIgnoring this sweep parameter\n"; Logger.Warn(() => message); return null; - + } } else // type==ParameterSweepType.List @@ -107,7 +107,7 @@ public static SimulationInput ReadSimulationInputFromFile(string inputFile) // use Math.Round to make sure floating point precision doesn't reduce/increase count sweepRange = new DoubleRange(start, stop, (int)(Math.Round((stop - start) / delta)) + 1); return new ParameterSweep(inputParameterType, sweepRange); - case ParameterSweepType.Count: + case ParameterSweepType.Count: // eg. paramsweep=mua1,0.01,4.0,101 paramsweep=mus1,0.5,1.5,3 paramsweep=mus2,0.5,1.5,3 ... start = double.Parse(parameterSweepString[1]); stop = double.Parse(parameterSweepString[2]); @@ -119,8 +119,8 @@ public static SimulationInput ReadSimulationInputFromFile(string inputFile) var number = int.Parse(parameterSweepString[1]); var sweepList = new double[number]; for (var i = 0; i < number; i++) - { - sweepList[i]=double.Parse(parameterSweepString[i + 2]); + { + sweepList[i] = double.Parse(parameterSweepString[i + 2]); } return new ParameterSweep(inputParameterType, sweepList); } diff --git a/Vts.MonteCarlo.CommandLineApplication/Program.cs b/Vts.MonteCarlo.CommandLineApplication/Program.cs index e076e05..3b87e23 100644 --- a/Vts.MonteCarlo.CommandLineApplication/Program.cs +++ b/Vts.MonteCarlo.CommandLineApplication/Program.cs @@ -1,23 +1,16 @@ -//#define PROCESS_ATTACH_DEBUG - +using NLog; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; -using NLog; using Vts.Common.Logging; [assembly: InternalsVisibleTo("Vts.MonteCarlo.CommandLineApplication.Test")] +[assembly: InternalsVisibleTo("Vts.MonteCarlo.PostProcessor.CommandLineApplication.Test")] namespace Vts.MonteCarlo.CommandLineApplication { - - #region CommandLine Arguments Parser - - /* Simple commandline argument parser written by Ananth B. http://www.ananthonline.net */ - - #endregion /// /// Monte Carlo command line application program. Type "mc help" for /// a description of the different command line parameters. @@ -35,15 +28,11 @@ public static class Program /// int = 2 (infile exists but does not pass validation) public static int Main(string[] args) { -#if PROCESS_ATTACH_DEBUG - Console.Read(); -#endif var inFile = ""; var inFiles = new List(); var outName = ""; var outPath = ""; - var CPUCount = "1"; // default is to use 1 - var infoOnlyOption = false; + var cpuCount = "1"; // default is to use 1 IList paramSweep = new List(); args.Process(() => @@ -51,7 +40,7 @@ public static int Main(string[] args) Logger.Info($"\nVirtual Photonics MC {GetVersionNumber(3)}\n"); Logger.Info("For more information type mc help"); Logger.Info("For help on a specific topic type dotnet mc.dll help=\n"); - }, + }, new CommandLine.Switch("help", val => { var helpTopic = val.First(); @@ -59,12 +48,10 @@ public static int Main(string[] args) ShowHelp(helpTopic); else ShowHelp(); - infoOnlyOption = true; }), new CommandLine.Switch("geninfiles", val => { GenerateDefaultInputFiles(); - infoOnlyOption = true; }), new CommandLine.Switch("infile", val => { @@ -91,23 +78,23 @@ public static int Main(string[] args) }), new CommandLine.Switch("cpucount", val => { - CPUCount = val.First(); - if (CPUCount == "all") - { - CPUCount = Environment.ProcessorCount.ToString(); - Logger.Info(() => "changed to maximum CPUs on system " + CPUCount); - } - else - { - if (!int.TryParse(CPUCount, out var CPUCountInt)) - { - Logger.Info(() => "unknown cpucount option " + CPUCount); - } - else - { - Logger.Info(() => "number of CPUs specified as " + CPUCount); - } - } + cpuCount = val.First(); + if (cpuCount == "all") + { + cpuCount = Environment.ProcessorCount.ToString(); + Logger.Info(() => "changed to maximum CPUs on system " + cpuCount); + } + else + { + if (!int.TryParse(cpuCount, out var cpuCountInt)) + { + Logger.Info(() => $"unknown cpucount option {cpuCount}"); + } + else + { + Logger.Info(() => $"number of CPUs specified as {cpuCountInt}"); + } + } }), new CommandLine.Switch("paramsweep", val => { @@ -134,9 +121,13 @@ public static int Main(string[] args) Logger.Info(() => "parameter sweep specified as " + sweepString[0] + " values"); })); - if (!infoOnlyOption) + if (CheckInfoOnly(args)) { - Func checkValid = simInput => + LogManager.Configuration = null; + return 0; + } + + Func checkValid = simInput => { var validationResult = MonteCarloSetup.ValidateSimulationInput(simInput); if (validationResult.IsValid) return true; @@ -145,80 +136,86 @@ public static int Main(string[] args) Console.Write("\nRemarks:" + validationResult.Remarks); return false; }; - SimulationInput input; - if (paramSweep.Any() || inFiles.Any()) + SimulationInput input; + if (paramSweep.Any() || inFiles.Any()) + { + IList inputs; + if (paramSweep.Any()) { - IList inputs; - if (paramSweep.Any()) + input = MonteCarloSetup.ReadSimulationInputFromFile(inFile); + if (input == null) { - input = MonteCarloSetup.ReadSimulationInputFromFile(inFile); - if (input == null) - { - return 1; - } - if (!string.IsNullOrEmpty(outName)) - { - input.OutputName = outName; - } - - inputs = MonteCarloSetup.ApplyParameterSweeps(input, paramSweep).ToList(); - } - else // if infiles.Count() > 0 - { - inputs = inFiles.Select(file => MonteCarloSetup.ReadSimulationInputFromFile(file)).ToList(); - if (!inputs.Any()) - { - return 1; - } + return 1; } - // validate input - if (inputs.Any(simulationInput => !checkValid(simulationInput))) + if (!string.IsNullOrEmpty(outName)) { - return 2; - } - // make sure input does not specify Database if CPUCount>1 - if (int.Parse(CPUCount) > 1 && (inputs.First().Options.Databases != null && inputs.First().Options.Databases.Count != 0)) - { - CPUCount = 1.ToString(); - Logger.Info(() => "parallel processing cannot be performed when a Database is specified, changed CPUCount to 1"); + input.OutputName = outName; } - MonteCarloSetup.RunSimulations(inputs, outPath, int.Parse(CPUCount)); - Logger.Info("\nSimulations complete."); - return 0; + inputs = MonteCarloSetup.ApplyParameterSweeps(input, paramSweep).ToList(); } - - input = MonteCarloSetup.ReadSimulationInputFromFile(inFile); - if (input == null) + else // if infiles.Count() > 0 { - return 1; + inputs = inFiles.Select(file => MonteCarloSetup.ReadSimulationInputFromFile(file)).ToList(); + if (!inputs.Any()) + { + return 1; + } } - - if (!checkValid(input)) - return 2; - - if (!string.IsNullOrEmpty(outName)) + // validate input + if (inputs.Any(simulationInput => !checkValid(simulationInput))) { - input.OutputName = outName; + return 2; } - // make sure input does not specify Database if CPUCount>1 - if (int.Parse(CPUCount) > 1 && (input.Options.Databases != null && input.Options.Databases?.Count != 0)) + if (int.Parse(cpuCount) > 1 && (inputs.First().Options.Databases != null && inputs.First().Options.Databases.Count != 0)) { - CPUCount = 1.ToString(); - Logger.Info(() => - "parallel processing cannot be performed when a Database is specified, changed CPUCount to 1"); + cpuCount = 1.ToString(); + Logger.Info(() => "parallel processing cannot be performed when a Database is specified, changed CPUCount to 1"); } - MonteCarloSetup.RunSimulation(input, outPath, int.Parse(CPUCount)); - Logger.Info("\nSimulation complete."); + MonteCarloSetup.RunSimulations(inputs, outPath, int.Parse(cpuCount)); + Logger.Info("\nSimulations complete."); return 0; } - LogManager.Configuration = null; + input = MonteCarloSetup.ReadSimulationInputFromFile(inFile); + if (input == null) + { + return 1; + } + + if (!checkValid(input)) + return 2; + + if (!string.IsNullOrEmpty(outName)) + { + input.OutputName = outName; + } + + // make sure input does not specify Database if CPUCount>1 + if (int.Parse(cpuCount) > 1 && (input.Options.Databases != null && input.Options.Databases?.Count != 0)) + { + cpuCount = 1.ToString(); + Logger.Info(() => + "parallel processing cannot be performed when a Database is specified, changed CPUCount to 1"); + } + + MonteCarloSetup.RunSimulation(input, outPath, int.Parse(cpuCount)); + Logger.Info("\nSimulation complete."); return 0; } - + + private static bool CheckInfoOnly(IEnumerable args) + { + foreach (var arg in args) + { + if (arg.StartsWith("help")) return true; + if (arg.Equals("geninfiles")) return true; + } + return false; + } + private static void GenerateDefaultInputFiles() { try @@ -355,7 +352,7 @@ private static void ShowHelp(string helpTopic) break; } } - + /// /// Gets the version number of the application /// diff --git a/Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs b/Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs new file mode 100644 index 0000000..9b1f1ff --- /dev/null +++ b/Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs @@ -0,0 +1,34 @@ +using NUnit.Framework; +using System; +using System.Linq; + +namespace Vts.MonteCarlo.CommandLineApplication.Test +{ + [TestFixture] + internal class CommandLineTests + { + [Test] + public void CommandLine_switch_test() + { + var arguments = new[] { "h=topic" }; + arguments.Process(() => Console.WriteLine(@"Usage"), + new CommandLine.Switch("help", "h", arg => + { + var helpTopic = arg.First(); + Assert.AreEqual("topic", helpTopic); + })); + } + + [Test] + public void CommandLine_no_switches_test() + { + var arguments = new[] { "undefined=true" }; + arguments.Process(() => Console.WriteLine(@"Usage"), + new CommandLine.Switch("help", "h", arg => + { + var undefined = arg.First(); + Assert.AreEqual("topic", undefined); + })); + } + } +} diff --git a/Vts.MonteCarlo.PostProcessor.Test/PostProcessorSetupTests.cs b/Vts.MonteCarlo.PostProcessor.Test/PostProcessorSetupTests.cs new file mode 100644 index 0000000..2674c0c --- /dev/null +++ b/Vts.MonteCarlo.PostProcessor.Test/PostProcessorSetupTests.cs @@ -0,0 +1,24 @@ +using NUnit.Framework; +using System.Threading.Tasks; +using Vts.MonteCarlo.CommandLineApplication; + +namespace Vts.MonteCarlo.PostProcessor.Test +{ + [TestFixture] + public class PostProcessorSetupTests + { + [Test] + public void ReadSimulationInputFromFile_returns_null() + { + var result = PostProcessorSetup.ReadPostProcessorInputFromFile(""); + Assert.IsNull(result); + } + + [Test] + public void ReadSimulationInputFromFile_throws_FileNotFoundException_returns_null() + { + var result = PostProcessorSetup.ReadPostProcessorInputFromFile("dummy.txt"); + Assert.IsNull(result); + } + } +} diff --git a/Vts.MonteCarlo.PostProcessor.Test/ProgramTests.cs b/Vts.MonteCarlo.PostProcessor.Test/ProgramTests.cs index 2155dc9..70cd539 100644 --- a/Vts.MonteCarlo.PostProcessor.Test/ProgramTests.cs +++ b/Vts.MonteCarlo.PostProcessor.Test/ProgramTests.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using NUnit.Framework; +using System.Collections.Generic; using System.IO; using System.Threading.Tasks; -using NUnit.Framework; using Vts.MonteCarlo.IO; namespace Vts.MonteCarlo.PostProcessor.Test @@ -12,11 +12,11 @@ public class ProgramTests /// /// clear all previously generated folders and files. /// - + // Note: needs to be kept current with PostProcessorInputProvider. If an infile is added there, it should be added here. private readonly List _listOfMcppInfiles = new List() { - "PostProcessor_ROfRhoTOfRho", + "PostProcessor_ROfRhoTOfRho", "PostProcessor_pMC_ROfRhoROfRhoAndTime", "PostProcessor_pMC_ROfRhoROfXAndYVariants", "PostProcessor_pMC_ROfFxROfFxAndTime", diff --git a/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Application.Test.csproj b/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Application.Test.csproj index 4db6f60..4ca30a5 100644 --- a/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Application.Test.csproj +++ b/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Application.Test.csproj @@ -2,9 +2,7 @@ net6.0 - false - Vts.MonteCarlo.PostProcessor.CommandLineApplication.Test diff --git a/Vts.MonteCarlo.PostProcessor/PostProcessorSetup.cs b/Vts.MonteCarlo.PostProcessor/PostProcessorSetup.cs index d287cdf..6516ca3 100644 --- a/Vts.MonteCarlo.PostProcessor/PostProcessorSetup.cs +++ b/Vts.MonteCarlo.PostProcessor/PostProcessorSetup.cs @@ -22,10 +22,10 @@ public static PostProcessorInput ReadPostProcessorInputFromFile(string inputFile // read input file then read in elements of input file if (string.IsNullOrEmpty(inputFile)) { - Console.WriteLine("\nNo input file specified. Using infile.txt from root mc_post.exe folder... "); - return ReadPostProcessorInputFromFile("infile.txt"); + Console.WriteLine("\nNo input file specified. Using infile.txt from root mc_post.exe folder... "); + return ReadPostProcessorInputFromFile("infile.txt"); } - + //get the full path for the input file var fullFilePath = Path.GetFullPath(inputFile); @@ -48,6 +48,7 @@ public static PostProcessorInput ReadPostProcessorInputFromFile(string inputFile return null; } } + /// /// Validate PostProcessor input with optional overriding command line "infile" option /// @@ -188,7 +189,7 @@ public static void RunPostProcessor(PostProcessorInput input, string inputFolder } } if (input.DetectorInputs.Any(di => di.TallyDetails.IsSpecularReflectanceTally)) - { + { detectorInputs = input.DetectorInputs.Where( di => di.TallyDetails.IsSpecularReflectanceTally).ToList(); var postProcessor = new PhotonDatabasePostProcessor( diff --git a/Vts.MonteCarlo.PostProcessor/Program.cs b/Vts.MonteCarlo.PostProcessor/Program.cs index 6bbd450..781cce5 100644 --- a/Vts.MonteCarlo.PostProcessor/Program.cs +++ b/Vts.MonteCarlo.PostProcessor/Program.cs @@ -1,74 +1,12 @@ -//#define PROCESS_ATTACH_DEBUG - using System; -using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; +using System.Runtime.CompilerServices; +using Vts.MonteCarlo.CommandLineApplication; + +[assembly: InternalsVisibleTo("Vts.MonteCarlo.PostProcessor.Test")] namespace Vts.MonteCarlo.PostProcessor { - #region CommandLine Arguments Parser - - /* Simple commandline argument parser written by Ananth B. http://www.ananthonline.net */ - internal static class CommandLine - { - public class Switch // Class that encapsulates switch data. - { - public Switch(string name, string shortForm, Action> handler) - { - Name = name; - ShortForm = shortForm; - Handler = handler; - } - - public Switch(string name, Action> handler) - { - Name = name; - ShortForm = null; - Handler = handler; - } - - public string Name { get; private set; } - public string ShortForm { get; private set; } - public Action> Handler { get; private set; } - - public int InvokeHandler(string[] values) - { - Handler(values); - return 1; - } - } - - /* The regex that extracts names and comma-separated values for switches - in the form ([="value 1",value2,...])+ */ - private static readonly Regex ArgRegex = - new Regex(@"(?[^=]+)=?((?\""?)(?(?(quoted)[^\""]+|[^,]+))\""?,?)*", - RegexOptions.Compiled | RegexOptions.CultureInvariant | - RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase); - - private const string NameGroup = "name"; // Names of capture groups - private const string ValueGroup = "value"; - - public static void Process(this string[] args, Action printUsage, params Switch[] switches) - { - /* Run through all matches in the argument list and if any of the switches - match, get the values and invoke the handler we were given. We do a Sum() - here for 2 reasons; a) To actually run the handlers - and b) see if any were invoked at all (each returns 1 if invoked). - If none were invoked, we simply invoke the printUsage handler. */ - if ((from arg in args - from Match match in ArgRegex.Matches(arg) - from s in switches - where match.Success && - ((string.Compare(match.Groups[NameGroup].Value, s.Name, true) == 0) || - (string.Compare(match.Groups[NameGroup].Value, s.ShortForm, true) == 0)) - select s.InvokeHandler(match.Groups[ValueGroup].Value.Split(','))).Sum() == 0) - printUsage(); // We didn't find any switches - } - } - - #endregion - public static class Program { /// @@ -79,54 +17,48 @@ public static class Program /// int = 2 (infile exists but does not pass validation) public static int Main(string[] args) { -#if PROCESS_ATTACH_DEBUG - Console.Read(); -#endif var inFile = "infile.txt"; var inPath = ""; var outName = ""; var outPath = ""; - var infoOnlyOption = false; args.Process(() => { - Console.WriteLine("Virtual Photonics MC Post-Processor 1.0"); + Console.WriteLine(@"Virtual Photonics MC Post-Processor 1.0"); Console.WriteLine(); - Console.WriteLine("For more information type mc_post help"); + Console.WriteLine(@"For more information type mc_post help"); Console.WriteLine(); }, new CommandLine.Switch("help", val => { - infoOnlyOption = true; ShowHelp(); }), new CommandLine.Switch("geninfiles", val => { GenerateDefaultInputFiles(); - infoOnlyOption = true; }), new CommandLine.Switch("infile", val => { inFile = val.First(); - Console.WriteLine("input file specified as {0}", inFile); + Console.WriteLine(@"input file specified as {0}", inFile); }), new CommandLine.Switch("inpath", val => { inPath = val.First(); - Console.WriteLine("input path specified as {0}", inPath); + Console.WriteLine(@"input path specified as {0}", inPath); }), new CommandLine.Switch("outname", val => { outName = val.First(); - Console.WriteLine("output file specified as {0}", outName); + Console.WriteLine(@"output file specified as {0}", outName); }), new CommandLine.Switch("outpath", val => { outPath = val.First(); - Console.WriteLine("output path specified as {0}", outPath); + Console.WriteLine(@"output path specified as {0}", outPath); }) ); - if (infoOnlyOption) return 0; + if (CheckInfoOnly(args)) return 0; var input = PostProcessorSetup.ReadPostProcessorInputFromFile(inFile); if (input == null) { @@ -150,6 +82,11 @@ public static int Main(string[] args) return 0; } + private static bool CheckInfoOnly(string[] args) + { + return args.Contains("help") || args.Contains("geninfiles"); + } + private static void GenerateDefaultInputFiles() { var infiles = PostProcessorInputProvider.GenerateAllPostProcessorInputs(); @@ -164,20 +101,20 @@ private static void GenerateDefaultInputFiles() /// private static void ShowHelp() { - Console.WriteLine("Virtual Photonics MC Post-Processor 1.0"); + Console.WriteLine(@"Virtual Photonics MC Post-Processor 1.0"); Console.WriteLine(); - Console.WriteLine("list of arguments:"); + Console.WriteLine(@"list of arguments:"); Console.WriteLine(); - Console.WriteLine("infile\t\tthe input file, accepts relative and absolute paths"); - Console.WriteLine("inpath\t\tthe input path, accepts relative and absolute paths"); - Console.WriteLine("outpath\t\tthe output path, accepts relative and absolute paths"); - Console.WriteLine("outname\t\toutput name, this overwrites output name in input file"); + Console.WriteLine(@"infile the input file, accepts relative and absolute paths"); + Console.WriteLine(@"inpath the input path, accepts relative and absolute paths"); + Console.WriteLine(@"outpath the output path, accepts relative and absolute paths"); + Console.WriteLine(@"outname output name, this overwrites output name in input file"); Console.WriteLine(); - Console.WriteLine("geninfiles\t\tgenerates example infiles and names them infile_XXX.txt"); + Console.WriteLine(@"geninfiles generates example infiles and names them infile_XXX.txt"); Console.WriteLine(); - Console.WriteLine("sample usage:"); + Console.WriteLine(@"sample usage:"); Console.WriteLine(); - Console.WriteLine("mc_post infile=myinput outname=myoutput"); + Console.WriteLine(@"mc_post infile=myinput outname=myoutput"); } } } diff --git a/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.Application.csproj b/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.Application.csproj index c89daa3..30d6830 100644 --- a/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.Application.csproj +++ b/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.Application.csproj @@ -31,6 +31,10 @@ + + + + Always From 816ceba1fb4c6a786af96bf811cd5174c4c92299 Mon Sep 17 00:00:00 2001 From: Lisa Malenfant Date: Sat, 30 Sep 2023 16:46:02 -0700 Subject: [PATCH 2/3] Removed the CommandLineTests.cs file from MCPP because it is identical to the one in MCCL --- .../CommandLineTests.cs | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs diff --git a/Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs b/Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs deleted file mode 100644 index 9b1f1ff..0000000 --- a/Vts.MonteCarlo.PostProcessor.Test/CommandLineTests.cs +++ /dev/null @@ -1,34 +0,0 @@ -using NUnit.Framework; -using System; -using System.Linq; - -namespace Vts.MonteCarlo.CommandLineApplication.Test -{ - [TestFixture] - internal class CommandLineTests - { - [Test] - public void CommandLine_switch_test() - { - var arguments = new[] { "h=topic" }; - arguments.Process(() => Console.WriteLine(@"Usage"), - new CommandLine.Switch("help", "h", arg => - { - var helpTopic = arg.First(); - Assert.AreEqual("topic", helpTopic); - })); - } - - [Test] - public void CommandLine_no_switches_test() - { - var arguments = new[] { "undefined=true" }; - arguments.Process(() => Console.WriteLine(@"Usage"), - new CommandLine.Switch("help", "h", arg => - { - var undefined = arg.First(); - Assert.AreEqual("topic", undefined); - })); - } - } -} From a61abf01c787c2f17b3c8bb7bcd8a6fb3b8aa45b Mon Sep 17 00:00:00 2001 From: Lisa Malenfant Date: Sun, 1 Oct 2023 14:41:02 -0700 Subject: [PATCH 3/3] Added the specific version to the header --- Vts.MonteCarlo.PostProcessor/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vts.MonteCarlo.PostProcessor/Program.cs b/Vts.MonteCarlo.PostProcessor/Program.cs index 781cce5..a0c6803 100644 --- a/Vts.MonteCarlo.PostProcessor/Program.cs +++ b/Vts.MonteCarlo.PostProcessor/Program.cs @@ -23,7 +23,7 @@ public static int Main(string[] args) var outPath = ""; args.Process(() => { - Console.WriteLine(@"Virtual Photonics MC Post-Processor 1.0"); + Console.WriteLine(@"Virtual Photonics MC Post-Processor {GetVersionNumber(3)}\n"")"); Console.WriteLine(); Console.WriteLine(@"For more information type mc_post help"); Console.WriteLine();