work on neighbour view
This commit is contained in:
29
kisli.py
29
kisli.py
@@ -191,22 +191,29 @@ if args.fromfile:
|
||||
|
||||
|
||||
if args.view == "N":
|
||||
neigh = np.zeros(shape=(9, 10, 2))
|
||||
neighview = np.zeros(shape=(30,32))
|
||||
|
||||
i = 0
|
||||
for row in full_matrix:
|
||||
point_specific_matrix=get_mapped(row)
|
||||
if(channels.map[i][0]+1 <= 10):
|
||||
neigh[channels.map[i][0]][channels.map[i][1]][0] = point_specific_matrix[channels.map[i][0]+1][channels.map[i][1]]
|
||||
if(channels.map[i][1]+1 <= 9):
|
||||
neigh[channels.map[i][0]][channels.map[i][1]][1] = point_specific_matrix[channels.map[i][0]][channels.map[i][1]+1]
|
||||
i+=1
|
||||
|
||||
neighview = np.zeros(shape=(18,20))
|
||||
for x in range(9):
|
||||
for y in range(10):
|
||||
neighview[(x*2)+1][y*2] = neigh[x][y][0]
|
||||
neighview[x*2][(y*2)+1] = neigh[x][y][1]
|
||||
#coordinates of specific point
|
||||
y_pos = channels.map[i][1] - 1
|
||||
x_pos = channels.map[i][0] - 1
|
||||
|
||||
if(x_pos+1 < 9):
|
||||
neighview[(x_pos*3)+2][(y_pos*3)+1] = point_specific_matrix[x_pos+1][y_pos]
|
||||
|
||||
if(x_pos-1 >= 0):
|
||||
neighview[(x_pos*3)+0][(y_pos*3)+1] = point_specific_matrix[x_pos-1][y_pos]
|
||||
|
||||
if(y_pos+1 < 10):
|
||||
neighview[(x_pos*3)+1][(y_pos*3)+2] = point_specific_matrix[x_pos][y_pos+1]
|
||||
|
||||
if(y_pos-1 >= 0):
|
||||
neighview[(x_pos*3)+1][(y_pos*3)+0] = point_specific_matrix[x_pos][y_pos-1]
|
||||
|
||||
i+=1
|
||||
|
||||
viewer = liveview.ResistanceView(maximum=4000)
|
||||
viewer.updateView(neighview)
|
||||
|
||||
Reference in New Issue
Block a user