Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Speed
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00066259
Message ID:
00066666
Vues:
58
>>>My application is a scheduling application. The grid actually represents a calendar used to schedule jobs for production in different plants. Each column represents a day and each line represents a set of jobs scheduled in a specific plant. A plant can have multiple jobs scheduled on the same day, so each plant will have multiple lines in the grid.
>>>
>>>Each plant also has non-production days. In the table which is the recordsource for the grid, non production days are set to the value "Blackout" and are displayed as "blacked out", (ie, background color is black.)
>>>
>>>The 240 days is as per the customers specifications. I agree that it is overkill, but it is what they want to be able to see, even though they will rarely go beyond the first forty or so. I know that this is not the source of my speed problem because I am currently working on a pared down version with only 50 columns.
>>>
>>>So my problem is that I need to be able to set each cells color based on two criteria:
>>>1. If the value in the cell is "Blackout", then the background color should be black.
>>>
>>>2. Otherwise, the color needs to be based on the defined color for the plant. This color is stored as a numeric value in a field in the table.
>>>
>>>So what you end up with is rows of different colors with blacked out cells scattered here and there based on days the plants not be producting, which will be different days for different plants.
>>>
>>>I have been unable to get this to perform. I understand that rgb() is not as efficient as already having the number. By tweaking my code (which I know is far from perfect), I have created minimal improvements, but the performance is still very slow. If you know how I can make this improve any more efficiently, I would appreciate very much any suggestions.
>>>
>>>Thanks,
>>>Paul
>>
>>I have feeling that the problem is resulted from algorithm which finds color for particular plant (i guess you have CASE structure with checking color-to-plant table). Did you try to bring color values directly into Grid.Recordsoucre (cursor) and paint cells regarding tmpGridcursor.colorvalue? It should save time.
>>Honestly, I never tried to use This.Value, I used to recordsource fields and, excuse me again, but I have feeling that this is wrong. I would kindly appreciate other UT people replies on this topic.
>
>Thanks for considering this problem, Edward. There is no case statement, the color for each plant is already being stored as a field in the recordsource, (see #2 in my explanation). I have also tried it using a UDF which takes as a parameter the field each column is bound to. This function checked first to see if the value of that field is blackout, and if not uses backcolor field in the grid recordsource.
>
>Any input from anyone would be appreciated, as this grid is the central piece of the app. Using this coloring scheme makes it incredibly easier to read, but the current performance level is just too slow.
>
>Paul

It might be non-applicable, but is it possible to change interface a little bit, e.g. have listbox with plant names and grid repopulated with one-plant related records from List.InteractiveChange.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform