Package xal.app.virtualaccelerator
Class VADocument
- java.lang.Object
-
- xal.extension.application.XalDocument
-
- xal.extension.application.smf.AcceleratorDocument
-
- xal.app.virtualaccelerator.VADocument
-
- All Implemented Interfaces:
ActionListener,Pageable,EventListener,xal.ca.PutListener
public class VADocument extends xal.extension.application.smf.AcceleratorDocument implements ActionListener, xal.ca.PutListener
CKA NOTES:
- In methodacreateDefaultProbe()TransferMapProbeis created in the case of a ring. The methodTransferMapState#setPhaseCoordinatesis called to create an initial static error. This does nothing because transfer map probes do not have phase coordinates any longer, the method is deprecated.
- The static noise for the above call is hard coded. As are many features in this class. VADocument is a custom AcceleratorDocument for virtual accelerator application.- Version:
- 1.6 13 Jul 2015
- Author:
- Paul Chu, Blaz Kranjc
-
-
Field Summary
Fields Modifier and Type Field Description xal.app.virtualaccelerator.DiagPlot_diagplotprotected xal.extension.application.Commandercommanderprotected xal.tools.messaging.MessageCentermessageCenterprotected xal.sim.scenario.ScenariomodelScenarioFor on-line modelstatic intNO_OPTIONprotected static StringSAVE_FAILED_TITLEprotected URLsourceprotected PlainDocumenttextDocumentThe document for the text pane in the main window.static StringWILDCARD_FILE_EXTENSIONstatic intYES_OPTION-
Fields inherited from class xal.extension.application.smf.AcceleratorDocument
accelerator, acceleratorFilePath, selectedSequence, selectedSequenceList
-
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
-
-
Constructor Summary
Constructors Constructor Description VADocument()Create a new empty documentVADocument(URL url)Create a new document loaded from the URL file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceleratorChanged()voidactionPerformed(ActionEvent ev)voidbuildOnlineModel()voidcustomizeCommands(xal.extension.application.Commander commander)intdisplayConfirmDialog(String arg0, String arg1)voiddisplayError(Exception arg0)voiddisplayError(String arg0, String arg1)voiddisplayError(String arg0, String arg1, Exception arg2)voiddisplayWarning(Exception arg0)voiddisplayWarning(String arg0, String arg1)voiddisplayWarning(String arg0, String arg1, Exception arg2)voidfreeCustomResources()StringgetCustomMenuDefinitionResource()FilegetDefaultFolder()URLgetDefaultFolderURL()StringgetDisplayFilePath()StringgetEmptyDocumentPath()StringgetFileNameForSaving()longgetModelSyncPeriod()get the model sync period in millisecondsStringgetNewDocumentName(String arg0)StringgetNewFileName()intgetNumberOfPages()PageFormatgetPageFormat(int arg0)PrintablegetPrintable(int arg0)protected xal.sim.scenario.ScenariogetScenario()URLgetSource()StringgetTitle()voidhandleDataWrittenTo(xal.tools.data.DataListener arg0, URL arg1)booleanhasChanges()voidhideDocument()booleanisEmpty()protected booleanisVARunning()voidmakeMainWindow()Make a main window by instantiating the my custom window.xal.ca.ChannelFactorynextChannelFactory()Override the nextChannelFactory() method to return this document's channel server factory.voidputCompleted(xal.ca.Channel chan)handle the CA put callbackprotected voidputDiagPVs()This method is for populating the diagnostic PVs (only BPMs + WSs for now) 2018-03-09 Added EMU, NPMs beam size and Current MonitorvoidsaveDocument()voidsaveDocumentAs(URL url)Save the document to the specified URL.voidselectedSequenceChanged()voidsetModelSyncPeriod(long period)update the model sync period in millisecondsvoidsetSource(URL arg0)voidshowDocument()voidupdate(xal.tools.data.DataAdaptor adaptor)booleanwarnUserOfUnsavedChangesWhenClosing()voidwillClose()handle this document being closedvoidwindowOpened()voidwindowWillOpen()String[]writableDocumentTypes()voidwriteDataTo(xal.tools.data.DataListener arg0, URL arg1)-
Methods inherited from class xal.extension.application.smf.AcceleratorDocument
acceleratorFilePathChanged, applySelectedAcceleratorWithDefaultPath, catchXmlDataAdaptorException, generateDocumentTitle, getAccelerator, getAcceleratorFilePath, getAcceleratorWindow, getNewFileNamePrefix, getSelectedSequence, getSelectedSequenceList, isSelectedSequenceRing, loadDefaultAccelerator, setAccelerator, setAcceleratorFilePath, setSelectedSequence, setSelectedSequenceList
-
-
-
-
Field Detail
-
textDocument
protected PlainDocument textDocument
The document for the text pane in the main window.
-
modelScenario
protected xal.sim.scenario.Scenario modelScenario
For on-line model
-
commander
protected xal.extension.application.Commander commander
-
_diagplot
public xal.app.virtualaccelerator.DiagPlot _diagplot
-
WILDCARD_FILE_EXTENSION
public static final String WILDCARD_FILE_EXTENSION
- See Also:
- Constant Field Values
-
YES_OPTION
public static final int YES_OPTION
- See Also:
- Constant Field Values
-
NO_OPTION
public static final int NO_OPTION
- See Also:
- Constant Field Values
-
SAVE_FAILED_TITLE
protected static final String SAVE_FAILED_TITLE
- See Also:
- Constant Field Values
-
messageCenter
protected xal.tools.messaging.MessageCenter messageCenter
-
source
protected URL source
-
-
Constructor Detail
-
VADocument
public VADocument()
Create a new empty document
-
VADocument
public VADocument(URL url)
Create a new document loaded from the URL file- Parameters:
url- The URL of the file to load into the new document.
-
-
Method Detail
-
nextChannelFactory
public xal.ca.ChannelFactory nextChannelFactory()
Override the nextChannelFactory() method to return this document's channel server factory.- Overrides:
nextChannelFactoryin classxal.extension.application.smf.AcceleratorDocument- Returns:
- this document's channel server factory
-
makeMainWindow
public void makeMainWindow()
Make a main window by instantiating the my custom window. Set the text pane to use the textDocument variable as its document.
-
getModelSyncPeriod
public long getModelSyncPeriod()
get the model sync period in milliseconds
-
setModelSyncPeriod
public void setModelSyncPeriod(long period)
update the model sync period in milliseconds
-
saveDocumentAs
public void saveDocumentAs(URL url)
Save the document to the specified URL.- Parameters:
url- The URL to which the document should be saved.
-
customizeCommands
public void customizeCommands(xal.extension.application.Commander commander)
-
willClose
public void willClose()
handle this document being closed
-
update
public void update(xal.tools.data.DataAdaptor adaptor)
-
getScenario
protected xal.sim.scenario.Scenario getScenario()
-
isVARunning
protected boolean isVARunning()
-
putDiagPVs
protected void putDiagPVs()
This method is for populating the diagnostic PVs (only BPMs + WSs for now) 2018-03-09 Added EMU, NPMs beam size and Current Monitor
-
putCompleted
public void putCompleted(xal.ca.Channel chan)
handle the CA put callback- Specified by:
putCompletedin interfacexal.ca.PutListener
-
acceleratorChanged
public void acceleratorChanged()
- Overrides:
acceleratorChangedin classxal.extension.application.smf.AcceleratorDocument
-
selectedSequenceChanged
public void selectedSequenceChanged()
- Overrides:
selectedSequenceChangedin classxal.extension.application.smf.AcceleratorDocument
-
buildOnlineModel
public void buildOnlineModel()
-
actionPerformed
public void actionPerformed(ActionEvent ev)
- Specified by:
actionPerformedin interfaceActionListener
-
writableDocumentTypes
public String[] writableDocumentTypes()
-
getCustomMenuDefinitionResource
public String getCustomMenuDefinitionResource()
-
getTitle
public String getTitle()
-
getSource
public URL getSource()
-
getDefaultFolder
public File getDefaultFolder()
-
getDefaultFolderURL
public URL getDefaultFolderURL()
-
setSource
public void setSource(URL arg0)
-
isEmpty
public boolean isEmpty()
-
getDisplayFilePath
public String getDisplayFilePath()
-
getFileNameForSaving
public String getFileNameForSaving()
-
getNewFileName
public String getNewFileName()
-
getEmptyDocumentPath
public String getEmptyDocumentPath()
-
hasChanges
public boolean hasChanges()
-
saveDocument
public void saveDocument()
-
writeDataTo
public void writeDataTo(xal.tools.data.DataListener arg0, URL arg1)
-
handleDataWrittenTo
public void handleDataWrittenTo(xal.tools.data.DataListener arg0, URL arg1)
-
warnUserOfUnsavedChangesWhenClosing
public boolean warnUserOfUnsavedChangesWhenClosing()
-
freeCustomResources
public void freeCustomResources()
-
windowWillOpen
public void windowWillOpen()
-
windowOpened
public void windowOpened()
-
showDocument
public void showDocument()
-
hideDocument
public void hideDocument()
-
displayWarning
public void displayWarning(Exception arg0)
-
displayError
public void displayError(Exception arg0)
-
getNumberOfPages
public int getNumberOfPages()
- Specified by:
getNumberOfPagesin interfacePageable
-
getPageFormat
public PageFormat getPageFormat(int arg0) throws IndexOutOfBoundsException
- Specified by:
getPageFormatin interfacePageable- Throws:
IndexOutOfBoundsException
-
getPrintable
public Printable getPrintable(int arg0) throws IndexOutOfBoundsException
- Specified by:
getPrintablein interfacePageable- Throws:
IndexOutOfBoundsException
-
-