Ejemplo n.º 1
0
        public JobInfo Execute(Guid sessionID, string webServiceUrl, JobInfo job)
        {
            sessionID_ = sessionID;
            webServiceUrl_ = webServiceUrl;
            //
            string localFile = exeInfo.workingFolder_+"\\"+ job.RemoteFilePath;
            download(job.RemoteFilePath, localFile);

            string outputFile = localFile + ".txt";

            int result = ocrExecute(localFile, outputFile);
            job.Result = result;

            if (result == 0)
            {//success
                string rFile = job.RemoteFilePath + ".txt";
                upload(rFile, outputFile);
                job.ResultRemoteFilePath = rFile;
            }
            else
            {//error
            }
            //
            return job;
        }
Ejemplo n.º 2
0
        public static IMessageHandler findHandler(string message, out JobInfo job)
        {
            job = null;
            if (message == null)
                return null;
            //
            JobInfo j = decodeJobInfo(message);
            if (j == null)
                return null;
            job = j;

            string appKey = buildAppID(j);
            if (appKey == null)
                return null;

            if (s_services.ContainsKey(appKey))
                return s_services[appKey];
            return null;
        }
Ejemplo n.º 3
0
 public static string buildAppID(JobInfo j)
 {
     if (j == null)
         return null;
     return j.AppID + "-" + j.Version;
 }