module Utils_simulator: sig
.. end
utils_simulator.ml
Author(s): Yann GLOUCHE
Version: 1.0
Since 12/12/2005
utils_simulator.ml
val path_span : string
val readFile : string -> string list
Read a file and return a list of string where each string is a line of the file
Returns string list
fileName
: is the name of the file to read
val saveFile : string -> string -> unit
Save a file
Returns unit
txt
: is the text to save
files types
val types : Tk.filePattern list
files types for the execution traces
val types_schema : Tk.filePattern list
files types for export the MSC on PS or PDF format
graphicals objects
val root : Widget.toplevel Widget.widget
Initialize Tk
Colors
val defcol : [> `Color of string ]
val selcol : [> `Color of string ]
val blue : [> `Color of string ]
val black : [> `Color of string ]
val red : [> `Color of string ]
val green : [> `Color of string ]
val blue_light : [> `Color of string ]
val clicol : [> `Color of string ]
val violet : [> `Color of string ]
val orange : [> `Color of string ]
val violet_light : [> `Color of string ]
Text font
val current_font_size : int Pervasives.ref
the current fonts size
val list_font : Tk.font list Pervasives.ref
val get_font : string -> string list -> unit
val set_size_of_all_fonts : int -> unit
for change fonts size
val configure : unit -> unit
val words : string list
val nop : unit -> unit
val scroll_link_canvas : Widget.scrollbar Widget.widget ->
Widget.canvas Widget.widget -> string -> unit
scroll_link_canvas link scroll event of the canvas to the scroll bar
Returns unit
sb
: scroll bar
lst
: canvas
orientation
: the value "horizontal" is for the horizontal scroll bar, the value "vertical" is for the vertical scroll bar
val scroll_link : Widget.scrollbar Widget.widget ->
Widget.listbox Widget.widget -> string -> unit
scroll_link link scroll event of the canvas to the scroll bar
Returns unit
sb
: scroll bar
lst
: list box
orientation
: the value "horizontal" is for the horizontal scroll bar, the value "vertical" is for the vertical scroll bar
list treatments
val remove : 'a -> 'a list -> 'a list
remove an element "elt" from a list "l"
Returns 'a list without the element elt
elt
: an element
l
: a list
val remove_one : 'a -> 'a list -> 'a list
remove just one occurence of an element "elt" from a list "l"
Returns 'a list without the element elt
elt
: an element
l
: a list
val remove_index : int -> 'a list -> 'a list
remove just the element to the index "index" from a list "l"
Returns 'a list without the element elt
l
: a list
val remove_double : 'a list -> 'a list
remove the multiple occurences of the element in a list "l"
Returns 'a list without the multiple occurences of the elements
val containStr : string -> string -> bool
test if the string "s1" contains the string "s2"
Returns bool
s2
: string
s1
: string
val indexStr : string -> string -> int
return the position of the string "s2" in the string "s1". return -1, if the string "s1" doesn't contain the string "s2"
Returns int
s2
: string
s1
: string
val find_separator : string -> int -> string -> int
find a separator "k" in a string "message" "(ak...kb)". It is used for find the arguments in a string of the form "a(b,..,c)" whitk k=","
Returns int, a position
sep
: is a separator. for example : ","
k
: int
message
: string
val replace : string -> string -> string -> string
replace a string "s1" by the string "s2" in a string "s"
Returns a new string
s1
: is a string
s2
: is a string
s
: is a string
val decompose : string -> string list
decompose a string of the form "a(b,...,c)" ina string list of the form a ;b ... ; c
Returns a string list of the form a ;b ... ; c
m1
: is a string of the form "a(b,...,c)"
val car : 'a list -> 'a
Returns the head of the list "l"
l
: a 'a list
val cdr : 'a list -> 'a list
Returns the tail of the list "l"
l
: a 'a list
val cadr : 'a list -> 'a
Returns the second element of the list "l"
l
: a 'a list
val cddr : 'a list -> 'a list
remove two elements at the begining to the list
Returns the list "l" without two elements at the begining to the list
l
: a 'a list
val caddr : 'a list -> 'a
Returns the third of the list "l"
l
: a 'a list
val remove_left_space : string -> int -> int -> string
remove the blank after the position "i" until another character in a string "s" with a length "l"
Returns a string
s
: string
l
: in, is a length
i
: int, is position in the string "s"after the position "i" until another character in a string "s" with a length "l"
val remove_right_space : string -> int -> int -> string
remove the blank before the position "i" until another character in a string "s" with a length "l"
Returns a string
s
: string
l
: in, is a length
i
: int, is position in the string "s"
val remove_space : string -> string
remove the blank at the beginning of a string "s" and at the end of this string "s"
Returns a string
s
: string
val actionTreatment : string -> string * string * string
decompose a string "mess" of the form "a -> b | c" in a 3-uplet (a,b,c)
Returns a 3-uplet (a,b,c) where the type of a, b, and c is string
mess
: is a string of the form "a -> b | c"
val round : float -> float
round a float to the near integer value
Returns a new float
y
: float
val min_l : 'a list -> 'a
compute the min in a list of int, float, double
Returns a number
l
: is a list of numbers
val max_l : 'a list -> 'a
compute the max in a list of int, float, double
Returns a number
l
: is a list of numbers
val list2string : string -> string list -> string
val get_name_in_session : string -> int -> string
return the name of a role composed a number of instanciation
Returns string, the name of a role composed a number of instanciation
name
: is the name of a role
id
: is the number of instantiation of the role "name"
val max_length_string : string list -> int
return the maximal length of a string in a list of strings
Returns the maximal length
l
: is a list of strings