[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.6 Planning

By default, a task is not selected when a new day is created. You must specify when the task must be selected.

 
$ dio87c -- ra myref 
$ dio87c -- rta myref task1
$ dio87c -- rp myref "2004-01-26" d1 
$ dio87c -- xdl 
d1
$ dio87c -- xtc d1
0
$ dio87c -- xdk d1
$

In this example, we create a task without telling when the task should be selected. Then, we create a day from the referential. Our task is not in the new day.

If the task must be selected every days, we will use the rtoa command with the add operator and the always operation :

 
$ dio87c -- rtoa myref task1 add always
$ dio87c -- rp myref "2004-01-26" d1 
$ dio87c -- xtc d1
1
$ dio87c -- xtl d1
task1
$ dio87c -- xdk d1
$

If the task must be selected on week end, we will remove the previous operation (rtok) and use two add operations : an operation to select Saturday (seventh day of the week) and another to select Sunday (first day of the week).

 
$ dio87c -- rtok myref task1 1
$ dio87c -- rtoa myref task1 add day_of_week 7
$ dio87c -- rtoa myref task1 add day_of_week 1
$

We will use the rtsy command to see when the task is selected. This command returns a calendar : every row is a day of the month (1 to 31), every column is a month (Jan to Dec). Every cell represents a day of the year. A star character follows the name of the day if the task is selected for this day :

 
$ dio87c -- rtsy myref task1 2004
Year : 2004
     Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
 1   Th  Su* Mo  Th  Sa* Tu  Th  Su* We  Fr  Mo  We   
 2   Fr  Mo  Tu  Fr  Su* We  Fr  Mo  Th  Sa* Tu  Th   
 3   Sa* Tu  We  Sa* Mo  Th  Sa* Tu  Fr  Su* We  Fr   
[...]
29   Th  Su* Mo  Th  Sa* Tu  Th  Su* We  Fr  Mo  We   
30   Fr  ..  Tu  Fr  Su* We  Fr  Mo  Th  Sa* Tu  Th   
31   Sa* ..  We  ..  Mo  ..  Sa* Tu  ..  Su* ..  Fr

You can see that every Saturday and Sunday are selected.

We will create a day on Thu Apr 01 and verify that the task isn't selected :

 
$ dio87c -- rp myref "2004-04-01" d1 
$ dio87c -- xtc d1
0
$ dio87c -- xdk d1
$

We will create a day on Sat May 01 and verify that the task is selected :

 
$ dio87c -- rp myref "2004-05-01" d1 
$ dio87c -- xtc d1
1
$ dio87c -- xtl d1
task1
$ dio87c -- xdk d1
$

If you have several tasks which must be selected at the same days, you can create a rule named week_end (rra command) with two add operations to select Saturday and Sunday (rroa commands). You can use the rrsy command to see the calendar of selected days :

 
$ dio87c -- rra myref week_end
$ dio87c -- rroa myref week_end add day_of_week 1
$ dio87c -- rroa myref week_end add day_of_week 7
$ dio87c -- rrsy myref week_end 2004
Year : 2004
    Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
 1  Th   Su*  Mo   Th   Sa*  Tu   Th   Su*  We   Fr   Mo   We   
 2  Fr   Mo   Tu   Fr   Su*  We   Fr   Mo   Th   Sa*  Tu   Th   
 3  Sa*  Tu   We   Sa*  Mo   Th   Sa*  Tu   Fr   Su*  We   Fr
[...]
31  Sa*  ..   We   ..   Mo   ..   Sa*  Tu   ..   Su*  ..   Fr
$

Then you can link tasks with this rule with an rtoa command. We will delete the task named `task1' and add three tasks linked with the rule `week_end' :

 
$ dio87c -- rtk myref task1
$
$ dio87c -- rta myref task2
$ dio87c -- rtoa myref task2 add rule week_end
$
$ dio87c -- rta myref task3
$ dio87c -- rtoa myref task3 add rule week_end
$
$ dio87c -- rta myref task4
$ dio87c -- rtoa myref task4 add rule week_end
$

Instead of creating days with rp command and deleting them, we will use the rs command. This command returns the list of tasks which will be selected at a given date :

 
$ dio87c -- rs myref "2004-01-03"
task2
task3
task4
$ dio87c -- rs myref "2004-01-01"
$

You can see that tasks are selected at Sa Jan 03 and not selected at Thu Jan 01.

Now we will create another rule to select work days. A solution is to create a rule with five operation (an operation for each work day). An other solution is to select all days (add always) and to remove week-end :

 
$ dio87c -- rra myref work_day
$ dio87c -- rroa myref work_day add always
$ dio87c -- rroa myref work_day remove rule week_end
$

We will use the rrol command to list operations of the rule and the rrsy to see if the rule is working :

 
$ dio87c -- rrol myref work_day
add     always	
remove  rule    week_end
$
$ dio87c -- rrsy myref work_day 2004
Year : 2004
    Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
 1  Th*  Su   Mo*  Th*  Sa   Tu*  Th*  Su   We*  Fr*  Mo*  We* 
 2  Fr*  Mo*  Tu*  Fr*  Su   We*  Fr*  Mo*  Th*  Sa   Tu*  Th* 
 3  Sa   Tu*  We*  Sa   Mo*  Th*  Sa   Tu*  Fr*  Su   We*  Fr* 
 4  Su   We*  Th*  Su   Tu*  Fr*  Su   We*  Sa   Mo*  Th*  Sa  
 5  Mo*  Th*  Fr*  Mo*  We*  Sa   Mo*  Th*  Su   Tu*  Fr*  Su  
 6  Tu*  Fr*  Sa   Tu*  Th*  Su   Tu*  Fr*  Mo*  We*  Sa   Mo*
 7  We*  Sa   Su   We*  Fr*  Mo*  We*  Sa   Tu*  Th*  Su   Tu* 
[...]
31  Sa   ..   We*  ..   Mo*  ..   Sa   Tu*  ..   Su   ..   Fr*
$

Now, we will create two tasks linked with `work_day' rule :

 
$ dio87c -- rta myref task5
$ dio87c -- rtoa myref task5 add rule work_day
$ dio87c -- rta myref task6
$ dio87c -- rtoa myref task6 add rule work_day

We can use the rs command to simulate :

 
$ dio87c -- rs myref "2004-01-03"
task2
task3
task4
$ dio87c -- rs myref "2004-01-01"
task5
task6
$

`task5' and `task6' are selected at Thu Jan 01 and not selected at Sa Jan 03.

There are other operation types :

There are other operators : `add', `add_from', `add_until', `remove', `remove_from', `remove_unti'l, `skip_before', `skip_after'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by dom on September, 11 2005 using texi2html