Exemplo n.º 1
0
 private static SweetsMachineEventData ConvertToLocalStoreData(SweetsMachineSimulatorEventArg e)
 {
     return(new SweetsMachineEventData
     {
         EventTime = e.EventTime,
         EventType = (int)e.EventType,
         EventValue1 = e.Value1,
         EventValue2 = e.Value2,
         EventValue3 = e.Value3,
         SerialNumber = e.MachineSerialNumber
     });
 }
Exemplo n.º 2
0
        private void _simulator_MachineEvents(object sender, SweetsMachineSimulatorEventArg e)
        {
            switch (e.EventType)
            {
            case SweetsMachineEventTypes.BuyProduct:
                AddLog(e.ToString());
                break;

            case SweetsMachineEventTypes.TempSensor:
                AddLogTemp(e.ToString());
                break;
            }
            if (rbSendToCloud.Checked)
            {
                _eventHubSender.SendDataAsync(ConvertToEventHub(e));
            }
            _localFileStore.Save(ConvertToLocalStoreData(e));
        }