Exemple #1
0
 def Deactivated(self):
     #        if DDAGui.__currentPanel__ != None :
     #            DDAGui.__currentPanel__.hide()
     #        FreeCADGui.DDADockWidget.Deactivated()
     import Base
     Base.enableSeletionObserver(False)
     import DDADatabase
     DDADatabase.enableOperationObverser(False)
Exemple #2
0
    def Deactivated(self):
#        if DDAGui.__currentPanel__ != None :
#            DDAGui.__currentPanel__.hide()
#        FreeCADGui.DDADockWidget.Deactivated()
        import Base
        Base.enableSeletionObserver(False)
        import DDADatabase
        DDADatabase.enableOperationObverser(False)
Exemple #3
0
    def Activated(self):
        import Base
        Base.confirmDocumentExisting('DDA')

        import Base
        Base.enableSelectionObserver(True)

        import DDADatabase
        DDADatabase.enableOperationObverser(True)
Exemple #4
0
def clearDocument():
    '''
    remove all objects from view
    '''
    
    print '###########################\n######### clearing document ####'
    import DDADatabase
    DDADatabase.enableOperationObverser(False)

    label = FreeCAD.ActiveDocument.Label
    FreeCAD.closeDocument(label)
    FreeCAD.newDocument(label)
    print '##############################'
    FreeCADGui.runCommand('DDA_ResetCamera')
    DDADatabase.enableOperationObverser(True)
Exemple #5
0
def clearDocument():
    '''
    remove all objects from view
    '''

    print '###########################\n######### clearing document ####'
    import DDADatabase
    DDADatabase.enableOperationObverser(False)

    label = FreeCAD.ActiveDocument.Label
    FreeCAD.closeDocument(label)
    FreeCAD.newDocument(label)
    print '##############################'
    FreeCADGui.runCommand('DDA_ResetCamera')
    DDADatabase.enableOperationObverser(True)
Exemple #6
0
    def Activated(self):
        import FreeCAD , FreeCADGui
        if hasattr(FreeCADGui,"draftToolBar"):
            FreeCADGui.draftToolBar.Deactivated()

        if not FreeCAD.ActiveDocument:
            FreeCAD.newDocument('DDA')
        
        import Base
        Base.enableSeletionObserver(True)
        import DDADatabase
        DDADatabase.enableOperationObverser(True)
        
        FreeCADGui.runCommand('DDA_ResetCamera')
        
        self.resetWorkbench()
Exemple #7
0
    def Activated(self):
        import FreeCAD, FreeCADGui
        if hasattr(FreeCADGui, "draftToolBar"):
            FreeCADGui.draftToolBar.Deactivated()

        if not FreeCAD.ActiveDocument:
            FreeCAD.newDocument('DDA')

        import Base
        Base.enableSeletionObserver(True)
        import DDADatabase
        DDADatabase.enableOperationObverser(True)

        FreeCADGui.runCommand('DDA_ResetCamera')

        self.resetWorkbench()
Exemple #8
0
    def Activated(self):
        from DDAShapes import DDACheckSaveJointSetsAndTunnels
        from storeScene import DLStoreData
        FreeCADGui.runCommand('DDA_CheckSaveJointSetsAndTunnels')
        if not DDACheckSaveJointSetsAndTunnels.isDataValid() :
            return
        FreeCADGui.runCommand("DDA_StoreData")
        if not DLStoreData.isDataValid():
            return

        clearDocument()
        self.calculate()            
        print 'calculate done'
        FreeCADGui.runCommand('DDA_ShowDCInputGraph')
#        self.graph.showStage2Graph(self.process)
        
        FreeCADGui.runCommand('DDA_ResetCamera')
        
        import DDADatabase
        DDADatabase.clearDLRedoUndoList()
