Exemple #1
0
        /// <summary>
        /// On data event from socket
        /// </summary>
        /// <param name="data"></param>
        private void OnData(string data)
        {
            //Data capture
            DataCapture?.Invoke(data);

            //Convert and use
            if (TryConvert(data, out DataPoint[] datapoint))
Exemple #2
0
 public static void Add(DataCapture.Data item)
 {
     if (DataAdded != null)
     {
         CapturedData.Push<DataCapture.Data>(item);
         DataAdded.Invoke(null, EventArgs.Empty);
     }
 }
Exemple #3
0
        protected void SaveCapture()
        {
            var dataCapture = new DataCapture {
                Expression = Model.Expression, Name = Model.Name, Type = Model.CaptureType
            };

            NatsService.Configuration.DataCaptures.Add(dataCapture);
            NatsService.Save();
            DataCaptureGrid.Insert(0, dataCapture);
        }
Exemple #4
0
 public MessageAnswerContext(
     DataCapture <Message> capture,
     BotDbContext context,
     ITelegramClient bot,
     IOptionsSnapshot <TelegramOptions> options,
     IOmbiService ombiAdmin,
     IBotOmbiService ombi,
     ILogger <MessageAnswerContext <TProgression> > logger
     ) : base(capture.Data?.Text, capture?.Data, context, bot, options, ombiAdmin, ombi, logger)
 {
 }
Exemple #5
0
 public OmbiServiceFactory(
     BotDbContext context,
     DataCapture <Message> capture,
     ILogger <OmbiServiceFactory> logger,
     IOptionsSnapshot <OmbiOptions> options)
 {
     _context = context;
     _capture = capture;
     _logger  = logger;
     _options = options;
 }
Exemple #6
0
        /// <summary>
        /// Called when data was received
        /// </summary>
        /// <param name="data">The data.</param>
        private void OnData(string data)
        {
            try
            {
                //Reset timer
                _timeoutTimer.EnableAndReset();

                //Data capture
                DataCapture?.Invoke(data);

                //Convert and use
                if (TryConvert(data, out DataPoint[] datapoint))
 public DataSyncMenuProvider(IocManager _iocManager,
                             IFormIOSchemeManager _formIOSchemeManager,
                             IDataSyncSettingsManager _dataSyncSettingManager,
                             DataSyncOperator _dataSyncOperator,
                             DataCapture _dataCapture,
                             TriggerOperation _triggerOperation
                             )
 {
     iocManager             = _iocManager;
     formIOSchemeManager    = _formIOSchemeManager;
     dataSyncSettingManager = _dataSyncSettingManager;
     dataSyncOperator       = _dataSyncOperator;
     dataCapture            = _dataCapture;
     triggerOperation       = _triggerOperation;
     Logger = NullLogger.Instance;
 }
Exemple #8
0
        private void OnItemClicked(string colName, DataCapture dataCapture)
        {
            switch (colName)
            {
            case nameof(DataCapture.Trash):
                NatsService.Configuration.DataCaptures.Remove(dataCapture);
                NatsService.Save();
                DataCaptureGrid.Remove(dataCapture);
                break;

            case nameof(DataCapture.Run):
                OnSelectedItemChanged(dataCapture);
                TestCapture();
                break;
            }
            InvokeAsync(StateHasChanged);
        }
Exemple #9
0
        public MainWindow()
        {
            kinect  = new KinectManager();
            capture = new DataCapture();

            rnd = new Random();

            kinect.OnStartTracking += PersonEnter;
            kinect.OnStopTracking  += PersonLeave;

            KinectRegion.SetKinectRegion(this, kinectRegion);

            this.DataContext = this;
            this.KeyDown    += new KeyEventHandler(OnButtonKeyDown);
            this.InitializeComponent();

            Mouse.OverrideCursor = Cursors.None;
        }
Exemple #10
0
 public static void DataSyncOperationClick(IocManager iocManager, DataSyncDirection dataSyncDirection, DataCapture dataCapture, DataSyncOperator dataSyncOperator, ILogger logger)
 {
     try
     {
         DataSyncConfig config = GetDataSyncConfig();
         if (config != null)
         {
             WaitDialogForm sdf = new WaitDialogForm("提示", "正在同步数据......");
             dataSyncOperator.SyncData(config, dataSyncDirection);
             dataCapture.CaptureDirtyFromDBAndSave(config, dataSyncDirection);
             MessageBox.Show(dataSyncDirection == DataSyncDirection.InnerDataSync? "内网数据同步完成" : "外网数据同步完成");
             sdf.Close();
         }
         else
         {
             logger.Warn("未找到数据同步的配置。/DataOperation/DataCaptureConfig.json");
         }
     }
     catch (Exception ex) {
         EventBus.Default.Trigger(new NonUIExceptionEventData {
             UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false)
         });
     }
 }
 public DataSysncMenuAction(IocManager _iocManager, DataCapture _dataCapture, DataSyncOperator _dataSyncOperator)
 {
     iocManager       = _iocManager;
     dataCapture      = _dataCapture;
     dataSyncOperator = _dataSyncOperator;
 }
Exemple #12
0
 private void OnItemDoubleClicked(string colName, DataCapture dataCapture)
 {
     OnSelectedItemChanged(dataCapture);
     TestCapture();
     InvokeAsync(StateHasChanged);
 }
Exemple #13
0
 private void OnSelectedItemChanged(DataCapture dataCapture)
 {
     Model.CaptureType = dataCapture.Type;
     Model.Name        = dataCapture.Name;
     Model.Expression  = dataCapture.Expression;
 }