diff --git a/Makefile b/Makefile index a797681b1cdf1081bf54abbc5c05d89b32d7181e..b70a1187c72aef0b319326daeb18ad65f61b9d7f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ TJI = $(wildcard *.tji) +PLANS = $(wildcard *.planning.tji) all: TJ3 @@ -7,7 +8,14 @@ tmp generated: TJ3: generated/timestamp -generated/timestamp: planning.tjp $(TJI) | generated +generated/planning.auto.tji \ +generated/frame.auto.tji: $(PLANS) gen_includes | generated + ./gen_includes + +generated/timestamp: planning.tjp \ + generated/planning.auto.tji \ + generated/frame.auto.tji \ + $(TJI) | generated LC_CTYPE=en_US.UTF-8 tj3 -o generated planning.tjp touch $@ diff --git a/alexanderp.planning.tji b/alexanderp.planning.tji new file mode 100644 index 0000000000000000000000000000000000000000..f75675ba5b43bfbb2545903e53a14ce5a3fb6f86 --- /dev/null +++ b/alexanderp.planning.tji @@ -0,0 +1,32 @@ +# alexanderp = Alexander Pisarevskiy +task io_2020 "New ethernet connected I/O" { + start 2020-10-19 + + task basic_networking "Implement basic networking" { + effort 2w + allocate alexanderp limits { weeklymax 25h } + } + + task moberg_integration "Integrate with moberg" { + effort 1w + depends !moberg_basic_ethernet + + allocate alexanderp limits { weeklymax 25h } + } + + task moberg_basic_ethernet "Basic ethernet for moberg" { + effort 1w + + allocate andersb limits { weeklymax 10h } + } + +} + +task ilon_car "Make Ilon car ready" { + + task faulhaber "Motor programming and cabling" { + effort 1w + allocate alexanderp limits { weeklymax 25h } + } + +} diff --git a/andersb.planning.tji b/andersb.planning.tji index fca322026fcb5505a7929c6865c4a5fb1df16db6..8eca73e57c80b4ae09444c5ac4b502dcb6ef4e42 100644 --- a/andersb.planning.tji +++ b/andersb.planning.tji @@ -1,16 +1,15 @@ +# andersb = Anders Blomdell task planning_prototype "Prototype of new planning site" { start 2020-10-19 task webserver "Create webserver" { effort 4h - allocate andersb limits { dailymax 2h } + allocate andersb limits { dailymax 2h } } task mockup "Create mockup" { effort 2d - allocate andersb limits { dailymax 2h } + allocate andersb limits { dailymax 2h } } } - - diff --git a/andersb.vacation b/andersb.vacation new file mode 100644 index 0000000000000000000000000000000000000000..ce9c6845f12b0e0bf744596a43508f8180b34696 --- /dev/null +++ b/andersb.vacation @@ -0,0 +1 @@ +vacation 2020-12-10 - 2020-12-30 diff --git a/andersn.planning.tji b/andersn.planning.tji new file mode 100644 index 0000000000000000000000000000000000000000..1f0bd19ee6d95b8b67817fe89561fc9212a38263 --- /dev/null +++ b/andersn.planning.tji @@ -0,0 +1,16 @@ +# andersn = Anders Nilsson +task decommission_sperry_03 "Decommission sperry-03" { + start 2020-10-19 + + task replace_disk "Replace faulty disk" { + effort 4h + allocate andersn limits { dailymax 2h } + } + + task move_users "Move users to appropriate fay" { + effort 2w + depends !replace_disk + allocate andersn limits { dailymax 3h } + } + +} diff --git a/gen_includes b/gen_includes new file mode 100755 index 0000000000000000000000000000000000000000..f417363e8aff9c6a15f420b97c0bb3963ef08028 --- /dev/null +++ b/gen_includes @@ -0,0 +1,64 @@ +#!/usr/bin/python3 + +import os +import re +import time + +if __name__ == '__main__': + user_tasks = "" + for path in [ f for f in os.listdir('.') if f.endswith('.planning.tji') ]: + name = re.match('^(.*).planning.tji$', path).group(1) + with open(path) as f: + line = f.readline() + m = re.match('^\s*#\s*%(name)s\s*=\s*(.*)\s*$' % dict(name=name), line) + if m: + full_name = m.group(1) + pass + else: + full_name = name + pass + pass + d = dict() + user_tasks += f'resource {name} "{full_name}" {{\n' + vacation = f'{name}.vacation' + if os.path.exists(vacation): + with open(vacation) as vf: + user_tasks += vf.read() + pass + user_tasks += '}\n' + user_tasks += f'task {name} "{full_name}" {{ }}' + user_tasks += f'include "../{name}.planning.tji" {{ taskprefix {name} }}' + pass + + with open("generated/planning.auto.tji", "w") as f: + f.write(user_tasks) + pass + + with open("generated/auto.monthly.tji", "w") as f: + now = time.localtime() + for i in range(4): + month = time.localtime(time.mktime((now.tm_year, now.tm_mon+i, 1, + 0,0,0, + -1,-1,-1))) + start = time.localtime(time.mktime((now.tm_year, now.tm_mon+i-1, 20, + 0,0,0, + -1,-1,-1))) + end = time.localtime(time.mktime((now.tm_year, now.tm_mon+i+1, 10, + 0,0,0, + -1,-1,-1))) + f.write(f'${{Monthly "{month.tm_year}_{month.tm_mon:02}" ' + + f'"{month.tm_year}-{month.tm_mon:02}" ' + + f'"{start.tm_year}-{start.tm_mon:02}-{start.tm_mday:02}" ' + + f'"{end.tm_year}-{end.tm_mon:02}-{end.tm_mday:02}" ' + + f'}}\n') + pass + with open("generated/auto.frame.tji", "w") as f: + now = time.localtime() + for i in range(4): + month = time.localtime(time.mktime((now.tm_year, now.tm_mon+i, 1, + 0,0,0, + -1,-1,-1))) + f.write(f'${{MonthlyReport "{month.tm_year}_{month.tm_mon:02}" ' + + f'"{month.tm_year}-{month.tm_mon:02}"}}\n') + pass + pass diff --git a/planning.tjp b/planning.tjp index 75502193fc00d6d53aa89f7f9e6c74374cdf62d2..ba1150055ce7fb8c37f38c96903e336a765ca4f8 100644 --- a/planning.tjp +++ b/planning.tjp @@ -15,11 +15,7 @@ leaves holiday "Christmas" 2020-12-24+2d # Top level container tasks task milestones "Milestones" {} -task andersb "Anders Blomdell" { } -task andersn "Anders Nilsson" { } -task alexander "Alexander Pisarevskiy" { } -task teachers "Teachers" { } +include "generated/planning.auto.tji" + -include "resources.tji" -include "andersb.planning.tji" { taskprefix andersb } include "report.tji" \ No newline at end of file diff --git a/report.tji b/report.tji index 03867d95fc0d527f9b52697dc00d02c8c0a380b2..e9def90a093c68adcabb148fe4d806d78a2e58fc 100644 --- a/report.tji +++ b/report.tji @@ -26,7 +26,7 @@ macro TaskTip [ # A traditional Gantt chart with a project overview. taskreport overview "" { header -8<- - == Projektöversikt == + == Project overview == ->8- columns bsi { title 'BSI' }, name, @@ -90,12 +90,59 @@ macro YearlyResorces [ } ] +macro Quarterly [ + resourcereport resources_${1}_${2} "" { + headline "Resources ${1} ${2}" + period ${1}-${3} + 3m + columns no, + name, + weekly { width 1600 ${TaskTip} } + + loadunit days + # We only like to show leaf tasks for leaf resources. + hidetask ~(isleaf() & isleaf_()) + sorttasks plan.start.up + } + resourcereport overview_${1}_${2} "" { + headline "Overview ${1} ${2}" + period ${1}-${3} + 3m + columns no, + name, + weekly { width 1600 ${TaskTip} } + + loadunit days + # We only like to show leaf tasks for leaf resources. + hidetask ~(isleaf() & isleaf_()) + sorttasks plan.start.up + } +] + macro YearlyTextResourceReport [ textreport "Resource ${1}" { formats html title "R${1}" center '<[report id="resources_${1}"]>' } + textreport "Resource ${1} Q1" { + formats html + title "R${1} Q1" + center '<[report id="resources_${1}_Q1"]>' + } + textreport "Resource ${1} Q2" { + formats html + title "R${1} Q2" + center '<[report id="resources_${1}_Q2"]>' + } + textreport "Resource ${1} Q3" { + formats html + title "R${1} Q3" + center '<[report id="resources_${1}_Q3"]>' + } + textreport "Resource ${1} Q4" { + formats html + title "R${1} Q4" + center '<[report id="resources_${1}_Q4"]>' + } ] macro YearlyTextOverviewReport [ @@ -104,12 +151,70 @@ macro YearlyTextOverviewReport [ title "O${1}" center '<[report id="overview_${1}"]>' } + textreport "Overview ${1} Q1" { + formats html + title "R${1} Q1" + center '<[report id="overview_${1}_Q1"]>' + } + textreport "Overview ${1} Q2" { + formats html + title "R${1} Q2" + center '<[report id="overview_${1}_Q2"]>' + } + textreport "Overview ${1} Q3" { + formats html + title "R${1} Q3" + center '<[report id="overview_${1}_Q3"]>' + } + textreport "Overview ${1} Q4" { + formats html + title "R${1} Q4" + center '<[report id="overview_${1}_Q4"]>' + } ] -${YearlyOverview "2020" } -${YearlyResorces "2020" } -${YearlyOverview "2021" } -${YearlyResorces "2021" } +macro Monthly [ + taskreport overview_${1} "" { + headline "Overview ${2}" + period ${3} - ${4} + columns name, + chart { scale day width 1200 ${TaskTip} } + + timeformat "%Y-%m-%d" + loadunit days + hideresource @all + hidetask ( (plan.end < ${3}) | ( ${4} < plan.start) ) + sorttasks tree + } + resourcereport resources_${1} "" { + headline "Resources ${2}" + period ${3} - ${4} + columns no, + name, + daily { width 1400 ${TaskTip} } + + loadunit days + # We only like to show leaf tasks for leaf resources. + hidetask ~(isleaf() & isleaf_()) + sorttasks plan.start.up + } +] + +macro MonthlyReport [ + textreport "Overview ${2}" { + formats html + title "O${2}" + center '<[report id="overview_${1}"]>' + } + textreport "Resources ${2}" { + formats html + title "R${2}" + center '<[report id="resources_${1}"]>' + } +] + +# Generate individual reports +include "generated/auto.monthly.tji" textreport frame "" { header -8<- @@ -129,9 +234,10 @@ textreport frame "" { center '<[report id="resources"]>' } - ${YearlyTextOverviewReport "2020"} - ${YearlyTextResourceReport "2020"} - ${YearlyTextOverviewReport "2021"} - ${YearlyTextResourceReport "2021"} +# ${MonthlyReport "2020_10" "2020-10"} +# ${MonthlyReport "2020_11" "2020-11"} +# ${MonthlyReport "2020_12" "2020-12"} } + +include "generated/auto.frame.tji" { reportprefix frame } \ No newline at end of file