Skip to content

Commit

Permalink
Merge pull request #296 from mxcube/cleanup_examples
Browse files Browse the repository at this point in the history
Cleaned up the config examples
  • Loading branch information
marcus-oscarsson authored Dec 19, 2018
2 parents 0ca969e + e0cade8 commit c752a80
Show file tree
Hide file tree
Showing 59 changed files with 18 additions and 200 deletions.
10 changes: 5 additions & 5 deletions BlissFramework/Bricks/Qt4_SampleChangerBrick3.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from BlissFramework.Utils import Qt4_widget_colors
from BlissFramework.Qt4_BaseComponents import BlissWidget
from BlissFramework import Qt4_Icons
from sample_changer import SC3
from HardwareRepository.HardwareObjects.abstract import AbstractSampleChanger
from Qt4_sample_changer_helper import *


Expand Down Expand Up @@ -470,7 +470,7 @@ def setIcons(self, scan_one_icon):
self.scan_basket_button.setIcon(Qt4_Icons.load_icon(scan_one_icon))

def scanBasket(self):
self.scanBasketSignal.emitt()
self.scanBasketSignal.emit()

class CurrentSampleView(CurrentView):

Expand Down Expand Up @@ -1210,13 +1210,13 @@ def minidiffGetControl(self):
self.status.setMinidiffStatus(self.sample_changer_hwobj.minidiffCanMove())

def changeBasket(self, basket_number):
address = SC3.Basket.getBasketAddress(basket_number)
address = AbstractSampleChanger.Basket.getBasketAddress(basket_number)
self.sample_changer_hwobj.select(address, wait=False)

def changeSample(self, sample_number):
basket_index = self.sample_changer_hwobj.getSelectedComponent().getIndex()
basket_number = basket_index + 1
address = SC3.Pin.getSampleAddress(basket_number, sample_number)
address = AbstractSampleChanger.Pin.getSampleAddress(basket_number, sample_number)
self.sample_changer_hwobj.select(address, wait=False)

