SUMCON
Status Window Module

Status Window

Log Module

Open

mod$OpenStatus:=(
If[nb$status[[0]]=!=Symbol,NotebookClose[nb$status]];
nb$status=
NotebookPut[Notebook[{},WindowSize->{500,300},
WindowMargins->{{Automatic,10},{Automatic,10}},
WindowTitle->"Status",
Editable->False,
Selectable->True,
WindowFrame->"ModelessDialog",
WindowFrameElements->{"CloseBox","ResizeArea","ZoomBox","MinimizeBox"},
WindowElements->{"VerticalScrollBar","HorizontalScrollBar"},
ShowCellBracket->False
	]];
);

mod$OpenStatus::usage="Open a notebook to write status.";

Close

mod$CloseStatus:=(
NotebookClose[nb$status];
Clear[nb$status];
);

mod$CloseStatus::usage="Close status window.";

Write

twodigits[i_]:=ToString[PaddedForm[IntegerPart[Abs[i]],2,NumberPadding->{"0","0"},NumberSigns->{"",""}]];
hhmmss[d_List]:=(twodigits[d[[4]]]<>":"<>twodigits[d[[5]]]<>":"<>twodigits[d[[6]]]);

mod$WriteStatus[t_String] := If[
nb$status[[0]]=!=Symbol,
statustime = DateList[];
SelectionMove[nb$status,After,Notebook];
SetOptions[nb$status,Editable->True];
NotebookWrite[
nb$status,
Cell[hhmmss[statustime]<>" : "<>t,"Text"]
	];
	SetOptions[nb$status,Editable->False];
];

mod$WriteStatus::usage="mod$WriteStatus[t] write down a message t on the status notebook with a time stamp";

Error

mod$WriteError[t_String] :=
(Beep[];
 If[
nb$status[[0]]=!=Symbol,
statustime = DateList[];
SelectionMove[nb$status,After,Notebook];
SetOptions[nb$status,Editable->True];
NotebookWrite[
nb$status,
Cell[hhmmss[statustime]<>" : "<>"[Error] "<>t,"Text",FontColor->Red]
	];
	SetOptions[nb$status,Editable->False];
];
);

mod$WriteError::usage="mod$WriteError[t] makes beep and write down an error message t on the status notebook by red characters.";