Alpha tester wanted: Collaborative FC add-on

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Alpha tester wanted: Collaborative FC add-on

Post by wmayer »

ickby wrote: Thu Mar 25, 2021 2:25 pm get_default_loop is not used in my code. Was there any more information, a stack-trace maybe? I wonder where this is coming from
Sorry, here is it:

Code: Select all

Traceback (most recent call last):
  File "/home/user/.FreeCAD/Mod/CollaborativeFC/Utils/AsyncSlot.py", line 35, in _runner
    await fnc(*args, **kwargs)
  File "/home/user/.FreeCAD/Mod/CollaborativeFC/OCP/API.py", line 234, in toggleConnectedSlot
    await self.connectToNode()
  File "/home/user/.FreeCAD/Mod/CollaborativeFC/OCP/API.py", line 80, in connectToNode
    self.__wamp.start()
  File "/usr/lib/python3/dist-packages/autobahn/asyncio/component.py", line 309, in start
    loop = asyncio.get_default_loop()
AttributeError: module 'asyncio' has no attribute 'get_default_loop'
EDIT:
What fixed it is to get an up-to-date autobahn package with pip3 download autobahn
Afterwards it allows me to connect to the p2p network.
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Alpha tester wanted: Collaborative FC add-on

Post by ickby »

Ok, I pushed updates that should adress most, if not all of the reported problems. I cannot test the python2/3 version issue on my machine, but this is how I tried to solve it:

Code: Select all

pyCmd = "python"
            if platform.system() == "Linux":
                fcPy = sys.version_info[0]
                process = await asyncio.create_subprocess_shell("python --version", stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
                out, err = await process.communicate()
        
                if not out:
                    raise Exception("Unable to detect the default python version")               
                if err and err.decode() != "":
                    raise Exception("Unable to detect the default python version: ", err.decode())
                
                sysPy = out.decode()[-5]
                if sysPy != fcPy:
                    pyCmd += str(fcPy)
Hopefully that works.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Alpha tester wanted: Collaborative FC add-on

Post by Kunda1 »

@ickby not sure you know this or not but if you want to test for different version of FC or even different branches (i.e. LinkStage3) take a look at:

https://github.com/FreeCAD/FreeCAD-macr ... 1b4d72c279

Code: Select all

if App.Version()[1].find('18') == 0: import DraftTrackers, Draft
if App.Version()[1].find('19') == 0: import draftguitools.gui_trackers as DraftTrackers
if App.Version()[5].find('LinkStage3') == 0: import draftguitools.gui_trackers as DraftTrackers
Then your addon can recognize that the 2 peers involved are both FC master or LinkStage3 etc...
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Alpha tester wanted: Collaborative FC add-on

Post by ickby »

I detailed the actions testers can help me with in the first topic. For completeness here is what I hope someone is willing to go through:

Can you find FreeCAD workflows, actions, etc. that lead to unsynchronized documents in the multiple open FreeCAD instances? Do the following:
3.1. Setup two FreeCad instances and and make sure both are connected to the network
3.2 Open a document on the first instance and share it.
3.3 In the second instance it will show up as "node" type document, open it there
4.4 In any instance, try a FreeCAD workflow, e.g. PartDesign, Draft, Arch, FEM, Path... whatever you can think of
4.5 On each step check, if the second instance does replicate your action correctly and the documents are the same
4.6 If the documents are not the same, or an error occurred in the report view, try to make a minimal example out of it that fails reproducible
4.7 Get creative in breaking it (except the known issues :) )

I'm really looking for the examples that fail, to add it to my unit tests and improve the overall code.
Post Reply