Commit cce321cd by Jorem Magcawas

update pause metrics

parent 93dfa4d2
filename,speed,avg_speed
"Felizardo, Brylle Theodure - Application Form.TIFF",2019.4465220643233,2019.4465220643233
"Felizardo, Theodure Brylle - Application Form.TIFF",1667.6961087090797,1843.5713153867014
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Image_Source_Path>./input/Felizardo, Brylle Theodure - Application Form.TIFF</Image_Source_Path> <Image_Source_Path>./input/Felizardo, Brylle Theodure - Application Form.TIFF</Image_Source_Path>
<No_of_Keystrokes>17</No_of_Keystrokes> <No_of_Keystrokes>3</No_of_Keystrokes>
<Processing_Time_Seconds>4.721</Processing_Time_Seconds> <Processing_Time_Seconds>5.348</Processing_Time_Seconds>
<Surname>asdfasd</Surname> <Surname>MAGALONA</Surname>
<Religion>asdfasdf</Religion> <Religion>BIBLE BAPTIST</Religion>
<Birthdate>2022-09-14</Birthdate> <Birthdate>2022-09-07</Birthdate>
<Age>12</Age> <Age>22</Age>
<Civil_Status>Single</Civil_Status> <Civil_Status>Single</Civil_Status>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Image_Source_Path>./input/Felizardo, Theodure Brylle - Application Form.TIFF</Image_Source_Path> <Image_Source_Path>./input/Felizardo, Theodure Brylle - Application Form.TIFF</Image_Source_Path>
<No_of_Keystrokes>31</No_of_Keystrokes> <No_of_Keystrokes>3</No_of_Keystrokes>
<Processing_Time_Seconds>6.827</Processing_Time_Seconds> <Processing_Time_Seconds>6.476</Processing_Time_Seconds>
<Surname>asdhfkjahsdkjh</Surname> <Surname>ONG</Surname>
<Religion>ksajdhflkjasdf</Religion> <Religion>CHRISTIAN</Religion>
<Birthdate>2022-09-14</Birthdate> <Birthdate>2022-09-21</Birthdate>
<Age>12</Age> <Age>21</Age>
<Civil_Status>Single</Civil_Status> <Civil_Status>Single</Civil_Status>
\ No newline at end of file
...@@ -13,6 +13,8 @@ let shortcut_flag = false ...@@ -13,6 +13,8 @@ let shortcut_flag = false
const csv_header = ['filename', 'speed', 'avg_speed']; const csv_header = ['filename', 'speed', 'avg_speed'];
let temp;
const startMetricCapture = () => { const startMetricCapture = () => {
// reset key strokes // reset key strokes
key_strokes = 0 key_strokes = 0
...@@ -78,6 +80,8 @@ const stopMetricCapture = () => { ...@@ -78,6 +80,8 @@ const stopMetricCapture = () => {
} }
} }
let interval = null;
const showMetricCapture = () => { const showMetricCapture = () => {
const obj = document.getElementById("counter"); const obj = document.getElementById("counter");
if(key_strokes != 0) { if(key_strokes != 0) {
...@@ -86,9 +90,11 @@ const showMetricCapture = () => { ...@@ -86,9 +90,11 @@ const showMetricCapture = () => {
rate >= 8000 ? obj.className = "green" : obj.className = "red"; rate >= 8000 ? obj.className = "green" : obj.className = "red";
obj.innerHTML = rate + " kph"; // immediately apply start value obj.innerHTML = rate + " kph"; // immediately apply start value
} }
setTimeout(showMetricCapture, 1000); interval = setTimeout(showMetricCapture, 1000);
} }
const saveMetrics = (metrics) => { const saveMetrics = (metrics) => {
try try
{ {
...@@ -135,6 +141,8 @@ const pauseMetricCapture = () => { ...@@ -135,6 +141,8 @@ const pauseMetricCapture = () => {
hideImage(); hideImage();
disableForm(); disableForm();
promptPaused(); promptPaused();
clearTimeout(interval);
temp = key_strokes;
// unpauseMetricCapture(); // unpauseMetricCapture();
// alert("PAUSED"); // alert("PAUSED");
} }
...@@ -144,6 +152,8 @@ const unpauseMetricCapture = () => { ...@@ -144,6 +152,8 @@ const unpauseMetricCapture = () => {
time_pause = 0; time_pause = 0;
unhideImage(); unhideImage();
enableForm(); enableForm();
key_strokes = temp;
showMetricCapture();
} }
const hideImage = () => { const hideImage = () => {
...@@ -187,6 +197,7 @@ function promptPaused(){ ...@@ -187,6 +197,7 @@ function promptPaused(){
promptMain.appendChild(message); promptMain.appendChild(message);
promptMain.appendChild(okButton); promptMain.appendChild(okButton);
viewer.appendChild(promptMain); viewer.appendChild(promptMain);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment