/************************************************** Module Dispatcher Client Version: 1.0 Author: Laurent Hachet Last update: 22/06/2001 This module allow to dispatch the visitor to the different c3d3 cells **************************************************/ /************************************************** load, save and init, it couldn't be more simple. **************************************************/ typeof cellNumber = ObjText;; /* the number of cells */ typeof connected = ObjText;; /* the maximum of connected in a cell */ fun load(l)= _SETtext cellNumber getInfo l "cellNumber"; _SETtext connected getInfo l "connected"; 0 ;; /* this function create 1 input and 1 output for each cell */ fun createIOCell(n) = if n == 0 then nil else ( ("eventC"::(strcat "in " (itoa n))::nil):: /* client side, at the inidmi end */ ("action"::(strcat "out " (itoa n))::nil):: /* server side, when the client is destroyed */ createIOCell (n-1) ) ;; fun save (filename, n)= ("action"::"start"::nil):: ("action"::"destroy"::nil):: ("event"::"siteFull"::nil):: ("cellNumber"::(_GETtext cellNumber)::nil):: ("connected"::(_GETtext connected)::nil):: createIOCell (atoi _GETtext cellNumber) ;; fun IniEditor (s)= let startEditor _channel nil nil nil 315 75 WN_NORMAL EDITOR_NORMAL s "worlds/asterix/dispatcher/dispatcher.dmc" nil nil @load @save nil -> ed in let getEditWin ed -> editWin in ( _CRtext _channel editWin 5 30 190 20 ET_ALIGN_LEFT (_locEditor "CELLNUMBER" nil); set cellNumber = _CReditLine _channel editWin 200 30 100 20 ET_DOWN+ET_AHSCROLL "3"; _CRtext _channel editWin 5 50 190 20 ET_ALIGN_LEFT (_locEditor "CONNECTED" nil); set connected = _CReditLine _channel editWin 200 50 100 20 ET_DOWN+ET_AHSCROLL "3"; if s==nil then nil else openDMI ed ); 0 ;;