Beispiel #1
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceId'>
 /// </param>
 /// <param name='datapointId'>
 /// </param>
 /// <param name='timestamp'>
 /// </param>
 /// <param name='value'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <double?> AddDeviceDataAsync(this IHistorian operations, string deviceId, string datapointId = default(string), DateTime?timestamp = default(DateTime?), double?value = default(double?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddDeviceDataWithHttpMessagesAsync(deviceId, datapointId, timestamp, value, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 public UnitReportsJob(IHistorian historian)
 {
     Name = "Unit Reports";
     Report = new UnitReport();
     Historian = historian;
      Logger = NLog.LogManager.GetCurrentClassLogger();
      IsNflRelated = true;
 }
 public OutputProjectionsJob(IHistorian historian)
 {
     Name = "Team Output Projections";
      Report = new ScoreTally();
      Historian = historian;
      Logger = NLog.LogManager.GetCurrentClassLogger();
      IsNflRelated = true;
 }
        public PreviousPickupChartJob( IKeepTheTime timekeeper, IHistorian historian )
        {
            Name = "Previous Pickup Chart";
             TimeKeeper = timekeeper;
             Logger = LogManager.GetCurrentClassLogger();
             Historian = historian;

             Week = Int32.Parse( TimeKeeper.PreviousWeek() );

             Report = new PickupChart(
            TimeKeeper.CurrentSeason( DateTime.Now ), Week );
        }
        private static bool OnStart(ServiceManager serviceManager)
        {
            var config = Config.FromFile();

            Log.Logger = new LoggerConfiguration()
                         .WriteTo.Console()
                         .WriteTo.RollingFile(new JsonFormatter(), "log-{Date}.txt", retainedFileCountLimit: 30, fileSizeLimitBytes: 10000)
                         .CreateLogger();

            IHistorian historian = null;

#if DEBUG
            historian = new Mock.HistorianClientMock(
                config.HistorianClientConfiguration == null
                    ? null
                    : config.HistorianClientConfiguration.SubscribeMessage);
#else
            historian = new Client.HistorianClient(config.HistorianClientConfiguration);
#endif
            DomainEvents.Register(historian);

            var rabbitMQPublisher = new RabbitMQPublisher(
                config.RabbitMQConfiguration.Hostname,
                config.RabbitMQConfiguration.Username,
                config.RabbitMQConfiguration.Password,
                config.RabbitMQConfiguration.SensorDataEventQueue);
            DomainEvents.Register(rabbitMQPublisher);
#if DEBUG
            DomainEvents.Register(new Mock.SensorDataLogger());
#endif
            DomainEvents.Register(new ConfigurationPersister());

            return(serviceManager
                   .Add(rabbitMQPublisher)
                   .Add(new RabbitMQListener(config.RabbitMQConfiguration.Hostname,
                                             config.RabbitMQConfiguration.Username,
                                             config.RabbitMQConfiguration.Password,
                                             config.RabbitMQConfiguration.ConfigurationEventQueue))
                   .Add(new WebSocketService(config.WebSocketServiceConfiguration))
                   .Add(historian)
                   .Start());
        }
Beispiel #6
0
        public String Logon(string connectionString)
        {
            //带连接字符串的连接函数,采用传入参数connectionString进行连接。
            if (this._rtdbconnection == null || this._rtdbconnection.State.ToString() != "Open")
            {
                this.ConnectionString = connectionString;
                this._rtdbconnection  = new RTDBConnection(connectionString);
                this._rtdbconnection.Open();
                this._iBase      = new BaseImpl(this._rtdbconnection);
                this._iSnapshot  = new SnapshotImpl(this._rtdbconnection);
                this._iHistorian = new HistorianImpl(this._rtdbconnection);
                this._iServer    = new ServerImpl(this._rtdbconnection);
            }

            if (this._rtdbconnection.State.ToString() == "Open")
            {
                return("logon");
            }
            else
            {
                return("logoff");
            }
        }
Beispiel #7
0
 public DefaultApiController(IStore store, ILogger <DefaultApiController> logger, IHistorian historian)
 {
     this.store     = store;
     this.logger    = logger;
     this.historian = historian;
 }
Beispiel #8
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceId'>
 /// </param>
 /// <param name='datapointId'>
 /// </param>
 /// <param name='timestamp'>
 /// </param>
 /// <param name='value'>
 /// </param>
 public static double?AddDeviceData(this IHistorian operations, string deviceId, string datapointId = default(string), DateTime?timestamp = default(DateTime?), double?value = default(double?))
 {
     return(Task.Factory.StartNew(s => ((IHistorian)s).AddDeviceDataAsync(deviceId, datapointId, timestamp, value), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 public BurnupController(IHistorian historian)
 {
     this.historian = historian;
 }
 public BurnDownController(IHistorian historian)
 {
     this.historian = historian;
 }
 public BugsController(IHistorian historian)
 {
     this.historian = historian;
 }