require File.expand_path('../cell.rb',__FILE__) class CellMgr def initialize(app) @app=app @cells=[] @cellIds=0 readCells end def save(object) p=getFreeCell p.save(object) p.cellId end def load(cellId) pp "cellID",cellId cell=@cells.select{|p|p.cellId==cellId}[0] unless cell pp "CELLID",cellId,@cellIds if cellId<=@cellIds cell=Cell.new(@app,cellId) end end return cell.load if cell raise "Cell with id #{cellId} not found!" end def saveIntern(cell) end def saveAll end private def getFreeCell p=Cell.new(@app,getNewCellId) @cells << p p end def readCells config=@app.retrieveConfig a=config["los"].content @cellIds=a.keys.max if a @cellIds||=0 end def getNewCellId @cellIds+=1 end end