Skip to content

Commit

Permalink
Merge pull request #13 from Zolko-123/development
Browse files Browse the repository at this point in the history
merge development => master, v0.7.6
  • Loading branch information
Zolko-123 authored Dec 12, 2019
2 parents f194461 + 524f39b commit cc0abfd
Show file tree
Hide file tree
Showing 9 changed files with 1,046 additions and 1,036 deletions.
49 changes: 33 additions & 16 deletions AnimationLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# placeDatumCmd.py


import time, math, re

from PySide import QtGui, QtCore
import FreeCADGui as Gui
import FreeCAD as App
import Part, math, re
import Part

from libAsm4 import *

Expand Down Expand Up @@ -86,19 +88,34 @@ def onRun(self):
begin = self.minValue.value()
end = self.maxValue.value()
step = self.stepValue.value()
sleep = self.sleepValue.value()
# basic checks
if varName:
varValue = begin
while varValue <= end and self.Run:
setattr( self.Variables, varName, varValue )
#App.ActiveDocument.recompute()
App.ActiveDocument.Model.recompute('True')
Gui.updateGui()
varValue += step
self.Run = True
return
else:
return
# if we go forwards ...
if end>begin and step>0:
varValue = begin
while varValue <= end and self.Run:
setattr( self.Variables, varName, varValue )
#App.ActiveDocument.recompute()
App.ActiveDocument.Model.recompute('True')
Gui.updateGui()
varValue += step
time.sleep(sleep)
self.Run = True
return
# ... or backwards
elif end<begin and step<0:
varValue = begin
while varValue >= end and self.Run:
setattr( self.Variables, varName, varValue )
#App.ActiveDocument.recompute()
App.ActiveDocument.Model.recompute('True')
Gui.updateGui()
varValue += step
time.sleep(sleep)
self.Run = True
return
return


"""
Expand Down Expand Up @@ -150,7 +167,7 @@ def drawUI(self):
self.rangeLabel.move(10,85)
# Minimum
self.minLabel = QtGui.QLabel(self)
self.minLabel.setText("Begin")
self.minLabel.setText("Begin :")
self.minLabel.move(120,65)
self.minValue = QtGui.QDoubleSpinBox(self)
self.minValue.move(200,60)
Expand All @@ -159,7 +176,7 @@ def drawUI(self):
self.minValue.setValue( 0.0 )
# Maximum
self.maxLabel = QtGui.QLabel(self)
self.maxLabel.setText("End")
self.maxLabel.setText("End :")
self.maxLabel.move(120,105)
self.maxValue = QtGui.QDoubleSpinBox(self)
self.maxValue.move(200,100)
Expand All @@ -169,7 +186,7 @@ def drawUI(self):

# Step
self.stepLabel = QtGui.QLabel(self)
self.stepLabel.setText("Step size")
self.stepLabel.setText("Step :")
self.stepLabel.move(10,145)
self.stepValue = QtGui.QDoubleSpinBox(self)
self.stepValue.move(200,140)
Expand All @@ -179,7 +196,7 @@ def drawUI(self):

# Sleep
self.sleepLabel = QtGui.QLabel(self)
self.sleepLabel.setText("Sleep (ms)")
self.sleepLabel.setText("Sleep (s) :")
self.sleepLabel.move(10,185)
self.sleepValue = QtGui.QDoubleSpinBox(self)
self.sleepValue.move(200,180)
Expand Down
3 changes: 2 additions & 1 deletion InitGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self):
def Initialize(self):
global dropDownCmdGroup
import newModelCmd # creates a new App::Part container called 'Model'
import newSketchCmd # creates a new Sketch in 'Model'
#import newSketchCmd # creates a new Sketch in 'Model'
import newDatumCmd # creates a new LCS in 'Model'
import newPartCmd # creates a new App::Part container called 'Model'
import newBodyCmd # creates a new Body in 'Model
Expand Down Expand Up @@ -168,6 +168,7 @@ def Initialize(self):
self.itemsContextMenu =["Asm4_insertLink",
"Asm4_placeLink",
"Asm4_placeFastener",
"Asm4_importDatum",
"Asm4_placeDatum" ]
# commands to appear in the 'Create' sub-menu in the contextual menu (right-click)
self.itemsCreateMenu = ["Asm4_newSketch",
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ This is then a raw interface between FreeCAD `App::Part` objects through the `Ap

## Release notes

* 2019.12.12 (**version 0.7.6**) :
Improved animation and datum import.

* 2019.12.02 (**version 0.7.5**) :
Minor (but useful !) refinements for variables and animation.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Assembly 4 Workbench for FreeCAD-v0.19
v0.7.5 2019.12.02
v0.7.6 2019.12.12

Loading

0 comments on commit cc0abfd

Please sign in to comment.