Example #1
0
        void data_DataUpdated(object sender, DataUpdatedEventArgs e)
        {
            short d = 0;
            try
            {
                d = Convert.ToInt16(e.Data.Value);
                if (d < 0 || d > 27648) { d = 0; }
            }
            catch { d = 0; }

            this.AddData(d, -1);
        }
Example #2
0
 private void DataUp(object Sender, DataUpdatedEventArgs <UInt16> e)
 {
     if (e.Data.HasTimeStamp)
     {
         label6.Text     = "Timestamp: ";
         label5.Text     = e.Data.TimeStamp.ToLocalTime().ToString();
         label5.Location = new Point(135, label5.Location.Y);
     }
     if (e.Data.HasValue)
     {
         UInt16 data = e.Data.GetValue();
         boolreader = Convert.ToString(data, 2);
         bool[] boolarray = new bool[17];
         boolarray = boolreader.Select(c => c == '1').ToArray();
         ledArray1.SetValues(boolarray);
     }
 }
Example #3
0
        //Handles S4 New Data
        private void S4S(object Sender, DataUpdatedEventArgs <bool> e)
        {
            if (e.Data.HasValue)
            {
                bool data = e.Data.GetValue();
                Station_4.Value = data;
                switch (Station_4.Value)
                {
                case true:
                    label11.Text = "Operational";
                    break;

                case false:
                    label11.Text = "Not Operational";
                    break;
                }
            }
        }
Example #4
0
        private void Input4New(object Sender, DataUpdatedEventArgs <UInt16> e)
        {
            if (e.Data.HasValue)
            {
                UInt16 data = e.Data.GetValue();
                boolreader = Convert.ToString(data, 2);
                bool[] boolarray = new bool[17];
                boolarray = boolreader.Select(c => c == '1').ToArray();

                NationalInstruments.UI.WindowsForms.Led[] leds = { E40, E41, E42, E43, E44, E45, E46, E47, E48, E49, E410, E411, E412, E413, E414, E415 };
                for (int i = 0; i < boolarray.Length; i++)
                {
                    leds[i].Value = boolarray[i];
                }
                for (int i = boolarray.Length; i < 16; i++)
                {
                    leds[i].Value = false;
                }
            }
        }
Example #5
0
 private void Input2New(object Sender, DataUpdatedEventArgs <UInt16> e)
 {
     if (e.Data.HasValue)
     {
         UInt16 data = e.Data.GetValue();
         boolreader = Convert.ToString(data, 2);
         bool[] boolarray = new bool[17];
         boolarray = boolreader.Select(c => c == '1').ToArray();
         //boolarray.Reverse();
         NationalInstruments.UI.WindowsForms.Led[] leds = { E20, E21, E22, E23, E24, E25, E26, E27, E28, E29, E210, E211, E212, E213, E214, E215 };
         for (int i = 0; i < boolarray.Length; i++)
         {
             leds[i].Value = boolarray[i];
         }
         for (int i = boolarray.Length; i < 16; i++)
         {
             leds[i].Value = false;
         }
     }
 }
        public void UpdateDB()
        {
            DataUpdatedEventArgs e = new DataUpdatedEventArgs();

            this.OnDataUpdated(e);
        }
Example #7
0
 public static void DataUpdateHandler(object sender, DataUpdatedEventArgs e)
 {
     WriteLog("Command: " + e.Command[3] + ". Data: " +
              Encoding.Default.GetString(e.DataToPrinter));
     WriteLog("Data from printer: " + Encoding.Default.GetString(e.DataToHost));
 }
Example #8
0
 private static void _poller_OnDataUpdated1(object sender, DataUpdatedEventArgs e)
 {
     //Console.WriteLine(sender.)
     //throw new NotImplementedException();
 }
Example #9
0
 //evento de Datasocket.
 private void ValorNuevo(object sender, DataUpdatedEventArgs e)
 {
     if(EventoSocket!=null)
             this.EventoSocket(this);
 }
Example #10
0
 void ObservableSubscriberDataUpdated(object sender, DataUpdatedEventArgs e)
 {
     _svc.UpdateVariableSingleAsync(((IObservableSubscriberBase)sender).BrowserItem.Name, float.Parse(e.Data.GetValue().ToString()), e.Data.TimeStamp);
 }
        /// <summary>
        /// Data updated handler of the DataService event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GraphControlPresenter_DataUpdated(object sender, DataUpdatedEventArgs e)
        {
            bool force = this.scaleService.IsItemsVisible(e.Items);

            UpdateView(force, e.Items);
        }
Example #12
0
 void ObservableSubscriberDataUpdated(object sender, DataUpdatedEventArgs <T> e)
 {
     OnSubscriberDataUpdated(sender, e);
 }
        private void UpdateDataEventHandler(object sender, DataUpdatedEventArgs e)
        {
            List <string> dataList = MHelper.GetStringListFromByteArray(e.DataToHost);

            PropertiesUpdate(dataList);
        }