Embed
Email

ALICE DCS USER INTERFACE ISTALLATION v1.0.10

Document Sample

Categories
Tags
Stats
views:
1
posted:
10/20/2011
language:
English
pages:
49
ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







The standard DCS USER INTERFACE in ALICE

Ver. 1.0.10 - 07/12/2006



History

23/06/2006 : Create

02/06/2006 : Modified the FSM STATE & MAIN CONTROL panel

02/11/2006 : Modified the Interface, LHC Status, Auxiliary Monitoring Zone

06/12/2006 : Encapsulate FSM functions, modified the Interface, Host status widgets









Acronyms list

AC Access Control FSM Finite State Machine

DU Device Unit FW Frame Work

CSV Comma Separated Values LU Logical Unit

CU Control Unit UI User Interface

DP PVSS Data Point UP User Panel

DPE PVSS Data Point Element









20/10/2011 - 1:58 PM 1/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







INDEX



Changes in the new release v 1.0.10 4

GUI changes 4

INSTALLATION changes 4

PROGRAMMING changes 4

COMPONENT PACKAGING changes 5

The standard DCS USER INTERFACE in ALICE v1.0 8

INTRODUCTION 8

DETECTOR LOGO 10

USER LOGIN 10

FSM NODE CONTROL 10

FSM NODE STATE 11

DETECTOR GRAPHIC LOCATOR 11

TITLE BAR 11

USER TOOL BAR 12

DATE-TIME 12

ENVIRONMENT PARAMETERS 12

LHC STATUS 13

The TREE BROWSER for the FSM HIERARCHY 13

The USER PANEL FOR MONITORING 14

Info Messenger 16

AUXILIARY MONITORING ZONE OF THE FSM MAJOR NODES 17

HOSTS STATE & MAIN FSM CONTROL PANEL for a DISTRIBUTED project 17

CLOSE WINDOW button 23

USER INTERFACE UPGRADE from version 1.0.7 to 1.0.10 24

I – Component Installation 24

II – Modify the config file : config/dcsUi.config 24

III – The FSM Control-Status panels 24

USER INTERFACE INSTALLATION 25

I –Component Installation 25

II – Change the Detector logo image : pictures/dcsUi/logo.bmp 25

III – Modify the config file : config/dcsUi.config 25

[Hierarchy] section 25

[AccessControl] section 25

[General] section 26

[HowToFacility] section 26

[Environment] section 26

[GraphicLocator] section 26

[AuxiliaryMonitoringZone] section 27

[HostsStatusZone] section 28

IV – Modify the config. file : config/dcsInfoMessenger.config 28

[InfoLogger] section 28

V – User Panel Template 29

VI – Graphic Locator Template 30

APPENDIX A – dcsUiBase library 33





20/10/2011 - 1:58 PM 2/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







COOKBOOK for the GRAPHIC LOCATOR CREATION 46









20/10/2011 - 1:58 PM 3/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









Changes in the new release v 1.0.10





GUI changes

 The Date & Time widget is moved on the upper left corner; the timer counter is deleted

and the dcsUi version number is now shown.

 The Environmental Parameters widget is now placed on a “single row”.

 The upper right corner hosts the LHC Status display.

 The Developer Tools button is moved in the upper „User tool bar‟.

 The Auxiliary Monitoring Zone (lower left corner) is modified in a 4x5 items Table View.

 The length of the Host Status & FSM Control Bar is increased to display more then 7

systems with more detailed status information.

 Pre-release of FSM-Chart Panel: a FSM tool devoted to display FSM status v.s. time is

now available.

 Pre-release of FSM-Hierarchy Ena/Disable configuration: a FSM tool devoted to

produce a configuration file with enable/disable information of the FSM hierarchy elements

is provided.









INSTALLATION changes

 Removed the SubServicesSystems variable into the [Hyerarchy] section.

 Redefined the [AccessControl] section adding new variables.

 Added the new section [AuxiliaryMonitoringZone].

 Added the new section [HostStatusZone].





PROGRAMERS RULES

 Please don’t use Layer number 8 in your project, this layer

is used by the dcsUi and is intended as reserved.

 In order to integrate your project into the ALICE DCS project

it is mandatory to include libraries in your scripts using

the instruction “#uses” and NOT the “LoadCtrlLib” sentence in

the config file.



PROGRAMMING changes

 In dcsUiBase.ctl library : modified the parameters of dcsUiBase_getACGrants function,

the new version (prototype) is (the change is just in formal names, back compatible with

previous release):

void dcsUiBase_getACGrants(bool &isDeveloper, bool &isExpert,

bool &isOperator, bool &isObserver)









20/10/2011 - 1:58 PM 4/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







 In dcsUiBase.ctl library : added a function to check the Status of a PVSS manager :

bool dcsUiBase_getMgrState(string sSystemName, string sManagerName,

string sManType, int iManNum = -1 )





 In dcsUiBase.ctl library : added two functions to decode LHC status :

bool dcsUiBase_LHCStatus2Mess(int iStatus, int iType=0)

string dcsUiBase_LHCStatus2Col(int iStatus)



 Usage of named colours; colour table definition is in the file : dcsUiBaseColours









COMPONENT PACKAGING changes

Directory FileName Action





bin HMPIDSticker.exe Deleted

PhoneDir.bat Deleted

colorDB dcsUiBaseColours Added

config dcsInfoMessenger_example.config

dcsUi_example.config

dcsUiSet.config

dcsUiSet.init

dcsUiSet.postInstall

help\en_US.iso88591\xxxHowTo xxxHowTo.html

panels\dcsFsmChart dcsFsmChart.pnl Added

dcsFsmChartAxis.pnl Added

dcsFsmChartAxisscale.pnl Added

dcsFsmChartBar.pnl Added

dcsFsmChartBino.pnl Added

dcsFsmChartCalendar.pnl Added

dcsFsmChartCalendarday.pnl Added

dcsFsmChartDateTime.pnl Added

dcsFsmChartSet.pnl Added

dcsFsmChartStato.pnl Added

panels\dcsFsmSynoptics dcsFsmSynoptics.pnl

dcsFsmSynopticsCUIcon.pnl

dcsFsmSynopticsDUIcon.pnl

dcsFsmSynopticsHorLine.pnl

dcsFsmSynopticsLUIcon.pnl

dcsFsmSynopticsVerLine.pnl

dcsFsmSynopticsWidget.pnl

panels\dcsFsmTools dcsFSMControl_example.pnl

dcsDimDnsStatusWidget.pnl Added

dcsFsmObjNodeWidget.pnl

dcsFsmControllHierarchyWidget.pnl Added



20/10/2011 - 1:58 PM 5/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







dcsFSMTailoring.pnl

dcsFsmHostStatusWidget.pnl Added

dcsFsmSrvHostWidget.pnl Added

dcsFSMTailorWidget.pnl Added

dcsHostStatus.pnl Added

panels\dcsUi dcsUiAuxiliaryWindow.pnl Added

dcsUiDataExtraction.pnl

dcsUiEnvirParam.pnl

dcsUiEnvirTrend.pnl

dcsUiFSMObjStatusDisplay.pnl

dcsUiFSMObjStatusWidget.pnl Deleted

dcsUiFsmObjWithDevLock.pnl Added

dcsUiFsmObjWithLock.pnl Added

dcsUiFSMStatus.pnl

dcsUiFSMSubServicesWindow.pnl Deleted

dcsUiFSMtree.pnl

dcsUiFsmUi.pnl Added

dcsUiHostFSMStatusWidget.pnl Added

dcsUiHostStatusWidget.pnl Added

dcsUiHostStatusWidgetSmall.pnl Added

dcsUiHwStatus.pnl Added

dcsUiInfoLogBook.pnl

dcsUiInfoPan.pnl

dcsUiInfoUserLog.pnl

dcsUiLHCStatus.pnl Added

dcsUiMainPanel.pnl

dcsUiSQLExtractor.pnl

dcsUiTimer.pnl

dcsUiTools.pnl

panels\fwFSMuser fwUi.pnl Deleted

logo.pnl Deleted

panels\xxxDetector xxxDetector.pnl

xxxUiLocator.pnl

pictures\dcsUi address.bmp Deleted

archiveset.bmp Added

alarm.bmp

backup.bmp

check.bmp

dat.bmp

diary.bmp Deleted

fsmcontrol.bmp

fsmengine.bmp

FSMTV_cuc.bmp

FSMTV_cue.bmp

FSMTV_cus.bmp

FSMTV_duc.bmp



20/10/2011 - 1:58 PM 6/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







