Re: [casetta] About compatibility between casio models |
[ Thread Index | Date Index | More lists.tuxfamily.org/casetta Archives ]
Florian Birée a écrit :
Hello,Errr... What I think about that ? First and foremost I am impressed by this system :-D Seriously, I think that the model you propose for casetta is the best... for users ! But it may be the worst for developers as it seems quite complicated to implement :-p We must think about how to implement this: the system must be able to various test, and to provide fixes when they fail (if some fixes are too heavy, we can make them as tools, like for change some basic function that doesn't exists in some models). About the implementation, I have the beginning of an idea. It would use the new object models of cas.py. In this e-mail ( http://listengine.tuxfamily.org/lists.tuxfamily.org/casetta/2007/08/msg00002.html ), I said about the file devices_serial.py " In send_data() function : raw_data_list = [data.raw_data[0:1028], data.raw_data[1028:2056], data.raw_data[2056:3084], data.raw_data[3084:4112]] elif data.__class__ == datacls.Matrix or data.__class__ == datacls.List or data.__class__ == datacls.SimlEquationMatrix or data.__class__ == datacls.PolyEquationMatrix: raw_data_list = data.get_raw_data_list() else: raw_data_list = [data.raw_data] I would like to replace this by : raw_data_list = data.get_raw_data_list(). This means each Transferable object in cas.py, should have a method who returns a list of data to be transferred even if this list contains only one element" I think each get_raw_data_list method (which is called before any transfer) could call another method named is_valid which would take the model of calculator in argument and raise errors. For example for a program : class TransferableProgram(datacls.Program): .... def is_valid(self, calculator_model): if calculator_model != "G100" and len(self.name): raise TooLongNameError if calculator_model == "G25": for line in self.get_text(): raise class TransferableList(datacls.List): .... def is_valid(self, calculator_model): if calculator_model == "G25": raise ListNotAvailable An then casetta_cli and gasetta could provide fixes using try: except blocks. Or maybe we should directly include a method to do the various fixes inside the objects. This implementation has advantages : quite easy to implement, ability to make completely different tests for any data_type and drawbacks : the method is_valid may be enormous for some data_types such as programs, it is not really "clean" as the compatibility test suite is not located is a specific module, and we cannot distinguish fatal, major errors and warnings. For warnings maybe just a return -1, "Your picture uses colors, I may not be displayed correctly." is enough. About backups, I think they should use the Fx-Interface model, they should be calculator dependent, although it may be possible to transfer a backup of a G35 to a G65. However, we will have huge problems ! About the particularities, you are right it is the first thing we should do. Listing the particularities may help us to find a good implementation. As far as I know : G100: Does not have the => instruction (equivalent to if ... then) G25: Does not have the circle sketch instruction. Where should we publish this information on the wiki ? Because this system may need some changes in the data model (some restriction should be moved in the compatibility test suit), I think this compatibility system should be a part of Casetta 0.4. If we wait, we'll have more code to change. This is a good argument ! Let's try to include this in Casetta 0.4 (As the development has just started and as we are free to mess up the compatibility with casetta_cli and gasetta). I think, to ease our work that the objective for casetta 0.4 should be to implement this compatibility layer and provide basic fixes but not too complicated ones. Yours, PS : I was correctly added to the group "casetta" on tuxfamily. Thank you ! --
Fabien ANDRE aka Xion345 Linux User #418689 -- fabien.andre.g@xxxxxxxxxx -- xion345@xxxxxxxxxxxxx How should I know if it works? That's what beta testers are for. I only coded it. ( Attributed to Linus Torvalds, Not dated ) |
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |