예제 #1
0
    /// <summary>
    /// Считывает
    /// </summary>
    public static BioResponse ReadPipe(String pipe, IDBSession dbSess) {
      var vResult = new BioResponse {
        Success = true
      };
      var v_sp = new RemoteProcessStatePack();

      if (!String.IsNullOrEmpty(pipe)) {
        var sql = "select ai_pipe.receive(:pipeName) as F_RSLT from dual";
        v_sp.pipe = pipe;
        try {
          var resObj = SQLCmd.ExecuteScalarSQL(dbSess, sql, new Params(new Param("pipeName", v_sp.pipe)), 120);
          var linesData = SQLUtils.ObjectAsString(resObj);
          if (linesData != null) {
            v_sp.sessionUID = ExctractSessionID(ref linesData);
            v_sp.lastPipedLines = new[] { linesData };
          }
        } catch (ThreadAbortException) {
          throw;
        } catch (Exception ex) {
          vResult.Ex = EBioException.CreateIfNotEBio(ex);
        }
      }
      vResult.RmtStatePacket = v_sp;
      return vResult;
    }
 private void _doOnChangeState(RemoteProcessStatePack packet) {
   if ((this._prevState == null) || (this._prevState != packet.State)) {
     this._prevState = packet.State;
     if (rmtUtl.IsRunning(packet.State)) {
       this.btnRun.IsEnabled = false;
       this.btnBreak.IsEnabled = true;
       this.btnClose.IsEnabled = false;
       this.btnOpen.IsEnabled = false;
     } else {
       this.btnRun.IsEnabled = true;
       this.btnBreak.IsEnabled = false;
       this.btnClose.IsEnabled = rmtUtl.IsFinished(packet.State);
       this.btnOpen.IsEnabled = (packet.State == RemoteProcState.Done) && packet.HasResultFile;
     }
   }
 }
 protected virtual void copyThis(ref RemoteProcessStatePack destObj) {
   destObj.BioCode = this.BioCode;
   destObj.Started = this.Started;
   destObj.Duration = this.Duration;
   destObj.State = this.State;
   destObj.HasResultFile = this.HasResultFile;
   destObj.Ex = (EBioException)this.Ex.Clone();
   destObj.pipe = this.pipe;
   destObj.sessionUID = this.sessionUID;
   destObj.owner = this.owner;
   destObj.lastPipedLines = (String[])this.lastPipedLines.Clone();
 }
 public void DoOnChangeState(RemoteProcessStatePack packet) {
   this._doOnChangeState(packet);
 }