Ejemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     foreach (string port in SerialPort.GetPortNames())
         portsComboBox.Items.Add(port);
     portsComboBox.SelectedIndex = 1;
     attentionValuesCollection = new DataCollection();
     var attentionDataSource = new EnumerableDataSource<Data>(attentionValuesCollection);
     attentionDataSource.SetXMapping(x => dateAttention.ConvertToDouble(x.Date));
     attentionDataSource.SetYMapping(y => y.Value);
     plotterAttention.AddLineGraph(attentionDataSource, Colors.Red, 2, "Attention");
     randomWordNumber = new Random();
     wordNumber = 0;
     attentionComingCounter = 0;
     attentionValueSum = 0;
     puzzlesSolved = 0;
     currentWord = "";
     config = new ULoader_JSON("config.json");
     uSender = config.GetSender("output1");
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates sender based on configuration.
 /// </summary>
 /// <param name="outputName">Name of output.</param>
 /// <returns>Sender object. (no autostart)</returns>
 public USender GetSender(string outputName)
 {
     USender client = new USender(GetSenderConfig(outputName));
     return client;
 }