def user_select_this_sample(self, basket_index, vial_index):
Expand Down Expand Up @@ -1273,7 +1273,7 @@ def scanBasket(self):
def scanAllBaskets(self):
baskets_to_scan = []
for index, basket_checkbox in enumerate(self.baskets):
baskets_to_scan.append(SC3.Basket.getBasketAddress(index + 1) \
baskets_to_scan.append(AbstractSampleChanger.Basket.getBasketAddress(index + 1) \
if basket_checkbox.isChecked() else None)
self.sample_changer_hwobj.scan(filter(None, baskets_to_scan),
recursive=True, wait=False)
Expand Down
2 changes: 1 addition & 1 deletion BlissFramework/Bricks/Qt4_sample_changer_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from BlissFramework.Utils import Qt4_widget_colors
from sample_changer.GenericSampleChanger import SampleChangerState, SampleChangerMode, SampleChanger
from HardwareRepository.HardwareObjects.abstract.AbstractSampleChanger import SampleChangerState, SampleChangerMode, SampleChanger

SC_STATE_COLOR = { SampleChangerState.Fault: Qt4_widget_colors.LIGHT_RED,
SampleChangerState.Ready: Qt4_widget_colors.LIGHT_GREEN,
Expand Down
1 change: 0 additions & 1 deletion ExampleFiles/example_mxcube_python3.gui

This file was deleted.

87 changes: 0 additions & 87 deletions ExampleFiles/rpc_client_example.py

This file was deleted.

2 changes: 1 addition & 1 deletion HardwareRepository
Submodule HardwareRepository updated 1127 files
4 changes: 0 additions & 4 deletions bin/Qt4_startGUI

This file was deleted.

54 changes: 0 additions & 54 deletions bin/hwr-server

This file was deleted.

4 changes: 2 additions & 2 deletions bin/mxcube
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ sys.path.insert(0, MXCUBE_ROOT)
MXCUBE_GUI_FILE = os.environ.get('MXCUBE_GUI_FILE')
if not MXCUBE_GUI_FILE:
MXCUBE_GUI_FILE = os.path.join(MXCUBE_ROOT,
"ExampleFiles/example_mxcube_qt4.yml")
"configuration/example_mxcube_qt4.yml")
if not os.environ.get('HARDWARE_REPOSITORY_SERVER'):
hr_server = os.path.join(MXCUBE_ROOT,
"ExampleFiles/HardwareObjects.xml")
"HardwareRepository/configuration/xml-qt")
os.environ['HARDWARE_REPOSITORY_SERVER'] = hr_server
from BlissFramework import Qt4_startGUI
Qt4_startGUI.run(MXCUBE_GUI_FILE)
4 changes: 2 additions & 2 deletions bin/mxcube_jupyter_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"outputs": [],
"source": [
"hwr_server = mxcube_root + \"/ExampleFiles/HardwareObjects.xml\"\n",
"hwr_server = mxcube_root + \"/HardwareRepository/configuration/xml-qt\"\n",
"HardwareRepository.setHardwareRepositoryServer(hwr_server)\n",
"hardware_repository = HardwareRepository.HardwareRepository()\n",
"hardware_repository.connect()\n",
Expand All @@ -59,7 +59,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Try to load some hardware objects defined in the ExampleFiles:"
"Try to load some hardware objects defined in the xml-qt:"
]
},
{
Expand Down
4 changes: 1 addition & 3 deletions bin/mxcube_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@


__credits__ = ["MXCuBE colaboration"]
__version__ = "2.2."

cwd = os.getcwd()
hwr_server = cwd + "/ExampleFiles/HardwareObjects.xml"
hwr_server = cwd + "/HardwareRepository/configuration/xml-qt"

print "==============================================================="
print "MXCuBE home directory: %s" % cwd
print "Hardware repository: %s" % hwr_server
HardwareRepository.setHardwareRepositoryServer(hwr_server)
hardware_repository = HardwareRepository.HardwareRepository()
hardware_repository.connect()
HardwareRepository.addHardwareObjectsDirs([cwd + "/HardwareObjects"])
unittest_hwobj = hardware_repository.getHardwareObject("unittest")
if unittest_hwobj is not None:
print "UnitTest hardware object loaded"
Expand Down
8 changes: 4 additions & 4 deletions bin/run_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
##########################################################################

# Define MXCuBE defaults
MXCUBE_BRICKS_PATH=$MXCUBE_ROOT/Bricks # (This could be exported from python script)
MXCUBE_HWOBJS_PATH=$MXCUBE_ROOT/HardwareObjects # (This could be exported from python script)
MXCUBE_DEFAULT_GUI_FILE=$MXCUBE_ROOT/ExampleFiles/example_mxcube_qt4.yml
MXCUBE_DEFAULT_XML_PATH=$MXCUBE_ROOT/ExampleFiles/HardwareObjects.xml
MXCUBE_BRICKS_PATH=$MXCUBE_ROOT/BlissFramework/Bricks # (This could be exported from python script)
MXCUBE_HWOBJS_PATH=$MXCUBE_ROOT/HardwareRepository/HardwareObjects # (This could be exported from python script)
MXCUBE_DEFAULT_GUI_FILE=$MXCUBE_ROOT/configuration/example_mxcube_qt4.yml
MXCUBE_DEFAULT_XML_PATH=$MXCUBE_ROOT/HardwareRepository/configuration/xml-qt

export PYTHONPATH=$PYTHONPATH:$MXCUBE_ROOT
export PYTHONPATH=$PYTHONPATH:$MXCUBE_BRICKS_PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/run_mxcube.csh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/csh -f

python /home/mxuser/mxcube2/bin/mxcube --hardwareRepository=/home/mxuser/mxcube2/ExampleFiles/HardwareObjects.xml --hardwareObjectsDirs=/home/mxuser/mxcube2/HardwareObjects/sample_changer $argv
python /home/USER/mxcube2/bin/mxcube --hardwareRepository=/home/USER/mxcube2/HardwareRepository/configuration/xml-qt $argv
2 changes: 1 addition & 1 deletion bin/run_mxcube_python3.csh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/csh -f

/home/mxuser/mxcube/mxcube-2/bin/mxcube_python3 --hardwareRepository=/home/mxuser/mxcube/mxcube-2/ExampleFiles/HardwareObjects.xml --hardwareObjectsDirs=/home/mxuser/mxcube/mxcube-2/HardwareObjects/sample_changer $argv
python3 /home/USER/mxcube2/bin/mxcube --hardwareRepository=/home/USER/mxcube2/HardwareRepository/configuration/xml-qt $argv
20 changes: 0 additions & 20 deletions bin/sc.py

This file was deleted.

14 changes: 0 additions & 14 deletions bin/startGUI

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c752a80

Please sign in to comment.