Chemblock läuft
This commit is contained in:
parent
7a67aec8e3
commit
c7cf5d2f0d
@ -16,7 +16,16 @@ tiphub = 16.5
|
|||||||
chemx = 200.0
|
chemx = 200.0
|
||||||
chemy = 50.0
|
chemy = 50.0
|
||||||
chemvol = 60.0
|
chemvol = 60.0
|
||||||
chemz = 50.0
|
chemz = 70.0
|
||||||
deltaz = 0.5
|
deltaz = 0.5
|
||||||
tauch = 0.0
|
tauch = 0.0
|
||||||
|
|
||||||
|
[reacblock]
|
||||||
|
rxoffset = 225.0
|
||||||
|
ryoffset = 150.0
|
||||||
|
rrows = 4
|
||||||
|
rcols = 6
|
||||||
|
rxspace = 20.0
|
||||||
|
ryspace = 19.0
|
||||||
|
rzlevel = 70.0
|
||||||
|
|
||||||
|
|||||||
@ -112,6 +112,12 @@ class LabPipBlock():
|
|||||||
def say_ok(self):
|
def say_ok(self):
|
||||||
print('ok')
|
print('ok')
|
||||||
|
|
||||||
|
class LabReactBlock(LabPipBlock):
|
||||||
|
|
||||||
|
def __init__(self, xoffset, yoffset, z, rows, cols, deltax, deltay):
|
||||||
|
super().__init__(xoffset, yoffset, z, rows, cols, deltax, deltay)
|
||||||
|
|
||||||
|
|
||||||
class ChemLoc():
|
class ChemLoc():
|
||||||
""" Chemikalien Lokation zloc location of surface
|
""" Chemikalien Lokation zloc location of surface
|
||||||
vol of chemical
|
vol of chemical
|
||||||
|
|||||||
@ -72,6 +72,7 @@
|
|||||||
#define P_STEP_PIN 26 // E0_STEP_PIN
|
#define P_STEP_PIN 26 // E0_STEP_PIN
|
||||||
#define P_DIR_PIN 28 // E0_DIR_PIN
|
#define P_DIR_PIN 28 // E0_DIR_PIN
|
||||||
#define P_CS_PIN 42 // E0_CS_PIN
|
#define P_CS_PIN 42 // E0_CS_PIN
|
||||||
|
#define P_LIMIT 19 // Z_MAX_PIN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -151,7 +152,7 @@ int changeDirection = 1;
|
|||||||
|
|
||||||
// ***** Variables for Serial Communication with Computer *****
|
// ***** Variables for Serial Communication with Computer *****
|
||||||
|
|
||||||
const byte numChars = 32;
|
const byte numChars = 32;
|
||||||
char receivedChars[numChars];
|
char receivedChars[numChars];
|
||||||
char tempChars[numChars]; // temporary array for use when parsing
|
char tempChars[numChars]; // temporary array for use when parsing
|
||||||
|
|
||||||
@ -177,7 +178,7 @@ boolean homeP;
|
|||||||
int x_steps_mm = 80;
|
int x_steps_mm = 80;
|
||||||
int y_steps_mm = 80;
|
int y_steps_mm = 80;
|
||||||
int z_steps_mm = 80;
|
int z_steps_mm = 80;
|
||||||
int p_steps_mm = 157.5;
|
double p_steps_mm = 5040;
|
||||||
|
|
||||||
|
|
||||||
// variables to hold location data
|
// variables to hold location data
|
||||||
@ -189,12 +190,13 @@ double locP_in_mm;
|
|||||||
int locX_in_steps;
|
int locX_in_steps;
|
||||||
int locY_in_steps;
|
int locY_in_steps;
|
||||||
int locZ_in_steps;
|
int locZ_in_steps;
|
||||||
int locP_in_steps;
|
double locP_in_steps;
|
||||||
|
|
||||||
#ifdef jfs
|
#ifdef jfs
|
||||||
int locX_max = 27000;
|
int locX_max = 27000;
|
||||||
int locY_max = -31200;
|
int locY_max = -31200;
|
||||||
int locZ_max = 4400;
|
int locZ_max = 6560;
|
||||||
|
double locP_max = 201600;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// variables to hold LED data
|
// variables to hold LED data
|
||||||
@ -207,7 +209,7 @@ void setup() {
|
|||||||
#ifdef otto
|
#ifdef otto
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
#endif
|
#endif
|
||||||
Serial.begin(9600);
|
Serial.begin(115000);
|
||||||
while(!Serial);
|
while(!Serial);
|
||||||
|
|
||||||
#ifdef otto
|
#ifdef otto
|
||||||
@ -259,6 +261,9 @@ void setup() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//***** Setting up Switches, Sensors, and Buttons *****
|
//***** Setting up Switches, Sensors, and Buttons *****
|
||||||
|
#ifdef jfs
|
||||||
|
pinMode(P_LIMIT, INPUT);
|
||||||
|
#endif
|
||||||
pinMode(X_LIMIT, INPUT);
|
pinMode(X_LIMIT, INPUT);
|
||||||
pinMode(Y_LIMIT, INPUT);
|
pinMode(Y_LIMIT, INPUT);
|
||||||
pinMode(Z_LIMIT, INPUT);
|
pinMode(Z_LIMIT, INPUT);
|
||||||
@ -330,7 +335,6 @@ void loop() {
|
|||||||
strcpy(tempChars, receivedChars);
|
strcpy(tempChars, receivedChars);
|
||||||
// this temporary copy is necessary to protect the original data
|
// this temporary copy is necessary to protect the original data
|
||||||
// because strtok() used in parseData() replaces the commas with \0
|
// because strtok() used in parseData() replaces the commas with \0
|
||||||
Serial.println(tempChars);
|
|
||||||
parseData();
|
parseData();
|
||||||
coordinateMove();
|
coordinateMove();
|
||||||
newData = false;
|
newData = false;
|
||||||
@ -371,6 +375,93 @@ void recvWithStartEndMarkers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//============
|
//============
|
||||||
|
void doHomeX(){
|
||||||
|
stepperX.setMaxSpeed(5000);
|
||||||
|
stepperX.setAcceleration(2000);
|
||||||
|
int initial_homing = stepperX.currentPosition();
|
||||||
|
homeX = false;
|
||||||
|
while (homeX == false){
|
||||||
|
initial_homing--;
|
||||||
|
stepperX.moveTo(initial_homing);
|
||||||
|
stepperX.run();
|
||||||
|
if (digitalRead(X_LIMIT) != 1) {
|
||||||
|
delay(1);
|
||||||
|
if (digitalRead(X_LIMIT) !=1){
|
||||||
|
homeX = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stepperX.setMaxSpeed(10000);
|
||||||
|
stepperX.setAcceleration(5000);
|
||||||
|
stepperX.setCurrentPosition(0);
|
||||||
|
Serial.println("X Homed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void doHomeY(){
|
||||||
|
int initial_homing = stepperY.currentPosition();
|
||||||
|
//Homing Y at min
|
||||||
|
stepperY.setMaxSpeed(5000);
|
||||||
|
stepperY.setAcceleration(2000);
|
||||||
|
initial_homing = stepperY.currentPosition();
|
||||||
|
homeY = false;
|
||||||
|
while (homeY == false){
|
||||||
|
initial_homing++;
|
||||||
|
stepperY.moveTo(initial_homing);
|
||||||
|
stepperY.run();
|
||||||
|
if (digitalRead(Y_LIMIT) != 1) {
|
||||||
|
delay(1);
|
||||||
|
if (digitalRead(Y_LIMIT) !=1){
|
||||||
|
homeY = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stepperY.setMaxSpeed(10000);
|
||||||
|
stepperY.setAcceleration(5000);
|
||||||
|
stepperY.setCurrentPosition(0);
|
||||||
|
Serial.println("Y Homed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void doHomeZ(){
|
||||||
|
stepperZ.setMaxSpeed(5000);
|
||||||
|
stepperZ.setAcceleration(2000);
|
||||||
|
int initial_homing = stepperZ.currentPosition();
|
||||||
|
homeZ = false;
|
||||||
|
while (homeZ == false){
|
||||||
|
initial_homing--;
|
||||||
|
stepperZ.moveTo(initial_homing);
|
||||||
|
stepperZ.run();
|
||||||
|
if (digitalRead(Z_LIMIT) != 1) {
|
||||||
|
delay(1);
|
||||||
|
if (digitalRead(Z_LIMIT) !=1){
|
||||||
|
homeZ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stepperZ.setMaxSpeed(10000);
|
||||||
|
stepperZ.setAcceleration(5000);
|
||||||
|
stepperZ.setCurrentPosition(0);
|
||||||
|
Serial.println("Z Homed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void doHomeP(){
|
||||||
|
stepperP.setMaxSpeed(5000);
|
||||||
|
stepperP.setAcceleration(2000);
|
||||||
|
int initial_homing = stepperP.currentPosition();
|
||||||
|
homeP = false;
|
||||||
|
while (homeP == false){
|
||||||
|
initial_homing--;
|
||||||
|
stepperP.moveTo(initial_homing);
|
||||||
|
stepperP.run();
|
||||||
|
if (digitalRead(P_LIMIT) != 1) {
|
||||||
|
delay(1);
|
||||||
|
if (digitalRead(P_LIMIT) !=1){
|
||||||
|
homeP = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stepperP.setCurrentPosition(0);
|
||||||
|
Serial.println("P Homed");
|
||||||
|
}
|
||||||
|
|
||||||
void parseData() { // split the data into its parts
|
void parseData() { // split the data into its parts
|
||||||
|
|
||||||
@ -442,9 +533,14 @@ void parseData() { // split the data into its parts
|
|||||||
Serial.println(" Z off limits ");
|
Serial.println(" Z off limits ");
|
||||||
locZ_in_steps = locZ_max;
|
locZ_in_steps = locZ_max;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
locP_in_steps = locP_in_mm * p_steps_mm;
|
locP_in_steps = locP_in_mm * p_steps_mm;
|
||||||
|
#ifdef jfs
|
||||||
|
if (locP_in_steps > locP_max) {
|
||||||
|
Serial.println(" P off limits ");
|
||||||
|
locP_in_steps = locP_max;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//============
|
//============
|
||||||
@ -457,7 +553,6 @@ void coordinateMove(){
|
|||||||
stepperZ.setMaxSpeed(2000);
|
stepperZ.setMaxSpeed(2000);
|
||||||
stepperZ.setAcceleration(1000);
|
stepperZ.setAcceleration(1000);
|
||||||
if (strcmp(mode, "G1") == 0){
|
if (strcmp(mode, "G1") == 0){
|
||||||
|
|
||||||
stepperX.moveTo(locX_in_steps);
|
stepperX.moveTo(locX_in_steps);
|
||||||
stepperY.moveTo(locY_in_steps);
|
stepperY.moveTo(locY_in_steps);
|
||||||
stepperZ.moveTo(locZ_in_steps);
|
stepperZ.moveTo(locZ_in_steps);
|
||||||
@ -469,7 +564,7 @@ void coordinateMove(){
|
|||||||
stepperY.setAcceleration(4000);
|
stepperY.setAcceleration(4000);
|
||||||
stepperZ.setMaxSpeed(10000);
|
stepperZ.setMaxSpeed(10000);
|
||||||
stepperZ.setAcceleration(6000);
|
stepperZ.setAcceleration(6000);
|
||||||
stepperP.setMaxSpeed(12000);
|
stepperP.setMaxSpeed(10000);
|
||||||
stepperP.setAcceleration(6000);
|
stepperP.setAcceleration(6000);
|
||||||
|
|
||||||
while(stepperX.targetPosition() != stepperX.currentPosition() or stepperY.targetPosition() != stepperY.currentPosition() or stepperZ.targetPosition() != stepperZ.currentPosition() or stepperP.targetPosition() != stepperP.currentPosition()){
|
while(stepperX.targetPosition() != stepperX.currentPosition() or stepperY.targetPosition() != stepperY.currentPosition() or stepperZ.targetPosition() != stepperZ.currentPosition() or stepperP.targetPosition() != stepperP.currentPosition()){
|
||||||
@ -592,99 +687,30 @@ void coordinateMove(){
|
|||||||
Serial.println( stepperY.currentPosition());
|
Serial.println( stepperY.currentPosition());
|
||||||
Serial.print("Z Position ");
|
Serial.print("Z Position ");
|
||||||
Serial.println( stepperZ.currentPosition());
|
Serial.println( stepperZ.currentPosition());
|
||||||
|
Serial.print("P Position ");
|
||||||
|
Serial.println( stepperP.currentPosition());
|
||||||
}
|
}
|
||||||
else if (strcmp(mode, "JZ") == 0){
|
else if (strcmp(mode, "JP") == 0){
|
||||||
|
doHomeP();
|
||||||
//Homing Z at min
|
}
|
||||||
stepperZ.setMaxSpeed(5000);
|
else if (strcmp(mode, "JX") == 0){
|
||||||
stepperZ.setAcceleration(2000);
|
doHomeX();
|
||||||
int initial_homing = stepperZ.currentPosition();
|
}
|
||||||
homeZ = false;
|
else if (strcmp(mode, "JY") == 0){
|
||||||
while (homeZ == false){
|
doHomeY();
|
||||||
initial_homing--;
|
}
|
||||||
stepperZ.moveTo(initial_homing);
|
else if (strcmp(mode, "JZ") == 0){
|
||||||
stepperZ.run();
|
doHomeZ();
|
||||||
if (digitalRead(Z_LIMIT) != 1) {
|
|
||||||
delay(1);
|
|
||||||
if (digitalRead(Z_LIMIT) !=1){
|
|
||||||
homeZ = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stepperZ.setMaxSpeed(10000);
|
|
||||||
stepperZ.setAcceleration(5000);
|
|
||||||
stepperZ.setCurrentPosition(0);
|
|
||||||
|
|
||||||
stepperP.setCurrentPosition(0);
|
|
||||||
Serial.println("<Z Homed>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//***** G28 - Homing Cycle *****
|
//***** G28 - Homing Cycle *****
|
||||||
// For this code to work as written the limit switches must be located at
|
|
||||||
// X - Mininum
|
|
||||||
// Y - Minimun
|
|
||||||
// Z - Minimun
|
|
||||||
else if (strcmp(mode, "G28") == 0){
|
else if (strcmp(mode, "G28") == 0){
|
||||||
//Homing X at min
|
doHomeZ();
|
||||||
stepperX.setMaxSpeed(5000);
|
doHomeY();
|
||||||
stepperX.setAcceleration(2000);
|
doHomeX();
|
||||||
int initial_homing = stepperX.currentPosition();
|
doHomeP();
|
||||||
homeX = false;
|
Serial.println("<OK Homed>");
|
||||||
while (homeX == false){
|
|
||||||
initial_homing--;
|
|
||||||
stepperX.moveTo(initial_homing);
|
|
||||||
stepperX.run();
|
|
||||||
if (digitalRead(X_LIMIT) != 1) {
|
|
||||||
delay(1);
|
|
||||||
if (digitalRead(X_LIMIT) !=1){
|
|
||||||
homeX = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stepperX.setMaxSpeed(10000);
|
|
||||||
stepperX.setAcceleration(5000);
|
|
||||||
stepperX.setCurrentPosition(0);
|
|
||||||
//Homing Y at min
|
|
||||||
stepperY.setMaxSpeed(5000);
|
|
||||||
stepperY.setAcceleration(2000);
|
|
||||||
initial_homing = stepperY.currentPosition();
|
|
||||||
homeY = false;
|
|
||||||
while (homeY == false){
|
|
||||||
initial_homing++;
|
|
||||||
stepperY.moveTo(initial_homing);
|
|
||||||
stepperY.run();
|
|
||||||
if (digitalRead(Y_LIMIT) != 1) {
|
|
||||||
delay(1);
|
|
||||||
if (digitalRead(Y_LIMIT) !=1){
|
|
||||||
homeY = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stepperY.setMaxSpeed(10000);
|
|
||||||
stepperY.setAcceleration(5000);
|
|
||||||
stepperY.setCurrentPosition(0);
|
|
||||||
//Homing Z at min
|
|
||||||
stepperZ.setMaxSpeed(5000);
|
|
||||||
stepperZ.setAcceleration(2000);
|
|
||||||
initial_homing = stepperZ.currentPosition();
|
|
||||||
homeZ = false;
|
|
||||||
while (homeZ == false){
|
|
||||||
initial_homing--;
|
|
||||||
stepperZ.moveTo(initial_homing);
|
|
||||||
stepperZ.run();
|
|
||||||
if (digitalRead(Z_LIMIT) != 1) {
|
|
||||||
delay(1);
|
|
||||||
if (digitalRead(Z_LIMIT) !=1){
|
|
||||||
homeZ = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stepperZ.setMaxSpeed(10000);
|
|
||||||
stepperZ.setAcceleration(5000);
|
|
||||||
stepperZ.setCurrentPosition(0);
|
|
||||||
|
|
||||||
stepperP.setCurrentPosition(0);
|
|
||||||
Serial.println("<OK Homed>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//########Grab Tip#########
|
//########Grab Tip#########
|
||||||
@ -721,4 +747,5 @@ void coordinateMove(){
|
|||||||
}
|
}
|
||||||
Serial.println("<ok>");
|
Serial.println("<ok>");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
145
gui/ser_one.py
145
gui/ser_one.py
@ -6,8 +6,10 @@ import tkinter.ttk as ttk
|
|||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
import os
|
import os
|
||||||
import labrobot as lrb
|
import labrobot as lrb
|
||||||
|
import threading
|
||||||
|
|
||||||
|
# commands
|
||||||
|
command = []
|
||||||
# serial ports
|
# serial ports
|
||||||
ports = serial.tools.list_ports.comports()
|
ports = serial.tools.list_ports.comports()
|
||||||
serialObj = serial.Serial()
|
serialObj = serial.Serial()
|
||||||
@ -17,7 +19,7 @@ def serial_ports():
|
|||||||
|
|
||||||
def on_select(event=None):
|
def on_select(event=None):
|
||||||
serialObj.port = cb.get().split(' ')[0]
|
serialObj.port = cb.get().split(' ')[0]
|
||||||
serialObj.baudrate = 115200
|
serialObj.baudrate = 115000
|
||||||
serialObj.open()
|
serialObj.open()
|
||||||
|
|
||||||
|
|
||||||
@ -101,32 +103,48 @@ b12 = ttk.Button(downrightframe,text='Dispense')
|
|||||||
b12.grid(row=1,column=2,sticky='ne')
|
b12.grid(row=1,column=2,sticky='ne')
|
||||||
b14 = ttk.Button(downrightframe,text='Take Chem')
|
b14 = ttk.Button(downrightframe,text='Take Chem')
|
||||||
b14.grid(row=2,column=0,sticky='ne')
|
b14.grid(row=2,column=0,sticky='ne')
|
||||||
|
b15 = ttk.Button(downrightframe,text='Next Vessel')
|
||||||
|
b15.grid(row=2,column=1,sticky='ne')
|
||||||
|
b16 = ttk.Button(downrightframe,text='Load Next')
|
||||||
|
b16.grid(row=2,column=2,sticky='ne')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###################### Parts
|
###################### Parts
|
||||||
## init Labrobot
|
## init Labrobot
|
||||||
|
|
||||||
|
## Top Block
|
||||||
xoffset = tk.DoubleVar()
|
xoffset = tk.DoubleVar()
|
||||||
yoffset = tk.DoubleVar()
|
yoffset = tk.DoubleVar()
|
||||||
rows = tk.IntVar()
|
rows = tk.IntVar()
|
||||||
cols = tk.IntVar()
|
cols = tk.IntVar()
|
||||||
xspace = tk.DoubleVar()
|
xspace = tk.DoubleVar()
|
||||||
yspace = tk.DoubleVar()
|
yspace = tk.DoubleVar()
|
||||||
tipvol = tk.IntVar()
|
|
||||||
zlevel = tk.DoubleVar()
|
zlevel = tk.DoubleVar()
|
||||||
|
akttip = tk.IntVar()
|
||||||
|
## Tip
|
||||||
|
tipvol = tk.IntVar()
|
||||||
tipup = tk.DoubleVar()
|
tipup = tk.DoubleVar()
|
||||||
tiphub = tk.DoubleVar()
|
tiphub = tk.DoubleVar()
|
||||||
tipspeed = tk.IntVar()
|
tipspeed = tk.IntVar()
|
||||||
akttip = tk.IntVar()
|
## Chemicals
|
||||||
|
|
||||||
chemX = tk.DoubleVar()
|
chemX = tk.DoubleVar()
|
||||||
chemY = tk.DoubleVar()
|
chemY = tk.DoubleVar()
|
||||||
chemVol = tk.DoubleVar()
|
chemVol = tk.DoubleVar()
|
||||||
chemZ = tk.DoubleVar()
|
chemZ = tk.DoubleVar()
|
||||||
deltaz = tk.DoubleVar()
|
deltaz = tk.DoubleVar()
|
||||||
tauch = tk.DoubleVar()
|
tauch = tk.DoubleVar()
|
||||||
|
## ReactionSpace
|
||||||
|
rxoffset = tk.DoubleVar()
|
||||||
|
ryoffset = tk.DoubleVar()
|
||||||
|
rrows = tk.IntVar()
|
||||||
|
rcols = tk.IntVar()
|
||||||
|
rxspace = tk.DoubleVar()
|
||||||
|
ryspace = tk.DoubleVar()
|
||||||
|
rtipvol = tk.IntVar()
|
||||||
|
rzlevel = tk.DoubleVar()
|
||||||
|
rakt = tk.IntVar()
|
||||||
|
|
||||||
|
|
||||||
def conf_read():
|
def conf_read():
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
@ -148,6 +166,13 @@ def conf_read():
|
|||||||
chemZ.set(float(config.get('chemblock','chemz',fallback=0)))
|
chemZ.set(float(config.get('chemblock','chemz',fallback=0)))
|
||||||
deltaz.set(float(config.get('chemblock','deltaz',fallback=0)))
|
deltaz.set(float(config.get('chemblock','deltaz',fallback=0)))
|
||||||
tauch.set(float(config.get('chemblock','tauch',fallback=0)))
|
tauch.set(float(config.get('chemblock','tauch',fallback=0)))
|
||||||
|
rxoffset.set(float(config.get('reacblock','rxoffset',fallback=0)))
|
||||||
|
ryoffset.set(float(config.get('reacblock','ryoffset',fallback=0)))
|
||||||
|
rrows.set(int(config.get('reacblock','rrows',fallback=0)))
|
||||||
|
rcols.set(int(config.get('reacblock','rcols',fallback=0)))
|
||||||
|
rxspace.set(float(config.get('reacblock','rxspace',fallback=0)))
|
||||||
|
ryspace.set(float(config.get('reacblock','ryspace',fallback=0)))
|
||||||
|
rzlevel.set(float(config.get('reacblock','rzlevel',fallback=0)))
|
||||||
|
|
||||||
def conf_write():
|
def conf_write():
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
@ -168,7 +193,14 @@ def conf_write():
|
|||||||
config.set('chemblock','chemvol',str(chemVol.get()))
|
config.set('chemblock','chemvol',str(chemVol.get()))
|
||||||
config.set('chemblock','chemz',str(chemZ.get()))
|
config.set('chemblock','chemz',str(chemZ.get()))
|
||||||
config.set('chemblock','deltaz',str(deltaz.get()))
|
config.set('chemblock','deltaz',str(deltaz.get()))
|
||||||
config.set('chemblock','tauch',str(tauch.get()))
|
config.set('chemblock','tauch',str(tauch.get()))
|
||||||
|
config.set('reacblock','rxoffset',str(rxoffset.get()))
|
||||||
|
config.set('reacblock','ryoffset',str(ryoffset.get()))
|
||||||
|
config.set('reacblock','rrows',str(rrows.get()))
|
||||||
|
config.set('reacblock','rcols',str(rcols.get()))
|
||||||
|
config.set('reacblock','rxspace',str(rxspace.get()))
|
||||||
|
config.set('reacblock','ryspace',str(ryspace.get()))
|
||||||
|
config.set('reacblock','rzlevel',str(rzlevel.get()))
|
||||||
with open(os.path.join(os.path.dirname(__file__), "config.ini"),'w') as f:
|
with open(os.path.join(os.path.dirname(__file__), "config.ini"),'w') as f:
|
||||||
config.write(f)
|
config.write(f)
|
||||||
conf_read()
|
conf_read()
|
||||||
@ -176,6 +208,7 @@ conf_read()
|
|||||||
lpb = lrb.LabPipBlock(xoffset.get(),yoffset.get(),zlevel.get(),rows.get(),cols.get(),xspace.get(),yspace.get())
|
lpb = lrb.LabPipBlock(xoffset.get(),yoffset.get(),zlevel.get(),rows.get(),cols.get(),xspace.get(),yspace.get())
|
||||||
pip = lrb.LabPip(vol=tipvol.get(),top=tipup.get(),hub=tiphub.get(),fe=tipspeed.get())
|
pip = lrb.LabPip(vol=tipvol.get(),top=tipup.get(),hub=tiphub.get(),fe=tipspeed.get())
|
||||||
chem = lrb.ChemLoc(chemX.get(),chemY.get(),chemZ.get(),chemVol.get(),deltaz.get(),tauch.get())
|
chem = lrb.ChemLoc(chemX.get(),chemY.get(),chemZ.get(),chemVol.get(),deltaz.get(),tauch.get())
|
||||||
|
react = lrb.LabReactBlock(rxoffset.get(),ryoffset.get(),rzlevel.get(),rrows.get(),rcols.get(),rxspace.get(),ryspace.get())
|
||||||
|
|
||||||
partframe = ttk.Frame(notebook)
|
partframe = ttk.Frame(notebook)
|
||||||
#partframe.rowconfigure(0,weight=1)
|
#partframe.rowconfigure(0,weight=1)
|
||||||
@ -245,6 +278,34 @@ ce4.grid(column=1,row=3,sticky='e')
|
|||||||
cl5 = ttk.Label(chemframe,text='DeltaZ/ml').grid(column=0,row=4,padx=5)
|
cl5 = ttk.Label(chemframe,text='DeltaZ/ml').grid(column=0,row=4,padx=5)
|
||||||
ce5 = ttk.Entry(chemframe,textvariable=deltaz)
|
ce5 = ttk.Entry(chemframe,textvariable=deltaz)
|
||||||
ce5.grid(column=1,row=4,sticky='e')
|
ce5.grid(column=1,row=4,sticky='e')
|
||||||
|
|
||||||
|
reactframe =ttk.LabelFrame(partframe,text='Reaction Vessels')
|
||||||
|
reactframe.grid(column=2,row=0,sticky='wns',padx=5,pady=5)
|
||||||
|
rl1 = ttk.Label(reactframe,text='X offset').grid(column=0,row=0,padx=5)
|
||||||
|
re1 = ttk.Entry(reactframe,textvariable=rxoffset)
|
||||||
|
re1.grid(column=1,row=0,sticky='e')
|
||||||
|
rl2 = ttk.Label(reactframe,text='rows').grid(column=0,row=2,padx=5)
|
||||||
|
re2 = ttk.Entry(reactframe,textvariable=rrows)
|
||||||
|
re2.grid(column=1,row=2,sticky='e')
|
||||||
|
rl3 = ttk.Label(reactframe,text='columns').grid(column=0,row=3,padx=5)
|
||||||
|
re3 = ttk.Entry(reactframe,textvariable=rcols)
|
||||||
|
re3.grid(column=1,row=3,sticky='e')
|
||||||
|
rl4 = ttk.Label(reactframe,text='x space').grid(column=0,row=4,padx=5)
|
||||||
|
re4 = ttk.Entry(reactframe,textvariable=rxspace)
|
||||||
|
re4.grid(column=1,row=4,sticky='e')
|
||||||
|
rl5 = ttk.Label(reactframe,text='y space').grid(column=0,row=5,padx=5)
|
||||||
|
re5 = ttk.Entry(reactframe,textvariable=ryspace)
|
||||||
|
re5.grid(column=1,row=5,sticky='e')
|
||||||
|
rl6 = ttk.Label(reactframe,text='Y offset').grid(column=0,row=1,padx=5)
|
||||||
|
re6 = ttk.Entry(reactframe,textvariable=ryoffset)
|
||||||
|
re6.grid(column=1,row=1,sticky='e')
|
||||||
|
rl7 = ttk.Label(reactframe,text='Z level').grid(column=0,row=6,padx=5)
|
||||||
|
re7 = ttk.Entry(reactframe,textvariable=rzlevel)
|
||||||
|
re7.grid(column=1,row=6,sticky='e')
|
||||||
|
ttk.Separator(reactframe, orient=tk.HORIZONTAL).grid(row=80,sticky='ew')
|
||||||
|
rl8 = ttk.Label(reactframe,text='Akt Vessel').grid(column=0,row=81,padx=5)
|
||||||
|
re8 = ttk.Entry(reactframe,textvariable=rakt)
|
||||||
|
re8.grid(column=1,row=81,sticky='e')
|
||||||
### commands and bindings
|
### commands and bindings
|
||||||
|
|
||||||
pb2.config(command=conf_write)
|
pb2.config(command=conf_write)
|
||||||
@ -273,6 +334,16 @@ def set_tipblock():
|
|||||||
chem.zloc = float(chemZ.get())
|
chem.zloc = float(chemZ.get())
|
||||||
chem.deltaz = float(deltaz.get())
|
chem.deltaz = float(deltaz.get())
|
||||||
chem.tauch = float(tauch.get())
|
chem.tauch = float(tauch.get())
|
||||||
|
global react
|
||||||
|
react.xoffset = float(rxoffset.get())
|
||||||
|
react.yoffset = float(ryoffset.get())
|
||||||
|
react.rows = int(rrows.get())
|
||||||
|
react.columns = int(rcols.get())
|
||||||
|
react.deltax = float(rxspace.get())
|
||||||
|
react.deltay = float(ryspace.get())
|
||||||
|
react.z = float(rzlevel.get())
|
||||||
|
react.akt = int(rakt.get())
|
||||||
|
|
||||||
|
|
||||||
pb1.config(command=set_tipblock)
|
pb1.config(command=set_tipblock)
|
||||||
|
|
||||||
@ -304,57 +375,77 @@ def do_gcode():
|
|||||||
s = e1.get()
|
s = e1.get()
|
||||||
s = s + '\n'
|
s = s + '\n'
|
||||||
print(s)
|
print(s)
|
||||||
serialObj.write(s.encode('utf-8'))
|
serialObj.write(s.encode('utf-8'))
|
||||||
b5.configure(command=do_gcode)
|
b5.configure(command=do_gcode)
|
||||||
|
|
||||||
def upTip():
|
def upTip():
|
||||||
serialObj.write(pip.up().encode('utf-8'))
|
command.append(pip.up().encode('utf-8'))
|
||||||
b9.configure(command=upTip)
|
b9.configure(command=upTip)
|
||||||
|
|
||||||
def downTip():
|
def downTip():
|
||||||
serialObj.write(pip.down().encode('utf-8'))
|
command.append(pip.down().encode('utf-8'))
|
||||||
b10.configure(command=downTip)
|
b10.configure(command=downTip)
|
||||||
|
|
||||||
def nextTip():
|
def nextTip():
|
||||||
upTip()
|
upTip()
|
||||||
serialObj.write(pip.get_tip(lpb.next()).encode('utf-8'))
|
serialObj.write(pip.get_tip(lpb.next()).encode('utf-8'))
|
||||||
akttip.set(lpb.akt)
|
akttip.set(lpb.akt)
|
||||||
downTip()
|
downTip()
|
||||||
|
|
||||||
b8.configure(command=nextTip)
|
b8.configure(command=nextTip)
|
||||||
|
|
||||||
def load():
|
def load():
|
||||||
serialObj.write(pip.go_top().encode('utf-8'))
|
command.append(pip.go_top().encode('utf-8'))
|
||||||
serialObj.write(pip.go_down().encode('utf-8'))
|
command.append(pip.go_down().encode('utf-8'))
|
||||||
serialObj.write(pip.go_top().encode('utf-8'))
|
command.append(pip.go_top().encode('utf-8'))
|
||||||
b13.config(command=load)
|
b13.config(command=load)
|
||||||
|
|
||||||
def dispense():
|
def dispense():
|
||||||
serialObj.write(pip.go_down().encode('utf-8'))
|
command.append(pip.go_down().encode('utf-8'))
|
||||||
b12.config(command=dispense)
|
b12.config(command=dispense)
|
||||||
|
|
||||||
def top():
|
def top():
|
||||||
serialObj.write(pip.go_top().encode('utf-8'))
|
command.append(pip.go_top().encode('utf-8'))
|
||||||
b11.config(command=top)
|
b11.config(command=top)
|
||||||
|
|
||||||
def takeChem():
|
def takeChem():
|
||||||
print(chem.getXY())
|
|
||||||
pip.setXY(chem.getXY())
|
|
||||||
serialObj.write(pip.sendXY().encode('utf-8'))
|
|
||||||
pip.setZ(chem.load(1))
|
|
||||||
serialObj.write(pip.down().encode('utf-8'))
|
|
||||||
serialObj.write(pip.go_top().encode('utf-8'))
|
|
||||||
upTip()
|
upTip()
|
||||||
|
pip.setXY(chem.getXY())
|
||||||
|
command.append(pip.sendXY().encode('utf-8'))
|
||||||
|
pip.setZ(chem.load(1))
|
||||||
|
command.append(pip.down().encode('utf-8'))
|
||||||
|
load()
|
||||||
|
command.append(pip.up().encode('utf-8'))
|
||||||
b14.config(command=takeChem)
|
b14.config(command=takeChem)
|
||||||
|
|
||||||
|
def nextVessel():
|
||||||
|
upTip()
|
||||||
|
command.append(pip.get_tip(react.next()).encode('utf-8'))
|
||||||
|
rakt.set(react.akt)
|
||||||
|
downTip()
|
||||||
|
b15.config(command=nextVessel)
|
||||||
|
|
||||||
|
def loadNext():
|
||||||
|
upTip()
|
||||||
|
takeChem()
|
||||||
|
nextVessel()
|
||||||
|
dispense()
|
||||||
|
upTip()
|
||||||
|
|
||||||
|
b16.config(command=loadNext)
|
||||||
|
|
||||||
|
weiter = True
|
||||||
def checkSerialPort():
|
def checkSerialPort():
|
||||||
|
global weiter
|
||||||
if serialObj.isOpen() and serialObj.in_waiting:
|
if serialObj.isOpen() and serialObj.in_waiting:
|
||||||
recentPacket = serialObj.readline()
|
recentPacket = serialObj.readline()
|
||||||
recentPacketString = recentPacket.decode('utf')
|
recentPacketString = recentPacket.decode('utf')
|
||||||
txt.insert('0.1',recentPacketString,'small')
|
txt.insert('0.1',recentPacketString,'small')
|
||||||
|
weiter = True
|
||||||
|
if (len(command) > 0) & (weiter==True) :
|
||||||
|
x = command.pop(0)
|
||||||
|
txt.insert('0.1',x,'small')
|
||||||
|
serialObj.write(x)
|
||||||
|
weiter=False
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user