Browse Source

wFusion weight selection demonstrator_updated.html updated

Debashis Chandra Ray 6 years ago
parent
commit
42c3cb65f7
1 changed files with 28 additions and 3 deletions
  1. 28 3
      JavaScript/JavaScript_Examples/demonstrator_updated.html

+ 28 - 3
JavaScript/JavaScript_Examples/demonstrator_updated.html

@@ -63,7 +63,23 @@ visually displays both the input objects and the output.
 			<td id="wf-operand2"></td>
 			<td>=</td>
 			<td id="wf-result"></td>
-			<td></td>
+			<td>Weight1 <select id = "weight1" onChange="selectW1(this.value);">
+				<option value="0">0</option>
+				<option value="1" selected="selected">1</option>
+				<option value="2">2</option>
+				<option value="3">3</option>
+				<option value="4">4</option>
+				<option value="5">5</option>
+				</select><br><br>
+				Weight2 <select id = "weight2" onChange="selectW2(this.value);">
+				<option value="0">0</option>
+				<option value="1" selected="selected">1</option>
+				<option value="2">2</option>
+				<option value="3">3</option>
+				<option value="4">4</option>
+				<option value="5">5</option>
+				</select>
+			</td>
 		</tr>
 	</table>
 
@@ -80,6 +96,16 @@ visually displays both the input objects and the output.
 										'cf-operand1','cf-operand2','cf-result',
 										'wf-operand1','wf-operand2','wf-result'];
 
+		function selectW1(value){
+			wweight[0] = parseInt(value);
+			WFObserver.update();
+		}
+		
+		function selectW2(value){
+			wweight[1] = parseInt(value);
+			WFObserver.update();
+		}
+		
 		// ANDObserver is used for the AND calculation
 		var ANDObserver = {
 			update: function() {
@@ -132,7 +158,7 @@ visually displays both the input objects and the output.
 				var fusArray = [];
 				fusArray.push(CT_objects['wf-operand1']);
 				fusArray.push(CT_objects['wf-operand2']);
-				
+								
 				//cFusion operation
 				var CT_result = fusTmp.wFusion(fusArray,wweight);
 				
@@ -180,7 +206,6 @@ visually displays both the input objects and the output.
 		ORObserver.update();
 		CFObserver.update();
 		WFObserver.update();
-		//document.getElementById("DoC").value = 1;
 	</script>
 
 	<p>