Skip to content

Commit

Permalink
add digi handling excl and node
Browse files Browse the repository at this point in the history
  • Loading branch information
untergasser committed Nov 24, 2021
1 parent 474dcea commit 3cf2923
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
33 changes: 31 additions & 2 deletions client/src/static/js/rdml_runedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ function updateClientData() {
var exClasRowUsed = false
var exDigiRowUsed = false
var rowCont = ""
var lastClassic = 0
for (var r = 0; r < rows; r++) {
rowCont += ' <tr>'
if (rowLabel == "123") {
Expand Down Expand Up @@ -507,7 +508,33 @@ function updateClientData() {
cell += 'Excl: ' + cExcl + '<br />'
cell += 'Note: ' + cNote + '</td>'
exClasRowUsed = true
} else {
lastClassic = dataPos
}
var dataPos = exRowCount - lastClassic - 1
if ((exClasRowUsed == false) &&
(reacts[reac].hasOwnProperty("partitions")) &&
(reacts[reac].partitions.hasOwnProperty("datas")) &&
(dataPos < reacts[reac].partitions.datas.length)) {
var cBgCol = "#ffffff"
var cExcl = ""
var cNote = ""
if (reacts[reac].partitions.datas[dataPos].hasOwnProperty("note")) {
cNote = reacts[reac].partitions.datas[dataPos].note
cBgCol = "#ccff66"
}
if (reacts[reac].partitions.datas[dataPos].hasOwnProperty("excluded")) {
cExcl = reacts[reac].partitions.datas[dataPos].excluded
cBgCol = "#ff704d"
}
cell = ' <td style="font-size:0.7em;background-color:' + cBgCol + ';"'
cell += ' onclick="showReactSel(1, ' + reac + ', ' + dataPos + ')">'
cell += reacts[reac].partitions.datas[dataPos].tar + '<br />'
cell += 'Excl: ' + cExcl + '<br />'
cell += 'Note: ' + cNote + '</td>'
exDigiRowUsed = true
}
if ((exClasRowUsed == false) &&
(exDigiRowUsed == false)) {
cell = ' <td></td>'
}
}
Expand Down Expand Up @@ -572,9 +599,11 @@ function updateClientData() {
rowCont += cell
}
rowCont += '</tr>\n'
if (exClasRowUsed == true) {
if ((exClasRowUsed == true) ||
(exDigiRowUsed == true)) {
ret += rowCont
exClasRowUsed = false
exDigiRowUsed = false
r--
exRowCount++
} else {
Expand Down
2 changes: 1 addition & 1 deletion server/rdmlpython
Submodule rdmlpython updated 1 files
+174 −5 rdml.py
36 changes: 34 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,10 +1519,17 @@ def handle_data():
return jsonify(errors=[{"title": "Invalid server request - run id not found!"}]), 400
if reqdata["sel-pcr"] == "classic":
if reqdata["sel-react"] > 0:
s_run.removeReactTar(reqdata["sel-react"], reqdata["sel-tar"])
s_run.removeClasReactTar(reqdata["sel-react"], reqdata["sel-tar"])
else:
if reqdata["sel-well"] != "":
s_run.removeReactTarGrp(reqdata["sel-well"], reqdata["sel-tar"])
s_run.removeClasReactTarGrp(reqdata["sel-well"], reqdata["sel-tar"])
else:
if reqdata["sel-react"] > 0:
s_run.removeDigiReactTar(reqdata["sel-react"], reqdata["sel-tar"])
else:
if reqdata["sel-well"] != "":
s_run.removeDigiReactTarGrp(reqdata["sel-well"], reqdata["sel-tar"])

data["reactsdata"] = s_run.getreactjson()
except rdml.RdmlError as err:
data["error"] = str(err)
Expand Down Expand Up @@ -1565,6 +1572,18 @@ def handle_data():
reqdata["sel-tar"],
reqdata["sel-excl"],
reqdata["sel-append"])
else:
if reqdata["sel-react"] > 0:
s_run.setDigiExcl(reqdata["sel-react"],
reqdata["sel-tar"],
reqdata["sel-excl"],
reqdata["sel-append"])
else:
if reqdata["sel-well"] != "":
s_run.setDigiExclGrp(reqdata["sel-well"],
reqdata["sel-tar"],
reqdata["sel-excl"],
reqdata["sel-append"])
data["reactsdata"] = s_run.getreactjson()
except rdml.RdmlError as err:
data["error"] = str(err)
Expand Down Expand Up @@ -1607,6 +1626,19 @@ def handle_data():
reqdata["sel-tar"],
reqdata["sel-note"],
reqdata["sel-append"])
else:
if reqdata["sel-react"] > 0:
s_run.setDigiNote(reqdata["sel-react"],
reqdata["sel-tar"],
reqdata["sel-note"],
reqdata["sel-append"])
else:
if reqdata["sel-well"] != "":
s_run.setDigiNoteGrp(reqdata["sel-well"],
reqdata["sel-tar"],
reqdata["sel-note"],
reqdata["sel-append"])

data["reactsdata"] = s_run.getreactjson()
except rdml.RdmlError as err:
data["error"] = str(err)
Expand Down

0 comments on commit 3cf2923

Please sign in to comment.