예제 #1
0
        public void UpdateCurveFromStream(ModelStream modelStream, GraphDrawer.Curve curve, double timeBegin, double timeEnd, ref float min, ref float max)
        {
            var timeValueList = ListPool <(double, float)> .Take();

            modelStream.StreamImpl.GetValues(timeBegin, timeEnd, timeValueList);

            Color c = modelStream.StreamImpl.Color;

            UpdateCurveFromValues(c, curve, ref min, ref max, timeValueList);

            ListPool <(double, float)> .Release(timeValueList);
        }
예제 #2
0
 /// <summary>
 /// There are two unmanaged resources we can dispose, <see cref="_session"/> and <see cref="ModelStream"/>
 /// </summary>
 /// <param name="disposing"></param>
 private void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         // There are two things to be disposed.
         if (disposing)
         {
             // First, we release the resource token by ONNXRuntime.
             _session.Dispose();
             // Second, Dispose of the model file stream.
             ModelStream.Dispose();
         }
         _disposed = true;
     }
 }