View Source London: Solving Layout Problems with CSS Grid & Friends
CSS traininghandout - KEK · CSS view. In the CSS context, a view is an element of the user...
Transcript of CSS traininghandout - KEK · CSS view. In the CSS context, a view is an element of the user...
1
2
3
TheControlSystemStudio(CSS)isanEclipseRCPbaseddevelopmentpla?ormandthefundamentformanyapplicaAonslikeEPICS,TANGOetc.AsmostoftheseapplicaAonsdealwithprocessvariablesandconnecAonstocontrolsystems,theCSSCoreprovidesthenecessaryAPIsforaconvenientstart.TheintegrateddevelopmentenvironmentofCSSprovidesfacilityfordatabasedevelopment,alarmmanagementsystem,displaydevelopmentandconversion,datatrending,diagnosActoolsetc.
ProcessvariableaddresssyntaxThegeneralsyntaxofaprocessvariableaddressisdefinedasfollows.ThisusesthemetasyntaxbasedontheExtendedBackus‐NaurForm[1]address::=[protocol]id[type][2]protocol::=('dal‐epics'|'dal‐Ane'|'dal‐tango'|'local')'://'[3]id::=(leXer|specialcharacter)+[4]type::=','('double'|'int'|'long'|'string'|'enum')[5]leXer::='A'|...|'Z'|'a'|...|'z'[6]specialcharacter::=':'|'/'|'\'|'.'|'['|']'[7]number::=digitWithoutZero(digit)*[8]digit::='0'|...|'9'[9]digitWithoutZero::='1'|...|'9'Thereare3opAonaland1mandatoryfragmentsthatconsAtuteafullprocessvariableaddress(line1).Theprotocol(line2)isopAonalanddefinestheconnecAonprotocol.Ifaprefixisnotspecified,adefaultprotocolischosenaccordingtothesefngsoftheCSS‐Core/Control‐Systempreferencepage.Theid(line3)ismandatory.ItmustbeagloballyuniquenameidenAfyingtheinformaAonyouwanttoaddress.Thetype(line5)isopAonal,too.Itcanbeusedtospecifytheexpectedreturntypeforchannelvaluesexplicitly.
4
SyntaxforEPICSWhenEPICSchannelsareaddressed,line3isasfollows:[3a]id::=recordname['.'fieldname][characterisAc][10]recordname::=(leXer|specialcharacter)+[11]fieldname::=(leXer)+[12]characterisAc::='['(leXer)+']'AnEPICSprocessvariableisalwaysidenAfiedbyitsrecordname(line10)whichisthereforemandatory.OpAonallyafieldnamecanbeprovidedtoaddressasinglefieldofarecord(line11).Ifnofieldnameisprovidedtheaddressdefaultstothe.VALfield.ThecharacterisAc(line12)isopAonalaswell.IfdefineditallowsforaccessingaddiAonalinformaAonofarecordwithoutestablishinganewconnecAon.AllcharacterisAcsofthesamerecordsharethesameconnecAon.SoingeneralitisagoodideatousecharacterisAcswheneverpossibletosavesystemresources.Thesecanbe
[PosiAon]‐posiAon[DescripAon]–longdescripAon[displayName]–shortdescripAon[propertyType]‐type[resoluAon]–numberofbitsusedforADCconversionofanalogvaluewhensampled[minimum]–minimumallowedvalue[maximum]–maximumallowedvalue[graphMin]–minimumallowedvaluewhendisplayed(e.g.inachart)[graphMax]–maximumallowedvaluewhendisplayed(e.g.inachart)[format]–Cprint‐fstyleformatthatisusedtorenderthevalue[units]–unitsofthevalue[scaleType]–scaletypeforplofng(linearorlogarithmic)[warningMax]–upperwarninglimit[warningMin]–lowerwarninglimit[alarmMax]–upperalarmlimit[alarmMin]–loweralarmlimit[sequenceLength]–sequencelength[enumValues]–enumvaluearray(returnsObject[])[enumDescripAons]–enumvaluedescripAons(returnsString[])[bitDescripAons]–bitdescripAons(returnsString[])[condiAonWhenSet]–acAvebitsignificance[condiAonWhenCleared]‐inacAvebitsignificance[bitMask]–bitsrelevance
5
SimpleDALallowstouseacertainsyntaxforaccessingPVs.
TheDataAccessLayer(DAL)isthecoreoftheconnecAonAPIs.ItcommunicatestoEPICSthroughCAJ(ChannelAccessJava),whichisapureJavaimplementaAonoftheCAprotocol.Inthe(near)futureitwillbepossibletoconnecttoTINEandTANGOcontrolsystemsthroughDALaswell.ATINEintegraAonisalreadyavailableasBeta.DALisaninherentpartoftheCSSCorebutcanalsobeusedasalibraryinanyotherJavaapplicaAon.SimpleDALisaconnecAonlayerbuiltontopofDAL.Itprovidesaslim,lesscomplexAPIthatallowsforamucheasierstartfordevelopersdealingwithprocessvariablesintheirapplicaAons.UsingSimpleDALimpliesacertainsyntaxforprocessvariableaddressesthatenablesapplicaAonstomakeuseofthefollowingfeatures:•accessdifferentcontrolsystems(e.g.TINEandEPICS)inoneapplicaAon•usecharacterisAcs,aconceptforresourcesavingaccesstorecordfields•queryprocessvariablesindifferenttypes•usesimulatedchannels•addresssystemfuncAonsasprocessvariable
6
ItisrecommendedthatthestandardversionofCSSshouldbedownloadedforthefirstuse.ItconsistsoftheCSSpla?ormandcommoncontrolsystemapplicaAons.
Pre‐requisites‐Javaversion1.6orhigherisrequiredDownload‐ThelinktothisishXp://css.desy.de/content/e413/index_eng.htmlPleasechoosetheversionaccordingtoyouroperaAngsystem.Extrac<ng–extractthedownloadedzipfileinadirectoryofyourchoice.Star<ng
Windows–Runthefilecss.exeunderCSS<Top>.Linux–Setexecutablemodeforthefile‘css’underCSS<top>andrun
Login‐TheXMPPlogincanbecancelledforiniAaluse.ThisloginsyouasanonymoususerintotheXMPPserverspecifiedinthepreferences.TheXMPPserverisusedforremotemanagement.OnecanalsosetuphisownXMPPserver.
7
CSSConsoleTheCSScontainsitsownconsole.ThisconsoledisplaysystemmessagesofcertaineventsandinformaAonaboutoccurrederrors.
FileNew‐Createanewfolder,resource,SwitchWorkspace‐ChangetheworkspaceoftheCSSinstance.Exportpreferences‐WritecurrentpreferencesoftheCSSinstanceinafile.OpenWorkspaceNavigator‐Opentheview'Workspace'.Import‐ImportresourcefromCVSintheworkspace.Exit‐ShutdownyourCSSinstallaAon.
Quickstart‐TheQuickstartmenuholdslinkstoSynopAcDisplaysintheworkspace.Theycanbeaddedviacontextmenuofadisplay.
WindowOpeninNewWindow‐OpenanewCSSwindow.OpenPerspecAve‐SelectandopenaparAcularCSSperspecAve.IntheCSScontext,aperspecAveisasetofuserinterfaceelementsthatareposiAonedinacertainway.ShowView‐OpenaparAcularCSSview.IntheCSScontext,aviewisanelementoftheuserinterfacethatdisplayssomethingandcanbefreelyarrangedbytheuser.
HelpWelcomeAboutCSS‐Openthe“About”dialogthatcontainstheCSSlicenseagreement.HelpContents‐OpentheCSShelpsystem.ThereyoumayfindamoredetaileddescripAonofthebasicuserinterfaceconceptsandallsystemsefngs.KeyAssist‐Openanoverviewofallshortcuts.CheatSheets‐ShowsavailableCheatSheets.CheatSheetsarestepbystepdocumentaAons.So}wareUpdates‐ManagethelocalCSSinstallaAonbyinstallingandupdaAngfeatures.‐>findandinstall‐>searchfornewfeaturestoinstall
8
• UsedtospecifytheEPICSIOClocaAonandotheraXributes• GotoCSSMenu‐>CSS‐>Preferences‐>CSScore‐>Controlsystem• SetthedefaultcontrolsystemasEPICS• Under‘CSScore’menuitem,goto‘EPICS’• SettheEPICSpreferenceshere.
9
CSSpluginsarethevarioustoolsavailablewithit.ToaddtheseintotheCSS:
• GotoCSSmenu‐>Help‐>So}wareupdates‐>FindandInstall• Select“Selectfornewfeaturestoinstall”• Selectthecheckboxfor“Controlsystemstudioupdatesite”• Click“Finish”• Expandthetreefor“Controlsystemstudioupdatesite”• Selectthepluginyouwanttoinstallandclick“selectrequired”buXon.• Go“next”andacceptlicenseagreement.• Nextandclick“Finish”• TheinstalledpluginwillnowappearintheCSSmenuunderappropriatecategory
10
Tomakeanewproject• GotoFile‐>New‐>other‐>General‐>Project• Nametheproject• Youcanmakenewfoldersorfilesinsideaproject• Tomakeafolder,rightclicktheprojectinthenavigator‐>New‐>other‐>General‐>folder• Tomakeanewfile,rightclicktheprojectinthenavigator‐>New‐>other‐>chooseaccordingly
11
Synop<cDisplayStudioSynopAcDisplayStudio(SDS)isagraphicaloperatorinterfacethatrepresentsthestructureandcurrentstateofaplant.Thestructureiscomposedofbasicelementssocalledwidgetslikelabels,metersorbargraphs.TobuildupapartofaplantthewidgetscanbearrangedintheeditmodeofSDSondisplays.Intheexecuteorrunmodetheoperatorscancontroltheprocessesviathedisplays.
NavigatorThenavigatorviewshowstheCSSprojectsintheworkspace.ACSSprojectholdstheconfiguraAonfilesforSDSdisplaysandfilesofotherCSSapplicaAons.Editor/PaleGeTheEditorshowsthedisplaysintheeditmodeandprovidesgrid,align,ruler,etc.OntherightsideisthepaleXewithallavailablewidgets.ThereisadraganddropsupportthatconnectsaprocessvariablefromanotherCSSapplicaAonautomaAcallywithawidget.WidgetProperAesForeachselectedwidgetintheeditorthewidgetpropertyviewshowsallavailableproperAes.Itispossibletodynamise*LINK*eachproperty.Thatmeansthatapropertyisconnectedtoaprocessvariableandchangeswiththevalueofthevariable.
12
Therearetwokindsofproperty• StaAc‐fixedduringexecuAonmode• Dynamic–changesduringexecuAonmode
Singlele}clickonapropertyonthePropertyViewtosetastaAcproperty.
Singlele}clickonapropertyopensaneditor.Therearesixgeneraleditors:‐‐Enteratext‐‐Enteranumber‐‐Chooseacolor‐‐Chooseafont‐‐Setaboolean‐‐Selectacomboitem
Andthreespecialeditors:‐‐Add/changealiases ‐‐Add/changeacAons‐‐GeneratetoolAp
13
• OpentheLayerManagementMenu:Window‐>ShowView‐>Other…‐>SynopAcDisplayStudio‐>LayerManagement• Insidethelayermanagementview,rightclicktoaddnewlayer,ormoveexisAng• Visibilityandorderofalayercanbechanged• Visibilityofalayercanbetoggleddynamically• Rightclickawidgettochangeitslayer
14
• Thepropertywith‘gearwheel’symbolisdynamic• Rightclickonpropertytoconfigureorremovedynamicaspects• Channelnamecanbetypeddirectly• AliascanbeusedinsteadofaPVname• DynamicproperAescanbeconfiguredbyrules(explainedlater)• EachwidgethasaPrimaryPV,itisusedwhenyouuse
• CopyPVtoclipboard• ForwardedtotheapplicaAonscalledbycontribuAonmenu• Tiptext
SoitisnecessarytodefineaprimaryPV
15
• AliasisamacrothatcanbeusedinsteadoflongPVnameorsyntax• Eachwidgetcanhaveseveralaliases(e.g.fordisplayingseveralplotsonstripchart)• Aliascanbeforwardedtoanewdisplay
16
• Colorcanbecustomizedforthese• RightclickonbackgroundcolorproperAestoconfiguredynamicaspects• GotoNext• Colorscanbesethere
17
• RulescanbeusedtodefinethedynamicbehaviorofwidgetproperAes• Therearetwotypesofrules
• Java• ECMA/JavaScript
• Scriptedrulefilesshouldbekeptat‘SDSScriptRules’folderundertheworkspace• ItisrecommendedthatJavaScriptrulesshouldbeusedforconfiguringdynamicproperAesinsteadofJava,asnocompilaAonisneededinthiscase
18
AcAondatasefngdefinestheacAonwhichisperformedwhenawidgetisacAvated(i.esayabuXonisclicked)
AcAonscanbeoftwotypes• Sendingvalue• Openadisplay
Eachwidgetcanhavearbitraryno.ofacAondata
AcAoncanbeexecutedfromthecontribuAonmenuaswell.ThecontribuAonmenuisinvokedbyrightclickingawidget‐>CSS‐><contribuAonmenu>
19
Cursorcanbechangedasthemousepointermovesoversomewidget
WidgetproperAeshaveafieldforchangingcursor
Therearetwokindofcursors
1. Systemcursors2. Other–acAonenabled,acAondisabled
20
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
21
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
22
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
23
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
24
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
25
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
26
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
27
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
28
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
29
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
30
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
31
DetaileddocumentaAonisfoundat
hXp://css.desy.de/content/e1576/e2369/SDS_Widgets_V0.10‐1.pdf
32
1. DefaultdisplayisthedefaultSDSfilewhichopensthroughthecontribuAonmenu(opendisplay)
2. Tosetthedefaultdisplaygotomainmenu‐>CSS‐>Preferences‐>CSSApplicaAons‐>Display‐>DefaultDisplay
3. Setthedefaultfileandthealiasname
4. QuickstartmenuisusedtoaddshortcuttoruntheSDSfilesdirectly.5. TheSDSfilesaddedtoquickstartmenuwilldirectlyopeninexecutemode6. Toaddfilestoquickstartmenu,rightclicktheSDSfileinnavigatorpane‐>addto
quickstart7. Toinvokedisplaysdirectlyfromquickstart,gotomainmenu‐>quickstart‐>(click
filename)8. Toeditquickstartpreferencesgotomainmenu‐>CSS‐>Preferences‐>CSS
ApplicaAons‐>UAliAes‐>Quickstart
33
WhatistheADLConverterTheADLConverterisaCSSPlugInthatconvertsControlSystemDisplays.ThisconvertsonlyfromADL‐FormattotheSynopAcDisplayStudioformatfromtheControlSystemStudio.
UsetheADLConverterThehandlingoftheADLConverterisverysimple.Firstclickthe“File"buXontochoosetheADL‐Fileswhichyouwanttoconvert.Thechosenfilesaredisplayedatthelistandareallselected.Secondclickthe"SelectPath"buXontochoosethetargetpathattheWorkspace.Andatlastclickthe"Convert"buXontoconverttheADL‐Files.OnlytheselectedFilesinthelistareconverted.
NewConversionToconvertothersetofADL‐Files,clearthelistby"Clear"buXonandchoosethenewADL‐Filesandanewtargetworkspacepath.Thenstartthenewconversion
34
ThePVTableprovidesatabularviewofPVnamesandtheircurrentvalue.Onecanstartandstoplivevalueupdates.InaddiAon,onecantakea"snapshot"ofcurrentvalues,whichgetssavedwhensavingthePVtabledocument.ThePVtabledisplayindicatescurrentvaluesthatdifferfromthe"snapshot"valuesinred.
OnecanconfiguretheupdaterateaswellasthethresholdforindicaAngdifferencesbetweenthecurrentvaluesandthosefromthesnapshot.
TostartwithPVtable1. Gotomainmenu‐>CSS‐>Display‐>PVTable2. Rightclicktheemptyareainthetable‐>3. WritethePVnametobemonitored,goonaddingnames4. AgreenLEDsymbolatthetopiconbarisforstarAngtheupdatesinPVtable.5. TheupdateratecanbeconfiguredbyrightclickonthePVtable‐>config
35
OverviewTheProbetoolallowsbasicreadingandwriAngofPVs.
Usage1. EnteranameintothePVnametextboxandenter.ThetoolwilldisplaythecurrentvalueofthegivenPVtogetherwithAmestampandstatus.2. The'Adjust'checkboxopensadialogforwriAnganewvaluetothePV.3. Thestatusbarprovideserrormessages.IfallisOK,itdisplaysaslowlyaveragedupdaterateofthePV.4. Italsodisplaysalarmzonesonthemeter5. Themetercanbedisabledalsofromthe‘Meter’checkbox
36
37