FSMTV_dus.bmp

FSMTV_luc.bmp

FSMTV_lue.bmp

FSMTV_lus.bmp

help.bmp

logo.bmp

network.bmp Deleted

note.bmp

notewrite.bmp

off.bmp

off_small.bmp

phone.bmp Deleted

printer.bmp

restart.bmp

restart_small.bmp

stick.bmp Deleted

tools.bmp

users.bmp

scripts\libs dcsInfoMessenger.ctl

dcsUiBase.ctl









20/10/2011 - 1:58 PM 7/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









The standard DCS USER INTERFACE in ALICE v1.0





INTRODUCTION



In the ALICE control room each DCS workplace will be equipped with one 19” display. To reduce

the risk of getting the DCS operator confused while dealing with many overlapping windows, the

ACC has considered the DCS operation as more effective and less risky if performed via one or

very few specialized windows. This strategy has been adopted in the Standard UI design (fig.1)

separating the FSM hierarchy browsing and monitoring action (mostly used during the normal

detector operation) from the FSM control.



How it works

On the UI left side is located the FSM hierarchy tree browser while on the right side of the same

window is located the User Panel (UP). The UP is meant to show monitoring information related to

the selected FSM node which is highlighted in the tree browser by a red square surrounding the

relevant icon. In this way, while navigating trough the FSM three, in the monitoring zone will

appear only the corresponding UP without popping up new windows.

The different UPs for the FSM nodes have to be designed and implemented according to the

requirements of the sub-detector experts.



For the selected node, provided the relevant privileges are granted at the Access Control (AC), the

standard FSM control panel for the command issue (detector control) can be opened in a smaller

overlapping window.



This strategy of separating in different windows actions carried out with different frequencies

allows for profiting in the browsing phase of almost all the screen for the UP where in a clear way

the detector details can be represented.



Standard UI installation

In order to facilitate the installation in a PVSS project, the UI is provided as a FW component.

In the following table are reported the software version of the different applications requested to

run the UI:





PVSS FW SMI++ AC

3.1 2.3.7 r24v13 (2.5.1) Related to FW









20/10/2011 - 1:58 PM 8/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









FSM NODE

STATE

DATE-TIME TITLE BAR LHC STATUS



USER LOGIN DETECTOR ENVIRONMENT

GRAPHIC USER TOOL PARAMETERS

DETECTOR LOCATOR BAR

LOGO





FSM NODE

CONTROL





USER PANEL

FOR

MONITORING

FSM

HIERARCHY

TREE

BROWSER

INFO

LOGGER









AUXILIARY MONITORING

ZONE OF THE FSM HOSTS STATE & CLOSE

MAJOR NODES FSM MAIN CONTROL WINDOWS





Figure 1. The Standard DCS UI provided by the ACC









20/10/2011 - 1:58 PM 9/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









Standard DCS UI description



DETECTOR LOGO

A bitmap image representing the “Detector Logo” (60 x 45 pixels) is contained in the following

file:



/pictures/dscUi/logo.bmp









USER LOGIN

This window displays the name of the logged user “User Name” (NO USER if nobody is logged).









Pressing the Key button then the Login Window opens. It allows for the User Name changing. This

is the standard FW Access Control Toolbar button.



The Settings of the “Grant List” for the ALICE UI, can be done by editing the [AccessControl]

section into the dscUi.config file.



Note: for details on the ALICE AC policy and the FW Access Control component, please refer

respectively to the “The ALICE DCS Integration Guidelines v.1.3.1” document and the relevant

JCOP FW documentation.



On the right side of the key icons, two bars show the Memory and Disk occupancy in percentage.





FSM NODE CONTROL

This push button opens the standard “FSM Control Window” corresponding to the selected node in

the tree browser. The button FSM node control is enabled only for the following AC grant levels:

Operator, Expert and Developer. The Observer is excluded.









For the Operator the FSM Control Window is opened in Modal mode, otherwise it is opened

Modless.



Note: In order to define the FSM Access Control, please refer to: http://lhcb-

online.web.cern.ch/lhcb-online/ecs/fw/FwFSM_v24r11.readme.txt





20/10/2011 - 1:58 PM 10/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







FSM NODE STATE









This widget displays some relevant information of the selected FSM node: the NAME (the FSM

Label property: in this case PIPPO DET), the STATE (by the state name and related color) and

operation MODE by the lock state (Included/Excluded or Enabled/Disabled).



In case of long FSM names (typically for the DU), only the last 22 characters are displayed.









DETECTOR GRAPHIC LOCATOR









If of interest, this area is devoted to host a “detector specific widget”. It shows the detector part

corresponding to the selected node in the tree browser. The widget must be developed by the

Detector Control system expert. A template file is provided in:



/panels/xxxDetector/xxxUiLocator.pnl



The “Graphic Locator facility” can be enabled/disabled editing the dcsUi.config file in the section

[GraphicLocator] setting respectively YES/NO the variable UseGraphicLocator





TITLE BAR









A two lines text space is used to show the main info about the displayed UP. In order to set the

title, in the Event_Initialize routine of the UP must call a function:



// ---------------- Set the title into the main window ------------------

dcsUiBase_setMainTitle("Node XXX – monitoring etc…");

// ----------------------------------------------------------------------





An example is provided in the template file:







20/10/2011 - 1:58 PM 11/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





/panels/xxxDetector/xxxDetector.pnl







USER TOOL BAR

This bar contains the push buttons that run some user facilities.









ICON DESCRIPTION GRANTED

Open the FW Standard Alarm Panel Operator,

Expert,

Developer

Open the WEB Browser at the Detector HowTo home page. This

HTML page is located at: All

/help/en_US.iso88591/xxxHowTo/xxxHowTo.html

where “xxx” represent the three letters detector prefix

Open the FW Help page related to the panel showed. Please

refer to FW documentation. All

Print the actual displayed panel Operator,

Expert,

Developer

Open a devoted panel for the DCS Developer containing

debugging tools, etc. Their precise functionalities are being Developer

discussed in the ACC team following some agreed policies and

are upgraded as new UI versions are released.

The referenced panel is located in



/panels/dcsUi/dcsUiTools.pnl





Additional buttons will be put only after proved necessity and agreed with the ACC. Any comment

and/or suggestion from the user are welcome.



DATE-TIME







This widget shows the time and date. At the right the version number of dcsUi is showed.



ENVIRONMENT PARAMETERS









20/10/2011 - 1:58 PM 12/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









This widget shows the values of two PVSS DPs; one devoted to monitor the environment

Temperature and the second the environment Pressure. Format and Units are displayed according

the PVSS settings.



The “Environment Parameters facility” can be enabled/disabled, editing the dcsUi.config file in the

section [Environment], and setting the variable UseIt to YER/NO accordingly. The DPs and the

DPE that trace the environment parameters (DP are specified as FW LOGICAL VIEW names), can

be chosen.



LHC STATUS









This widget shows the status of the LHC: the Scheduled Task, the Beam Status and the

Radiation Status. This information will be published via DIM server running on the ALICE DCS

computer dedicated to the external services.



For more details on the meaning of the LHC status please refers to: “LHC Operational Mode”

document (EDMS doc No. : 580728).





The TREE BROWSER for the FSM HIERARCHY









Figure 2 The tree browser of the FSM hierarchy.









20/10/2011 - 1:58 PM 13/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







In the figure 2 is displayed the tree browser for the detector FSM hierarchy. Each node, according

to a legend, is represented via a small icon (yellow toothed wheel for CU, cyan toothed wheel for

LU and green rectangle for DU) followed by its name (FSM Label property for CU and LU).



A red box surrounding the icon, the bold font and the surrounding “« »” of the name, highlights

the selected FSM node.



The navigation with the tree browser is quite similar to the one of the “standard Windows”.

Clicking on the mouse right button, a FSM node is selected and the associated UP is then

automatically displayed in the dedicated area of the UI.



If commands have to be issued, then pushing the FSM Node Control button, the standard FSM

control panel (smaller than the UI) opens. This is the only case when two panels are opened. Once

the control operations are over then it can be closed and the browsing trough the tree can restart.



The root node of hierarchy to be first displayed at the start up can be chosen setting the variables

RootNode and RootObjec, in the dcsUi.config file in the section [Hierarchy].









The USER PANEL FOR MONITORING

Once a FSM node is selected then the corresponding UP appears in the reserved area of the UI. It is

intended to provide complementing monitoring information. In addition, according to the user

grant, in the UP, tables for the HV-LV channel settings (Vset, Iset,..etc), or pressure and/or