Exemple #9
0
    def Activated(self):
        from DDAShapes import DDACheckSaveJointSetsAndTunnels
        from storeScene import DLStoreData
        FreeCADGui.runCommand('DDA_CheckSaveJointSetsAndTunnels')
        if not DDACheckSaveJointSetsAndTunnels.isDataValid():
            return
        FreeCADGui.runCommand("DDA_StoreData")
        if not DLStoreData.isDataValid():
            return

        clearDocument()
        self.calculate()
        print 'calculate done'
        FreeCADGui.runCommand('DDA_ShowDCInputGraph')
        #        self.graph.showStage2Graph(self.process)

        FreeCADGui.runCommand('DDA_ResetCamera')

        import DDADatabase
        DDADatabase.clearDLRedoUndoList()
Exemple #10
0
def _clearDocument():
    '''
    remove all objects from view
    '''
    print '###########################\n######### clearing document ####'
    import DDADatabase
    DDADatabase.enableOperationObverser(False)

    import FreeCAD, FreeCADGui
    doc = FreeCAD.getDocument('DDA')
    if not doc:
        doc = FreeCAD.newDocument('DDA')
    else:
        # make sure coin objects in DG are removed
        import DDAGui
        DDAGui.clearPlayer()
        DDAGui.clearCalculator()

    for obj in doc.Objects:
        doc.removeObject(obj.Label)

    DDADatabase.enableOperationObverser(True)
    print '##############################'
Exemple #11
0
    def parse(self):
        import Base
        filename = Base.__currentProjectPath__ + '/data.dc'
        print 'try to read DC data from file : ' , filename
#        filename = Base.__currentProjectPath__ + '/tmpData.dc'
        self.__fileReader.setFile(filename)
        import DDADatabase
        self.database = DDADatabase.DCInputDatabase()
        self.reset()
        self.__ParsePandect()
        self.__parseLines()
        self.__parsePoints()
        self.__fileReader.closeFile()
        DDADatabase.dc_inputDatabase = self.database
        self.database = None
Exemple #12
0
def _clearDocument():
    '''
    remove all objects from view
    '''
    print '###########################\n######### clearing document ####'
    import DDADatabase
    DDADatabase.enableOperationObverser(False)
    
    import FreeCAD, FreeCADGui
    doc = FreeCAD.getDocument('DDA')
    if not doc:
        doc = FreeCAD.newDocument('DDA')
    else:
        # make sure coin objects in DG are removed
        import DDAGui
        DDAGui.clearPlayer()
        DDAGui.clearCalculator()

        
    for obj in doc.Objects:
        doc.removeObject(obj.Label)

    DDADatabase.enableOperationObverser(True)
    print '##############################'
Exemple #13
0
    def save2Database(self):
        '''
        save data to DDADatabase.dl_database
        '''
        from DDAShapes import DDAJointSets, DDATunnels
        DDADatabase.dl_database = DDADatabase.DLDatabase()

        database = DDADatabase.dl_database

        database.jointSets = self.__jointSets
        DDAJointSets.dataTable.refreshData(database.jointSets)
        database.slope = self.__slope
        DDAJointSets.slopeDataTable.refreshData(database.slope)

        database.tunnels = self.__tunnels
        DDATunnels.dataTable.refreshData(database.tunnels)

        # boundaryNodes
        pts = [tuple(p) for p in self.__boundaryNodes]
        pts.append(pts[0])
        database.boundaryNodes = [DDAPolyLine(pts, 1)]

        # additional lines
        database.additionalLines = \
            [DDALine((p[0],p[1],0) , (p[2],p[3],0) , p[4]) for p in self.__additionalLines]

        # material line
        database.materialLines = \
            [DDALine((p[0],p[1],0) , (p[2],p[3],0) , p[4]) for p in self.__materialLines]

        # bolt element
        database.boltElements = \
            [DDALine((p[0],p[1],0) , (p[2],p[3],0) , p[4]) for p in self.__boltElements]

        # points
        database.fixedPoints = [
            DDAPoint(t[0], t[1]) for t in self.__fixedPoints
        ]
        database.loadingPoints = [
            DDAPoint(t[0], t[1]) for t in self.__loadingPoints
        ]
        database.measuredPoints = [
            DDAPoint(t[0], t[1]) for t in self.__measuredPoints
        ]
        database.holePoints = [DDAPoint(t[0], t[1]) for t in self.__holePoints]
        self.reset()
        import Base
        Base.refreshAllShapes()