FET Forum

FET Support (English) => Get Help => Topic started by: Rk on May 03, 2011, 07:04:11 AM

Title: Time and number of periods different
Post by: Rk on May 03, 2011, 07:04:11 AM
Hi

In my school on wed.day the  duration of the period and number is periods different from other days.  How to add this constrains?

Thanks in advance

Regards,
Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 03, 2011, 08:33:27 AM
If on Wed you have n hours per day and on the other days m hours per day, make n hours per day in FET = max (m, n) and the invalid slots not available (with constraint break is easiest).
Title: Re: Time and number of periods different
Post by: Rk on May 03, 2011, 10:02:35 AM
Thanks but there is one more issue

On wed.day the duration of the periods also different.

Eg: Other days 1 hour is 9:30 - 10:15
on wed.days 1 hour will be 10:- 11:30, like there are some differences

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 03, 2011, 10:09:45 AM
There is some help about this situation, but I don't know the exact location (forum, FAQ, I am not sure). Anyway, I'll write it again:

You should consider the lowest common divisor. If durations are, say, 30 minutes and 45 minutes, then lcd=15. This is one FET hour. Activity with real duration 30 minutes will have FET duration = 2, and real duration 45 minutes will have FET duration 3, real 60 minutes = FET 4 "hours".

There is one problem: you cannot instruct FET that if activity A is on Mon, duration is 3, and if it is on Wed, duration is 2.

We can talk about this, let me know more details if my answer is not complete.
Title: Re: Time and number of periods different
Post by: Rk on May 03, 2011, 12:36:47 PM
Thanks for the help

Lest common devisor will be 5 minutes according to our time and we have 8 hours every day so it will be more than 60 hours per day ! which i dont think can be accommodated,rt?

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 03, 2011, 12:40:49 PM
Yes, unfortunately, you are right.

Solutions:

1) Maybe you can approximate by lcd=10 minutes;

2) You can increase from max 60 slots per day to 8*(60/5)=96. I can give advice how to do that.
Title: Re: Time and number of periods different
Post by: Rk on May 03, 2011, 12:42:33 PM
Pls i need advice to increase it to 96
Thanks for your help

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 03, 2011, 12:57:46 PM
Please see:

http://lalescu.ro/liviu/fet/forum/index.php?topic=134.0

And do similar, but considering MAX_HOURS_PER_DAY and hours instead of days.

Please tell me if you succeed or if you need more help.
Title: Re: Time and number of periods different
Post by: Rk on May 03, 2011, 01:11:11 PM
Thanks for the help.  I will change the code and compile it.  It takes around 2 hours in my laptop to compile.  I will let you know result by tomorrow

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 03, 2011, 01:20:07 PM
What system do you have? (hardware, software). If private, send as a private message or email to me, or just tell me how old is the system.

On my computer, it takes about 30 minutes to compile (single core), and my computer is about 4 years old (AMD 64 bit dual core 4000+, 2.11 GHz). (more precisely, GNU/Linux: 26 minutes single core, 16 minutes double core with -j 2 switch; Windows: 37 minutes, single core).

Are you using the latest FET version? (this is highly recommended). Also, latest Qt, gcc, g++?

I am just curious, because 2 hours is a lot of time.
Title: Re: Time and number of periods different
Post by: Rk on May 04, 2011, 07:34:05 AM
It take only 45 minutes to compile.  I am using a Macbook pro 13inch note book. 
I changed this line
const int MAX_HOURS_PER_DAY=96;
and compiled it.  I am not able to understand the procedure to creat .fet file.  Can you pls provide some more detials

Regards,
Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 04, 2011, 08:42:16 AM
Save an empty file, say it is named data.fet. Then open it with a text editor, or with an XML editor. See near the beginning, section "Hours_List". You need to change this section, add more hours (change Number value and add more Name sections). If you want, you can save a file with 5 hours and a file with 7 hours, compare them by contents (I use kdiff3 utility for that), and see how FET added these 2 hours, and do similarly.
Title: Re: Time and number of periods different
Post by: Rk on May 04, 2011, 09:03:08 AM
Thanks for the quick reply but I am still confused. Here are my questions:

1. As you mentioned, I created an empty file data.fet but not sure about its structure. I need 96 hours per day, so do I need a file just like this?

<Hours_List>
        <Number>96</Number>
        <Name>08:00</Name>
        <Name>08:05</Name>
        -----
        -----
        <Name>16:00</Name>
</Hours_List>

Is that correct?

2. Where do I place this data.fet file? In the same location where the fet executable located?

Also I think the change I made in  src/engine/timetable_defs.h (   const int MAX_HOURS_PER_DAY=96) before compiling is correct.

Thanks,
Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 04, 2011, 09:11:21 AM
QuoteThanks for the quick reply but I am still confused. Here are my questions:

1. As you mentioned, I created an empty file data.fet but not sure about its structure. I need 96 hours per day, so do I need a file just like this?

<Hours_List>
        <Number>96</Number>
        <Name>08:00</Name>
        <Name>08:05</Name>
        -----
        -----
        <Name>16:00</Name>
</Hours_List>

Is that correct?

2. Where do I place this data.fet file? In the same location where the fet executable located?

Sorry: open FET, click Save as, save empty data as data.fet. This is a file of approximately 1187 bytes. This is what I mean empty file. It is in fact empty data. Modify it with a text/XML editor, save it, then open it with FET File->Open menu.

Quote
Also I think the change I made in  src/engine/timetable_defs.h (   const int MAX_HOURS_PER_DAY=96) before compiling is correct.

I do not understand.