temperature limit settings, can be made available.

Its dimensions are: 820x650 pixels.



The association between the FSM node and the panel must be done with the standard

procedure in the FW Device & Editor Navigator.



A template file of detector UP is available in:



/panels/xxxDetector/xxxDetector.pnl



In order to exploit in the UP the user‟s grants provided by the FW Access Control (AC), the DCS

programmer is asked to strictly follow the schema reported in the template. He has to write all the

relevant code for Enabling/Disabling the widgets, the setting tables, etc.



For the exploitation of the user‟s grants in the FSM control please refers to http://lhcb-

online.web.cern.ch/lhcb-online/ecs/fw/FwFSM_v24r11.readme.txt



//Function (NoName)_General()

// ------ Access Control related Functions --------------------------------

void xxxDetector_DisableAllAC()

{

// Put Here all commands to disable objects on the panel

}

void xxxDetector_EnableAC(bool isObserver, bool isOperator,

bool isExpert, bool isDeveloper)





20/10/2011 - 1:58 PM 14/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





{

if(isObserver) {

// Put Here all commands to enable objects on panel

// related to Guest grants

}

if(isOperator) {

// Put Here all commands to enable objects on panel

// related to Operator grants

}

if(isExpert) {

// Put Here all commands to enable objects on panel

// related to Expert grants

}

if(isDeveloper) {

// Put Here all commands to enable objects on panel

// related to Administrator grants

}

}

void xxxDetector_LoggedUserAC(string dp, string username_from_ui)

{

// Set the minimum users grants

bool isObserver=false;

bool isOperator=false;

bool isExpert=false;

bool isDeveloper=false;



// Disable all items in the panel

xxxDetector_DisableAllAC();

// Get Grants for the specified user

dcsUiBase_getACGrants(isDeveloper, isExpert, isOperator, isObserver);

// Now enable - this is related to the specific Policy rules

xxxDetector_EnableAC(isObserver,isOperator,isExpert,isDeveloper);

}

// ---------------------------------------------------------------------------





This is the template for the EventIntailize routine of the UP panel



//Function (NoName)_EventInitialize()



main()

{



// -------- Access control -------------------------------------------

// Set the CB Function that Hook the change of Logged User

dyn_string exceptionInfo;

fwAccessControl_setupPanel("xxxDetector_LoggedUserAC",exceptionInfo);

if (dynlen(exceptionInfo)) {

xxxDetector_LoggedUserAC("",""); // global "reject"

}

// ----------------------------------------------------------------------





// ---------------- Set the title into the main window ------------------

dcsUiBase_setMainTitle("XXX - Detector View");

// ----------------------------------------------------------------------



}





The last chunk of software is linked to the EventTerminate routine called when the panel is closed.

In this routine it is mandatory to put all the removeSymbol calls necessary to delete all the

graphics objects displayed during the panel run time (by the addSymbol function).





20/10/2011 - 1:58 PM 15/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









//Function (NoName)_EventTerminate()

main()

{

// -------------- Event Terminate ---------------------

//

// Here REMOVE all objects inserted with an

// addSymbol() function

//

// int removeSymbol (string moduleName, string panelName, string refName);

//

//



}





Info Messenger









This widget shows the Info Messenger messages. The first line contains the last one arrived, while

below all the others received during the session (if any).

According to the privileges granted at the user (Operator, Expert or Developer), two buttons allows

for to open a logbook utility. From there messages on the detector operation and state can be

entered. The browsing on the archived messages can be done as well.



In the actual version, massages are recorded into a local ASCII file. A library is also provided to

include the Info Logging facility in the user panels or scripts.



The InfoMessenger parameters can be set editing the dcsInfoMessenger.config .



[InfoLogger]

localInfoFileName=D:\DCSTEST\Prova1/log/InfoLogger.log

localInfoFileSize=12



serverInfoHostName=hmpidcs3.cern.ch

serverInfoHostPort=5656



readerInfoDPName=dcsInfoLogger

readerInfoSystemName=dist_1





At present these are the relevant variables :



localInfoFileName := Name and Path of local file hosting the messages

localInfoFileSize := Maximum dimension of Log file (KiloBytes)



readerInfoDPName := name of a DP devoted to do as log-interface

readerInfoSystemName := name of System hosting the log-interface DP (for distrib. Systems)







20/10/2011 - 1:58 PM 16/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







AUXILIARY MONITORING ZONE OF THE FSM MAJOR NODES

This widget can monitor the state and operation mode of a list of critical FSM nodes. Only as

suggestion: these nodes can refer to devices of the detector infrastructure (power supplies, cooling

and gas plants, etc…) which states, a priori, are relevant for the operation of detector parts as

Super module, Module, Sector …..

For the FSM operation of the critical nodes (command issue), the normal browsing and control

panel opening procedure, has to be followed.









Up to twenty nodes, arranged on five rows, can be displayed.



The list of the FSM nodes to be displayed can be defined editing the dcsUi.config in the

[AuxiliaryMonitoringZone] section.



The variable Title has to be set with a string containing the title.

Then five variables named Row1.. Row5 contains a comma separated list of, up to four, FSM

nodes, using the following format:



Rowi = “,,.[,,.]







[AuxiliaryMonitoringZone]

# ----- This display the table -------

Title = "XXX DETECTOR Auxiliary Zone"

Row1 = "xxx R1,Node One,SECTOR1.DEV1_1,Node Two,SECTOR1.DEV1_2"

Row2 = "xxx R2,Plant One,INFRAS.PLANT1,Plant Two,INFRAS.PLANT1"

# -------------------------------------









HOSTS STATE & MAIN FSM CONTROL PANEL for a DISTRIBUTED project









20/10/2011 - 1:58 PM 17/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







This bar contains one push button that opens the FSM Expert Control Panel (fig. 3). From there the

start/stop of the entire FSM machinery for a distributed PVSS project can be carried out. It is

enabled only if the Expert/Admin privileges are granted at the FW AC.

On the right side of the button there are a series of small widgets that automatically displays the

state of systems running in the distributed system.

There are three types of widgets, the simplest that shows the status of the connection and the

system name for a defined Distributed System, the second that is able to show also information

about FSM processes/managers status and the last, represented by a small square that shows just

the status of the connection.



The dcsHostFSMStatusWidget display this information:



Name of PVSS system and

Status of Distribution

Connection. The ToolTip text

shows the Host name



Status of the FSM

Engine









Status of the FSM

Control API process, Status of the FSM

PVSS00smi.exe Device Handler

Status of the FSM

Manager

Server manager :

fwFsmSrvr.ctl









The list of the Systems to be displayed can be defined editing the dcsUi.config in the

[HostsStatusZone] section.



The variable ExternalFSMPanel has to be set, with a string that specify the name of FSM Control

panel that will be opened pushing the FSM button..

Then the variable named Hosts contains a comma separated list of System names that will be

displayed with the first type of widget, using the following format:



Hosts = ":[,:]"





The variable named FSMHosts contains a comma separated list of System names that will be

displayed with the second type of widget, using the following format:



FSMHosts = ":[,:]"





20/10/2011 - 1:58 PM 18/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









Finally, the variable named HostsSmall contains a comma separated list of System names that will

be displayed with the third type of widget, using the following format:



HostsSmall = ":[,:]"







[HostsStatusZone]

ExternalFSMPanel = "dcsFsmTools\dcsFSMControl.pnl"

Hosts = "ALIDCS001:dcs_system1,ALIDCS002:dcs_system2"

HostsSmall = "ALIDCS001:dcs_system1,HMPIDCS3:hmp_main"

FSMHosts = "HMPIDCS3:hmp_main,HMPIDCS4:hmp_hvlv"

# -------------------------------------





The FSM Expert Control Panel (fig. 3) contains all relevant information about FSM detailed status

& control. In order to adapt the panel at the sub-detector FSM structure, the DCS programmer is

asked to modify the panel putting the suitable number of the requested objects.









Figure 3



An example panel is in the :



/panels/dcsFsmTools/dcsFSMControl_example.pnl



Some widgets are furnished in order to arrange this panel:





20/10/2011 - 1:58 PM 19/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









 dcsDimDnsStatusWidget.pnl : Display the status of DIM DNS Server node.









 dcsFsmControllHierarchyWidget.pnl : Display two push buttons able to made the Stop

Start/restart of the entire Hierarchy.







 dcsFsmHostStatusWidget.pnl : Display a small square that represent a Host into the

Distributed system. Two parameters have to be specified: $HostName (DNS Name of Host

without the domain suffix) and $SystemName (the PVSS project system name without the

colon character).









