taskjuggler 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +119 -0
- data/benchmarks/allocatedSlots.tjp +1602 -0
- data/benchmarks/booking.tjp +40 -30
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/css/tjmanual.css +0 -0
- data/{test/TestSuite/Scheduler/Correct → benchmarks}/css/tjreport.css +1 -0
- data/benchmarks/gantt.tjp +57 -0
- data/benchmarks/htmltaskreport.tjp +26 -1
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/details.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-green.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-red.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-yellow.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resource.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resourcegroup.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/task.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/taskgroup.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-down.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-flat.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-up.png +0 -0
- data/benchmarks/profile.clt +36082 -0
- data/benchmarks/profile.html +58182 -0
- data/benchmarks/runbench.rb +6 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/scripts/wz_tooltip.js +0 -0
- data/doc/AppConfig.html +85 -37
- data/doc/Arguments.html +11 -1
- data/doc/CHANGELOG.html +131 -2
- data/doc/COPYING.html +11 -1
- data/doc/Object.html +12 -3
- data/doc/README.html +11 -1
- data/doc/RuntimeConfig.html +11 -1
- data/doc/String.html +11 -1
- data/doc/StringIO.html +11 -1
- data/doc/TaskJuggler.html +250 -219
- data/doc/TaskJuggler/Account.html +11 -1
- data/doc/TaskJuggler/AccountAttribute.html +11 -1
- data/doc/TaskJuggler/AccountScenario.html +11 -1
- data/doc/TaskJuggler/Allocation.html +11 -1
- data/doc/TaskJuggler/AllocationAttribute.html +11 -1
- data/doc/TaskJuggler/AttributeBase.html +11 -1
- data/doc/TaskJuggler/AttributeDefinition.html +11 -1
- data/doc/TaskJuggler/BatchProcessor.html +11 -1
- data/doc/TaskJuggler/Booking.html +11 -1
- data/doc/TaskJuggler/BookingListAttribute.html +11 -1
- data/doc/TaskJuggler/BooleanAttribute.html +11 -1
- data/doc/TaskJuggler/CSVFile.html +12 -2
- data/doc/TaskJuggler/CellSettingPattern.html +11 -1
- data/doc/TaskJuggler/CellSettingPatternList.html +11 -1
- data/doc/TaskJuggler/Charge.html +11 -1
- data/doc/TaskJuggler/ChargeListAttribute.html +11 -1
- data/doc/TaskJuggler/ChargeSet.html +11 -1
- data/doc/TaskJuggler/ChargeSetListAttribute.html +11 -1
- data/doc/TaskJuggler/CollisionDetector.html +1063 -0
- data/doc/TaskJuggler/ColumnListAttribute.html +11 -1
- data/doc/TaskJuggler/ColumnTable.html +11 -1
- data/doc/TaskJuggler/Daemon.html +11 -1
- data/doc/TaskJuggler/{OnShiftCache.html → DataCache.html} +127 -139
- data/doc/TaskJuggler/DataCacheEntry.html +711 -0
- data/doc/TaskJuggler/DateAttribute.html +11 -1
- data/doc/TaskJuggler/DefinitionListAttribute.html +11 -1
- data/doc/TaskJuggler/DependencyListAttribute.html +11 -1
- data/doc/TaskJuggler/DurationAttribute.html +16 -5
- data/doc/TaskJuggler/FileList.html +11 -1
- data/doc/TaskJuggler/FileRecord.html +11 -1
- data/doc/TaskJuggler/FixnumAttribute.html +19 -9
- data/doc/TaskJuggler/FlagListAttribute.html +29 -19
- data/doc/TaskJuggler/FloatAttribute.html +23 -13
- data/doc/TaskJuggler/FormatListAttribute.html +19 -9
- data/doc/TaskJuggler/GanttChart.html +94 -133
- data/doc/TaskJuggler/GanttContainer.html +11 -1
- data/doc/TaskJuggler/GanttHeader.html +11 -1
- data/doc/TaskJuggler/GanttHeaderScaleItem.html +11 -1
- data/doc/TaskJuggler/GanttLine.html +11 -1
- data/doc/TaskJuggler/GanttLoadStack.html +11 -1
- data/doc/TaskJuggler/GanttMilestone.html +11 -1
- data/doc/TaskJuggler/GanttRouter.html +247 -596
- data/doc/TaskJuggler/GanttTaskBar.html +11 -1
- data/doc/TaskJuggler/HTMLDocument.html +11 -1
- data/doc/TaskJuggler/HTMLGraphics.html +11 -1
- data/doc/TaskJuggler/Interval.html +11 -1
- data/doc/TaskJuggler/IntervalListAttribute.html +33 -23
- data/doc/TaskJuggler/JobInfo.html +11 -1
- data/doc/TaskJuggler/Journal.html +11 -1
- data/doc/TaskJuggler/JournalEntry.html +11 -1
- data/doc/TaskJuggler/JournalEntryList.html +11 -1
- data/doc/TaskJuggler/KeywordArray.html +11 -1
- data/doc/TaskJuggler/KeywordDocumentation.html +16 -6
- data/doc/TaskJuggler/Limits.html +11 -1
- data/doc/TaskJuggler/Limits/Limit.html +11 -1
- data/doc/TaskJuggler/LimitsAttribute.html +24 -14
- data/doc/TaskJuggler/ListAttributeBase.html +11 -1
- data/doc/TaskJuggler/Log.html +11 -1
- data/doc/TaskJuggler/LogFile.html +11 -1
- data/doc/TaskJuggler/LogicalAttribute.html +11 -1
- data/doc/TaskJuggler/LogicalExpression.html +11 -1
- data/doc/TaskJuggler/LogicalExpressionAttribute.html +19 -9
- data/doc/TaskJuggler/LogicalFlag.html +11 -1
- data/doc/TaskJuggler/LogicalFunction.html +11 -1
- data/doc/TaskJuggler/LogicalOperation.html +11 -1
- data/doc/TaskJuggler/Macro.html +11 -1
- data/doc/TaskJuggler/MacroTable.html +11 -1
- data/doc/TaskJuggler/ManagerResponsibilities.html +11 -1
- data/doc/TaskJuggler/ManagerStatusRecord.html +11 -1
- data/doc/TaskJuggler/Message.html +11 -1
- data/doc/TaskJuggler/MessageHandler.html +11 -1
- data/doc/TaskJuggler/Navigator.html +12 -2
- data/doc/TaskJuggler/NavigatorElement.html +11 -1
- data/doc/TaskJuggler/NikuProject.html +11 -1
- data/doc/TaskJuggler/NikuReport.html +11 -1
- data/doc/TaskJuggler/NikuResource.html +11 -1
- data/doc/TaskJuggler/NodeListAttribute.html +17 -7
- data/doc/TaskJuggler/PlaceHolderCell.html +722 -0
- data/doc/TaskJuggler/ProcessIntercom.html +11 -1
- data/doc/TaskJuggler/ProcessIntercomIface.html +11 -1
- data/doc/TaskJuggler/Project.html +587 -500
- data/doc/TaskJuggler/ProjectBroker.html +11 -1
- data/doc/TaskJuggler/ProjectBrokerIface.html +11 -1
- data/doc/TaskJuggler/ProjectFileParser.html +205 -192
- data/doc/TaskJuggler/ProjectFileScanner.html +230 -207
- data/doc/TaskJuggler/ProjectRecord.html +11 -1
- data/doc/TaskJuggler/ProjectServer.html +11 -1
- data/doc/TaskJuggler/ProjectServerIface.html +11 -1
- data/doc/TaskJuggler/PropertyAttribute.html +19 -9
- data/doc/TaskJuggler/PropertyList.html +95 -83
- data/doc/TaskJuggler/PropertySet.html +11 -1
- data/doc/TaskJuggler/PropertyTreeNode.html +11 -1
- data/doc/TaskJuggler/Query.html +234 -232
- data/doc/TaskJuggler/RTFHandlers.html +11 -1
- data/doc/TaskJuggler/RTFNavigator.html +11 -1
- data/doc/TaskJuggler/RTFQuery.html +11 -1
- data/doc/TaskJuggler/RTFReport.html +11 -1
- data/doc/TaskJuggler/RTFReportLink.html +11 -1
- data/doc/TaskJuggler/RTFWithQuerySupport.html +11 -1
- data/doc/TaskJuggler/RealFormat.html +12 -2
- data/doc/TaskJuggler/RealFormatAttribute.html +15 -5
- data/doc/TaskJuggler/ReferenceAttribute.html +38 -28
- data/doc/TaskJuggler/Report.html +96 -113
- data/doc/TaskJuggler/ReportBase.html +161 -152
- data/doc/TaskJuggler/ReportContext.html +11 -1
- data/doc/TaskJuggler/ReportServer.html +59 -48
- data/doc/TaskJuggler/ReportServerIface.html +51 -41
- data/doc/TaskJuggler/ReportServerRecord.html +11 -1
- data/doc/TaskJuggler/ReportServlet.html +11 -1
- data/doc/TaskJuggler/ReportTable.html +46 -25
- data/doc/TaskJuggler/ReportTableCell.html +296 -275
- data/doc/TaskJuggler/ReportTableColumn.html +14 -4
- data/doc/TaskJuggler/ReportTableLegend.html +11 -1
- data/doc/TaskJuggler/ReportTableLine.html +19 -7
- data/doc/TaskJuggler/Resource.html +12 -2
- data/doc/TaskJuggler/ResourceListAttribute.html +40 -30
- data/doc/TaskJuggler/ResourceListRE.html +11 -1
- data/doc/TaskJuggler/ResourceScenario.html +708 -565
- data/doc/TaskJuggler/RichText.html +54 -36
- data/doc/TaskJuggler/RichTextAttribute.html +31 -21
- data/doc/TaskJuggler/RichTextDocument.html +11 -1
- data/doc/TaskJuggler/RichTextElement.html +11 -1
- data/doc/TaskJuggler/RichTextFunctionExample.html +11 -1
- data/doc/TaskJuggler/RichTextFunctionHandler.html +11 -1
- data/doc/TaskJuggler/RichTextImage.html +11 -1
- data/doc/TaskJuggler/RichTextIntermediate.html +81 -71
- data/doc/TaskJuggler/RichTextParser.html +88 -33
- data/doc/TaskJuggler/RichTextScanner.html +45 -35
- data/doc/TaskJuggler/RichTextSnip.html +11 -1
- data/doc/TaskJuggler/RichTextSyntaxRules.html +436 -389
- data/doc/TaskJuggler/Scenario.html +11 -1
- data/doc/TaskJuggler/ScenarioData.html +11 -1
- data/doc/TaskJuggler/ScenarioListAttribute.html +23 -13
- data/doc/TaskJuggler/Scoreboard.html +92 -73
- data/doc/TaskJuggler/SheetHandlerBase.html +11 -1
- data/doc/TaskJuggler/SheetReceiver.html +11 -1
- data/doc/TaskJuggler/SheetSender.html +11 -1
- data/doc/TaskJuggler/Shift.html +11 -1
- data/doc/TaskJuggler/ShiftAssignment.html +11 -1
- data/doc/TaskJuggler/ShiftAssignments.html +11 -1
- data/doc/TaskJuggler/ShiftAssignmentsAttribute.html +24 -14
- data/doc/TaskJuggler/ShiftScenario.html +11 -1
- data/doc/TaskJuggler/SimpleQueryExpander.html +11 -1
- data/doc/TaskJuggler/SortListAttribute.html +21 -11
- data/doc/TaskJuggler/SourceFileInfo.html +11 -1
- data/doc/TaskJuggler/StatusSheetReceiver.html +11 -1
- data/doc/TaskJuggler/StatusSheetReport.html +11 -1
- data/doc/TaskJuggler/StatusSheetSender.html +112 -11
- data/doc/TaskJuggler/StringAttribute.html +23 -13
- data/doc/TaskJuggler/SymbolAttribute.html +19 -9
- data/doc/TaskJuggler/SyntaxReference.html +80 -71
- data/doc/TaskJuggler/TOCEntry.html +11 -1
- data/doc/TaskJuggler/TSResourceRecord.html +11 -1
- data/doc/TaskJuggler/TSTaskRecord.html +11 -1
- data/doc/TaskJuggler/TableColumnDefinition.html +11 -1
- data/doc/TaskJuggler/TableOfContents.html +11 -1
- data/doc/TaskJuggler/TableReport.html +422 -411
- data/doc/TaskJuggler/Task.html +11 -1
- data/doc/TaskJuggler/TaskDependency.html +11 -1
- data/doc/TaskJuggler/TaskListAttribute.html +33 -23
- data/doc/TaskJuggler/TaskListRE.html +11 -1
- data/doc/TaskJuggler/TaskScenario.html +2007 -1919
- data/doc/TaskJuggler/TextFormatter.html +11 -1
- data/doc/TaskJuggler/TextParser.html +421 -612
- data/doc/TaskJuggler/TextParser/Pattern.html +410 -211
- data/doc/TaskJuggler/TextParser/Rule.html +224 -152
- data/doc/TaskJuggler/TextParser/StackElement.html +190 -28
- data/doc/TaskJuggler/TextParser/State.html +989 -0
- data/doc/TaskJuggler/TextParser/StateTransition.html +782 -0
- data/doc/TaskJuggler/TextParser/TextParserResultArray.html +25 -14
- data/doc/TaskJuggler/TextParser/TokenDoc.html +11 -1
- data/doc/TaskJuggler/TextReport.html +11 -1
- data/doc/TaskJuggler/TextScanner.html +285 -273
- data/doc/TaskJuggler/TextScanner/BufferStreamHandle.html +17 -7
- data/doc/TaskJuggler/TextScanner/FileStreamHandle.html +24 -14
- data/doc/TaskJuggler/TextScanner/MacroStackEntry.html +11 -1
- data/doc/TaskJuggler/TextScanner/StreamHandle.html +64 -52
- data/doc/TaskJuggler/TimeSheet.html +11 -1
- data/doc/TaskJuggler/TimeSheetReceiver.html +11 -1
- data/doc/TaskJuggler/TimeSheetRecord.html +11 -1
- data/doc/TaskJuggler/TimeSheetReport.html +11 -1
- data/doc/TaskJuggler/TimeSheetSender.html +11 -1
- data/doc/TaskJuggler/TimeSheetSummary.html +11 -1
- data/doc/TaskJuggler/TimeSheets.html +11 -1
- data/doc/TaskJuggler/Tj3AppBase.html +11 -1
- data/doc/TaskJuggler/Tj3Client.html +11 -1
- data/doc/TaskJuggler/Tj3Daemon.html +11 -1
- data/doc/TaskJuggler/Tj3SheetAppBase.html +11 -1
- data/doc/TaskJuggler/Tj3SsReceiver.html +11 -1
- data/doc/TaskJuggler/Tj3SsSender.html +11 -1
- data/doc/TaskJuggler/Tj3TsReceiver.html +11 -1
- data/doc/TaskJuggler/Tj3TsSender.html +11 -1
- data/doc/TaskJuggler/Tj3TsSummary.html +11 -1
- data/doc/TaskJuggler/TjException.html +11 -1
- data/doc/TaskJuggler/TjTime.html +474 -324
- data/doc/TaskJuggler/TjpExample.html +11 -1
- data/doc/TaskJuggler/TjpExportRE.html +11 -1
- data/doc/TaskJuggler/TjpSyntaxRules.html +3731 -3662
- data/doc/TaskJuggler/URLParameter.html +11 -1
- data/doc/TaskJuggler/UserManual.html +11 -1
- data/doc/TaskJuggler/VimSyntax.html +11 -1
- data/doc/TaskJuggler/WebServer.html +11 -1
- data/doc/TaskJuggler/WorkingHours.html +295 -221
- data/doc/TaskJuggler/WorkingHoursAttribute.html +11 -1
- data/doc/TaskJuggler/XMLBlob.html +11 -1
- data/doc/TaskJuggler/XMLComment.html +11 -1
- data/doc/TaskJuggler/XMLDocument.html +11 -1
- data/doc/TaskJuggler/XMLElement.html +11 -1
- data/doc/TaskJuggler/XMLNamedText.html +11 -1
- data/doc/TaskJuggler/XMLText.html +11 -1
- data/doc/index.html +694 -624
- data/doc/lib/AppConfig_rb.html +1 -1
- data/doc/lib/Attributes_rb.html +1 -1
- data/doc/lib/Booking_rb.html +1 -1
- data/doc/lib/DataCache_rb.html +69 -0
- data/doc/lib/KeywordDocumentation_rb.html +1 -1
- data/doc/lib/ProjectFileParser_rb.html +1 -1
- data/doc/lib/ProjectFileScanner_rb.html +1 -1
- data/doc/lib/Project_rb.html +1 -1
- data/doc/lib/PropertyList_rb.html +1 -1
- data/doc/lib/Query_rb.html +1 -1
- data/doc/lib/RealFormat_rb.html +1 -1
- data/doc/lib/ResourceScenario_rb.html +1 -1
- data/doc/lib/Resource_rb.html +1 -1
- data/doc/lib/RichTextParser_rb.html +1 -1
- data/doc/lib/RichTextScanner_rb.html +1 -1
- data/doc/lib/RichTextSyntaxRules_rb.html +1 -1
- data/doc/lib/RichText_rb.html +1 -1
- data/doc/lib/Scoreboard_rb.html +1 -1
- data/doc/lib/StatusSheetSender_rb.html +1 -1
- data/doc/lib/SyntaxReference_rb.html +1 -1
- data/doc/lib/TaskJuggler_rb.html +1 -1
- data/doc/lib/TaskScenario_rb.html +3 -1
- data/doc/lib/TextParser/Pattern_rb.html +3 -1
- data/doc/lib/TextParser/Rule_rb.html +3 -1
- data/doc/lib/TextParser/StackElement_rb.html +3 -1
- data/doc/lib/TextParser/State_rb.html +65 -0
- data/doc/lib/TextParser_rb.html +1 -1
- data/doc/lib/TextScanner_rb.html +1 -1
- data/doc/lib/Tj3Config_rb.html +1 -1
- data/doc/lib/TjTime_rb.html +1 -1
- data/doc/lib/TjpSyntaxRules_rb.html +1 -1
- data/doc/lib/WorkingHours_rb.html +3 -1
- data/doc/lib/daemon/ReportServer_rb.html +1 -1
- data/doc/lib/reports/CSVFile_rb.html +1 -1
- data/doc/lib/reports/CollisionDetector_rb.html +67 -0
- data/doc/lib/reports/GanttChart_rb.html +1 -1
- data/doc/lib/reports/GanttRouter_rb.html +3 -1
- data/doc/lib/reports/Navigator_rb.html +1 -1
- data/doc/lib/reports/ReportBase_rb.html +1 -1
- data/doc/lib/reports/ReportTableCell_rb.html +1 -1
- data/doc/lib/reports/ReportTableColumn_rb.html +1 -1
- data/doc/lib/reports/ReportTableLine_rb.html +1 -1
- data/doc/lib/reports/ReportTable_rb.html +1 -1
- data/doc/lib/reports/Report_rb.html +1 -1
- data/doc/lib/reports/TableReport_rb.html +1 -1
- data/doc/lib/taskjuggler3_rb.html +1 -1
- data/examples/tutorial.tjp +1 -2
- data/lib/AppConfig.rb +10 -4
- data/lib/Attributes.rb +4 -4
- data/lib/DataCache.rb +124 -0
- data/lib/KeywordDocumentation.rb +5 -5
- data/lib/Project.rb +54 -10
- data/lib/ProjectFileParser.rb +10 -9
- data/lib/ProjectFileScanner.rb +38 -25
- data/lib/PropertyList.rb +6 -4
- data/lib/Query.rb +0 -8
- data/lib/RealFormat.rb +1 -1
- data/lib/Resource.rb +1 -1
- data/lib/ResourceScenario.rb +96 -31
- data/lib/RichText.rb +17 -5
- data/lib/RichTextParser.rb +22 -9
- data/lib/RichTextScanner.rb +34 -34
- data/lib/RichTextSyntaxRules.rb +41 -36
- data/lib/Scoreboard.rb +16 -7
- data/lib/StatusSheetSender.rb +63 -0
- data/lib/SyntaxReference.rb +9 -10
- data/lib/TaskJuggler.rb +28 -4
- data/lib/TaskScenario.rb +66 -19
- data/lib/TextParser.rb +219 -384
- data/lib/TextParser/Pattern.rb +168 -49
- data/lib/TextParser/Rule.rb +33 -17
- data/lib/TextParser/StackElement.rb +42 -2
- data/lib/TextParser/State.rb +175 -0
- data/lib/TextScanner.rb +19 -15
- data/lib/Tj3Config.rb +1 -1
- data/lib/TjTime.rb +111 -3
- data/lib/TjpSyntaxRules.rb +122 -66
- data/lib/WorkingHours.rb +91 -186
- data/lib/daemon/ReportServer.rb +3 -2
- data/lib/reports/CSVFile.rb +1 -1
- data/lib/reports/CollisionDetector.rb +177 -0
- data/lib/reports/GanttChart.rb +25 -41
- data/lib/reports/GanttRouter.rb +104 -233
- data/lib/reports/Navigator.rb +1 -1
- data/lib/reports/Report.rb +9 -33
- data/lib/reports/ReportBase.rb +0 -1
- data/lib/reports/ReportTable.rb +19 -8
- data/lib/reports/ReportTableCell.rb +61 -25
- data/lib/reports/ReportTableColumn.rb +2 -2
- data/lib/reports/ReportTableLine.rb +4 -2
- data/lib/reports/TableReport.rb +1 -0
- data/lib/taskjuggler3.rb +0 -1
- data/manual/Installation +7 -3
- data/manual/Intro +12 -10
- data/manual/The_TaskJuggler_Syntax +4 -4
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/genrefs +1 -1
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -4
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -22
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +32 -24
- data/test/TestSuite/CSV-Reports/weekly-Reference.csv +13 -0
- data/test/TestSuite/CSV-Reports/weekly.tjp +9 -0
- data/test/TestSuite/HTML-Reports/css/tjreport.css +7 -2
- data/test/TestSuite/HTML-Reports/depArrows.html +839 -830
- data/test/TestSuite/HTML-Reports/depArrows.tjp +12 -12
- data/test/TestSuite/HTML-Reports/profile.html +37581 -0
- data/test/TestSuite/ReportGenerator/Errors/no_report_defined.tjp +7 -0
- data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.tjp +1 -1
- data/test/TestSuite/StatusSheets/TimeSheets/2002-03-01/missing-reports +2 -0
- data/test/TestSuite/StatusSheets/run +2 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +13 -5
- data/test/TestSuite/Syntax/Correct/ResourceRoot.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/RollupResource.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +1 -1
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -1
- data/test/TestSuite/Syntax/Errors/include_before_project.tjp +2 -0
- data/test/TestSuite/Syntax/Errors/no_reduce.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +1 -1
- data/test/TestSuite/TimeSheets/run +1 -1
- data/test/test_CSV-Reports.rb +2 -4
- data/test/test_CollisionDetector.rb +85 -0
- data/test/test_Project.rb +2 -2
- data/test/test_ProjectFileScanner.rb +73 -31
- data/test/test_Query.rb +2 -2
- data/test/test_ReportGenerator.rb +1 -1
- data/test/test_RichText.rb +4 -4
- data/test/test_WorkingHours.rb +150 -11
- metadata +75 -67
- data/test/TestSuite/ReportGenerator/Errors/css/tjreport.css +0 -407
- data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.html +0 -26
- data/test/TestSuite/Scheduler/Correct/Allocate.html +0 -3210
- data/test/TestSuite/Scheduler/Correct/Container.html +0 -349
- data/test/TestSuite/Scheduler/Correct/Limits.html +0 -4964
- data/test/TestSuite/Scheduler/Correct/Shift.html +0 -1719
- data/test/TestSuite/Scheduler/Correct/Shift2.html +0 -476
- data/test/TestSuite/Scheduler/Correct/css/tjmanual.css +0 -66
- data/test/TestSuite/Scheduler/Correct/icons/details.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-green.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-red.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/resource.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/task.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/taskgroup.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-down.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-flat.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-up.png +0 -0
- data/test/TestSuite/Scheduler/Correct/scripts/wz_tooltip.js +0 -1301
- data/test/TestSuite/Scheduler/Errors/css/tjmanual.css +0 -66
- data/test/TestSuite/Scheduler/Errors/css/tjreport.css +0 -407
- data/test/TestSuite/Scheduler/Errors/icons/details.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-green.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-red.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/resource.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/task.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/taskgroup.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-down.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-flat.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-up.png +0 -0
- data/test/TestSuite/Scheduler/Errors/scripts/wz_tooltip.js +0 -1301
- data/test/TestSuite/StatusSheets/resrep.tji +0 -7
- data/test/TestSuite/StatusSheets/tj3d.log +0 -312
- data/test/TestSuite/Syntax/Correct/Managers.html +0 -263
- data/test/TestSuite/TimeSheets/acceptable_intervals +0 -1
- data/test/TestSuite/TimeSheets/statussheets.log +0 -1
|
@@ -151,12 +151,18 @@
|
|
|
151
151
|
|
|
152
152
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
153
153
|
|
|
154
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
155
|
+
|
|
154
156
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
155
157
|
|
|
156
158
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
157
159
|
|
|
158
160
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
159
161
|
|
|
162
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
163
|
+
|
|
164
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
165
|
+
|
|
160
166
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
161
167
|
|
|
162
168
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -263,7 +269,7 @@
|
|
|
263
269
|
|
|
264
270
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
265
271
|
|
|
266
|
-
<li><a href="../TaskJuggler/
|
|
272
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
267
273
|
|
|
268
274
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
269
275
|
|
|
@@ -443,6 +449,10 @@
|
|
|
443
449
|
|
|
444
450
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
445
451
|
|
|
452
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
453
|
+
|
|
454
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
455
|
+
|
|
446
456
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
447
457
|
|
|
448
458
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -176,12 +176,18 @@
|
|
|
176
176
|
|
|
177
177
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
178
178
|
|
|
179
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
180
|
+
|
|
179
181
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
180
182
|
|
|
181
183
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
182
184
|
|
|
183
185
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
184
186
|
|
|
187
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
188
|
+
|
|
189
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
190
|
+
|
|
185
191
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
186
192
|
|
|
187
193
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -288,7 +294,7 @@
|
|
|
288
294
|
|
|
289
295
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
290
296
|
|
|
291
|
-
<li><a href="../TaskJuggler/
|
|
297
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
292
298
|
|
|
293
299
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
294
300
|
|
|
@@ -468,6 +474,10 @@
|
|
|
468
474
|
|
|
469
475
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
470
476
|
|
|
477
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
478
|
+
|
|
479
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
480
|
+
|
|
471
481
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
472
482
|
|
|
473
483
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -164,12 +164,18 @@
|
|
|
164
164
|
|
|
165
165
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
166
166
|
|
|
167
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
168
|
+
|
|
167
169
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
168
170
|
|
|
169
171
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
170
172
|
|
|
171
173
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
172
174
|
|
|
175
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
176
|
+
|
|
177
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
178
|
+
|
|
173
179
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
174
180
|
|
|
175
181
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -276,7 +282,7 @@
|
|
|
276
282
|
|
|
277
283
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
278
284
|
|
|
279
|
-
<li><a href="../TaskJuggler/
|
|
285
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
280
286
|
|
|
281
287
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
282
288
|
|
|
@@ -456,6 +462,10 @@
|
|
|
456
462
|
|
|
457
463
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
458
464
|
|
|
465
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
466
|
+
|
|
467
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
468
|
+
|
|
459
469
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
460
470
|
|
|
461
471
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -172,12 +172,18 @@
|
|
|
172
172
|
|
|
173
173
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
174
174
|
|
|
175
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
176
|
+
|
|
175
177
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
176
178
|
|
|
177
179
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
178
180
|
|
|
179
181
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
180
182
|
|
|
183
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
184
|
+
|
|
185
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
186
|
+
|
|
181
187
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
182
188
|
|
|
183
189
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -284,7 +290,7 @@
|
|
|
284
290
|
|
|
285
291
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
286
292
|
|
|
287
|
-
<li><a href="../TaskJuggler/
|
|
293
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
288
294
|
|
|
289
295
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
290
296
|
|
|
@@ -464,6 +470,10 @@
|
|
|
464
470
|
|
|
465
471
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
466
472
|
|
|
473
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
474
|
+
|
|
475
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
476
|
+
|
|
467
477
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
468
478
|
|
|
469
479
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -73,30 +73,16 @@
|
|
|
73
73
|
|
|
74
74
|
<li><a href="#method-i-addLineTo">#addLineTo</a></li>
|
|
75
75
|
|
|
76
|
-
<li><a href="#method-i-addSegment">#addSegment</a></li>
|
|
77
|
-
|
|
78
76
|
<li><a href="#method-i-addZone">#addZone</a></li>
|
|
79
77
|
|
|
80
|
-
<li><a href="#method-i-checkLines">#checkLines</a></li>
|
|
81
|
-
|
|
82
|
-
<li><a href="#method-i-clip">#clip</a></li>
|
|
83
|
-
|
|
84
|
-
<li><a href="#method-i-collision%3F">#collision?</a></li>
|
|
85
|
-
|
|
86
|
-
<li><a href="#method-i-doubleCheckLine">#doubleCheckLine</a></li>
|
|
87
|
-
|
|
88
78
|
<li><a href="#method-i-justify">#justify</a></li>
|
|
89
79
|
|
|
90
|
-
<li><a href="#method-i-merge">#merge</a></li>
|
|
91
|
-
|
|
92
|
-
<li><a href="#method-i-mergeable%3F">#mergeable?</a></li>
|
|
93
|
-
|
|
94
|
-
<li><a href="#method-i-overlaps%3F">#overlaps?</a></li>
|
|
95
|
-
|
|
96
80
|
<li><a href="#method-i-placeLine">#placeLine</a></li>
|
|
97
81
|
|
|
98
82
|
<li><a href="#method-i-route">#route</a></li>
|
|
99
83
|
|
|
84
|
+
<li><a href="#method-i-routeLines">#routeLines</a></li>
|
|
85
|
+
|
|
100
86
|
<li><a href="#method-i-to_html">#to_html</a></li>
|
|
101
87
|
|
|
102
88
|
</ul>
|
|
@@ -105,17 +91,6 @@
|
|
|
105
91
|
|
|
106
92
|
<!-- Included Modules -->
|
|
107
93
|
|
|
108
|
-
<div id="includes-section" class="section">
|
|
109
|
-
<h3 class="section-header">Included Modules</h3>
|
|
110
|
-
<ul class="link-list">
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<li><span class="include">HTMLGraphics</span></li>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</ul>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
94
|
</div>
|
|
120
95
|
|
|
121
96
|
<div id="project-metadata">
|
|
@@ -188,12 +163,18 @@
|
|
|
188
163
|
|
|
189
164
|
<li><a href="../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
190
165
|
|
|
166
|
+
<li><a href="../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
167
|
+
|
|
191
168
|
<li><a href="../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
192
169
|
|
|
193
170
|
<li><a href="../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
194
171
|
|
|
195
172
|
<li><a href="../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
196
173
|
|
|
174
|
+
<li><a href="../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
175
|
+
|
|
176
|
+
<li><a href="../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
177
|
+
|
|
197
178
|
<li><a href="../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
198
179
|
|
|
199
180
|
<li><a href="../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -300,7 +281,7 @@
|
|
|
300
281
|
|
|
301
282
|
<li><a href="../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
302
283
|
|
|
303
|
-
<li><a href="../TaskJuggler/
|
|
284
|
+
<li><a href="../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
304
285
|
|
|
305
286
|
<li><a href="../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
306
287
|
|
|
@@ -480,6 +461,10 @@
|
|
|
480
461
|
|
|
481
462
|
<li><a href="../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
482
463
|
|
|
464
|
+
<li><a href="../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
465
|
+
|
|
466
|
+
<li><a href="../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
467
|
+
|
|
483
468
|
<li><a href="../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
484
469
|
|
|
485
470
|
<li><a href="../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -601,6 +586,27 @@ from start to end point.
|
|
|
601
586
|
|
|
602
587
|
<!-- Constants -->
|
|
603
588
|
|
|
589
|
+
<div id="constants-list" class="section">
|
|
590
|
+
<h3 class="section-header">Constants</h3>
|
|
591
|
+
<dl>
|
|
592
|
+
|
|
593
|
+
<dt><a name="MinStartGap">MinStartGap</a></dt>
|
|
594
|
+
|
|
595
|
+
<dd class="description"><p>
|
|
596
|
+
Minimum distance between the starting point and the first turning point.
|
|
597
|
+
</p></dd>
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
<dt><a name="MinEndGap">MinEndGap</a></dt>
|
|
601
|
+
|
|
602
|
+
<dd class="description"><p>
|
|
603
|
+
Minimum distance between the last turning point and the tip of the arrow.
|
|
604
|
+
</p></dd>
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
</dl>
|
|
608
|
+
</div>
|
|
609
|
+
|
|
604
610
|
|
|
605
611
|
<!-- Attributes -->
|
|
606
612
|
|
|
@@ -635,21 +641,13 @@ is operating on.
|
|
|
635
641
|
<div class="method-source-code"
|
|
636
642
|
id="new-source">
|
|
637
643
|
<pre>
|
|
638
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
34: <span class="ruby-comment cmt"># particular x coordinate are stored in @vLines, for y coordinates in</span>
|
|
646
|
-
35: <span class="ruby-comment cmt"># @hLines. Each entry is an Array of [ start, end ] values that describe</span>
|
|
647
|
-
36: <span class="ruby-comment cmt"># the blocked segments of that particular line. Start and end point are</span>
|
|
648
|
-
37: <span class="ruby-comment cmt"># part of the segment. A listed segment will not be overwritten during</span>
|
|
649
|
-
38: <span class="ruby-comment cmt"># routing.</span>
|
|
650
|
-
39: <span class="ruby-ivar">@hLines</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@height</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span> = [] }
|
|
651
|
-
40: <span class="ruby-ivar">@vLines</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@width</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span> = [] }
|
|
652
|
-
41: <span class="ruby-keyword kw">end</span></pre>
|
|
644
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 34</span>
|
|
645
|
+
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
|
|
646
|
+
35: <span class="ruby-ivar">@width</span> = <span class="ruby-identifier">width</span>.<span class="ruby-identifier">to_i</span>
|
|
647
|
+
36: <span class="ruby-ivar">@height</span> = <span class="ruby-identifier">height</span>.<span class="ruby-identifier">to_i</span>
|
|
648
|
+
37:
|
|
649
|
+
38: <span class="ruby-ivar">@detector</span> = <span class="ruby-constant">CollisionDetector</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@width</span>, <span class="ruby-ivar">@height</span>)
|
|
650
|
+
39: <span class="ruby-keyword kw">end</span></pre>
|
|
653
651
|
</div>
|
|
654
652
|
|
|
655
653
|
</div>
|
|
@@ -679,42 +677,17 @@ is operating on.
|
|
|
679
677
|
|
|
680
678
|
<div class="method-description">
|
|
681
679
|
|
|
682
|
-
|
|
683
|
-
This function registers an area as don’t-cross-zone. The rectangular
|
|
684
|
-
zone is described by <em>x</em>, <em>y</em>, <em>w</em> and <em>h</em>. If
|
|
685
|
-
<em>horiz</em> is true, the zone will be blocked for horizontal lines, if
|
|
686
|
-
<em>vert</em> is true the zone will be blocked for vertical lines.
|
|
687
|
-
</p>
|
|
680
|
+
|
|
688
681
|
|
|
689
682
|
|
|
690
683
|
|
|
691
684
|
<div class="method-source-code"
|
|
692
685
|
id="add-one-source">
|
|
693
686
|
<pre>
|
|
694
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
50: <span class="ruby-identifier">y</span> = <span class="ruby-identifier">clip</span>(<span class="ruby-identifier">y</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@height</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
|
|
699
|
-
51: <span class="ruby-identifier">w</span> = <span class="ruby-identifier">clip</span>(<span class="ruby-identifier">w</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@width</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">x</span>)
|
|
700
|
-
52: <span class="ruby-identifier">h</span> = <span class="ruby-identifier">clip</span>(<span class="ruby-identifier">h</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@height</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">y</span>)
|
|
701
|
-
53:
|
|
702
|
-
54: <span class="ruby-comment cmt"># We can ignore empty zones.</span>
|
|
703
|
-
55: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">w</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">h</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
704
|
-
56:
|
|
705
|
-
57: <span class="ruby-comment cmt"># Break the rectangle into line segments and add them to the appropriate</span>
|
|
706
|
-
58: <span class="ruby-comment cmt"># line Arrays.</span>
|
|
707
|
-
59: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">horiz</span>
|
|
708
|
-
60: <span class="ruby-identifier">y</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">h</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
|
709
|
-
61: <span class="ruby-identifier">addSegment</span>(<span class="ruby-ivar">@hLines</span>[<span class="ruby-identifier">i</span>], [ <span class="ruby-identifier">x</span>, <span class="ruby-identifier">x</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">w</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ])
|
|
710
|
-
62: <span class="ruby-keyword kw">end</span>
|
|
711
|
-
63: <span class="ruby-keyword kw">end</span>
|
|
712
|
-
64: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">vert</span>
|
|
713
|
-
65: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">x</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">w</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
|
714
|
-
66: <span class="ruby-identifier">addSegment</span>(<span class="ruby-ivar">@vLines</span>[<span class="ruby-identifier">i</span>], [ <span class="ruby-identifier">y</span>, <span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">h</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ])
|
|
715
|
-
67: <span class="ruby-keyword kw">end</span>
|
|
716
|
-
68: <span class="ruby-keyword kw">end</span>
|
|
717
|
-
69: <span class="ruby-keyword kw">end</span></pre>
|
|
687
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 41</span>
|
|
688
|
+
41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">addZone</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-identifier">horiz</span>, <span class="ruby-identifier">vert</span>)
|
|
689
|
+
42: <span class="ruby-ivar">@detector</span>.<span class="ruby-identifier">addBlockedZone</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-identifier">horiz</span>, <span class="ruby-identifier">vert</span>)
|
|
690
|
+
43: <span class="ruby-keyword kw">end</span></pre>
|
|
718
691
|
</div>
|
|
719
692
|
|
|
720
693
|
</div>
|
|
@@ -731,7 +704,7 @@ zone is described by <em>x</em>, <em>y</em>, <em>w</em> and <em>h</em>. If
|
|
|
731
704
|
<div class="method-heading">
|
|
732
705
|
|
|
733
706
|
<span class="method-name">route</span><span
|
|
734
|
-
class="method-args">(
|
|
707
|
+
class="method-args">(startX, startY, endX, endY)</span>
|
|
735
708
|
<span class="method-click-advice">click to toggle source</span>
|
|
736
709
|
|
|
737
710
|
</div>
|
|
@@ -743,7 +716,9 @@ Find a non-blocked route from the <em>startPoint</em> [ x, y ] to the
|
|
|
743
716
|
<em>endPoint</em> [ x, y ]. The route always starts from the start point
|
|
744
717
|
towards the right side of the chart and reaches the end point from the left
|
|
745
718
|
side of the chart. All lines are always strictly horizontal or vertical.
|
|
746
|
-
There are no diagonal lines.
|
|
719
|
+
There are no diagonal lines. The result is an Array of [ x, y ] points that
|
|
720
|
+
include the <em>startPoint</em> as first and <em>endPoint</em> as last
|
|
721
|
+
element.
|
|
747
722
|
</p>
|
|
748
723
|
|
|
749
724
|
|
|
@@ -751,136 +726,74 @@ There are no diagonal lines.
|
|
|
751
726
|
<div class="method-source-code"
|
|
752
727
|
id="route-source">
|
|
753
728
|
<pre>
|
|
754
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
116: <span class="ruby-comment cmt"># 4------X endPoint</span>
|
|
796
|
-
117: <span class="ruby-comment cmt"># |endGap|</span>
|
|
797
|
-
118: <span class="ruby-comment cmt"># x2</span>
|
|
798
|
-
119:
|
|
799
|
-
120: <span class="ruby-comment cmt"># Place horizontal segue. We don't know the width yet, so we have to</span>
|
|
800
|
-
121: <span class="ruby-comment cmt"># assume full width. That's acceptable for horizontal lines.</span>
|
|
801
|
-
122: <span class="ruby-identifier">ySeg</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-value">0</span>, <span class="ruby-ivar">@width</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ], <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">startPoint</span>[<span class="ruby-value">1</span>],
|
|
802
|
-
123: <span class="ruby-identifier">startPoint</span>[<span class="ruby-value">1</span>] <span class="ruby-operator"><</span> <span class="ruby-identifier">endPoint</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>)
|
|
803
|
-
124: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Routing failed"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ySeg</span>
|
|
804
|
-
125:
|
|
805
|
-
126: <span class="ruby-comment cmt"># Place 1st vertical</span>
|
|
806
|
-
127: <span class="ruby-identifier">x1</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-identifier">startPoint</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">+</span> (<span class="ruby-identifier">startPoint</span>[<span class="ruby-value">1</span>] <span class="ruby-operator"><</span> <span class="ruby-identifier">endPoint</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>),
|
|
807
|
-
128: <span class="ruby-identifier">ySeg</span> ], <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">startPoint</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">startGap</span>, <span class="ruby-value">1</span>)
|
|
808
|
-
129: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Routing failed"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">x1</span>
|
|
809
|
-
130:
|
|
810
|
-
131: <span class="ruby-comment cmt"># Place 2nd vertical</span>
|
|
811
|
-
132: <span class="ruby-identifier">x2</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-identifier">ySeg</span>, <span class="ruby-identifier">endPoint</span>[<span class="ruby-value">1</span>] ], <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">endPoint</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">endGap</span>, <span class="ruby-value">1</span>)
|
|
812
|
-
133: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Routing failed"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">x2</span>
|
|
729
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 94</span>
|
|
730
|
+
94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route</span>(<span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>)
|
|
731
|
+
95: <span class="ruby-identifier">points</span> = [ [ <span class="ruby-identifier">startX</span>, <span class="ruby-identifier">startY</span> ] ]
|
|
732
|
+
96: <span class="ruby-identifier">startGap</span> = <span class="ruby-constant">MinStartGap</span>
|
|
733
|
+
97: <span class="ruby-identifier">endGap</span> = <span class="ruby-constant">MinEndGap</span>
|
|
734
|
+
98:
|
|
735
|
+
99: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">endX</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">startX</span> <span class="ruby-operator">></span> <span class="ruby-identifier">startGap</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">endGap</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span>
|
|
736
|
+
100: <span class="ruby-comment cmt"># If the horizontal distance between start and end point is large enough</span>
|
|
737
|
+
101: <span class="ruby-comment cmt"># we can try a direct route.</span>
|
|
738
|
+
102: <span class="ruby-comment cmt">#</span>
|
|
739
|
+
103: <span class="ruby-comment cmt"># xSeg</span>
|
|
740
|
+
104: <span class="ruby-comment cmt"># |startGap|</span>
|
|
741
|
+
105: <span class="ruby-comment cmt"># startX/endX X--------1</span>
|
|
742
|
+
106: <span class="ruby-comment cmt"># |</span>
|
|
743
|
+
107: <span class="ruby-comment cmt"># |</span>
|
|
744
|
+
108: <span class="ruby-comment cmt"># 2------X endX/endY</span>
|
|
745
|
+
109: <span class="ruby-comment cmt"># |endGap|</span>
|
|
746
|
+
110: <span class="ruby-comment cmt">#</span>
|
|
747
|
+
111: <span class="ruby-identifier">xSeg</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-identifier">startY</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">startY</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">endY</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>), <span class="ruby-identifier">endY</span> ],
|
|
748
|
+
112: <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">startX</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">startGap</span>, <span class="ruby-value">1</span>)
|
|
749
|
+
113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">xSeg</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">xSeg</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">endX</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">endGap</span>
|
|
750
|
+
114: <span class="ruby-comment cmt"># The simple version works. Add the lines.</span>
|
|
751
|
+
115: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">xSeg</span>, <span class="ruby-identifier">startY</span>) <span class="ruby-comment cmt"># Point 1</span>
|
|
752
|
+
116: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">xSeg</span>, <span class="ruby-identifier">endY</span>) <span class="ruby-comment cmt"># Point 2</span>
|
|
753
|
+
117: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>)
|
|
754
|
+
118: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">points</span>
|
|
755
|
+
119: <span class="ruby-keyword kw">end</span>
|
|
756
|
+
120: <span class="ruby-keyword kw">end</span>
|
|
757
|
+
121:
|
|
758
|
+
122: <span class="ruby-comment cmt"># If the simple approach above fails, the try a more complex routing</span>
|
|
759
|
+
123: <span class="ruby-comment cmt"># strategy.</span>
|
|
760
|
+
124: <span class="ruby-comment cmt">#</span>
|
|
761
|
+
125: <span class="ruby-comment cmt"># x1</span>
|
|
762
|
+
126: <span class="ruby-comment cmt"># |startGap|</span>
|
|
763
|
+
127: <span class="ruby-comment cmt"># startX/startY X--------1 yLS</span>
|
|
764
|
+
128: <span class="ruby-comment cmt"># |</span>
|
|
765
|
+
129: <span class="ruby-comment cmt"># 3---------------2 ySeg</span>
|
|
766
|
+
130: <span class="ruby-comment cmt"># |</span>
|
|
767
|
+
131: <span class="ruby-comment cmt"># 4------X endX/endY</span>
|
|
768
|
+
132: <span class="ruby-comment cmt"># |endGap|</span>
|
|
769
|
+
133: <span class="ruby-comment cmt"># x2</span>
|
|
813
770
|
134:
|
|
814
|
-
135: <span class="ruby-comment cmt">#
|
|
815
|
-
136: <span class="ruby-comment cmt">#
|
|
816
|
-
137: <span class="ruby-identifier">
|
|
817
|
-
138: <span class="ruby-keyword kw">
|
|
818
|
-
139:
|
|
819
|
-
140:
|
|
820
|
-
141: <span class="ruby-
|
|
821
|
-
142: <span class="ruby-identifier">
|
|
822
|
-
143: <span class="ruby-identifier">
|
|
771
|
+
135: <span class="ruby-comment cmt"># Place horizontal segue. We don't know the width yet, so we have to</span>
|
|
772
|
+
136: <span class="ruby-comment cmt"># assume full width. That's acceptable for horizontal lines.</span>
|
|
773
|
+
137: <span class="ruby-identifier">deltaY</span> = <span class="ruby-identifier">startY</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">endY</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>
|
|
774
|
+
138: <span class="ruby-identifier">ySeg</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-value">0</span>, <span class="ruby-ivar">@width</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ], <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">startY</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span> * <span class="ruby-identifier">deltaY</span>, <span class="ruby-identifier">deltaY</span>)
|
|
775
|
+
139: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Routing failed"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ySeg</span>
|
|
776
|
+
140:
|
|
777
|
+
141: <span class="ruby-comment cmt"># Place 1st vertical</span>
|
|
778
|
+
142: <span class="ruby-identifier">x1</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-identifier">startY</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">deltaY</span>, <span class="ruby-identifier">ySeg</span> ], <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">startX</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">startGap</span>, <span class="ruby-value">1</span>)
|
|
779
|
+
143: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Routing failed"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">x1</span>
|
|
823
780
|
144:
|
|
824
|
-
145: <span class="ruby-
|
|
825
|
-
146:
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
<span class="method-name">to_html</span><span
|
|
842
|
-
class="method-args">()</span>
|
|
843
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
844
|
-
|
|
845
|
-
</div>
|
|
846
|
-
|
|
847
|
-
<div class="method-description">
|
|
848
|
-
|
|
849
|
-
<p>
|
|
850
|
-
This function is only intended for debugging purposes. It marks either the
|
|
851
|
-
vertical or horizontal zones in the chart.
|
|
852
|
-
</p>
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
<div class="method-source-code"
|
|
857
|
-
id="to-html-source">
|
|
858
|
-
<pre>
|
|
859
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 150</span>
|
|
860
|
-
150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_html</span>
|
|
861
|
-
151: <span class="ruby-identifier">html</span> = []
|
|
862
|
-
152: <span class="ruby-comment cmt"># Change this to determine what zones you want to see.</span>
|
|
863
|
-
153: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">true</span>
|
|
864
|
-
154: <span class="ruby-comment cmt"># Show vertical blocks</span>
|
|
865
|
-
155: <span class="ruby-identifier">x</span> = <span class="ruby-value">0</span>
|
|
866
|
-
156: <span class="ruby-ivar">@vLines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
|
867
|
-
157: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">segment</span><span class="ruby-operator">|</span>
|
|
868
|
-
158: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lineToHTML</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">segment</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">x</span>, <span class="ruby-identifier">segment</span>[<span class="ruby-value">1</span>], <span class="ruby-value str">'white'</span>)
|
|
869
|
-
159: <span class="ruby-keyword kw">end</span>
|
|
870
|
-
160: <span class="ruby-identifier">x</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
871
|
-
161: <span class="ruby-keyword kw">end</span>
|
|
872
|
-
162: <span class="ruby-keyword kw">else</span>
|
|
873
|
-
163: <span class="ruby-comment cmt"># Show horizontal blocks</span>
|
|
874
|
-
164: <span class="ruby-identifier">y</span> = <span class="ruby-value">0</span>
|
|
875
|
-
165: <span class="ruby-ivar">@hLines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
|
876
|
-
166: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">segment</span><span class="ruby-operator">|</span>
|
|
877
|
-
167: <span class="ruby-identifier">html</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lineToHTML</span>(<span class="ruby-identifier">segment</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">y</span>, <span class="ruby-identifier">segment</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">y</span>, <span class="ruby-value str">'white'</span>)
|
|
878
|
-
168: <span class="ruby-keyword kw">end</span>
|
|
879
|
-
169: <span class="ruby-identifier">y</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
880
|
-
170: <span class="ruby-keyword kw">end</span>
|
|
881
|
-
171: <span class="ruby-keyword kw">end</span>
|
|
882
|
-
172: <span class="ruby-identifier">html</span>
|
|
883
|
-
173: <span class="ruby-keyword kw">end</span></pre>
|
|
781
|
+
145: <span class="ruby-comment cmt"># Place 2nd vertical</span>
|
|
782
|
+
146: <span class="ruby-identifier">x2</span> = <span class="ruby-identifier">placeLine</span>([ <span class="ruby-identifier">ySeg</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">deltaY</span>, <span class="ruby-identifier">endY</span> ], <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">endX</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">endGap</span>, <span class="ruby-value">1</span>)
|
|
783
|
+
147: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Routing failed"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">x2</span>
|
|
784
|
+
148:
|
|
785
|
+
149: <span class="ruby-comment cmt"># Now add the points 1 - 4 to the list and mark the zones around them. For</span>
|
|
786
|
+
150: <span class="ruby-comment cmt"># vertical lines, we only mark vertical zones and vice versa.</span>
|
|
787
|
+
151: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">x1</span>, <span class="ruby-identifier">startY</span>) <span class="ruby-comment cmt"># Point 1</span>
|
|
788
|
+
152: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">x2</span>
|
|
789
|
+
153: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">x1</span>, <span class="ruby-identifier">ySeg</span>) <span class="ruby-comment cmt"># Point 2</span>
|
|
790
|
+
154: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">ySeg</span>) <span class="ruby-comment cmt"># Point 3</span>
|
|
791
|
+
155: <span class="ruby-keyword kw">end</span>
|
|
792
|
+
156: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">endY</span>) <span class="ruby-comment cmt"># Point 4</span>
|
|
793
|
+
157: <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">endX</span>, <span class="ruby-identifier">endY</span>)
|
|
794
|
+
158:
|
|
795
|
+
159: <span class="ruby-identifier">points</span>
|
|
796
|
+
160: <span class="ruby-keyword kw">end</span></pre>
|
|
884
797
|
</div>
|
|
885
798
|
|
|
886
799
|
</div>
|
|
@@ -891,115 +804,69 @@ vertical or horizontal zones in the chart.
|
|
|
891
804
|
</div>
|
|
892
805
|
|
|
893
806
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
<div id="private-instance-method-details" class="method-section section">
|
|
897
|
-
<h3 class="section-header">Private Instance Methods</h3>
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
<div id="add-ine-o-method" class="method-detail ">
|
|
901
|
-
<a name="method-i-addLineTo"></a>
|
|
807
|
+
<div id="route-ines-method" class="method-detail ">
|
|
808
|
+
<a name="method-i-routeLines"></a>
|
|
902
809
|
|
|
903
810
|
<div class="method-heading">
|
|
904
811
|
|
|
905
|
-
<span class="method-name">
|
|
906
|
-
class="method-args">(
|
|
812
|
+
<span class="method-name">routeLines</span><span
|
|
813
|
+
class="method-args">(fromToPoints)</span>
|
|
907
814
|
<span class="method-click-advice">click to toggle source</span>
|
|
908
815
|
|
|
909
816
|
</div>
|
|
910
817
|
|
|
911
818
|
<div class="method-description">
|
|
912
819
|
|
|
913
|
-
<p>
|
|
914
|
-
This function adds another waypoint to an existing line. In addition it
|
|
915
|
-
adds a zone that is 2 pixel wide on each side of the line and runs in the
|
|
916
|
-
direction of the line. This avoids too closely aligned parallel lines in
|
|
917
|
-
the chart.
|
|
918
|
-
</p>
|
|
919
|
-
|
|
920
|
-
|
|
921
820
|
|
|
922
|
-
<div class="method-source-code"
|
|
923
|
-
id="add-ine-o-source">
|
|
924
|
-
<pre>
|
|
925
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 323</span>
|
|
926
|
-
323: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>)
|
|
927
|
-
324: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Point list may not be empty"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">points</span>.<span class="ruby-identifier">empty?</span>
|
|
928
|
-
325:
|
|
929
|
-
326: <span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span> = <span class="ruby-identifier">points</span>[<span class="ruby-value">1</span>]
|
|
930
|
-
327: <span class="ruby-identifier">points</span> <span class="ruby-operator"><<</span> [ <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span> ]
|
|
931
|
-
328:
|
|
932
|
-
329: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">x2</span>
|
|
933
|
-
330: <span class="ruby-comment cmt"># vertical line</span>
|
|
934
|
-
331: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@width</span>
|
|
935
|
-
332: <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span> = <span class="ruby-identifier">justify</span>(<span class="ruby-identifier">x1</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-value">5</span>, <span class="ruby-identifier">y2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">y1</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
|
|
936
|
-
333: <span class="ruby-identifier">addZone</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>)
|
|
937
|
-
334: <span class="ruby-keyword kw">else</span>
|
|
938
|
-
335: <span class="ruby-comment cmt"># horizontal line</span>
|
|
939
|
-
336: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">y1</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@height</span>
|
|
940
|
-
337: <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span> = <span class="ruby-identifier">justify</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">x2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-value">5</span>)
|
|
941
|
-
338: <span class="ruby-identifier">addZone</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>)
|
|
942
|
-
339: <span class="ruby-keyword kw">end</span>
|
|
943
|
-
340: <span class="ruby-keyword kw">end</span></pre>
|
|
944
|
-
</div>
|
|
945
|
-
|
|
946
|
-
</div>
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
</div>
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
<div id="add-egment-method" class="method-detail ">
|
|
955
|
-
<a name="method-i-addSegment"></a>
|
|
956
|
-
|
|
957
|
-
<div class="method-heading">
|
|
958
|
-
|
|
959
|
-
<span class="method-name">addSegment</span><span
|
|
960
|
-
class="method-args">(line, newSegment)</span>
|
|
961
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
962
|
-
|
|
963
|
-
</div>
|
|
964
|
-
|
|
965
|
-
<div class="method-description">
|
|
966
|
-
|
|
967
|
-
<p>
|
|
968
|
-
This function adds a new segment to the line. In case the new segment
|
|
969
|
-
overlaps with or directly attaches to existing segments, these segments are
|
|
970
|
-
merged into a single segment.
|
|
971
|
-
</p>
|
|
972
821
|
|
|
973
822
|
|
|
974
823
|
|
|
975
824
|
<div class="method-source-code"
|
|
976
|
-
id="
|
|
825
|
+
id="route-ines-source">
|
|
977
826
|
<pre>
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
827
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 45</span>
|
|
828
|
+
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">routeLines</span>(<span class="ruby-identifier">fromToPoints</span>)
|
|
829
|
+
46: <span class="ruby-comment cmt"># We first convert the fromToPoints list into a more readable list of</span>
|
|
830
|
+
47: <span class="ruby-comment cmt"># Hash objects.</span>
|
|
831
|
+
48: <span class="ruby-identifier">routes</span> = []
|
|
832
|
+
49: <span class="ruby-identifier">fromToPoints</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">touple</span><span class="ruby-operator">|</span>
|
|
833
|
+
50: <span class="ruby-identifier">routes</span> <span class="ruby-operator"><<</span> {
|
|
834
|
+
51: <span class="ruby-value">:startX</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">touple</span>[<span class="ruby-value">0</span>],
|
|
835
|
+
52: <span class="ruby-value">:startY</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">touple</span>[<span class="ruby-value">1</span>],
|
|
836
|
+
53: <span class="ruby-value">:endX</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">touple</span>[<span class="ruby-value">2</span>],
|
|
837
|
+
54: <span class="ruby-value">:endY</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">touple</span>[<span class="ruby-value">3</span>],
|
|
838
|
+
55: <span class="ruby-value">:id</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">touple</span>[<span class="ruby-value">4</span>]
|
|
839
|
+
56: }
|
|
840
|
+
57: <span class="ruby-keyword kw">end</span>
|
|
841
|
+
58:
|
|
842
|
+
59: <span class="ruby-comment cmt"># To make sure that we minimize the crossings of arrows that</span>
|
|
843
|
+
60: <span class="ruby-comment cmt"># originate from the same position, we sort the arrows by the</span>
|
|
844
|
+
61: <span class="ruby-comment cmt"># smallest angle between the vertical line through the task end</span>
|
|
845
|
+
62: <span class="ruby-comment cmt"># and the line between the start and end of the arrow.</span>
|
|
846
|
+
63: <span class="ruby-identifier">routes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
|
847
|
+
64: <span class="ruby-identifier">adjLeg</span> = (<span class="ruby-identifier">r</span>[<span class="ruby-value">:endX</span>] <span class="ruby-operator">-</span> <span class="ruby-constant">MinEndGap</span>) <span class="ruby-operator">-</span> (<span class="ruby-identifier">r</span>[<span class="ruby-value">:startX</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">MinStartGap</span>)
|
|
848
|
+
65: <span class="ruby-identifier">oppLeg</span> = (<span class="ruby-identifier">r</span>[<span class="ruby-value">:startY</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">r</span>[<span class="ruby-value">:endY</span>]).<span class="ruby-identifier">abs</span>
|
|
849
|
+
66: <span class="ruby-identifier">r</span>[<span class="ruby-value">:distance</span>] = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">adjLeg</span> <span class="ruby-operator">**</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">oppLeg</span> <span class="ruby-operator">**</span> <span class="ruby-value">2</span>)
|
|
850
|
+
67: <span class="ruby-comment cmt"># We can now calculate the sinus values of the angle between the</span>
|
|
851
|
+
68: <span class="ruby-comment cmt"># vertical and a line through the coordinates.</span>
|
|
852
|
+
69: <span class="ruby-identifier">sinus</span> = <span class="ruby-identifier">oppLeg</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">r</span>[<span class="ruby-value">:distance</span>]
|
|
853
|
+
70: <span class="ruby-identifier">r</span>[<span class="ruby-value">:angle</span>] = (<span class="ruby-identifier">adjLeg</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Math</span><span class="ruby-operator">::</span><span class="ruby-constant">PI</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">asin</span>(<span class="ruby-constant">Math</span><span class="ruby-operator">::</span><span class="ruby-constant">PI</span><span class="ruby-operator">/</span><span class="ruby-value">2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">sinus</span>) <span class="ruby-operator">:</span>
|
|
854
|
+
71: <span class="ruby-constant">Math</span>.<span class="ruby-identifier">asin</span>(<span class="ruby-identifier">sinus</span>)) <span class="ruby-operator">/</span> (<span class="ruby-constant">Math</span><span class="ruby-operator">::</span><span class="ruby-constant">PI</span> <span class="ruby-operator">/</span> (<span class="ruby-value">2</span> * <span class="ruby-value">90</span>))
|
|
855
|
+
72: <span class="ruby-keyword kw">end</span>
|
|
856
|
+
73: <span class="ruby-comment cmt"># We sort the arrows from small to a large angle. In case the angle is</span>
|
|
857
|
+
74: <span class="ruby-comment cmt"># identical, we use the length of the line as second criteria.</span>
|
|
858
|
+
75: <span class="ruby-identifier">routes</span>.<span class="ruby-identifier">sort!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r1</span>, <span class="ruby-identifier">r2</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">r1</span>[<span class="ruby-value">:angle</span>] <span class="ruby-operator">/</span> <span class="ruby-value">5</span>).<span class="ruby-identifier">to_i</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">r2</span>[<span class="ruby-value">:angle</span>] <span class="ruby-operator">/</span> <span class="ruby-value">5</span>).<span class="ruby-identifier">to_i</span> <span class="ruby-operator">?</span>
|
|
859
|
+
76: <span class="ruby-operator">-</span>(<span class="ruby-identifier">r1</span>[<span class="ruby-value">:distance</span>] <span class="ruby-operator"><=></span> <span class="ruby-identifier">r2</span>[<span class="ruby-value">:distance</span>]) <span class="ruby-operator">:</span>
|
|
860
|
+
77: <span class="ruby-operator">-</span>(<span class="ruby-identifier">r1</span>[<span class="ruby-value">:angle</span>] <span class="ruby-operator"><=></span> <span class="ruby-identifier">r2</span>[<span class="ruby-value">:angle</span>]) }
|
|
861
|
+
78:
|
|
862
|
+
79: <span class="ruby-comment cmt"># Now that the routes are in proper order, we can actually lay the</span>
|
|
863
|
+
80: <span class="ruby-comment cmt"># routes.</span>
|
|
864
|
+
81: <span class="ruby-identifier">routePoints</span> = []
|
|
865
|
+
82: <span class="ruby-identifier">routes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
|
866
|
+
83: <span class="ruby-identifier">routePoints</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">route</span>(<span class="ruby-identifier">r</span>[<span class="ruby-value">:startX</span>], <span class="ruby-identifier">r</span>[<span class="ruby-value">:startY</span>], <span class="ruby-identifier">r</span>[<span class="ruby-value">:endX</span>], <span class="ruby-identifier">r</span>[<span class="ruby-value">:endY</span>])
|
|
867
|
+
84: <span class="ruby-keyword kw">end</span>
|
|
868
|
+
85: <span class="ruby-identifier">routePoints</span>
|
|
869
|
+
86: <span class="ruby-keyword kw">end</span></pre>
|
|
1003
870
|
</div>
|
|
1004
871
|
|
|
1005
872
|
</div>
|
|
@@ -1010,62 +877,13 @@ merged into a single segment.
|
|
|
1010
877
|
</div>
|
|
1011
878
|
|
|
1012
879
|
|
|
1013
|
-
<div id="
|
|
1014
|
-
<a name="method-i-
|
|
1015
|
-
|
|
1016
|
-
<div class="method-heading">
|
|
1017
|
-
|
|
1018
|
-
<span class="method-name">checkLines</span><span
|
|
1019
|
-
class="method-args">(lines)</span>
|
|
1020
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
1021
|
-
|
|
1022
|
-
</div>
|
|
1023
|
-
|
|
1024
|
-
<div class="method-description">
|
|
1025
|
-
|
|
1026
|
-
<p>
|
|
1027
|
-
This is just an internal sanity check that is not needed for normal
|
|
1028
|
-
operation. It checks that all the line segments are valid and stored in
|
|
1029
|
-
ascending order.
|
|
1030
|
-
</p>
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
<div class="method-source-code"
|
|
1035
|
-
id="check-ines-source">
|
|
1036
|
-
<pre>
|
|
1037
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 345</span>
|
|
1038
|
-
345: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">checkLines</span>(<span class="ruby-identifier">lines</span>)
|
|
1039
|
-
346: <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
|
1040
|
-
347: <span class="ruby-identifier">v</span> = <span class="ruby-keyword kw">nil</span>
|
|
1041
|
-
348: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">segment</span><span class="ruby-operator">|</span>
|
|
1042
|
-
349: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">></span> <span class="ruby-identifier">segment</span>[<span class="ruby-value">1</span>]
|
|
1043
|
-
350: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Invalid segment [#{segment[0]}, #{segment[1]}]"</span>
|
|
1044
|
-
351: <span class="ruby-keyword kw">end</span>
|
|
1045
|
-
352: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>
|
|
1046
|
-
353: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Segment sequence error"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">segment</span>[<span class="ruby-value">0</span>]
|
|
1047
|
-
354: <span class="ruby-keyword kw">end</span>
|
|
1048
|
-
355: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">segment</span>[<span class="ruby-value">1</span>]
|
|
1049
|
-
356: <span class="ruby-keyword kw">end</span>
|
|
1050
|
-
357: <span class="ruby-keyword kw">end</span>
|
|
1051
|
-
358: <span class="ruby-keyword kw">end</span></pre>
|
|
1052
|
-
</div>
|
|
1053
|
-
|
|
1054
|
-
</div>
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
</div>
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
<div id="clip-method" class="method-detail ">
|
|
1063
|
-
<a name="method-i-clip"></a>
|
|
880
|
+
<div id="to-html-method" class="method-detail ">
|
|
881
|
+
<a name="method-i-to_html"></a>
|
|
1064
882
|
|
|
1065
883
|
<div class="method-heading">
|
|
1066
884
|
|
|
1067
|
-
<span class="method-name">
|
|
1068
|
-
class="method-args">(
|
|
885
|
+
<span class="method-name">to_html</span><span
|
|
886
|
+
class="method-args">()</span>
|
|
1069
887
|
<span class="method-click-advice">click to toggle source</span>
|
|
1070
888
|
|
|
1071
889
|
</div>
|
|
@@ -1073,20 +891,19 @@ ascending order.
|
|
|
1073
891
|
<div class="method-description">
|
|
1074
892
|
|
|
1075
893
|
<p>
|
|
1076
|
-
|
|
894
|
+
This function is only intended for debugging purposes. It marks either the
|
|
895
|
+
vertical or horizontal zones in the chart.
|
|
1077
896
|
</p>
|
|
1078
897
|
|
|
1079
898
|
|
|
1080
899
|
|
|
1081
900
|
<div class="method-source-code"
|
|
1082
|
-
id="
|
|
901
|
+
id="to-html-source">
|
|
1083
902
|
<pre>
|
|
1084
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
181: <span class="ruby-identifier">v</span>
|
|
1089
|
-
182: <span class="ruby-keyword kw">end</span></pre>
|
|
903
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 164</span>
|
|
904
|
+
164: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_html</span>
|
|
905
|
+
165: <span class="ruby-ivar">@detector</span>.<span class="ruby-identifier">to_html</span>
|
|
906
|
+
166: <span class="ruby-keyword kw">end</span></pre>
|
|
1090
907
|
</div>
|
|
1091
908
|
|
|
1092
909
|
</div>
|
|
@@ -1097,76 +914,19 @@ Simple utility function to limit <em>v</em> between 0 and <em>max</em>.
|
|
|
1097
914
|
</div>
|
|
1098
915
|
|
|
1099
916
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
<span class="method-name">collision?</span><span
|
|
1106
|
-
class="method-args">(line, probeSegment)</span>
|
|
1107
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
1108
|
-
|
|
1109
|
-
</div>
|
|
1110
|
-
|
|
1111
|
-
<div class="method-description">
|
|
1112
|
-
|
|
1113
|
-
<p>
|
|
1114
|
-
Find out if any of the segments in <em>line</em> overlap with the
|
|
1115
|
-
<em>probeSegment</em>. If so, return true, false otherwise.
|
|
1116
|
-
</p>
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
<div class="method-source-code"
|
|
1121
|
-
id="collision--source">
|
|
1122
|
-
<pre>
|
|
1123
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 253</span>
|
|
1124
|
-
253: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collision?</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">probeSegment</span>)
|
|
1125
|
-
254: <span class="ruby-comment cmt"># For complex charts, the segment lists can be rather long. We use a</span>
|
|
1126
|
-
255: <span class="ruby-comment cmt"># binary search to be fairly efficient.</span>
|
|
1127
|
-
256: <span class="ruby-identifier">l</span> = <span class="ruby-value">0</span>
|
|
1128
|
-
257: <span class="ruby-identifier">u</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
|
1129
|
-
258: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">l</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">u</span>
|
|
1130
|
-
259: <span class="ruby-comment cmt"># Look at the element in the middle between l and u.</span>
|
|
1131
|
-
260: <span class="ruby-identifier">p</span> = <span class="ruby-identifier">l</span> <span class="ruby-operator">+</span> ((<span class="ruby-identifier">u</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">l</span>) <span class="ruby-operator">/</span> <span class="ruby-value">2</span>).<span class="ruby-identifier">to_i</span>
|
|
1132
|
-
261: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">overlaps?</span>(<span class="ruby-identifier">line</span>[<span class="ruby-identifier">p</span>], <span class="ruby-identifier">probeSegment</span>)
|
|
1133
|
-
262:
|
|
1134
|
-
263: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">probeSegment</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">></span> <span class="ruby-identifier">line</span>[<span class="ruby-identifier">p</span>][<span class="ruby-value">1</span>]
|
|
1135
|
-
264: <span class="ruby-comment cmt"># The potential target is above p. Adjust lower bound.</span>
|
|
1136
|
-
265: <span class="ruby-identifier">l</span> = <span class="ruby-identifier">p</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
1137
|
-
266: <span class="ruby-keyword kw">else</span>
|
|
1138
|
-
267: <span class="ruby-comment cmt"># The potential target is below p. Adjust upper bound.</span>
|
|
1139
|
-
268: <span class="ruby-identifier">u</span> = <span class="ruby-identifier">p</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
|
1140
|
-
269: <span class="ruby-keyword kw">end</span>
|
|
1141
|
-
270: <span class="ruby-keyword kw">end</span>
|
|
1142
|
-
271: <span class="ruby-comment cmt"># TODO: This code uses a simple linear search to double check the above</span>
|
|
1143
|
-
272: <span class="ruby-comment cmt"># binary search. It can be removed once we know the above code always</span>
|
|
1144
|
-
273: <span class="ruby-comment cmt"># works properly.</span>
|
|
1145
|
-
274: <span class="ruby-identifier">line</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">segment</span><span class="ruby-operator">|</span>
|
|
1146
|
-
275: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">overlaps?</span>(<span class="ruby-identifier">probeSegment</span>, <span class="ruby-identifier">segment</span>)
|
|
1147
|
-
276: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Binary search failed to find collision"</span>
|
|
1148
|
-
277: <span class="ruby-keyword kw">end</span>
|
|
1149
|
-
278: <span class="ruby-keyword kw">end</span>
|
|
1150
|
-
279:
|
|
1151
|
-
280: <span class="ruby-keyword kw">false</span>
|
|
1152
|
-
281: <span class="ruby-keyword kw">end</span></pre>
|
|
1153
|
-
</div>
|
|
1154
|
-
|
|
1155
|
-
</div>
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
</div>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
<div id="private-instance-method-details" class="method-section section">
|
|
920
|
+
<h3 class="section-header">Private Instance Methods</h3>
|
|
1161
921
|
|
|
1162
922
|
|
|
1163
|
-
<div id="
|
|
1164
|
-
<a name="method-i-
|
|
923
|
+
<div id="add-ine-o-method" class="method-detail ">
|
|
924
|
+
<a name="method-i-addLineTo"></a>
|
|
1165
925
|
|
|
1166
926
|
<div class="method-heading">
|
|
1167
927
|
|
|
1168
|
-
<span class="method-name">
|
|
1169
|
-
class="method-args">(
|
|
928
|
+
<span class="method-name">addLineTo</span><span
|
|
929
|
+
class="method-args">(points, x2, y2)</span>
|
|
1170
930
|
<span class="method-click-advice">click to toggle source</span>
|
|
1171
931
|
|
|
1172
932
|
</div>
|
|
@@ -1174,27 +934,36 @@ Find out if any of the segments in <em>line</em> overlap with the
|
|
|
1174
934
|
<div class="method-description">
|
|
1175
935
|
|
|
1176
936
|
<p>
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
937
|
+
This function adds another waypoint to an existing line. In addition it
|
|
938
|
+
adds a zone that is 2 pixel wide on each side of the line and runs in the
|
|
939
|
+
direction of the line. This avoids too closely aligned parallel lines in
|
|
940
|
+
the chart.
|
|
1180
941
|
</p>
|
|
1181
942
|
|
|
1182
943
|
|
|
1183
944
|
|
|
1184
945
|
<div class="method-source-code"
|
|
1185
|
-
id="
|
|
946
|
+
id="add-ine-o-source">
|
|
1186
947
|
<pre>
|
|
1187
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
948
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 208</span>
|
|
949
|
+
208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">addLineTo</span>(<span class="ruby-identifier">points</span>, <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span>)
|
|
950
|
+
209: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Point list may not be empty"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">points</span>.<span class="ruby-identifier">empty?</span>
|
|
951
|
+
210:
|
|
952
|
+
211: <span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span> = <span class="ruby-identifier">points</span>[<span class="ruby-value">1</span>]
|
|
953
|
+
212: <span class="ruby-identifier">points</span> <span class="ruby-operator"><<</span> [ <span class="ruby-identifier">x2</span>, <span class="ruby-identifier">y2</span> ]
|
|
954
|
+
213:
|
|
955
|
+
214: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">x2</span>
|
|
956
|
+
215: <span class="ruby-comment cmt"># vertical line</span>
|
|
957
|
+
216: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@width</span>
|
|
958
|
+
217: <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span> = <span class="ruby-identifier">justify</span>(<span class="ruby-identifier">x1</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">y1</span>, <span class="ruby-value">5</span>, <span class="ruby-identifier">y2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">y1</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
|
|
959
|
+
218: <span class="ruby-identifier">addZone</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>)
|
|
960
|
+
219: <span class="ruby-keyword kw">else</span>
|
|
961
|
+
220: <span class="ruby-comment cmt"># horizontal line</span>
|
|
962
|
+
221: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">y1</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@height</span>
|
|
963
|
+
222: <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span> = <span class="ruby-identifier">justify</span>(<span class="ruby-identifier">x1</span>, <span class="ruby-identifier">y1</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">x2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">x1</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-value">5</span>)
|
|
964
|
+
223: <span class="ruby-identifier">addZone</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>)
|
|
965
|
+
224: <span class="ruby-keyword kw">end</span>
|
|
966
|
+
225: <span class="ruby-keyword kw">end</span></pre>
|
|
1198
967
|
</div>
|
|
1199
968
|
|
|
1200
969
|
</div>
|
|
@@ -1230,135 +999,19 @@ the same rectangle with all positive coordinates.
|
|
|
1230
999
|
<div class="method-source-code"
|
|
1231
1000
|
id="justify-source">
|
|
1232
1001
|
<pre>
|
|
1233
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
</div>
|
|
1247
|
-
|
|
1248
|
-
</div>
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
</div>
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
<div id="merge-method" class="method-detail ">
|
|
1257
|
-
<a name="method-i-merge"></a>
|
|
1258
|
-
|
|
1259
|
-
<div class="method-heading">
|
|
1260
|
-
|
|
1261
|
-
<span class="method-name">merge</span><span
|
|
1262
|
-
class="method-args">(dst, seg)</span>
|
|
1263
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
1264
|
-
|
|
1265
|
-
</div>
|
|
1266
|
-
|
|
1267
|
-
<div class="method-description">
|
|
1268
|
-
|
|
1269
|
-
<p>
|
|
1270
|
-
Merge the two segments described by <em>dst</em> and <em>src</em> into
|
|
1271
|
-
<em>dst</em>.
|
|
1272
|
-
</p>
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
<div class="method-source-code"
|
|
1277
|
-
id="merge-source">
|
|
1278
|
-
<pre>
|
|
1279
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 246</span>
|
|
1280
|
-
246: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">seg</span>)
|
|
1281
|
-
247: <span class="ruby-identifier">dst</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">seg</span>[<span class="ruby-value">0</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">seg</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><</span> <span class="ruby-identifier">dst</span>[<span class="ruby-value">0</span>]
|
|
1282
|
-
248: <span class="ruby-identifier">dst</span>[<span class="ruby-value">1</span>] = <span class="ruby-identifier">seg</span>[<span class="ruby-value">1</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">seg</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">></span> <span class="ruby-identifier">dst</span>[<span class="ruby-value">1</span>]
|
|
1283
|
-
249: <span class="ruby-keyword kw">end</span></pre>
|
|
1284
|
-
</div>
|
|
1285
|
-
|
|
1286
|
-
</div>
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
</div>
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
<div id="mergeable--method" class="method-detail ">
|
|
1295
|
-
<a name="method-i-mergeable%3F"></a>
|
|
1296
|
-
|
|
1297
|
-
<div class="method-heading">
|
|
1298
|
-
|
|
1299
|
-
<span class="method-name">mergeable?</span><span
|
|
1300
|
-
class="method-args">(s1, s2)</span>
|
|
1301
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
1302
|
-
|
|
1303
|
-
</div>
|
|
1304
|
-
|
|
1305
|
-
<div class="method-description">
|
|
1306
|
-
|
|
1307
|
-
<p>
|
|
1308
|
-
Return true if the two segments described by <em>s1</em> and <em>s2</em>
|
|
1309
|
-
overlap each other or are directly attached to each other.
|
|
1310
|
-
</p>
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
<div class="method-source-code"
|
|
1315
|
-
id="mergeable--source">
|
|
1316
|
-
<pre>
|
|
1317
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 239</span>
|
|
1318
|
-
239: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mergeable?</span>(<span class="ruby-identifier">s1</span>, <span class="ruby-identifier">s2</span>)
|
|
1319
|
-
240: <span class="ruby-identifier">overlaps?</span>(<span class="ruby-identifier">s1</span>, <span class="ruby-identifier">s2</span>) <span class="ruby-operator">||</span>
|
|
1320
|
-
241: (<span class="ruby-identifier">s1</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">s2</span>[<span class="ruby-value">0</span>]) <span class="ruby-operator">||</span>
|
|
1321
|
-
242: (<span class="ruby-identifier">s2</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">s1</span>[<span class="ruby-value">0</span>])
|
|
1322
|
-
243: <span class="ruby-keyword kw">end</span></pre>
|
|
1323
|
-
</div>
|
|
1324
|
-
|
|
1325
|
-
</div>
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
</div>
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
<div id="overlaps--method" class="method-detail ">
|
|
1334
|
-
<a name="method-i-overlaps%3F"></a>
|
|
1335
|
-
|
|
1336
|
-
<div class="method-heading">
|
|
1337
|
-
|
|
1338
|
-
<span class="method-name">overlaps?</span><span
|
|
1339
|
-
class="method-args">(s1, s2)</span>
|
|
1340
|
-
<span class="method-click-advice">click to toggle source</span>
|
|
1341
|
-
|
|
1342
|
-
</div>
|
|
1343
|
-
|
|
1344
|
-
<div class="method-description">
|
|
1345
|
-
|
|
1346
|
-
<p>
|
|
1347
|
-
Return true if the two segments described by <em>s1</em> and <em>s2</em>
|
|
1348
|
-
overlap each other. A segment is a [ start, end ] Array. The two points are
|
|
1349
|
-
part of the segment.
|
|
1350
|
-
</p>
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
<div class="method-source-code"
|
|
1355
|
-
id="overlaps--source">
|
|
1356
|
-
<pre>
|
|
1357
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 232</span>
|
|
1358
|
-
232: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">overlaps?</span>(<span class="ruby-identifier">s1</span>, <span class="ruby-identifier">s2</span>)
|
|
1359
|
-
233: (<span class="ruby-identifier">s1</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><=</span> <span class="ruby-identifier">s2</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">&&</span> <span class="ruby-identifier">s2</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><=</span> <span class="ruby-identifier">s1</span>[<span class="ruby-value">1</span>]) <span class="ruby-operator">||</span>
|
|
1360
|
-
234: (<span class="ruby-identifier">s2</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><=</span> <span class="ruby-identifier">s1</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">&&</span> <span class="ruby-identifier">s1</span>[<span class="ruby-value">0</span>] <span class="ruby-operator"><=</span> <span class="ruby-identifier">s2</span>[<span class="ruby-value">1</span>])
|
|
1361
|
-
235: <span class="ruby-keyword kw">end</span></pre>
|
|
1002
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 231</span>
|
|
1003
|
+
231: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">justify</span>(<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>)
|
|
1004
|
+
232: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">w</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
|
1005
|
+
233: <span class="ruby-identifier">w</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">w</span>
|
|
1006
|
+
234: <span class="ruby-identifier">x</span> = <span class="ruby-identifier">x</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">w</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
1007
|
+
235: <span class="ruby-keyword kw">end</span>
|
|
1008
|
+
236: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">h</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
|
1009
|
+
237: <span class="ruby-identifier">h</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">h</span>
|
|
1010
|
+
238: <span class="ruby-identifier">y</span> = <span class="ruby-identifier">y</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">h</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
1011
|
+
239: <span class="ruby-keyword kw">end</span>
|
|
1012
|
+
240: <span class="ruby-comment cmt"># Return the potentially adjusted rectangle coordinates.</span>
|
|
1013
|
+
241: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span>, <span class="ruby-identifier">w</span>, <span class="ruby-identifier">h</span>
|
|
1014
|
+
242: <span class="ruby-keyword kw">end</span></pre>
|
|
1362
1015
|
</div>
|
|
1363
1016
|
|
|
1364
1017
|
</div>
|
|
@@ -1397,35 +1050,33 @@ collision free coordinate or the outside edge of the routing area.
|
|
|
1397
1050
|
<div class="method-source-code"
|
|
1398
1051
|
id="place-ine-source">
|
|
1399
1052
|
<pre>
|
|
1400
|
-
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
316: <span class="ruby-identifier">pos</span>
|
|
1428
|
-
317: <span class="ruby-keyword kw">end</span></pre>
|
|
1053
|
+
<span class="ruby-comment cmt"># File lib/reports/GanttRouter.rb, line 177</span>
|
|
1054
|
+
177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">placeLine</span>(<span class="ruby-identifier">segment</span>, <span class="ruby-identifier">horizontal</span>, <span class="ruby-identifier">start</span>, <span class="ruby-identifier">delta</span>)
|
|
1055
|
+
178: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"delta may not be 0"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delta</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
1056
|
+
179: <span class="ruby-comment cmt"># Start must be an integer and lie within the routing area.</span>
|
|
1057
|
+
180: <span class="ruby-identifier">pos</span> = <span class="ruby-identifier">start</span>.<span class="ruby-identifier">to_i</span>
|
|
1058
|
+
181: <span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pos</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
|
1059
|
+
182: <span class="ruby-identifier">max</span> = (<span class="ruby-identifier">horizontal</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@height</span><span class="ruby-operator">:</span> <span class="ruby-ivar">@width</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
|
1060
|
+
183: <span class="ruby-identifier">pos</span> = <span class="ruby-identifier">max</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pos</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max</span>
|
|
1061
|
+
184:
|
|
1062
|
+
185: <span class="ruby-comment cmt"># Make sure that the segment coordinates are in ascending order.</span>
|
|
1063
|
+
186: <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">sort!</span>
|
|
1064
|
+
187: <span class="ruby-comment cmt"># TODO: Remove this check once the code becomes stable.</span>
|
|
1065
|
+
188: <span class="ruby-comment cmt">#checkLines(lines)</span>
|
|
1066
|
+
189: <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@detector</span>.<span class="ruby-identifier">collision?</span>(<span class="ruby-identifier">pos</span>, <span class="ruby-identifier">segment</span>, <span class="ruby-identifier">horizontal</span>)
|
|
1067
|
+
190: <span class="ruby-identifier">pos</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">delta</span>
|
|
1068
|
+
191: <span class="ruby-comment cmt"># Check if we have exceded the chart area towards top/left.</span>
|
|
1069
|
+
192: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">delta</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
|
1070
|
+
193: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pos</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
|
1071
|
+
194: <span class="ruby-keyword kw">break</span>
|
|
1072
|
+
195: <span class="ruby-keyword kw">end</span>
|
|
1073
|
+
196: <span class="ruby-keyword kw">else</span>
|
|
1074
|
+
197: <span class="ruby-comment cmt"># And towards right/bottom.</span>
|
|
1075
|
+
198: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pos</span> <span class="ruby-operator">>=</span> (<span class="ruby-identifier">horizontal</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@height</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@width</span>)
|
|
1076
|
+
199: <span class="ruby-keyword kw">end</span>
|
|
1077
|
+
200: <span class="ruby-keyword kw">end</span>
|
|
1078
|
+
201: <span class="ruby-identifier">pos</span>
|
|
1079
|
+
202: <span class="ruby-keyword kw">end</span></pre>
|
|
1429
1080
|
</div>
|
|
1430
1081
|
|
|
1431
1082
|
</div>
|