Ejemplo n.º 1
0
        /// <summary>
        ///     Set the simulation
        /// </summary>
        /// <param name="pauseInterval"></param>
        /// <param name="fidelity"></param>
        /// <param name="timeUnits"></param>
        public void SetSimulation(Fidelity fidelity, ushort pauseInterval, TimeStepType timeUnits)
        {
            Simulation.DeltaTime = fidelity switch
            {
                Fidelity.Low => 0.5F,
                Fidelity.Medium => 0.25F,
                Fidelity.High => 0.125F,
                _ => throw new ArgumentOutOfRangeException(nameof(fidelity), fidelity, null)
            };

            Simulation.PauseInterval = pauseInterval;
            Simulation.TimeUnits     = timeUnits;
        }
Ejemplo n.º 2
0
        public void SetFidelity(int level)
        {
            switch (level)
            {
            default:
                Fidelity = Fidelity.Low;
                break;

            case 1:
                Fidelity = Fidelity.Medium;
                break;

            case 2:
                Fidelity = Fidelity.High;
                break;
            }
        }
Ejemplo n.º 3
0
        /* Makes a PerformTranscription call */
        public Guid PerformTranscription(Guid apiToken,
                                         Guid jobId,
                                         Fidelity fidelity,
                                         Priority?priority                   = null,
                                         Uri callbackUri                     = null,
                                         int?turnaroundHours                 = null,
                                         Language?targetLanguage             = null,
                                         PerformTranscriptionOptions options = null)
        {
            Dictionary <string, string> queryDictionary = InitJobReqDict(apiToken, jobId);

            queryDictionary.Add("transcription_fidelity", fidelity.GetDescription());
            if (priority != null)
            {
                queryDictionary.Add("priority", priority.GetDescription());
            }
            if (callbackUri != null)
            {
                queryDictionary.Add("callback_url", callbackUri.ToString());
            }
            if (turnaroundHours != null)
            {
                queryDictionary.Add("turnaround_hours", turnaroundHours.ToString());
            }
            if (targetLanguage != null)
            {
                queryDictionary.Add("target_language", targetLanguage.GetDescription());
            }
            if (options != null)
            {
                queryDictionary.Add("options", JsonConvert.SerializeObject(options.GetDictionary()));
            }

            Uri    requestUri     = Utils.BuildUri(BASE_URL, PERFORM_TRANSCRIPTION, queryDictionary);
            string serverResponse = web.HttpRequest(requestUri, HttpMethod.GET, WebUtils.BASIC_TIMEOUT);
            Dictionary <string, string> response = Utils.Deserialize <Dictionary <string, string> >(serverResponse);

            return(new Guid(response["TaskId"]));
        }
Ejemplo n.º 4
0
 public JobListOptions(DateTime? createDateFrom = null,
                       DateTime? createDateTo = null,
                       DateTime? startDateFrom = null,
                       DateTime? startDateTo = null,
                       DateTime? dueDateFrom = null,
                       DateTime? dueDateTo = null,
                       DateTime? completeDateFrom = null,
                       DateTime? completeDateTo = null,
                       JobStatus? jobStatus = null,
                       Fidelity? fidelity = null,
                       Priority? priority = null,
                       int? turnaroundTimeHoursFrom = null,
                       int? turnaroundTimeHoursTo = null,
                       string jobName = null,
                       string externalId = null,
                       JobDifficulty? jobDifficulty = null,
                       string subAccount = null)
 {
     this.CreateDateFrom = createDateFrom;
     this.CreateDateTo = createDateTo;
     this.StartDateFrom = startDateFrom;
     this.StartDateTo = startDateTo;
     this.DueDateFrom = dueDateFrom;
     this.DueDateTo = dueDateTo;
     this.CompleteDateFrom = completeDateFrom;
     this.CompleteDateTo = completeDateTo;
     this.JobStatus = jobStatus;
     this.Fidelity = fidelity;
     this.Priority = priority;
     this.TurnaroundTimeHoursFrom = turnaroundTimeHoursFrom;
     this.TurnaroundTimeHoursTo = turnaroundTimeHoursTo;
     this.JobName = jobName;
     this.ExternalId = externalId;
     this.JobDifficulty = jobDifficulty;
     this.SubAccount = subAccount;
 }
Ejemplo n.º 5
0
 public void WriteSettings(Fidelity.Components.ISettingsHost notUsing)
 {
     l.Debug("WriteSettings");
 }
Ejemplo n.º 6
0
 public void ReadSettings(Fidelity.Components.ISettingsHost notUsing)
 {
     l.Debug("ReadSettings");
 }