A click on the square opens a related panel showing relevant information about the

distributed host.









 dcsFsmSrvHostWidget.pnl : It displays the status of a FSM Server Manager. One

parameter has to be specified: $SysName (the PVSS project system name without the

colon character).









20/10/2011 - 1:58 PM 20/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







Then, the name of system, the status of fwFsmSrvr.ctl manager, and the status of the FSM

server are showed.



 dcsFsmObjNodeWidget.pnl: It displays the status of a FSM Domain node. Two

parameters have to be specified: $sysName (the PVSS project system name without the

colon character) and $node (the FSM domain node name).







The name of node, two push buttons to restart and to stop the FSM tree recursively, then

the status of FSM Domain node, and the ownership of that domain are shown.



 dcsFSMTailorWidget.pnl : It displays the controls used to set and create the FSM

enable/disable configuration file then edit, save and apply the operation mode of all

the CUs in the FSM (include, exclude, disable, enable).









In fact, since the CU operation mode is lost at each FSM Start/Stop, or at the PVSS project

restart, then for hierarchies with many CUs, the configuration file can be very useful. Since

this facility is under development it has been included in the UI as a pre-release version for

test purposes.









20/10/2011 - 1:58 PM 21/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







In the upper part of the FSM MAIN CONTROL panel there are two others buttons to access

additional FSM features as:

- the FSM synoptic panel, showing at one glance the state and the operational mode of all

the FSM objects in the project;









- the FSM Chart panel showing the FSM_ State vs. Time of the FSM objects in the

project. Also this facility is a pre- release for test purposes.









In order to display the chart it is mandatory to archive the states of the FSM CUs/DUs.

For this a dedicated tool is provided. A panel, opened by means of a “setting” button,

gives the possibility to set the “Archive” property of all the FSM nodes of a system.









20/10/2011 - 1:58 PM 22/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









CLOSE WINDOW button

The CLOSE button can be optionally displayed into the main panel. However, to prevent

accidental panel closure, editing the dcsUi.config in the [General] section, and setting the variable

CloseButton with NO, the main UI is left continuously running under the control of the PVSS

consol process.









20/10/2011 - 1:58 PM 23/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









USER INTERFACE UPGRADE from version 1.0.7 to 1.0.10

I – Component Installation

In order to make the upgrade of standard DCS UI component „Extract‟ all zipped files into a

temporary directory. Then, start your PVSS Project and run the standard JCOP FW

“fwInstallation.pnl” panel.



Install the new release of component Alice DCS UI.



Restart the project package



The “post install” procedure provides all the operations needed to the new release.

It deletes the related files. If you are interested to maintain old files, please make a

backup before the new installation is started (?).







II – Modify the config file : config/dcsUi.config



Relevant changes in the configuration file config/dcsUi.config are in [AccessControl] ,

[AuxiliariMonitorigZone] and [HostsMonitorigZone] sections.



In the package an example file named dcsUi_example.config is present. More details

are in “USER INTERFACE INSTALLATION” chapter.









III – The FSM Control-Status panels



In the directory panels/dcsFsmTools/ there is the file: dcsFSMControl_example.pnl

which contains the “template”. Rename it as dcsFSMControl.pnl. Please, take in

account that in that directory there is your previous customized panel.









20/10/2011 - 1:58 PM 24/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









USER INTERFACE INSTALLATION

I –Component Installation

In order to install the standard UI component „Extract‟ all zipped files into a temporary directory.

Then, start your PVSS Project and run the standard JCOP FW “fwInstallation.pnl” panel.



Install the component Alice DCS UI.



Restart the project.





II – Change the Detector logo image : pictures/dcsUi/logo.bmp



In order to change the displayed logo in the upper left corner of the UI the user can replace the file:

logo.bmp with a customized one. (60 pixel width, 43 pixel height, 256 colours).







III – Modify the config file : config/dcsUi.config



The UI configuration file config/dcsUi.config concentrates in one place all the possible settings

the user can do for the UI.



In the package an example file named dcsUi_example.config is present. After the

first installation and before the customization of the configuration, rename it as

dcsUi.config this action prevents to overwrite this file during the installation of next

releases.









[Hierarchy] section

This section contains specifications about the FSM Hierarchy:



RootNode = Name of Root FSM Domain

RootObject = Name of Root FSM Object









[AccessControl] section

This section contains two lines devoted to the Centralizaed Access Control mechanism:



UseCentralizedAC=YES

CentralizedACServer=dcs_system2







20/10/2011 - 1:58 PM 25/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF







These lines although not yet active must not be neither removed nor changed.



A third line specifies the detector Access Control Domain name:



ACDomain=



For more details on the Access Control please refer to the Manual Page of the JCOP Framework

Access Control component and to the ACC Access control responsible.





[General] section

This section contains indication on some additional options of the UI.



CloseButton = Specify if the Main Panel have the “CLOSE” button







[HowToFacility] section

This section specifies the path and the file name of the “Detector Related HowTo” home page. The

PathName is specified starting from the “\help\en_US.iso88591\” directory.



HowToFileName = Specify the HomePage path for the HowTo Pages facility







[Environment] section

This section contains indication about the widget for the Environment parameters



UseIt = Specify if the EnviromentParam Widget will be displayed

TemperatureDP = Alias name of DP that contains the environment temperature

PressureDP = Alias name of DP that contains the environment pressure

DPElement = Name of the DP Element that contains the P/T value



Example :



Let‟s suppose that in the project we have two DP of FwAi type that are used to read the

environment parameters, and their names into the Logical View are: ENVIRON/TEMP and

ENVIRON/PRES. The settings are:



[Environment]

UseIt=YES

TemperatureDP = ENVIRON/TEMP

PressureDP = ENVIRON/PRES

DPElement = actual.value





[GraphicLocator] section

This section contains details about the Graphic Locator widget







20/10/2011 - 1:58 PM 26/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





UseGraphicLocator = Specify if the Widget will be displayed

GraphLocatorfile = Specify the path and filename of panel that realize the

Detector specific Graphic Locator



Example :



[GraphicLocator]

UseGraphicLocator=YES

GraphLocatorFile=xxxDetector\xxxUiLocator.pnl









[AuxiliaryMonitoringZone] section

This section contains details about the Auxiliary Monitoring Zone widget



Title = Specify the Title of the Monitoring zone

Row1= Specify the list of nodes that are displayed into the first row

Row2= Specify the list of nodes that are displayed into the second row

Row3= Specify the list of nodes that are displayed into the third row

Row4= Specify the list of nodes that are displayed into the fourth row

Row5= Specify the list of nodes that are displayed into the fifth row





The syntax of the is :



,,, . . ,,



And for the is:



.



Example :



Assuming that in the project the FSM Hierarchy is:



Hierarchy FSM

Type

XXX_DETECTOR C.U.

XXX_SECTOR1 C.U.

XXX_PART1_1 L.U.

XXX_PART1_2 L.U.

XXX_DEV_2A D.U.

XXX_SECTOR2 C.U.

XXX_PART2_1 L.U.

XXX_INFRASTRUCTURE C.U.

XXX_INFR_CRATE1 L.U.

XXX_INFR_CRATE2 L.U.



And we want to display in the Auxiliary Zone the status of nodes “XXX_PART1_1”,

“XXX_PART2_1”, “XXX_DEV_2A” , “XXX_INFR_CRATE1” and “XXX_INFR_CRATE2”





20/10/2011 - 1:58 PM 27/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









The configuration file could be:



[AuxiliaryMonitoringZone]

Title = "XXX detector relevant nodes"

Row1 = "Partitions,FIRST,XXX_SECTOR1.XXX_PART1_1,SECOND,XXX_SECTOR2.XXX_PART2_1

Row2 = "Devices,DEV OF SEC1,XXX_PART1_2.XXX_DEV_2A

Row3 = "Crates,POWER,XXX_INFRASTRUCTURE.XXX_INFR_CRATE1,

GAS,XXX_INFRASTRUCTURE.XXX_INFR_CRATE1









[HostsStatusZone] section

This section contains details about the Hosts Status Zone widget



ExternalFSMPanel = Specify the name of the panel open with the FSM Control push

button. The standard one is : "dcsFsmTools\dcsFSMControl.pnl"

Hosts= Specify the list of distributed hosts that are displayed with the

“simple host widget”

HostsSmall= Specify the list of distributed hosts that are displayed with the

“small host widget”

FSMHosts= Specify the list of distributed hosts that are displayed with the

“complex host widget”





