Skip to content

Commit

Permalink
ændret i methods.py sorting_script robot sqlhandler og measure
Browse files Browse the repository at this point in the history
  • Loading branch information
Salizer committed May 31, 2012
1 parent 2e21b43 commit 18ab9db
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Kode/SIR/ControlSystem/DSLFiler/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import ControlSystem
clr.AddReference("System.Data")
import System.Data.SqlClient
clr.AddReference("SqlInteraction")
import SqlInteraction

# coordinates movement function
def moveByCoordinates(x,y,z):
Expand Down Expand Up @@ -139,6 +141,18 @@ def insertBox(position_id,length,width,depth,weight):
print "box inserted succesfully"
return True

def getPositionIDFromMeasurements(volume,weight):
volumeDifference = 2
weightDifference = 1
command = _sqlhandler.makeCommand("SELECT PositionID FROM BoxInfo WHERE Volume <= "+str(volume+volumeDifference).replace(',','.')+"AND Volume >="+str(volume-volumeDifference).replace(',','.')+"AND Weight <= "+str(weight+weightDifference).replace(',','.')+"AND Weight >="+str(weight-weightDifference).replace(',','.'))
reader = _sqlhandler.runQuery(command, 'read')
list = reader.readRow()
reader.close()
if (len(list) != 0):
return list[0]
else:
return -1

def removeBox(box_id):
try:
command = _sqlhandler.makeCommand("DELETE FROM BoxInfo WHERE BoxID = "+str(boxid))
Expand Down
1 change: 1 addition & 0 deletions Kode/SIR/ControlSystem/robot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ public bool moveToCubePosition(string vectorname,int _iCubeID)
else
return false;
}

#endregion

#region Axis movements
Expand Down
2 changes: 1 addition & 1 deletion Kode/SIR/SqlInteraction/sqlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public SqlCommand makeCommand(string _commandText)
command.CommandTimeout = Connection.TimeOut;
command.CommandType = CommandType.Text;
command.CommandText = _commandText;

return command;
}

Expand Down
Binary file modified Ressourcer/Measure.xlsx
Binary file not shown.

0 comments on commit 18ab9db

Please sign in to comment.