taskjuggler 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +280 -0
- data/README +31 -0
- data/Rakefile +20 -0
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/benchmarks/allocate.tjp +30 -0
- data/benchmarks/booking.tjp +62 -0
- data/benchmarks/depends.tjp +112 -0
- data/benchmarks/htmltaskreport.tjp +45 -0
- data/benchmarks/runbench.rb +24 -0
- data/bin/tj3 +3 -0
- data/bin/tj3man +3 -0
- data/doc/classes/AppConfig.html +808 -0
- data/doc/classes/Arguments.html +226 -0
- data/doc/classes/String.html +395 -0
- data/doc/classes/TaskJuggler.html +1358 -0
- data/doc/classes/TaskJuggler/Account.html +257 -0
- data/doc/classes/TaskJuggler/AccountScenario.html +218 -0
- data/doc/classes/TaskJuggler/Allocation.html +419 -0
- data/doc/classes/TaskJuggler/AllocationAttribute.html +291 -0
- data/doc/classes/TaskJuggler/AttributeBase.html +608 -0
- data/doc/classes/TaskJuggler/AttributeDefinition.html +259 -0
- data/doc/classes/TaskJuggler/Booking.html +307 -0
- data/doc/classes/TaskJuggler/BookingListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/BooleanAttribute.html +261 -0
- data/doc/classes/TaskJuggler/CSVFile.html +325 -0
- data/doc/classes/TaskJuggler/Charge.html +279 -0
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +229 -0
- data/doc/classes/TaskJuggler/ChargeSet.html +440 -0
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +276 -0
- data/doc/classes/TaskJuggler/ColumnTable.html +260 -0
- data/doc/classes/TaskJuggler/DateAttribute.html +194 -0
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/DurationAttribute.html +229 -0
- data/doc/classes/TaskJuggler/FixnumAttribute.html +194 -0
- data/doc/classes/TaskJuggler/FlagListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/FloatAttribute.html +229 -0
- data/doc/classes/TaskJuggler/GanttChart.html +667 -0
- data/doc/classes/TaskJuggler/GanttContainer.html +441 -0
- data/doc/classes/TaskJuggler/GanttHeader.html +280 -0
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +245 -0
- data/doc/classes/TaskJuggler/GanttLine.html +398 -0
- data/doc/classes/TaskJuggler/GanttLoadStack.html +327 -0
- data/doc/classes/TaskJuggler/GanttMilestone.html +415 -0
- data/doc/classes/TaskJuggler/GanttRouter.html +425 -0
- data/doc/classes/TaskJuggler/GanttTaskBar.html +429 -0
- data/doc/classes/TaskJuggler/HTMLDocument.html +240 -0
- data/doc/classes/TaskJuggler/HTMLGraphics.html +231 -0
- data/doc/classes/TaskJuggler/Interval.html +552 -0
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +796 -0
- data/doc/classes/TaskJuggler/Limits.html +416 -0
- data/doc/classes/TaskJuggler/Limits/Limit.html +381 -0
- data/doc/classes/TaskJuggler/LimitsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/Log.html +613 -0
- data/doc/classes/TaskJuggler/LogicalAttribute.html +226 -0
- data/doc/classes/TaskJuggler/LogicalExpression.html +251 -0
- data/doc/classes/TaskJuggler/LogicalFlag.html +229 -0
- data/doc/classes/TaskJuggler/LogicalFunction.html +324 -0
- data/doc/classes/TaskJuggler/LogicalOperation.html +299 -0
- data/doc/classes/TaskJuggler/Macro.html +194 -0
- data/doc/classes/TaskJuggler/MacroParser.html +360 -0
- data/doc/classes/TaskJuggler/MacroTable.html +366 -0
- data/doc/classes/TaskJuggler/Message.html +281 -0
- data/doc/classes/TaskJuggler/MessageHandler.html +215 -0
- data/doc/classes/TaskJuggler/Project.html +1606 -0
- data/doc/classes/TaskJuggler/ProjectFileParser.html +412 -0
- data/doc/classes/TaskJuggler/PropertyList.html +597 -0
- data/doc/classes/TaskJuggler/PropertySet.html +1200 -0
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +1449 -0
- data/doc/classes/TaskJuggler/Query.html +600 -0
- data/doc/classes/TaskJuggler/RealFormat.html +252 -0
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +194 -0
- data/doc/classes/TaskJuggler/Report.html +528 -0
- data/doc/classes/TaskJuggler/ReportElement.html +1070 -0
- data/doc/classes/TaskJuggler/ReportTable.html +497 -0
- data/doc/classes/TaskJuggler/ReportTableCell.html +518 -0
- data/doc/classes/TaskJuggler/ReportTableColumn.html +364 -0
- data/doc/classes/TaskJuggler/ReportTableElement.html +644 -0
- data/doc/classes/TaskJuggler/ReportTableLegend.html +343 -0
- data/doc/classes/TaskJuggler/ReportTableLine.html +431 -0
- data/doc/classes/TaskJuggler/Resource.html +211 -0
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/ResourceListRE.html +249 -0
- data/doc/classes/TaskJuggler/ResourceScenario.html +1137 -0
- data/doc/classes/TaskJuggler/RichText.html +537 -0
- data/doc/classes/TaskJuggler/RichTextAttribute.html +229 -0
- data/doc/classes/TaskJuggler/RichTextDocument.html +418 -0
- data/doc/classes/TaskJuggler/RichTextElement.html +829 -0
- data/doc/classes/TaskJuggler/RichTextException.html +212 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +317 -0
- data/doc/classes/TaskJuggler/RichTextProtocolExample.html +303 -0
- data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +194 -0
- data/doc/classes/TaskJuggler/RichTextScanner.html +561 -0
- data/doc/classes/TaskJuggler/RichTextSnip.html +364 -0
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +883 -0
- data/doc/classes/TaskJuggler/Scenario.html +163 -0
- data/doc/classes/TaskJuggler/ScenarioData.html +354 -0
- data/doc/classes/TaskJuggler/Scoreboard.html +638 -0
- data/doc/classes/TaskJuggler/Shift.html +255 -0
- data/doc/classes/TaskJuggler/ShiftAssignment.html +488 -0
- data/doc/classes/TaskJuggler/ShiftAssignments.html +715 -0
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/ShiftScenario.html +282 -0
- data/doc/classes/TaskJuggler/SourceFileInfo.html +247 -0
- data/doc/classes/TaskJuggler/StringAttribute.html +229 -0
- data/doc/classes/TaskJuggler/SymbolAttribute.html +194 -0
- data/doc/classes/TaskJuggler/SyntaxReference.html +516 -0
- data/doc/classes/TaskJuggler/TOCEntry.html +242 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +273 -0
- data/doc/classes/TaskJuggler/TableOfContents.html +256 -0
- data/doc/classes/TaskJuggler/Task.html +203 -0
- data/doc/classes/TaskJuggler/TaskDependency.html +251 -0
- data/doc/classes/TaskJuggler/TaskListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/TaskListRE.html +250 -0
- data/doc/classes/TaskJuggler/TaskScenario.html +2206 -0
- data/doc/classes/TaskJuggler/TextParser.html +670 -0
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +923 -0
- data/doc/classes/TaskJuggler/TextParser/Rule.html +779 -0
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +267 -0
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +212 -0
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +221 -0
- data/doc/classes/TaskJuggler/TextScanner.html +708 -0
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +355 -0
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +341 -0
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +260 -0
- data/doc/classes/TaskJuggler/TjException.html +185 -0
- data/doc/classes/TaskJuggler/TjTime.html +1845 -0
- data/doc/classes/TaskJuggler/TjpExample.html +310 -0
- data/doc/classes/TaskJuggler/TjpExportRE.html +329 -0
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +8928 -0
- data/doc/classes/TaskJuggler/UserManual.html +606 -0
- data/doc/classes/TaskJuggler/WorkingHours.html +582 -0
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +284 -0
- data/doc/classes/TaskJuggler/XMLBlob.html +207 -0
- data/doc/classes/TaskJuggler/XMLComment.html +206 -0
- data/doc/classes/TaskJuggler/XMLDocument.html +293 -0
- data/doc/classes/TaskJuggler/XMLElement.html +341 -0
- data/doc/classes/TaskJuggler/XMLNamedText.html +174 -0
- data/doc/classes/TaskJuggler/XMLText.html +221 -0
- data/doc/files/COPYING.html +448 -0
- data/doc/files/README.html +134 -0
- data/doc/files/lib/AccountScenario_rb.html +116 -0
- data/doc/files/lib/Account_rb.html +118 -0
- data/doc/files/lib/Allocation_rb.html +118 -0
- data/doc/files/lib/AppConfig_rb.html +116 -0
- data/doc/files/lib/AttributeBase_rb.html +106 -0
- data/doc/files/lib/AttributeDefinition_rb.html +106 -0
- data/doc/files/lib/Attributes_rb.html +130 -0
- data/doc/files/lib/Booking_rb.html +106 -0
- data/doc/files/lib/ChargeSet_rb.html +116 -0
- data/doc/files/lib/Charge_rb.html +116 -0
- data/doc/files/lib/HTMLDocument_rb.html +116 -0
- data/doc/files/lib/Interval_rb.html +116 -0
- data/doc/files/lib/KeywordDocumentation_rb.html +122 -0
- data/doc/files/lib/Limits_rb.html +116 -0
- data/doc/files/lib/Log_rb.html +116 -0
- data/doc/files/lib/LogicalExpression_rb.html +122 -0
- data/doc/files/lib/LogicalFlag_rb.html +116 -0
- data/doc/files/lib/LogicalFunction_rb.html +116 -0
- data/doc/files/lib/LogicalOperation_rb.html +116 -0
- data/doc/files/lib/MacroParser_rb.html +118 -0
- data/doc/files/lib/MacroTable_rb.html +122 -0
- data/doc/files/lib/MessageHandler_rb.html +106 -0
- data/doc/files/lib/Message_rb.html +116 -0
- data/doc/files/lib/ProjectFileParser_rb.html +122 -0
- data/doc/files/lib/Project_rb.html +148 -0
- data/doc/files/lib/PropertyList_rb.html +106 -0
- data/doc/files/lib/PropertySet_rb.html +118 -0
- data/doc/files/lib/PropertyTreeNode_rb.html +106 -0
- data/doc/files/lib/Query_rb.html +116 -0
- data/doc/files/lib/RealFormat_rb.html +106 -0
- data/doc/files/lib/ResourceScenario_rb.html +116 -0
- data/doc/files/lib/Resource_rb.html +118 -0
- data/doc/files/lib/RichTextDocument_rb.html +120 -0
- data/doc/files/lib/RichTextElement_rb.html +120 -0
- data/doc/files/lib/RichTextParser_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolExample_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolHandler_rb.html +106 -0
- data/doc/files/lib/RichTextScanner_rb.html +116 -0
- data/doc/files/lib/RichTextSnip_rb.html +118 -0
- data/doc/files/lib/RichTextSyntaxRules_rb.html +106 -0
- data/doc/files/lib/RichText_rb.html +118 -0
- data/doc/files/lib/ScenarioData_rb.html +118 -0
- data/doc/files/lib/Scenario_rb.html +116 -0
- data/doc/files/lib/Scoreboard_rb.html +106 -0
- data/doc/files/lib/ShiftAssignments_rb.html +116 -0
- data/doc/files/lib/ShiftScenario_rb.html +116 -0
- data/doc/files/lib/Shift_rb.html +118 -0
- data/doc/files/lib/SourceFileInfo_rb.html +106 -0
- data/doc/files/lib/SyntaxReference_rb.html +122 -0
- data/doc/files/lib/TOCEntry_rb.html +118 -0
- data/doc/files/lib/TableColumnDefinition_rb.html +106 -0
- data/doc/files/lib/TableOfContents_rb.html +118 -0
- data/doc/files/lib/TaskDependency_rb.html +106 -0
- data/doc/files/lib/TaskJuggler_rb.html +120 -0
- data/doc/files/lib/TaskScenario_rb.html +116 -0
- data/doc/files/lib/Task_rb.html +118 -0
- data/doc/files/lib/TextParser/Pattern_rb.html +116 -0
- data/doc/files/lib/TextParser/Rule_rb.html +106 -0
- data/doc/files/lib/TextParser/StackElement_rb.html +106 -0
- data/doc/files/lib/TextParser/TokenDoc_rb.html +106 -0
- data/doc/files/lib/TextParser_rb.html +124 -0
- data/doc/files/lib/TextScanner_rb.html +128 -0
- data/doc/files/lib/Tj3Config_rb.html +118 -0
- data/doc/files/lib/TjException_rb.html +106 -0
- data/doc/files/lib/TjTime_rb.html +118 -0
- data/doc/files/lib/TjpExample_rb.html +116 -0
- data/doc/files/lib/TjpSyntaxRules_rb.html +106 -0
- data/doc/files/lib/UTF8String_rb.html +132 -0
- data/doc/files/lib/UserManual_rb.html +124 -0
- data/doc/files/lib/WorkingHours_rb.html +116 -0
- data/doc/files/lib/XMLDocument_rb.html +116 -0
- data/doc/files/lib/XMLElement_rb.html +116 -0
- data/doc/files/lib/reports/CSVFile_rb.html +116 -0
- data/doc/files/lib/reports/ColumnTable_rb.html +116 -0
- data/doc/files/lib/reports/GanttChart_rb.html +122 -0
- data/doc/files/lib/reports/GanttContainer_rb.html +116 -0
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +106 -0
- data/doc/files/lib/reports/GanttHeader_rb.html +116 -0
- data/doc/files/lib/reports/GanttLine_rb.html +126 -0
- data/doc/files/lib/reports/GanttLoadStack_rb.html +116 -0
- data/doc/files/lib/reports/GanttMilestone_rb.html +116 -0
- data/doc/files/lib/reports/GanttRouter_rb.html +106 -0
- data/doc/files/lib/reports/GanttTaskBar_rb.html +116 -0
- data/doc/files/lib/reports/HTMLGraphics_rb.html +106 -0
- data/doc/files/lib/reports/ReportElement_rb.html +118 -0
- data/doc/files/lib/reports/ReportTableCell_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableColumn_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableElement_rb.html +122 -0
- data/doc/files/lib/reports/ReportTableLegend_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableLine_rb.html +116 -0
- data/doc/files/lib/reports/ReportTable_rb.html +118 -0
- data/doc/files/lib/reports/Report_rb.html +126 -0
- data/doc/files/lib/reports/ResourceListRE_rb.html +122 -0
- data/doc/files/lib/reports/TaskListRE_rb.html +122 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +116 -0
- data/doc/files/lib/taskjuggler3_rb.html +276 -0
- data/doc/files/lib/tj3man_rb.html +189 -0
- data/doc/fr_class_index.html +285 -0
- data/doc/fr_file_index.html +223 -0
- data/doc/fr_method_index.html +1953 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/examples/tutorial.tjp +361 -0
- data/gem_spec.rb +30 -0
- data/lib/Account.rb +50 -0
- data/lib/AccountScenario.rb +39 -0
- data/lib/Allocation.rb +102 -0
- data/lib/AppConfig.rb +134 -0
- data/lib/AttributeBase.rb +131 -0
- data/lib/AttributeDefinition.rb +47 -0
- data/lib/Attributes.rb +478 -0
- data/lib/BatchProcessor.rb +209 -0
- data/lib/Booking.rb +59 -0
- data/lib/Charge.rb +71 -0
- data/lib/ChargeSet.rb +126 -0
- data/lib/HTMLDocument.rb +59 -0
- data/lib/Interval.rb +127 -0
- data/lib/KeywordDocumentation.rb +560 -0
- data/lib/Limits.rb +219 -0
- data/lib/Log.rb +160 -0
- data/lib/LogicalExpression.rb +71 -0
- data/lib/LogicalFlag.rb +34 -0
- data/lib/LogicalFunction.rb +102 -0
- data/lib/LogicalOperation.rb +118 -0
- data/lib/MacroParser.rb +77 -0
- data/lib/MacroTable.rb +84 -0
- data/lib/Message.rb +56 -0
- data/lib/MessageHandler.rb +34 -0
- data/lib/Project.rb +662 -0
- data/lib/ProjectFileParser.rb +333 -0
- data/lib/PropertyList.rb +181 -0
- data/lib/PropertySet.rb +304 -0
- data/lib/PropertyTreeNode.rb +461 -0
- data/lib/Query.rb +227 -0
- data/lib/RealFormat.rb +73 -0
- data/lib/Resource.rb +42 -0
- data/lib/ResourceScenario.rb +511 -0
- data/lib/RichText.rb +147 -0
- data/lib/RichTextDocument.rb +139 -0
- data/lib/RichTextElement.rb +391 -0
- data/lib/RichTextParser.rb +66 -0
- data/lib/RichTextProtocolExample.rb +65 -0
- data/lib/RichTextProtocolHandler.rb +35 -0
- data/lib/RichTextScanner.rb +390 -0
- data/lib/RichTextSnip.rb +104 -0
- data/lib/RichTextSyntaxRules.rb +265 -0
- data/lib/Scenario.rb +27 -0
- data/lib/ScenarioData.rb +65 -0
- data/lib/Scoreboard.rb +141 -0
- data/lib/Shift.rb +48 -0
- data/lib/ShiftAssignments.rb +291 -0
- data/lib/ShiftScenario.rb +46 -0
- data/lib/SourceFileInfo.rb +37 -0
- data/lib/SyntaxReference.rb +284 -0
- data/lib/TOCEntry.rb +76 -0
- data/lib/TableColumnDefinition.rb +54 -0
- data/lib/TableOfContents.rb +46 -0
- data/lib/Task.rb +37 -0
- data/lib/TaskDependency.rb +39 -0
- data/lib/TaskJuggler.rb +84 -0
- data/lib/TaskScenario.rb +1622 -0
- data/lib/TextParser.rb +416 -0
- data/lib/TextParser/Pattern.rb +263 -0
- data/lib/TextParser/Rule.rb +171 -0
- data/lib/TextParser/StackElement.rb +45 -0
- data/lib/TextParser/TokenDoc.rb +38 -0
- data/lib/TextScanner.rb +682 -0
- data/lib/Tj3Config.rb +27 -0
- data/lib/TjException.rb +27 -0
- data/lib/TjTime.rb +395 -0
- data/lib/TjpExample.rb +119 -0
- data/lib/TjpSyntaxRules.rb +4022 -0
- data/lib/UTF8String.rb +100 -0
- data/lib/UserManual.rb +282 -0
- data/lib/WorkingHours.rb +323 -0
- data/lib/XMLDocument.rb +54 -0
- data/lib/XMLElement.rb +175 -0
- data/lib/reports/CSVFile.rb +146 -0
- data/lib/reports/ColumnTable.rb +66 -0
- data/lib/reports/GanttChart.rb +308 -0
- data/lib/reports/GanttContainer.rb +107 -0
- data/lib/reports/GanttHeader.rb +141 -0
- data/lib/reports/GanttHeaderScaleItem.rb +42 -0
- data/lib/reports/GanttLine.rb +329 -0
- data/lib/reports/GanttLoadStack.rb +113 -0
- data/lib/reports/GanttMilestone.rb +80 -0
- data/lib/reports/GanttRouter.rb +375 -0
- data/lib/reports/GanttTaskBar.rb +95 -0
- data/lib/reports/HTMLGraphics.rb +65 -0
- data/lib/reports/Report.rb +344 -0
- data/lib/reports/ReportElement.rb +427 -0
- data/lib/reports/ReportTable.rb +144 -0
- data/lib/reports/ReportTableCell.rb +142 -0
- data/lib/reports/ReportTableColumn.rb +82 -0
- data/lib/reports/ReportTableElement.rb +852 -0
- data/lib/reports/ReportTableLegend.rb +167 -0
- data/lib/reports/ReportTableLine.rb +87 -0
- data/lib/reports/ResourceListRE.rb +72 -0
- data/lib/reports/TaskListRE.rb +73 -0
- data/lib/reports/TjpExportRE.rb +394 -0
- data/lib/taskjuggler3.rb +106 -0
- data/lib/tj3man.rb +88 -0
- data/manual/Day_To_Day_Juggling +168 -0
- data/manual/Getting_Started +61 -0
- data/manual/How_To_Contribute +185 -0
- data/manual/Installation +68 -0
- data/manual/Intro +102 -0
- data/manual/Reporting_Bugs +26 -0
- data/manual/Rich_Text_Attributes +90 -0
- data/manual/TaskJuggler_2x_Migration +40 -0
- data/manual/Tutorial +579 -0
- data/manual/fdl +450 -0
- data/prj_cfg.rb +43 -0
- data/setup.rb +1585 -0
- data/tasks/csts.rake +72 -0
- data/tasks/gem.rake +14 -0
- data/tasks/manual.rake +10 -0
- data/tasks/missing.rake +21 -0
- data/tasks/rcov.rake +14 -0
- data/tasks/rdoc.rake +17 -0
- data/tasks/rexml_fix.rb +16 -0
- data/tasks/rexml_fix_19.rb +49 -0
- data/tasks/show.rake +21 -0
- data/tasks/stats.rake +25 -0
- data/tasks/test.rake +11 -0
- data/test/MessageChecker.rb +53 -0
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/celltext.tjp +7 -0
- data/test/TestSuite/CSV-Reports/genrefs +6 -0
- data/test/TestSuite/CSV-Reports/project-1.tji +57 -0
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -0
- data/test/TestSuite/CSV-Reports/resourcereport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +11 -0
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortByTree.tjp +8 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/taskreport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +24 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +11 -0
- data/test/TestSuite/Scheduler/Correct/Allocate.tjp +86 -0
- data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +63 -0
- data/test/TestSuite/Scheduler/Correct/Booking.tjp +161 -0
- data/test/TestSuite/Scheduler/Correct/Depends.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Duration.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +129 -0
- data/test/TestSuite/Scheduler/Correct/Limits.tjp +81 -0
- data/test/TestSuite/Scheduler/Correct/MultipleMandatories.tjp +43 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +28 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +62 -0
- data/test/TestSuite/Scheduler/Correct/Precedes.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Shift.tjp +102 -0
- data/test/TestSuite/Scheduler/Errors/account_no_leaf.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/booking_conflict.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/booking_no_duty.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/booking_on_vacation.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/container_booking.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/container_duration.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/effort_no_allocations.tjp +7 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_1.tjp +19 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_10.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_11.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_12.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_13.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_14.tjp +26 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_2.tjp +24 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_3.tjp +18 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_4.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_5.tjp +37 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_6.tjp +35 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_7.tjp +46 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_8.tjp +51 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_9.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/maxend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/maxstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_booking.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/milestone_duration.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_start_end.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/multiple_durations.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/no_tasks.tjp +6 -0
- data/test/TestSuite/Scheduler/Errors/not_scheduled.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_child.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_multi.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_parent.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_self.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_unknown.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_1.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_2.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_3.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_1.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_2.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_3.tjp +9 -0
- data/test/TestSuite/Syntax/Correct/Account.tjp +53 -0
- data/test/TestSuite/Syntax/Correct/Allocate-1.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/Alternative.tjp +13 -0
- data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Caption.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Comments.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Complete.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/CompletedWork.tji +20 -0
- data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Currencyformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/CustomAttributes.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Depends1.tjp +22 -0
- data/test/TestSuite/Syntax/Correct/Durations.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Efficiency.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Export.tjp +40 -0
- data/test/TestSuite/Syntax/Correct/Flags.tjp +32 -0
- data/test/TestSuite/Syntax/Correct/Freeze.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Gap.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Limits-1.tjp +71 -0
- data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Macro-1.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Mandatory.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Milestone.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/MinMax.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Numberformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Period.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Persistent.tjp +11 -0
- data/test/TestSuite/Syntax/Correct/Precedes1.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Priority.tjp +30 -0
- data/test/TestSuite/Syntax/Correct/Project.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/ProjectIDs.tjp +23 -0
- data/test/TestSuite/Syntax/Correct/RawHTML.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Reports.tjp +54 -0
- data/test/TestSuite/Syntax/Correct/Resource.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Responsible.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Scenario.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/Scheduling.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Select.tjp +27 -0
- data/test/TestSuite/Syntax/Correct/Shift.tjp +55 -0
- data/test/TestSuite/Syntax/Correct/Simple.tjp +25 -0
- data/test/TestSuite/Syntax/Correct/String.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Supplement.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/TimeFrame.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Timezone.tjp +8 -0
- data/test/TestSuite/Syntax/Correct/Vacation.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/csvtest +16 -0
- data/test/TestSuite/Syntax/Correct/manual2example.rb +24 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +485 -0
- data/test/TestSuite/Syntax/Errors/bad_include.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/booking_group.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/booking_milestone.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/booking_no_leaf.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/chargeset.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/container_attribute.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/date_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/effort_zero.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -0
- data/test/TestSuite/Syntax/Errors/export_bad_extn.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/extend_id_cap.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_end_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_start_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/leaf_resource_id_expected.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/misaligned_date.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/operand_attribute.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/overtime_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/purge_no_list.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/purge_unknown_id.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/report_end.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_start.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/resource_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/resource_id_expected.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/scenario_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_assignment_overlap.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/shift_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_id_expected.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/sloppy_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/sort_direction.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/start_before_end1.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/start_before_end2.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/task_complete.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/task_priority.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_without_chargeset.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/time_interval.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/too_many_bangs.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/undecl_flag.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_projectid.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_id.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/unknown_task.tjp +10 -0
- data/test/all.rb +31 -0
- data/test/test_BatchProcessor.rb +54 -0
- data/test/test_CSV-Reports.rb +101 -0
- data/test/test_Limits.rb +104 -0
- data/test/test_LogicalExpression.rb +110 -0
- data/test/test_MacroTable.rb +51 -0
- data/test/test_Project.rb +57 -0
- data/test/test_PropertySet.rb +71 -0
- data/test/test_Query.rb +83 -0
- data/test/test_RealFormat.rb +83 -0
- data/test/test_RichText.rb +869 -0
- data/test/test_Scheduler.rb +42 -0
- data/test/test_ShiftAssignments.rb +77 -0
- data/test/test_Syntax.rb +41 -0
- data/test/test_TextScanner.rb +95 -0
- data/test/test_TjTime.rb +114 -0
- data/test/test_TjpExample.rb +169 -0
- data/test/test_UTF8String.rb +84 -0
- data/test/test_WorkingHours.rb +56 -0
- metadata +649 -0
data/lib/Scoreboard.rb
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = Scoreboard.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
class TaskJuggler
|
14
|
+
|
15
|
+
# Scoreboard objects are instrumental during the scheduling process. The
|
16
|
+
# project time span is divided into discrete time slots by the scheduling
|
17
|
+
# resolution. This class models the resulting time slots with an array that
|
18
|
+
# spans from project start o project end. Each slot has an index start with 0
|
19
|
+
# at the project start.
|
20
|
+
class Scoreboard
|
21
|
+
|
22
|
+
attr_reader :startDate, :endDate, :resolution, :size
|
23
|
+
|
24
|
+
# Create the scoreboard based on the the given _startDate_, _endDate_ and
|
25
|
+
# timing _resolution_. The resolution must be specified in seconds.
|
26
|
+
# Optionally you can provide an initial value for the scoreboard cells.
|
27
|
+
def initialize(startDate, endDate, resolution, initVal = nil)
|
28
|
+
@startDate = startDate
|
29
|
+
@endDate = endDate
|
30
|
+
@resolution = resolution
|
31
|
+
@size = ((endDate - startDate) / resolution).ceil + 1
|
32
|
+
clear(initVal)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Erase all values and set them to nil or a new initial value.
|
36
|
+
def clear(initVal = nil)
|
37
|
+
@sb = Array.new(@size, initVal)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Converts a scroreboard index to the corresponding date. You can optionally
|
41
|
+
# sanitize the _idx_ value by forcing it into the project range.
|
42
|
+
def idxToDate(idx, forceIntoProject = false)
|
43
|
+
if forceIntoProject
|
44
|
+
return @startDate if kdx < 0
|
45
|
+
return @endDate if @size - 1 if idx >= @size
|
46
|
+
elsif idx < 0 || idx >= @size
|
47
|
+
raise "Index #{idx} is out of scoreboard range (#{size - 1})"
|
48
|
+
end
|
49
|
+
@startDate + idx * @resolution
|
50
|
+
end
|
51
|
+
|
52
|
+
# Converts a date to the corresponding scoreboard index. You can optionally
|
53
|
+
# sanitize the _date_ by forcing it into the project time span.
|
54
|
+
def dateToIdx(date, forceIntoProject = false)
|
55
|
+
if forceIntoProject
|
56
|
+
return 0 if date < @startDate
|
57
|
+
return @size - 1 if date >= @endDate
|
58
|
+
elsif date < @startDate || date > @endDate
|
59
|
+
raise "Date #{date} is out of project time range " +
|
60
|
+
"(#{@startDate} - #{@endDate})"
|
61
|
+
end
|
62
|
+
((date - @startDate) / @resolution).to_i
|
63
|
+
end
|
64
|
+
|
65
|
+
# Iterate over all scoreboard entries.
|
66
|
+
def each
|
67
|
+
@sb.each do |entry|
|
68
|
+
yield entry
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Assign result of block to each element.
|
73
|
+
def collect!
|
74
|
+
@sb.collect! { |x| yield x }
|
75
|
+
end
|
76
|
+
|
77
|
+
# Get the value at index _idx_.
|
78
|
+
def [](idx)
|
79
|
+
@sb[idx]
|
80
|
+
end
|
81
|
+
|
82
|
+
# Set the _value_ at index _idx_.
|
83
|
+
def []=(idx, value)
|
84
|
+
@sb[idx] = value
|
85
|
+
end
|
86
|
+
|
87
|
+
# Get the value corresponding to _date_.
|
88
|
+
def get(date)
|
89
|
+
@sb[dateToIdx(date)]
|
90
|
+
end
|
91
|
+
|
92
|
+
# Set the _value_ corresponding to _date_.
|
93
|
+
def set(date, value)
|
94
|
+
@sb[dateToIdx(date)] = value
|
95
|
+
end
|
96
|
+
|
97
|
+
# Return a list of intervals that describe a contiguous part of the
|
98
|
+
# scoreboard that contains only the values listed in _targets_. The
|
99
|
+
# intervals must be within the interval described by _iv_ and must be at
|
100
|
+
# least _minDuration_ long. The return value is an Array of [ start, end ]
|
101
|
+
# TjTime values.
|
102
|
+
def collectTimeOffIntervals(iv, minDuration, targets)
|
103
|
+
# Determine the start and stop index for the scoreboard search.
|
104
|
+
startIdx = dateToIdx(iv.start, true)
|
105
|
+
endIdx = dateToIdx(iv.end, true)
|
106
|
+
|
107
|
+
# Convert the minDuration into number of slots.
|
108
|
+
minDuration /= @resolution
|
109
|
+
minDuration = 1 if minDuration <= 0
|
110
|
+
|
111
|
+
# This is collects the resulting intervals.
|
112
|
+
intervals = []
|
113
|
+
# The duration counter for the currently analyzed interval and the start
|
114
|
+
# index.
|
115
|
+
duration = start = 0
|
116
|
+
|
117
|
+
startIdx.upto(endIdx) do |idx|
|
118
|
+
# Check whether the scoreboard slot matches any of the target values.
|
119
|
+
if targets.include?(@sb[idx])
|
120
|
+
# If so, save the start position if this is the first slot and start
|
121
|
+
# counting the matching slots.
|
122
|
+
start = idx if start == 0
|
123
|
+
duration += 1
|
124
|
+
else
|
125
|
+
# If we don't have a match, check if we've just finished a matching
|
126
|
+
# interval.
|
127
|
+
if duration > 0
|
128
|
+
if duration >= minDuration
|
129
|
+
intervals << [ idxToDate(start), idxToDate(idx) ]
|
130
|
+
end
|
131
|
+
duration = start = 0
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
intervals
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
|
data/lib/Shift.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = Shift.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
|
14
|
+
require 'PropertyTreeNode'
|
15
|
+
require 'ShiftScenario'
|
16
|
+
|
17
|
+
class TaskJuggler
|
18
|
+
|
19
|
+
# A shift is a definition of working hours for each day of the week. It may
|
20
|
+
# also contain a list of intervals that define off-duty periods or vacations.
|
21
|
+
class Shift < PropertyTreeNode
|
22
|
+
|
23
|
+
def initialize(project, id, name, parent)
|
24
|
+
super(project.shifts, id, name, parent)
|
25
|
+
project.addShift(self)
|
26
|
+
|
27
|
+
@data = Array.new(@project.scenarioCount, nil)
|
28
|
+
@project.scenarioCount.times do |i|
|
29
|
+
@data[i] = ShiftScenario.new(self, i, @scenarioAttributes[i])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Many Shift functions are scenario specific. These functions are
|
34
|
+
# provided by the class ShiftScenario. In case we can't find a
|
35
|
+
# function called for the Shift class we try to find it in
|
36
|
+
# ShiftScenario.
|
37
|
+
def method_missing(func, scenarioIdx, *args)
|
38
|
+
@data[scenarioIdx].method(func).call(*args)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Return a reference to the _scenarioIdx_-th scenario.
|
42
|
+
def scenario(scenarioIdx)
|
43
|
+
return @data[scenarioIdx]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1,291 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = ShiftAssignments.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'Scoreboard'
|
14
|
+
|
15
|
+
class TaskJuggler
|
16
|
+
|
17
|
+
# A ShiftAssignment associate a specific defined shift with a time interval
|
18
|
+
# where the shift should be active.
|
19
|
+
class ShiftAssignment
|
20
|
+
|
21
|
+
attr_reader :shiftScenario
|
22
|
+
attr_accessor :interval
|
23
|
+
|
24
|
+
def initialize(shiftScenario, interval)
|
25
|
+
@shiftScenario = shiftScenario
|
26
|
+
@interval = interval
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns true if the ShiftAssignment objects are similar enough.
|
30
|
+
def ==(sa)
|
31
|
+
return @shiftScenario.object_id == sa.shiftScenario.object_id &&
|
32
|
+
@interval == sa.interval
|
33
|
+
end
|
34
|
+
|
35
|
+
# Return a deep copy of self.
|
36
|
+
def copy
|
37
|
+
ShiftAssignment.new(@shiftScenario, Interval.new(@interval))
|
38
|
+
end
|
39
|
+
|
40
|
+
# Return true if the _iv_ interval overlaps with the assignment interval.
|
41
|
+
def overlaps?(iv)
|
42
|
+
@interval.overlaps?(iv)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns true if the shift is active and requests to replace global
|
46
|
+
# vacation settings.
|
47
|
+
def replace?(date)
|
48
|
+
@interval.start <= date && date < @interval.end && @shiftScenario.replace?
|
49
|
+
end
|
50
|
+
|
51
|
+
# Check if date is withing the assignment period.
|
52
|
+
def assigned?(date)
|
53
|
+
@interval.start <= date && date < @interval.end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns true if the shift has working hours defined for the _date_.
|
57
|
+
def onShift?(date)
|
58
|
+
@shiftScenario.onShift?(date)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns true if the shift has a vacation defined for the _date_.
|
62
|
+
def onVacation?(date)
|
63
|
+
@shiftScenario.onVacation?(date)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Primarily used for debugging
|
67
|
+
def to_s
|
68
|
+
"#{@shiftScenario.property.id} #{interval}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# This class manages a list of ShiftAssignment elements. The intervals of the
|
73
|
+
# assignments must not overlap.
|
74
|
+
#
|
75
|
+
# Since it is fairly costly to determine the onShift and onVacation values
|
76
|
+
# for a given date we use a scoreboard to cache all computed values.
|
77
|
+
# Changes to the assigment set invalidate the cache again.
|
78
|
+
#
|
79
|
+
# To optimize memory usage and computation time the Scoreboard objects for
|
80
|
+
# similar ShiftAssignments are shared.
|
81
|
+
#
|
82
|
+
# Scoreboard entries can have 5 possible values
|
83
|
+
# nil: Value has not been determined yet.
|
84
|
+
# 0: No assignment
|
85
|
+
# 1: on shift
|
86
|
+
# 2: Off-hour slot
|
87
|
+
# 3: Vacation slot
|
88
|
+
class ShiftAssignments
|
89
|
+
|
90
|
+
include ObjectSpace
|
91
|
+
|
92
|
+
attr_reader :project, :assignments
|
93
|
+
|
94
|
+
# This class is sharing the Scoreboard instances for ShiftAssignments that
|
95
|
+
# have identical assignement data. This class variable holds an array with
|
96
|
+
# records for each unique Scoreboard. A record is an array of references
|
97
|
+
# to the owning ShiftAssignments objects and a reference to the Scoreboard
|
98
|
+
# object.
|
99
|
+
@@scoreboards = []
|
100
|
+
|
101
|
+
def initialize(sa = nil)
|
102
|
+
define_finalizer(self, self.class.method(:deleteScoreboard).to_proc)
|
103
|
+
|
104
|
+
@assignments = []
|
105
|
+
if sa
|
106
|
+
@project = sa.project
|
107
|
+
sa.assignments.each do |assignment|
|
108
|
+
@assignments << assignment.copy
|
109
|
+
end
|
110
|
+
@scoreboard = newScoreboard
|
111
|
+
else
|
112
|
+
@project = nil
|
113
|
+
@scoreboard = nil
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Some operations require access to the whole project.
|
118
|
+
def setProject(project)
|
119
|
+
@project = project
|
120
|
+
end
|
121
|
+
|
122
|
+
# Add a new assignment to the list. In case there was no overlap the
|
123
|
+
# function returns true. Otherwise false.
|
124
|
+
def addAssignment(shiftAssignment)
|
125
|
+
# Make sure we don't insert overlapping assignments.
|
126
|
+
return false if overlaps?(shiftAssignment.interval)
|
127
|
+
|
128
|
+
@assignments << shiftAssignment
|
129
|
+
@scoreboard = newScoreboard
|
130
|
+
true
|
131
|
+
end
|
132
|
+
|
133
|
+
# This function returns the entry in the scoreboard that corresponds to
|
134
|
+
# _date_. If the slot has not yet been determined, it's calculated first.
|
135
|
+
def getSbSlot(date)
|
136
|
+
idx = @scoreboard.dateToIdx(date)
|
137
|
+
# Check if we have a value already for this slot.
|
138
|
+
return @scoreboard[idx] unless @scoreboard[idx].nil?
|
139
|
+
|
140
|
+
# If not, compute it.
|
141
|
+
@assignments.each do |sa|
|
142
|
+
next unless sa.assigned?(date)
|
143
|
+
|
144
|
+
# Set the 8th bit if the shift replaces global vacations.
|
145
|
+
replace = sa.replace?(date) ? (1 << 8) : 0
|
146
|
+
|
147
|
+
if sa.onVacation?(date)
|
148
|
+
# On vacation
|
149
|
+
return @scoreboard[idx] = 3 | replace
|
150
|
+
elsif sa.onShift?(date)
|
151
|
+
# On shift
|
152
|
+
return @scoreboard[idx] = 1 | replace
|
153
|
+
else
|
154
|
+
# Off hour
|
155
|
+
return @scoreboard[idx] = 2 | replace
|
156
|
+
end
|
157
|
+
end
|
158
|
+
# No assignment for slot
|
159
|
+
@scoreboard[idx] = 0
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns true if any of the defined shift periods overlaps with the date or
|
163
|
+
# interval specified by _date_.
|
164
|
+
def assigned?(date)
|
165
|
+
getSbSlot(date) > 0
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns true if any of the defined shift periods contains the
|
169
|
+
# _date_ and the shift has working hours defined for that _date_.
|
170
|
+
def onShift?(date)
|
171
|
+
(getSbSlot(date) & 0xFF) == 1
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns true if any of the defined shift periods contains the _date_ and
|
175
|
+
# the shift has a vacation defined or all off hours defined for that _date_.
|
176
|
+
def timeOff?(date)
|
177
|
+
(getSbSlot(date) & 0xFF) >= 2
|
178
|
+
end
|
179
|
+
|
180
|
+
# Returns true if any of the defined shift periods contains the _date_ and
|
181
|
+
# if the shift has a vacation defined for the _date_.
|
182
|
+
def onVacation?(date)
|
183
|
+
(getSbSlot(date) & 0xFF) == 3
|
184
|
+
end
|
185
|
+
|
186
|
+
# Return a list of intervals that lay within _iv_ and are at least
|
187
|
+
# minDuration long and contain no working time. In this class the scoreboard
|
188
|
+
# values 2 and 3 mark time off. Additionally the 8-th but may be set as
|
189
|
+
# well.
|
190
|
+
def collectTimeOffIntervals(iv, minDuration)
|
191
|
+
@scoreboard.collectTimeOffIntervals(iv, minDuration,
|
192
|
+
[ 2, 3, (1 << 8) | 2, (1 << 8) | 3 ])
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns true if two ShiftAssignments object have the same assignment
|
196
|
+
# pattern.
|
197
|
+
def ==(shiftAssignments)
|
198
|
+
return false if @assignments.size != shiftAssignments.assignments.size ||
|
199
|
+
@project != shiftAssignments.project
|
200
|
+
|
201
|
+
@assignments.size.times do |i|
|
202
|
+
return false if @assignments[i] != shiftAssignments.assignments[i]
|
203
|
+
end
|
204
|
+
true
|
205
|
+
end
|
206
|
+
|
207
|
+
def ShiftAssignments.scoreboards
|
208
|
+
@@scoreboards
|
209
|
+
end
|
210
|
+
|
211
|
+
def ShiftAssignments.sbClear
|
212
|
+
@@scoreboards = []
|
213
|
+
end
|
214
|
+
|
215
|
+
# This function is primarily used for debugging purposes.
|
216
|
+
def to_s
|
217
|
+
return '' if @assignments.empty?
|
218
|
+
|
219
|
+
out = "shifts "
|
220
|
+
first = true
|
221
|
+
@assignments.each do |sa|
|
222
|
+
if first
|
223
|
+
first = false
|
224
|
+
else
|
225
|
+
out += ', '
|
226
|
+
end
|
227
|
+
out += sa.to_s
|
228
|
+
end
|
229
|
+
out
|
230
|
+
end
|
231
|
+
|
232
|
+
private
|
233
|
+
|
234
|
+
# This function either returns a new Scoreboard or a reference to an
|
235
|
+
# existing one in case we already have one for the same assigment patterns.
|
236
|
+
def newScoreboard
|
237
|
+
@@scoreboards.each do |sbRecord|
|
238
|
+
# We only have to look at the first ShiftAssignment for a comparison.
|
239
|
+
# The others should match as well.
|
240
|
+
if self == ObjectSpace._id2ref(sbRecord[0][0])
|
241
|
+
# Register the ShiftAssignments object as a user of an existing
|
242
|
+
# scoreboard. We have to store the object_id, not the reference. If
|
243
|
+
# we'd store a reference, the GC will never destroy it.
|
244
|
+
sbRecord[0] << object_id
|
245
|
+
# Return a reference to the existing scoreboard.
|
246
|
+
return sbRecord[1]
|
247
|
+
end
|
248
|
+
end
|
249
|
+
# We have not found a matching scoreboard, so we have to create a new one.
|
250
|
+
newSb = Scoreboard.new(@project['start'], @project['end'],
|
251
|
+
@project['scheduleGranularity'])
|
252
|
+
# Create a new record for it and register the ShiftAssignments object as
|
253
|
+
# first user.
|
254
|
+
newRecord = [ [ object_id ], newSb ]
|
255
|
+
# Append the new record to the list.
|
256
|
+
@@scoreboards << newRecord
|
257
|
+
return newSb
|
258
|
+
end
|
259
|
+
|
260
|
+
# This function is called whenever a ShiftAssignments object gets destroyed
|
261
|
+
# by the GC.
|
262
|
+
def ShiftAssignments.deleteScoreboard(objId)
|
263
|
+
# Attention: Due to the way this class is called, there will be no visible
|
264
|
+
# exceptions here. All runtime errors will go unnoticed!
|
265
|
+
#
|
266
|
+
# Well search the @@scoreboards for an entry that holds a reference to the
|
267
|
+
# deleted ShiftAssignments object. If it's the last in the record, we
|
268
|
+
# delete the whole record. If not, we'll just remove it form the record.
|
269
|
+
@@scoreboards.each do |sbRecord|
|
270
|
+
assignmentObjectIDs = sbRecord[0]
|
271
|
+
assignmentObjectIDs.delete_if { |id| id == objId }
|
272
|
+
# No more ShiftAssignments in this record. Delete it from the list.
|
273
|
+
break if assignmentObjectIDs.empty?
|
274
|
+
end
|
275
|
+
# Delete all entries which have empty reference lists.
|
276
|
+
@@scoreboards.delete_if { |sbRecord| sbRecord[0].empty? }
|
277
|
+
ObjectSpace.undefine_finalizer(self)
|
278
|
+
end
|
279
|
+
|
280
|
+
# Returns true if the interval overlaps with any of the assignment periods.
|
281
|
+
def overlaps?(iv)
|
282
|
+
@assignments.each do |sa|
|
283
|
+
return true if sa.overlaps?(iv)
|
284
|
+
end
|
285
|
+
false
|
286
|
+
end
|
287
|
+
|
288
|
+
end
|
289
|
+
|
290
|
+
end
|
291
|
+
|