The syntax of the is :



:[,:…]



For the is a string contain the DNS host name without the domain suffix



For the is a string contain the PVSS System name without the colon character









IV – Modify the config. file : config/dcsInfoMessenger.config



In order to tailor the Info Logger Facility open and edit the file config/dcsInfoMessenger.config



In the package an example file named dcsInfoMessenger_example.config is present.

After the first installation and before the customization of the configuration, rename it

as dcsInfoMessenger.config this action prevents to overwrite this file during the

installation of next releases.



[InfoLogger] section



LocalInfoFileName = Complete Path and Name of local file that contains





20/10/2011 - 1:58 PM 28/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





Info send to the “local info system”

LocalInfoFileSize = Maximum size of InfoLogger Local File

serverInfoHostName = Internet standard DNS name for the Info Server Host

serverInfoHostPort = TCP/IP port number for the Info Server Host

readerInfoDPName = Name of DP that collects all DCS Info in the system

readerInfoSystemName = Name of PVSS system name that collects all DCS

Info



V – User Panel Template

In the panels/xxxDetector/ directory there is a template named: xxxDetector.pnl. It contains the

“template scripts” that integrates the Access Control mechanism in the user panels.



In the General section of the Panel, there are three defined functions:

- the first one disables all the panel objects sensitive to the “Logged User”;

- the second one enables the panel objects according to the “grant level”;

- the third one is the CallBack_Function that react to the User Login.



//Function (NoName)_General()



// ------ Access Control related Functions -----------------------------------

-

//

void xxxDetector_DisableAllAC()

{

// Put Here all commands to disable objects on panel

}



void xxxDetector_EnableAC(bool isObserver, bool isOperator, bool isExpert, bool

isDepeloper)

{

if(isObserver)

{

// Put Here all commands to enable objects on panel

// related to Guest grants

}

if(isOperator)

{

// Put Here all commands to enable objects on panel

// related to Operator grants

}

if(isExpert)

{

// Put Here all commands to enable objects on panel

// related to Expert grants

}

if(isDepeloper)

{

// Put Here all commands to enable objects on panel

// related to Administrator grants

}

}



void xxxDetector_LoggedUserAC(string dp, string username_from_ui)

{

// Set the minimum users grants

bool isObserver=false;







20/10/2011 - 1:58 PM 29/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





bool isOperator=false;

bool isExpert=false;

bool isDepeloper=false;



// Disable all items in the panel

xxxDetector_DisableAllAC();

// Get Grants for the specified user

dcsUiBase_getACGrants(isDepeloper,isExpert,isOperator,isObserver);

// Now enable - this is related to the specific Policy rules

xxxDetector_EnableAC(isObserver,isOperator,isExpert,isDepeloper);

}

// ------------------------------------------------------------------------------





In the EventInitialize section of the Panel, there are some code lines that register the Access

Control CallBackFunction and set the Title in the Main Panel Window.



//Function (NoName)_EventInitialize()



main()

{

// -------- Access control -------------------------------------------

// Set the CB Function that Hook the change of Logged User

dyn_string exceptionInfo;

fwAccessControl_setupPanel("xxxDetector_LoggedUserAC",exceptionInfo);

if (dynlen(exceptionInfo)) {

xxxDetector_LoggedUserAC("",""); // global "reject"

}

// ----------------------------------------------------------------------



// ---------------- Set the title into the main window ------------------

dcsUiBase_setMainTitle("XXX - Detector View");

// ----------------------------------------------------------------------

}





In the EventTerminate section of the Panel, has to be write all the lines that remove the objects

added in the panel at run time.

Due to the fact that the ALICE DCS UI is based on “only one panel” displayed, then each user

panel is opened in the same “module/panel”. This enforces the developer to delete all the graphic

objects added at run time with the addSymbol function.



//Function (NoName)_EventTerminate()

main()

{

// -------------- Event Terminate ---------------------

//

// Here REMOVE all objects inserted with an

// addSymbol() function

//

// int removeSymbol (string moduleName, string panelName, string refName);

//

//

}







VI – Graphic Locator Template

In the directory panels/xxxDetector/ there is a template file named: xxxUiLocator.pnl. It contains

the “template scripts” that realize the Graphic Locator widget.





20/10/2011 - 1:58 PM 30/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









The developer must write some functions that Hide/Visualize a graphic schema of the detector

according to the object name passed to the control.



//Function (NoName)_General()

__resetBack()

{

// Here put all commands to reset colors

// of graph objects

/* ------------- Example ------------------

setValue("Mod0", "backCol", "{128,128,128}");

setValue("Mod1", "backCol", "{128,128,128}");

setValue("Mod2", "backCol", "{128,128,128}");

setValue("Mod3", "backCol", "{128,128,128}");

----------------------------------------- */

}

__invisible()

{

// Here put all commands to set all graph

// objects INVISIBLE

/* ------------- Example ------------------

setValue("Mod0", "visible", false);

----------------------------------------- */

}

__visible(string what)

{

// Here put all commands to set graph objects

// of type "what" VISIBLE

/* ------------- Example ------------------

switch(what)

{

default:

setValue("Mod0", "visible", true);

break;

}

----------------------------------------- */

}

__setDisplay( string object )

{

// Here put the script to decode the Object

// in order to decide graph objects of locator in the

// panel will be set properties colors/visible ecc.

//

/* ------------- Example ------------------

int type = 0;

__invisible();

switch(type)

{

case 0:

setValue("Mod0", "backCol", "{254,251,251}");

txtDescr.text = "ALL";

break;

case 1:

setValue("Mod0", "backCol", "{254,251,251}");

txtDescr.text = "RICH MOD-0";

break;

}

---------------------------------------- */

}

//Function (NoName)_EventInitialize()

main()

{

// This is called at the startup





20/10/2011 - 1:58 PM 31/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





__setDisplay( $obj );

}

//Function txtLocation_EventSetFocus()

main()

{

// This is called each time a new panel is loaded

__resetBack();

__setDisplay( txtLocation.text );

setInputFocus(myModuleName(),myPanelName(),"txtDummy");

}





All the graphic objects, representing the detector‟s parts, have to have a corresponding FSM node

in the hierarchy.

As suggestion: in order to highlight the detector part selected in the tree browser, the locator can

fill with the white colour, the corresponding shapes. In addition it can set a text box with a short

label.









20/10/2011 - 1:58 PM 32/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









APPENDIX A – dcsUiBase library

/* ------------------------------------------------------------



ALICE DCS - UI LIBRARY



This library collect all functions linked to the ALICE UI



---------------------------------------------------------------*/

// Ver. 0.4 3/11/2006

//

// Add information for LHC







// ---------- Constant definition ----------------------------

const string DCSUI_VERSION = "1.0.10";



// Coordinate In the AC Grant List

const int DCSUI_AC_OBSERVER = 1;

const int DCSUI_AC_OPERATOR = 2;

const int DCSUI_AC_EXPERT = 3;

const int DCSUI_AC_DEVELOPER = 4;



// LHC Constants

const int DCSUI_LHC_SCHEDULE_SHUTDOWN = 1;

const int DCSUI_LHC_SCHEDULE_CHECKOUT = 2;

const int DCSUI_LHC_SCHEDULE_PROTON_RUN = 3;

const int DCSUI_LHC_SCHEDULE_ION_RUN = 4;

const int DCSUI_LHC_SCHEDULE_HIGH_BETA_RUN = 5;

const int DCSUI_LHC_SCHEDULE_MACHINE_DEVELOPMENT = 6;



const int DCSUI_LHC_CYCLE_PREPARE = 1;

const int DCSUI_LHC_CYCLE_PRE_INJECTION = 2;

const int DCSUI_LHC_CYCLE_INJECTION = 3;

const int DCSUI_LHC_CYCLE_FILLING = 4;

const int DCSUI_LHC_CYCLE_RAMP = 5;

const int DCSUI_LHC_CYCLE_ADJUST = 6;

const int DCSUI_LHC_CYCLE_UNSTABLE_BEAMS = 7;

const int DCSUI_LHC_CYCLE_STABLE_BEAMS = 8;

const int DCSUI_LHC_CYCLE_BEAM_DUMP = 9;

const int DCSUI_LHC_CYCLE_RECOVER = 10;

const int DCSUI_LHC_CYCLE_PRE_CYCLE = 11;



const int DCSUI_FSM_MODAL = 1;

const int DCSUI_FSM_MODLESS = 2;







