Class 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 method createDefaultProbe() a TransferMapProbe is created in the case of a ring. The method TransferMapState#setPhaseCoordinates is 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 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
      • 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:
        nextChannelFactory in class xal.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:
        putCompleted in interface xal.ca.PutListener
      • acceleratorChanged

        public void acceleratorChanged()
        Overrides:
        acceleratorChanged in class xal.extension.application.smf.AcceleratorDocument
      • selectedSequenceChanged

        public void selectedSequenceChanged()
        Overrides:
        selectedSequenceChanged in class xal.extension.application.smf.AcceleratorDocument
      • buildOnlineModel

        public void buildOnlineModel()
      • 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()
      • getNewDocumentName

        public String getNewDocumentName​(String arg0)
      • 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()
      • displayConfirmDialog

        public int displayConfirmDialog​(String arg0,
                                        String arg1)
      • displayWarning

        public void displayWarning​(String arg0,
                                   String arg1)
      • displayWarning

        public void displayWarning​(Exception arg0)
      • displayError

        public void displayError​(String arg0,
                                 String arg1)
      • displayError

        public void displayError​(Exception arg0)