Exemple #1
0
 def onClick(self, sender):
     self.status.setText('Button pressed')
     if sender == self.buttonupdate:
         self.commobj = AMS_Comm()
         self.status.setText(
             'Updating data: Press Display list button to refesh')
     if sender == self.button:
         if AMSJavascript.sent > AMSJavascript.recv:
             self.status.setText('Press button again: AMSJavascript.sent ' +
                                 str(AMSJavascript.sent) +
                                 ' AMSJavascript.recv ' +
                                 str(AMSJavascript.recv))
             return
         if self.commobj.commname == 'No AMS publisher running':
             self.status.setText(self.commobj.commname)
         else:
             self.status.setText('Memories for AMS Comm: ' +
                                 str(AMSJavascript.sent) +
                                 str(AMSJavascript.recv) +
                                 self.commobj.commname)
             result = self.commobj.get_memory_list()
             if self.tree: self.panel.remove(self.tree)
             self.tree = Tree()
             for i in result:
                 subtree = TreeItem(i)
                 memory = self.commobj.memory_attach(i)
                 fields = memory.get_field_list()
                 for j in fields:
                     field = memory.get_field_info(j)
                     subtree.addItem(j + ' = ' + str(field[4]))
                 self.tree.addItem(subtree)
                 self.panel.add(self.tree)
Exemple #2
0
 def onClick(self, sender):
     self.status.setText('Button pressed')
     if sender == self.buttonupdate:
         self.commobj = AMS_Comm()
         self.status.setText('Updating data: Press Display list button to refesh')
     if sender == self.button:
         if AMSJavascript.sent > AMSJavascript.recv: 
            self.status.setText('Press button again: AMSJavascript.sent '+str(AMSJavascript.sent)+' AMSJavascript.recv '+str(AMSJavascript.recv))
            return
         if self.commobj.commname == 'No AMS publisher running':
            self.status.setText(self.commobj.commname)
         else:
            self.status.setText('Memories for AMS Comm: '+str(AMSJavascript.sent)+str(AMSJavascript.recv)+self.commobj.commname)
            result = self.commobj.get_memory_list()
            if self.tree: self.panel.remove(self.tree)
            self.tree = Tree()
            for i in result:
               subtree = TreeItem(i)
               memory = self.commobj.memory_attach(i)
               fields = memory.get_field_list()
               for j in fields:
                  field = memory.get_field_info(j)
                  subtree.addItem(j+' = '+str(field[4]))
               self.tree.addItem(subtree)
               self.panel.add(self.tree)
Exemple #3
0
    def onModuleLoad(self):
        self.status = Label()
        self.button = Button(
            "Display list of all published memories and fields", self)
        self.buttonupdate = Button("Update data from AMS publisher", self)

        buttons = HorizontalPanel()
        buttons.add(self.button)
        buttons.add(self.buttonupdate)
        buttons.setSpacing(8)

        info = """<p>This example demonstrates the calling of the Memory Snooper in PETSc with Pyjamas and <a href="http://json-rpc.org/">JSON-RPC</a>.</p>"""

        self.panel = VerticalPanel()
        self.panel.add(HTML(info))
        self.panel.add(buttons)
        self.panel.add(self.status)
        RootPanel().add(self.panel)
        self.commobj = AMS_Comm()
        self.tree = None
        if AMSJavascript.sent > AMSJavascript.recv:
            self.status.setText('Press button again: AMSJavascript.sent ' +
                                str(AMSJavascript.sent) +
                                ' AMSJavascript.recv ' +
                                str(AMSJavascript.recv))
            return
        if self.commobj.commname == 'No AMS publisher running':
            self.status.setText(self.commobj.commname)
        else:
            self.status.setText('Memories for AMS Comm: ' +
                                str(AMSJavascript.sent) +
                                str(AMSJavascript.recv) +
                                self.commobj.commname)
            result = self.commobj.get_memory_list()
            if self.tree: self.panel.remove(self.tree)
            self.tree = Tree()
            for i in result:
                subtree = TreeItem(i)
                memory = self.commobj.memory_attach(i)
                fields = memory.get_field_list()
                for j in fields:
                    field = memory.get_field_info(j)
                    subtree.addItem(j + ' = ' + str(field[4]))
                self.tree.addItem(subtree)
                self.panel.add(self.tree)
Exemple #4
0
    def onModuleLoad(self):
        self.status=Label()
        self.button = Button("Display list of all published memories and fields", self)
        self.buttonupdate = Button("Update data from AMS publisher", self)

        buttons = HorizontalPanel()
        buttons.add(self.button)
        buttons.add(self.buttonupdate)
        buttons.setSpacing(8)
        
        info = """<p>This example demonstrates the calling of the Memory Snooper in PETSc with Pyjamas and <a href="http://json-rpc.org/">JSON-RPC</a>.</p>"""
        
        self.panel = VerticalPanel()
        self.panel.add(HTML(info))
        self.panel.add(buttons)
        self.panel.add(self.status)
        RootPanel().add(self.panel)
        self.commobj = AMS_Comm()
        self.tree = None
        if AMSJavascript.sent > AMSJavascript.recv: 
           self.status.setText('Press button again: AMSJavascript.sent '+str(AMSJavascript.sent)+' AMSJavascript.recv '+str(AMSJavascript.recv))
           return
        if self.commobj.commname == 'No AMS publisher running':
           self.status.setText(self.commobj.commname)
        else:
           self.status.setText('Memories for AMS Comm: '+str(AMSJavascript.sent)+str(AMSJavascript.recv)+self.commobj.commname)
           result = self.commobj.get_memory_list()
           if self.tree: self.panel.remove(self.tree)
           self.tree = Tree()
           for i in result:
              subtree = TreeItem(i)
              memory = self.commobj.memory_attach(i)
              fields = memory.get_field_list()
              for j in fields:
                 field = memory.get_field_info(j)
                 subtree.addItem(j+' = '+str(field[4]))
              self.tree.addItem(subtree)
              self.panel.add(self.tree)