/* ------------------------------------------------------------

Funtion for Setting Global Variables



F.A. ver 1.0 19/6/2006



History



19/06/2006 - Creation

03/08/2006 - Modify to the dcsUiBase_setMainTitle

19/10/2006 - Add Configs entry for the Auziliary Monitoring Zone

30/10/2006 - Add Configs entry for AC centralized Service



------------------------------------------------------------ */





20/10/2011 - 1:58 PM 33/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





bool dcsUiBase_Init()

{

// Verify if the init is done

if( globalExists( "dcsUiACDomain" ) )

{

DebugTN("dcsUiBase_Init(): ver."+DCSUI_VERSION+" Intialization phase

done. Skipped !");

return(false);

}



DebugTN("dcsUiBase_Init(): ver."+DCSUI_VERSION+" Intialization phase...");



// Define the globals variables

addGlobal("dcsUiRootNode", STRING_VAR);

addGlobal("dcsUiRootObj", STRING_VAR);

addGlobal("dcsUiAmzSubServList", STRING_VAR);

addGlobal("dcsUiAmzTitle", STRING_VAR);

addGlobal("dcsUiAmzRow", DYN_STRING_VAR);

// addGlobal("dcsUiACGrantList", DYN_DYN_STRING_VAR);

addGlobal("dcsUiACDomain", STRING_VAR);

addGlobal("dcsUiACCentralized", BOOL_VAR);

addGlobal("dcsUiACServerName", STRING_VAR);



// Verify the presence of Config file

if( getFileSize(getPath(CONFIG_REL_PATH) + "dcsUi.config") == -1)

{

DebugTN("dcsUiBase_Init(): ERROR Wrong dcsUi.config File !! Init

Aborted.");

return(false);

}



// Read the config file variables

string fi = getPath(CONFIG_REL_PATH) + "dcsUi.config";

int val = 0;

string result= "";



// read the Hierarchy

string sec = "Hierarchy";

if(paCfgReadValue(fi,sec, "RootNode",result) != 0 )

{

DebugTN("dcsUiBase_Init(): ERROR accessing dcsUi.config file!

("+fi+":"+sec+":RootNode)" );

return(false);

}

dcsUiRootNode = result;

result = "";

val += paCfgReadValue(fi,sec, "RootObject",result);

dcsUiRootObj = result;



// read the AMZ

string sec = "AuxiliaryMonitoringZone";

result = "";

val += paCfgReadValue(fi,sec, "Title",result);

dcsUiAmzTitle = result;

result = "";

val += paCfgReadValue(fi,sec, "Row1",result);

dynAppend(dcsUiAmzRow,result);

result = "";

val += paCfgReadValue(fi,sec, "Row2",result);

dynAppend(dcsUiAmzRow,result);

result = "";

val += paCfgReadValue(fi,sec, "Row3",result);

dynAppend(dcsUiAmzRow,result);

result = "";







20/10/2011 - 1:58 PM 34/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





val += paCfgReadValue(fi,sec, "Row4",result);

dynAppend(dcsUiAmzRow,result);

result = "";

val += paCfgReadValue(fi,sec, "Row5",result);

dynAppend(dcsUiAmzRow,result);

// result = "";

// val += paCfgReadValue(fi,sec, "SubServicesItems",result);

dcsUiAmzSubServList= "";





// read the Access Control Def.

string sec = "AccessControl";

dyn_string dsAppo;



result = "";

val += paCfgReadValue(fi,sec, "UseCentralizedAC",result);

dcsUiACCentralized = (strtoupper(result) == "YES") ? true : false;



result = "";

val += paCfgReadValue(fi,sec, "CentralizedACServer",result);

dcsUiACServerName =result;



result = "";

val += paCfgReadValue(fi,sec, "ACDomain",result);

dcsUiACDomain = result;





// Now it ends -----

DebugTN("dcsUiBase_Init(): init DONE !");

return( (val == 0) ? true : false );

}

// ------------------------------------------------------------





/* ------------------------------------------------------------

Funtion for Get a Param from the Config File



F.A. ver 1.0 19/6/2006



History



19/06/2006 - Creation

------------------------------------------------------------ */

string dcsUiBase_getConfigParam(string section, string name)

{

int val = 0;

string result= "";

string fi = getPath(CONFIG_REL_PATH) + "dcsUi.config";



if(paCfgReadValue(fi, section, name ,result) != 0 )

{

DebugTN("dcsUiBase_getConfigParam(): ERROR accessing dcsUi.config file!

("+fi+":"+section+":"+name+")");

return("");

}

return(result);

}





/* ------------------------------------------------------------

Funtion for Get the AC grants defined into the config

file Grants list



F.A. ver 1.0 19/6/2006







20/10/2011 - 1:58 PM 35/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









History



19/06/2006 - Creation

------------------------------------------------------------ */

void dcsUiBase_getACGrants(bool & isDeveloper,bool & isExpert,

bool & isOperator, bool & isObserver)

{

dyn_string exceptionInfo;



fwAccessControl_isGranted(dcsUiACDomain+":Monitor",isObserver,

exceptionInfo);

if (dynlen(exceptionInfo)) { return; }



fwAccessControl_isGranted(dcsUiACDomain+":Control",isOperator,

exceptionInfo);

if (dynlen(exceptionInfo)) { return; }



fwAccessControl_isGranted(dcsUiACDomain+":Debug",isExpert,

exceptionInfo);

if (dynlen(exceptionInfo)) { return; }



fwAccessControl_isGranted(dcsUiACDomain+":Modify",isDeveloper,

exceptionInfo);

if (dynlen(exceptionInfo)) { return; }



}

// ------------------------------------------------------------





/* ------------------------------------------------------------

Funtion for set the title into the Main DCS Window



F.A. ver 1.0 19/6/2006



History



19/06/2006 - Creation

30/10/2006 - Add the Existence verify

------------------------------------------------------------ */

void dcsUiBase_setMainTitle(string title)

{

if(!shapeExists("txtTitlePanel")) return;

if(strlen(title) > 60 && strpos(title,"\n") < 0)

{



setValue("txtTitlePanel","text",substr(title,0,59)+"\n"+substr(title,60));

}

else

setValue("txtTitlePanel","text",title);

}

// ----------------------------------------------------------





/* -------------------------------------------------------------

Function for get the status of a One Manager



F.A. ver 1.0 03/10/2006



History



03/10/2006 - Creation

-------------------------------------------------------------- */









20/10/2011 - 1:58 PM 36/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





bool dcsUiBase_getMgrState(string sSystemName, string sManagerName, string

sManType, int iManNum = -1 )

{

dyn_int diManNums;

string sManTypeU = "";

sManType = strtoupper(substr(sManType,0,1))+strtolower(substr(sManType,1));

sManTypeU = strtoupper(sManType);



if(iManNum == -1)



dpGet(sSystemName+":_Connections."+sManType+".ManNums:_original.._value",diManN

ums);

else

dynAppend(diManNums,iManNum);



return(dcsUiBase_getMgrsState(sSystemName, sManagerName, sManType, diManNums));

}



/* -------------------------------------------------------------

Function for get the status of a List of Managers



F.A. ver 1.0 03/10/2006



History



03/10/2006 - Creation

-------------------------------------------------------------- */

bool dcsUiBase_getMgrsState(string sSystemName, string sManagerName, string

sManType, dyn_int diManNums)

{



dyn_string dsResults;

dyn_string dsAppo;

string sResult = "";

int count =0;

int j = 0;

int i=0;

string sDebDP = "";

string sManTypeU = "";



sManType = strtoupper(substr(sManType,0,1))+strtolower(substr(sManType,1));

sManTypeU = strtoupper(sManType);



for(i=1;i<=dynlen(diManNums);i++)

{

sDebDP = sSystemName+":_CtrlDebug_"+sManTypeU+"_"+(diManNums[i]);

if (dpExists(sDebDP))

{

count = 0;

dynClear(dsResults);

dpSetWait(sDebDP+".Command:_original.._value", "info scripts");

while ( dynlen(dsResults) < 1 && count < 40)

{

delay(0,50);

dpGet(sDebDP+".Result:_online.._value", dsResults);

count ++;

}

for(j=1; j <= dynlen(dsResults);j++)

{

dsAppo = strsplit(dsResults[j], ";");

if( dsAppo[dynlen(dsAppo)] == sManagerName)

return(true);

}

}







20/10/2011 - 1:58 PM 37/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





}

return(false);

}

// ------------------------------------------------------------



/* -------------------------------------------------------------

Function to convert the status of LHC into message



F.A. ver 1.0 20/10/2006



History



-------------------------------------------------------------- */

bool dcsUiBase_LHCStatus2Mess(int iStatus, int iType=0)

{

if(iType == 0)

{

switch(iStatus)

{

case DCSUI_LHC_CYCLE_PREPARE:

return("PREPARE");

break;

case DCSUI_LHC_CYCLE_PRE_INJECTION:

return("PRE INJECTION");

break;

case DCSUI_LHC_CYCLE_INJECTION:

return("INJECTION");

break;

case DCSUI_LHC_CYCLE_FILLING:

return("FILLED");

break;

case DCSUI_LHC_CYCLE_RAMP:

return("RUMP");

break;

case DCSUI_LHC_CYCLE_ADJUST:

return("ADJUST");

break;

case DCSUI_LHC_CYCLE_UNSTABLE_BEAMS:

return("UNSTABLE BEAMS");

break;

case DCSUI_LHC_CYCLE_STABLE_BEAMS:

return("STABLE BEAMS");

break;

case DCSUI_LHC_CYCLE_BEAM_DUMP:

return("BEAM DUMP");

break;

case DCSUI_LHC_CYCLE_RECOVER:

return("RECOVER");

break;

case DCSUI_LHC_CYCLE_PRE_CYCLE:

return("PRE CYCLE");

break;

default:

return("UNDEFINED");

break;

}

}

else

{

switch(iStatus)

{

case DCSUI_LHC_SCHEDULE_SHUTDOWN:

return("SHUTDOWN");

break;







20/10/2011 - 1:58 PM 38/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





case DCSUI_LHC_SCHEDULE_CHECKOUT:

return("CHECKOUT");

break;

case DCSUI_LHC_SCHEDULE_PROTON_RUN:

return("PROTON RUN");

break;

case DCSUI_LHC_SCHEDULE_ION_RUN:

return("ION RUN");

break;

case DCSUI_LHC_SCHEDULE_HIGH_BETA_RUN:

return("HIGH BETA RUN");

break;

case DCSUI_LHC_SCHEDULE_MACHINE_DEVELOPMENT:

return("MACHINE DEVELOPMENT");

break;

default:

return("UNDEFINED");

break;

}

}

}



/* -------------------------------------------------------------

Function to convert the status of LHC into color



F.A. ver 1.0 20/10/2006



History



-------------------------------------------------------------- */

string dcsUiBase_LHCStatus2Col(int iStatus)

{

switch(iStatus)

{

case DCSUI_LHC_CYCLE_PREPARE:

return("FwStateOKNotPhysics");

break;

case DCSUI_LHC_CYCLE_PRE_INJECTION:

return("FwStateOKNotPhysics");

break;

case DCSUI_LHC_CYCLE_INJECTION:

return("FwStateAttention1");

break;

case DCSUI_LHC_CYCLE_FILLING:

return("FwStateOKNotPhysics");

break;

case DCSUI_LHC_CYCLE_RAMP:

return("FwStateAttention1");

break;

case DCSUI_LHC_CYCLE_ADJUST:

return("FwStateAttention1");

break;

case DCSUI_LHC_CYCLE_UNSTABLE_BEAMS:

return("FwStateAttention2");

break;

case DCSUI_LHC_CYCLE_STABLE_BEAMS:

return("FwStateOKPhysics");

break;

case DCSUI_LHC_CYCLE_BEAM_DUMP:

return("FwStateOKNotPhysics");

break;

case DCSUI_LHC_CYCLE_RECOVER:

return("FwStateAttention2");

break;







20/10/2011 - 1:58 PM 39/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





case DCSUI_LHC_CYCLE_PRE_CYCLE:

return("FwStateOKNotPhysics");

break;

default:

return("FwStateAttention3");

break;

}



}





/* ==============================================================

FSM FUNCTIONS WRAPPER SECTION



This section is for Wrapping the FSM private function



================================================================ */



/* -------------------------------------------------------------

Function to open the FSM Control Panel



F.A. ver 1.0 15/11/2006



History



-------------------------------------------------------------- */

dcsUi_openFsmControlPanel(string node,string object, int mode=DCSUI_FSM_MODLESS)

{

string panel;



switch(mode)

{

case DCSUI_FSM_MODAL:

fwUi_setTopDomain(node, object, "");

ChildPanelOnModal("dcsUi/dcsUiFsmUi.pnl", "FSM Control :"+object,



makeDynString("$node:" + node, "$obj:" + object, "$mode:MODAL" ),

75, 100);



break;

case DCSUI_FSM_MODLESS:

fwUi_setTopDomain(node, object, "");



ModuleOnWithPanel ("FSM Control :"+object,

75, 100, 0, 0,

1, 1, "None",

"dcsUi/dcsUiFsmUi.pnl", "FSM Control :"+object,

makeDynString("$node:" + node, "$obj:" + object,

"$mode:MODLESS"));



/*



RootPanelOn("dcsUi/dcsUiFsmUi.pnl", "FSM Control :"+object,



makeDynString("$node:" + node, "$obj:" + object, "$mode:MODLESS" ),

75, 100);



*/

break;



// fwUi_showFsmObject(node, object, node);

break;

}

}







20/10/2011 - 1:58 PM 40/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









/* -------------------------------------------------------------

Place an FSM Object with a CU type lock in the FSM main panel.



F.A. ver 1.0 15/11/2006



History

Imported from Fsm 24.13



@param node: The node name (CU) for this panel (available in $node).

@param obj: The object name (a CU) (either $obj or the result of

fwFsmUi_getXXXChildren()).

@param x: The X coordinate for the Object.

@param y: The Y coordinate for the Object.

@return The X coordinate of the end of the object, if the user wants to

place an adjacent widget



-------------------------------------------------------------- */

int dcsUi_addFsmObjWithLock(string node, string obj, int x, int y, string part =

"", string mode = "MODAL")

{

int nextx;

addSymbol(myModuleName(),myPanelName(),"dcsUi/dcsUiFsmObjWithLock.pnl",

obj,

makeDynString("$domain:"+node,"$obj:"+obj,"$part:"+part,"$mode:"+mode),

x, y, 0,1,1);

nextx = x+181+130+22;

return nextx;

}



/* -------------------------------------------------------------

Place an FSM Object with a LU/DU/Obj type lock (enable/disable widget) in the

FSM main panel.



F.A. ver 1.0 15/11/2006



History

Imported from Fsm 24.13



@param node: The node name (CU) for this panel (available in $node).

@param obj: The object name (a CU) (either $obj or the result of

fwFsmUi_getXXXChildren()).

@param x: The X coordinate for the Object.

@param y: The Y coordinate for the Object.

@return The X coordinate of the end of the object, if the user wants to

place an adjacent widget



-------------------------------------------------------------- */

int dcsUi_addFsmObjWithDevLock(string node, string obj, int x, int y, string part

= "",string mode = "MODAL")

{

int nextx;

addSymbol(myModuleName(),myPanelName(),"dcsUi/dcsUiFsmObjWithDevLock.pnl",

obj,

makeDynString("$domain:"+node,"$obj:"+obj,"$part:"+part,"$mode:"+mode),

x, y, 0,1,1);

nextx = x+181+130+22;

return nextx;

}



/* -------------------------------------------------------------

initialize the FSM.



F.A. ver 1.0 25/11/2006







20/10/2011 - 1:58 PM 41/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









History



-------------------------------------------------------------- */

void dcsUi_FsmInitialize()

{

// --- NOT Public FSM Functions Call ------

fwFsm_startShowFwObjects();

fwFsm_initialize();

}



/* -------------------------------------------------------------

Get the user Panel associated with an FSM object.



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

void dcsUi_getFsmUserPanel(string domain, string object, string &PanelName)

{

string sAp;



// --- NOT Public FSM Function call ------------------------

fwUi_getUserPanel(domain, object, sAp);



PanelName = sAp;

}



/* -------------------------------------------------------------

Get the user Panel Path .



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

string dcsUi_getFsmPanelPath(string Panel)

{

// --- NOT Public FSM Function call ------------------------

return(fwUi_getPanelPath(Panel));

}



/* -------------------------------------------------------------

Get the Label of a Fsm Node.



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

void dcsUi_getFsmLabel(string domain, string object, string &label)

{

string sAp;



// --- NOT Public FSM Function call ------------------------

fwUi_getLabel(domain, object, sAp);

label = sAp;

return;

}



/* -------------------------------------------------------------

Test if an object is a DU









20/10/2011 - 1:58 PM 42/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

bool dcsUi_FsmIsDU(string domain, string object)

{

// --- NOT Public FSM Function call ------------------------

return(fwFsm_isDU(domain,object));

}



/* -------------------------------------------------------------

Test if an object is a CU



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

bool dcsUi_FsmIsCU(string domain, string object)

{

// --- NOT Public FSM Function call ------------------------

return(fwFsm_isCU(domain,object));

}





/* -------------------------------------------------------------

Get the Device Physical Name



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

string dcsUi_getFsmPhysicalDeviceName(string domain, string object)

{

string sAp, device;

// --- NOT Public FSM Function call ------------------------

fwUi_getDomainSys(domain, sAp);

device = fwFsm_getPhysicalDeviceName(sAp+object);

return(sAp+device);

}



/* -------------------------------------------------------------

Get the Node/Obj for associated



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

void dcsUi_translateFsmNodeObj(string &node, string &obj)

{



// --- NOT Public FSM Function call ------------------------

if(fwFsm_isAssociated(obj))

{

node = fwFsm_getAssociatedDomain(obj);

obj = fwFsm_getAssociatedObj(obj);

// ---------------------------------------------------------

}

else

{

// node = node;







20/10/2011 - 1:58 PM 43/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





// obj = obj;

}

}



/* -------------------------------------------------------------

Show an FSM object



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

void dcsUi_showFsmObject(string node, string obj, string sParent)

{

// --- NOT Public FSM Function call ------------------------

fwUi_showFsmObject(node, obj, sParent);

// ---------------------------------------------------------

}



/* -------------------------------------------------------------

Simple FSM initialize



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

void dcsUi_FsmSimpleInitialize()

{

// --- NOT Public FSM Function call ------------------------

fwFsm_initialize(0);

// ---------------------------------------------------------

}



/* -------------------------------------------------------------

Get the FSM Hierarchy



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

string dcsUi_FsmGetDomains()

{

// --- NOT Public FSM Function call ------------------------

return( fwFsm_getDomains() );

// ---------------------------------------------------------

}



/* -------------------------------------------------------------

Get the Mode Bits



F.A. ver 1.0 25/11/2006



History



-------------------------------------------------------------- */

bit32 dcsUi_FsmGetCUModeBits(string SubDomain)

{



// --- NOT Public FSM Function call ------------------------

return(fwUi_getCUModeBits(SubDomain) );

// ---------------------------------------------------------}

}







20/10/2011 - 1:58 PM 44/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









/* -------------------------------------------------------------

Get the Ownership



F.A. ver 1.0 07/12/2006



History



-------------------------------------------------------------- */

string dcsUi_FsmGetOwnership( string node)

{

string result;

fwUi_getOwnership(node, result);

return(result);

}



// ============================ EOF ===========================









20/10/2011 - 1:58 PM 45/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









COOKBOOK for the GRAPHIC LOCATOR CREATION

In order to build a graphic locator widget, let‟s assume the detector has the followings Logical

View:



Hierarchy FSM Type

XXX_DETECTOR C.U.

XXX_SECTOR1 C.U.

XXX_PART1_1 L.U.

XXX_PART1_2 L.U.

XXX_SECTOR2 C.U.

XXX_PART2_1 L.U.

XXX_INFRASTRUCTURE C.U.

XXX_INFR_CRATE1 L.U.

XXX_INFR_CRATE2 L.U.



Then the corresponding graphic view of the detector can be the following:





SECTOR1

SECTOR1 PART 2

PART 1



CRATE1





CRATE2





SECTOR2

PART 1

INFRASTRUCTURE





First of all we open the template file xxxDetector/xxxUiLocator.pnl and build the graphic schema

of the detector.









Then assign the names to all the objects as showed in the figure.



20/10/2011 - 1:58 PM 46/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF









Sec1 Sec2 Infr Cr1



Sec3 Cr2



Now open the Script Editor Windows and start to write the scripts in the NoName_General

section.

First of all write the function that reset the background color of all the objects:



__resetBack()

{

setMultiValue("Sec1", "backCol", "{128,128,128}",

"Sec2", "backCol", "{128,128,128}",

"Sec3", "backCol", "{128,128,128}",

"Infr", "backCol", "{128,128,128}",

"Cr1", "backCol", "{128,128,128}",

"Cr2", "backCol", "{128,128,128}");

}





Then the function that makes invisible all objects :



__invisible()

{

setMultiValue("Sec1", "visible", false,

"Sec2", "visible", false,

"Sec3", "visible", false,

"Infr", "visible", false,

"Cr1", "visible", false,

"Cr2", "visible", false);

}





Now we define the function that makes visible some objects according to the “Logical name”

passed as parameter :



__visible(string what)

{

switch(what)

{

case “XXX_DETECTOR”: // all sectors and rack switched on

setMultiValue("Sec1", "visible", true,





20/10/2011 - 1:58 PM 47/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





"Sec2", "visible", true,

"Sec3", "visible", true,

"Infr", "visible", true);

break;

case “XXX_SECTOR1”: // all sectors switched on

case “XXX_SECTOR2”:

case “XXX_PART1_1”:

case “XXX_PART1_2”:

case “XXX_PART2_3”:

setMultiValue("Sec1", "visible", true,

"Sec2", "visible", true,

"Sec3", "visible", true);

break;

case XXX_INFRASTRUCTURE: // switch rack and crates

case XXX_INFR_CRATE1:

case XXX_INFR_CRATE2:

setMultiValue("Infr", "visible", true,

"Cr1", "visible", true,

"Cr2", "visible", true);

break;

}

}





And finally the script that change the background color according the object:



__setDisplay( string object )

{

// switch off/on objects

__invisible();

__visible(object);



// set the white back ground

switch(object)

{

case “XXX_DETECTOR”: // all sectors and rack switched on

setMultiValue("Sec1", "backCol", "{254,251,251}",

"Sec2", "backCol", "{254,251,251}",

"Sec3", "backCol", "{254,251,251}",

"Infr", "backCol", "{254,251,251}");

txtDescr.text = "XXX DETECTOR";

break;

case “XXX_SECTOR1”: // part 1 & 2 of sector 1 are switched on

setMultiValue("Sec1", "backCol", "{254,251,251}",

"Sec2", "backCol", "{254,251,251}");

txtDescr.text = "SECTOR 1";

break;

case “XXX_SECTOR2”: // part 1 of sector 2 is switched on

setMultiValue("Sec3", "backCol", "{254,251,251}");

txtDescr.text = "SECTOR 2";

break;

case “XXX_PART1_1”: // part 1 of sector 1 is switched on

setMultiValue("Sec1", "backCol", "{254,251,251}");

txtDescr.text = "PART1 – SEC1";

break;

case “XXX_PART1_2”: // part 2 of sector 1 is switched on

setMultiValue("Sec2", "backCol", "{254,251,251}");

txtDescr.text = "PART2 – SEC1";

break;

case “XXX_PART2_1”: // part 1 of sector 2 is switched on

setMultiValue("Sec3", "backCol", "{254,251,251}");

txtDescr.text = "PART1 – SEC2";

break;

case “XXX_INFRASTRUCTURE”: // the rack is switched on





20/10/2011 - 1:58 PM 48/49 13d71532-933c-4839-b317-1b313f92a388.doc

ALICE DCS ALICE DCS USER INTERFACE COMPONENT GDC/AF





setMultiValue("Infr", "backCol", "{254,251,251}");

txtDescr.text = "INFRASTR. RACK";

break;

case “XXX_INFR_CRATE1”: // the first crate is switched on

setMultiValue("Cr1", "backCol", "{254,251,251}");

txtDescr.text = "POWER CRATE";

break;

case “XXX_INFR_CRATE2”: // the secont crate is switched on

setMultiValue("Cr2", "backCol", "{254,251,251}");

txtDescr.text = "VME TRIGGER";

break;

}

}





Then rename and save the panel in the relevant directory.









Example of panel at Run Time









20/10/2011 - 1:58 PM 49/49 13d71532-933c-4839-b317-1b313f92a388.doc


Related docs
Other docs by Stariya Js @ B...
et-103
Views: 0  |  Downloads: 0
0411540177524_65427
Views: 0  |  Downloads: 0
6.Edgars_Minhene
Views: 0  |  Downloads: 0
DISSERTAODIOTTOFINAL
Views: 0  |  Downloads: 0
sean-cunningham
Views: 0  |  Downloads: 0
HWS4
Views: 2  |  Downloads: 0
Object+oriented+experiment+2
Views: 0  |  Downloads: 0
A_secret_Reveal__a_Mission_Planned
Views: 0  |  Downloads: 0
karensimonresume
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!