comparison codegear/InputDataGear.cs @ 8:e6f5b7d14dd1

update DataGears
author riono <e165729@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2020 00:49:32 +0900
parents 839e355f92ed
children ce6906edcbf4
comparison
equal deleted inserted replaced
7:f48a2df9da65 8:e6f5b7d14dd1
2 using System.Collections.Concurrent; 2 using System.Collections.Concurrent;
3 using System.Collections.Generic; 3 using System.Collections.Generic;
4 using Christie_net.datagear.dg; 4 using Christie_net.datagear.dg;
5 5
6 namespace Christie_net.codegear { 6 namespace Christie_net.codegear {
7 public class InputDataGear { 7 public class InputDataGear {
8 public ConcurrentDictionary<string, DataGear<Type>> inputValue = new ConcurrentDictionary<string, DataGear<Type>>(); 8 public CodeGear cg;
9 public CodeGearManager cgm; 9 public CodeGearManager cgm;
10 public CodeGear cg; 10 private int count;
11 private int count = 0; 11 public ConcurrentDictionary<string, DataGear<Type>> inputValue = new ConcurrentDictionary<string, DataGear<Type>>();
12 12
13 public InputDataGear(CodeGear cg) { 13 public InputDataGear(CodeGear cg) {
14 this.cg = cg; 14 this.cg = cg;
15 } 15 }
16 16
17 private void FinishInput(CodeGearManager cgm, List<Command> commandList) { 17 private void FinishInput(CodeGearManager cgm, List<Command> commandList) {
18 this.cgm = cgm; 18 this.cgm = cgm;
19 count = commandList.Count; 19 count = commandList.Count;
20 20
21 if (count == 0) { 21 if (count == 0) SubmitCG();
22 SubmitCG();
23 }
24 22
25 foreach (Command cm in commandList) { 23 foreach (Command cm in commandList) cgm.GetDGM(cm.toDgmName).RunCommand(cm);
26 cgm.GetDGM(cm.toDgmName).RunCommand(cm); 24 }
27 }
28 }
29 25
30 public void SetInputs(string key, DataGear<Type> dg) { 26 public void SetInputs(string key, DataGear<Type> dg) {
31 inputValue.AddOrUpdate(key, dg); 27 inputValue.AddOrUpdate(key, dg);
32 }
33 } 28 }
34 } 29 }
30 }