Skip to content

Commit

Permalink
Updated installation instructions and bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
2xB committed Oct 25, 2018
1 parent f5fce04 commit b20a03e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ PyQt5: <https://www.riverbankcomputing.com/software/pyqt/>

All dependencies are available through pip.

## Installation:
## Installation
### Full

```
$ sudo cp dlscan.py /usr/bin/dlscan
$ sudo chmod +x /usr/bin/dlscan
$ sudo mkdir /usr/share/dlscan
$ sudo cp scan_gui.ui /usr/share/dlscan/
```

## Lightweight (no gui)
```
$ sudo cp dlscan.py /usr/bin/dlscan
$ sudo chmod +x /usr/bin/dlscan
Expand Down
17 changes: 13 additions & 4 deletions dlscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import usb.util
import numpy as np
import math
import os

from PIL import Image

Expand Down Expand Up @@ -172,16 +173,25 @@ def save_array_as_img(realcolors, name):
im.save(name,"png")

def gui():
global QtCore, QtWidgets, QtGui, uic, os, ImageQt
global QtCore, QtWidgets, QtGui, uic, ImageQt
from PyQt5 import QtCore, QtWidgets, QtGui, uic
import os
from PIL.ImageQt import ImageQt

class ScanGui(QtWidgets.QMainWindow):
def __init__(self):
QtWidgets.QMainWindow.__init__(self)
uipath = os.path.join(os.path.dirname(__file__), 'scan_gui.ui')

_uipath1 = os.path.join(os.path.dirname(__file__), 'scan_gui.ui')
_uipath2 = os.path.join('/usr/share/dlscan', 'scan_gui.ui')
if os.path.isfile(_uipath1):
uipath = _uipath1
elif os.path.isfile(_uipath2):
uipath = _uipath2
else:
return

uic.loadUi(uipath, self)


self.preview_view.ui.histogram.hide()
self.preview_view.ui.roiBtn.hide()
Expand All @@ -194,7 +204,6 @@ def buttons_settings_scan(self):
greyscale = self.settings_color.currentIndex() == 1

self.realcolors = scan(greyscale)
colors = self.realcolors
self.preview_save.setEnabled(True)

self.preview_view.ui.histogram.show()
Expand Down

0 comments on commit b20a03e

Please sign in to comment.