taskjuggler / TaskJuggler

TaskJuggler - Project Management beyond Gantt chart drawing
http://www.taskjuggler.org
GNU General Public License v2.0
737 stars 171 forks source link

Arithmetic on task parameters #103

Open gwierzchowski opened 11 years ago

gwierzchowski commented 11 years ago

There is currently syntax %{...} which allows users for some basic data arithmetics, but it only works against project predefined macros. It would be great if it could be also used with taks' parameters which are already known in time when reports are being generated. Following code ilustrates what I mean:

macro GaugeReal [
  celltext  (plan.start < %{ ${now} - 1d} ) "Does work"
  #celltext  (plan.start < %{ plan.end - 1d} ) "Does not work"
  #Error: Unexpected token 'plan.end' found. Expecting '{'
]

taskreport gantt "Gantt" {
  formats html
  columns name, start, end, gauge { ${GaugeReal} }, chart
}

I would like to use this feature to mark on reports not completed taks which are CLOSE (e.g. 2 days) to reach their deadlines, but did not pass it yet.

BTW: Please mark it as Feature - I don't know how to do this in my github profile.

scrapper commented 11 years ago

No need to use the %{...} notation here. That's just needed to signal to the parser to evaluate it while reading the file.

celltext (plan.start < (plan.end - 1d) )

would do. But it requires some additions to the logical expression code. The biggest challenge is testing though.

antibios commented 9 years ago

Does this work in macros? I'm attempting: task "Test expression" { start ${2} - 1d

start (${2} - 1d)

}

and they all fail