I think your change is good.

Quote
Thanks,
Rk
Title: Re: Time and number of periods different
Post by: Rk on May 04, 2011, 09:41:24 AM
Thanks :-)

I have created the data.fet file and changed the Hours_List as follows:

<Hours_List>
        <Number>96</Number>
        <Name>08:00</Name>
        <Name>08:05</Name>
        ------
        ------
</Hours_List>

Then opened it with FET but still the max hours per day (FET -> Data -> Basic -> Days and Hours) is 60 and cannot be increased. Not sure what I am missing. I am attaching the data.fet file and hoping that you can point me to the right direction.

Thanks a bunch for your help.

Rk.
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 04, 2011, 09:48:46 AM
In the topic I wrote above ( http://lalescu.ro/liviu/fet/forum/index.php?topic=134.0 ), I say there that you should not open from FET the dialog of hours per day, as this may crash FET or show only 60 hours.

So, please read that portion of the topic again.

Let me know the results.
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 04, 2011, 09:57:20 AM
More details:

1) Your file seems incorrect. The hour 19:00 for instance appears at least twice. All hours' names should be different.

2) You can of course make the hours dialog of FET work with 96 hours. But this is complicated for you, if you don't know Qt and C++. And it is not needed, as it is much easier to work with a text/XML editor on the .fet file. I can give advice also here, if you really need it.
Title: Re: Time and number of periods different
Post by: Rk on May 04, 2011, 11:10:12 AM
Thanks again for all your helps.

1. I will fix the duplicate entries and will try it out.

2. I am not a c++ programmer but I am very much interested to try it out, if you can provide step by step instructions. Please do that only if time permits.

Again, thanks :-)

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 04, 2011, 11:37:56 AM
Quote
2. I am not a c++ programmer but I am very much interested to try it out, if you can provide step by step instructions. Please do that only if time permits.

OK, sure:

1) src/interface/hoursform.cpp, replace 60 by 96 in all 4 places, then add more lines after line 119, in a similar manner.

2) src/interface/hoursform_template.ui. This is an XML text file. You can modify it with a text/XML editor (maybe difficult), or open it with Qt Designer. There are 60 slots, add 36 more, similar to ones existing. You may want to use copy/paste of objects in Qt Designer.

3) recompile, of course, then run the new modified FET.

I think that's all. Let me know!
Title: Re: Time and number of periods different
Post by: Rk on May 04, 2011, 01:51:38 PM
Thanks again.

Regarding the interface change, I am having some issues with copy/paste in Qt designer. Will check further on it and will let you know the result.

Regarding my exact requirement (creating that custom timetable), I succeeded creating it with your help and the only issue I found was that in the generated timetable, a single period shows all those time slots. i.e. the first period 8.00 to 8.45 shows 8.00, 8.05, 8.10 up to  8.45 on the page. Not sure it can be removed.

Anyways, thanks for all your helps.

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 04, 2011, 02:00:59 PM
QuoteThanks again.

Regarding the interface change, I am having some issues with copy/paste in Qt designer. Will check further on it and will let you know the result.

Additional advice: the form is locked in a layout. Right click and select "Break layout". Then, after you finish work, select everything and put into a grid layout. It may also work without breaking the layout, but I am not sure.

If you work in Qt Designer, you can take care of tab order for newly added items (in the .ui file, they are listed near the end).

Quote
Regarding my exact requirement (creating that custom timetable), I succeeded creating it with your help and the only issue I found was that in the generated timetable, a single period shows all those time slots. i.e. the first period 8.00 to 8.45 shows 8.00, 8.05, 8.10 up to  8.45 on the page. Not sure it can be removed.

That is great! (that you solved it). This was the main problem. About the display problem, maybe you can import the HTML into a spreadsheet (using office software) and remove the hours column. I am not sure. Maybe Volker can advise better.

Could you send me your file and resulted timetables? Only if the data is not private. Also, what is your opinion about our program? (you can write in feed-back forum section or on the guestbook or here, as you wish). Are there other programs able to solve your requirement?
Title: Re: Time and number of periods different
Post by: Rk on May 05, 2011, 01:55:57 PM
Yes, I got the interface working. Thanks for your help. Here is what I have done (just collecting what you instructed in one place)

1) In src/interface/hoursform.cpp, replace 60 by 96 in all 4 places, then add more lines after line 119, in a similar manner.

2) Edit src/interface/hoursform_template.ui. You can modify it with a text/XML editor (maybe difficult), or open it with Qt Designer. There are 60 slots, add 36 more, similar to ones existing. Additional advice: the form is locked in a layout. Right click and select "Break layout". Then, after you finish work, select everything and put into a grid layout. It may also work without breaking the layout, but I am not sure.

3. In src/engine/timetable_defs.h, line 129, instead of 60 put how much you need (in my case 96)
eg: const int MAX_HOURS_PER_DAY=96;

4. recompile, of course, then run the new modified FET.

Here I am attaching a screenshot of the hours per day Window and the modified ui file (in case it helps any other).

Thanks a bunch :-)

Rk
Title: Re: Time and number of periods different
Post by: Liviu Lalescu on May 05, 2011, 03:29:20 PM
Thank you, also!

Only one thing: to be perfect, you need to care also of tab order. If you press the Tab key, you go from hour 1 to hour 2, 3 and so on. If you added hours in another order than increasing, then the user presses Tab and goes say from hour 67 to hour 80.

In your file, I see that you removed tab order. You can add it from Qt Designer, there is a button there, and click on each hour, in order.

This is not very important, but others might want to care about this, too.