Exemple #1
0
        /// <summary>
        /// The method returns log data filtered by the specified filter.
        /// [HttpPost ("getJournalDatas/{journalTypeName}")]
        /// </summary>
        /// <returns> Returns log data filtered by the specified filter</returns>
        public string GetJournalDatas(string journalTypeName, EventLogBaseGridFilter filter)
        {
            var postParams = JsonConvert.SerializeObject(filter);
            var url        = $"/api/Journals/getJournalDatas/{journalTypeName}";

            return(Post(url, postParams));
        }
Exemple #2
0
        /// <summary>
        /// Method for obtaining a list of programs executed on machines.
        /// </summary>
        /// <param name = "dpaClient"> Authorized client </param>
        /// <returns> Returns a list of running programs on machines </returns>
        public static IEnumerable <ProcessingProgramRecord> GetProcessingProgramRecord(DpaClient dpaClient)
        {
            var filter = new GridRequestOptions()
            {
                Skip = 0,
                Take = 20,
            };
            var gridOptions = new EventLogBaseGridFilter()
            {
                GridOptions         = filter,
                DateTimeOffsetFrom  = DateTimeOffset.Now.AddDays(-1),
                DateTimeOffsetUntil = DateTimeOffset.Now,
                ItemIds             = { }
            };
            var processingProgramRecordJson = dpaClient.GetJournalDatas("ProcessingProgramRecord", gridOptions);

            return(JsonConvert.DeserializeObject <List <ProcessingProgramRecord> >(processingProgramRecordJson));
        }
Exemple #3
0
        /// <summary>
        /// Method for obtaining a list of machine statuses.
        /// </summary>
        /// <param name = "dpaClient"> Authorized client </param>
        /// <returns> Returns a list of machine states </return
        public static IEnumerable <MachineStateRecord> GetMachineStatus(DpaClient dpaClient)
        {
            var filter = new GridRequestOptions()
            {
                Skip = 0,
                Take = 20,
            };
            var gridOptions = new EventLogBaseGridFilter()
            {
                GridOptions         = filter,
                DateTimeOffsetFrom  = DateTimeOffset.Now.AddDays(-1),   // Beginning of period.
                DateTimeOffsetUntil = DateTimeOffset.Now,               // End of period.
                ItemIds             = { }                               // List of id equipmets (machines).
            };
            var processingProgramRecordJson = dpaClient.GetJournalDatas("MachineStateRecord", gridOptions);

            return(JsonConvert.DeserializeObject <List <MachineStateRecord> >(processingProgramRecordJson));
        }