public unsafe void CopyFromCache(GLCachedBuffer SourceBuffer, CopyMethod CopyOptions)
        {
            if (SourceBuffer == null)
            {
                throw new Exception("Cannot accept a null buffer!");
            }

            lock (ThreadLock)
            {
                ops.bptr = (byte *)DrawingBuffer;
                ops.dptr = (float *)DepthBuffer;
                ops.iptr = (int *)DrawingBuffer;
                CD       = SourceBuffer;

                ops.CDptr = (float *)CD.Z_ptr;
                ops.CPptr = (byte *)CD.RGB_ptr;
                ops.CIptr = (int *)CD.RGB_ptr;

                if (CopyOptions == CopyMethod.Memcpy)
                {
                    CopyQuickReverse();
                }
                else if (CopyOptions == CopyMethod.SplitLoop)
                {
                    CopyQuickSplitLoop();
                }
                else
                {
                    CopyQuickReverseDepthTest();
                }
            }
        }
        public void MapVirtualMachine(CopyMethod copyMethod)
        {
            ConsoleOutput.WriteLine("Opening '{0}' ({1})", _vmConfig.File, _vmConfig.Type);

            _vm = new VMWareMappedVirtualMachine(
                _vmConfig.Name,
                _simulationOnly ? null : _host.Open(_vmConfig.File),
                _snapshotConfig.Username,
                _snapshotConfig.Password,
                copyMethod,
                _simulationOnly);
        }
Exemple #3
0
 public VMWareMappedVirtualMachine(
     string name,
     VMWareVirtualMachine vm,
     string username,
     string password,
     CopyMethod copyMethod,
     bool simulationOnly)
 {
     _name           = name;
     _vm             = vm;
     _copyMethod     = copyMethod;
     _username       = username;
     _password       = password;
     _simulationOnly = simulationOnly;
 }
 public VMWareMappedVirtualMachine(
     string name,
     VMWareVirtualMachine vm,
     string username,
     string password,
     CopyMethod copyMethod,
     bool simulationOnly)
 {
     _name = name;
     _vm = vm;
     _copyMethod = copyMethod;
     _username = username;
     _password = password;
     _simulationOnly = simulationOnly;
 }
Exemple #5
0
    public Network(Network other, CopyMethod method)
    {
        layers = other.layers;

        if (method == CopyMethod.DEEP)
        {
            Init_Weights(other);
        }
        else if (method == CopyMethod.RANDOM)
        {
            Init_Weights(null);
        }
        else if (method == CopyMethod.SHALLOW)
        {
            for (int i = 0; i < layers.Length - 1; i++)
            {
                weights.Add(new double[layers[i], layers[i + 1]]);
            }
        }
    }
Exemple #6
0
        public bool InstallUninstall(
            InstallerConfig installerConfig,
            DriverTaskInstanceOptions options)
        {
            try
            {
                _results.Clear();

                _vmPowerDriver.PowerOnDependencies();
                _vmPowerDriver.ThrowOnFailure();

                _vmPowerDriver.ConnectToHost();

                CopyMethod copyMethod = _vmConfig.CopyMethod;
                if (copyMethod == CopyMethod.undefined)
                {
                    copyMethod = installerConfig.CopyMethod;
                }
                _vmPowerDriver.MapVirtualMachine(copyMethod);

                if (!_snapshotRestored)
                {
                    _vmPowerDriver.PrepareSnapshot();
                    _snapshotRestored = true;
                }

                _vmPowerDriver.LoginToGuest();

                CopyInstaller(installerConfig);

                Instance installInstance = new Instance(
                    _logpath, _simulationOnly, _config, _vmPowerDriver.Vm, _vmPowerDriver.VmConfig, installerConfig, _vmPowerDriver.SnapshotConfig);

                Instance.InstanceOptions instanceOptions = new Instance.InstanceOptions();
                instanceOptions.Install   = options.Install;
                instanceOptions.Uninstall = options.Uninstall;
                Result remoteInstallResult = installInstance.InstallUninstall(instanceOptions);

                foreach (VirtualMachinePowerResult powerResult in _vmPowerDriver.PowerResults)
                {
                    remoteInstallResult.Add(powerResult);
                }

                _results.Add(remoteInstallResult);

                if (remoteInstallResult.RebootRequired)
                {
                    if (installerConfig.RebootIfRequired)
                    {
                        ConsoleOutput.WriteLine("Shutting down '{0}:{1}'", _vmPowerDriver.VmConfig.Name,
                                                _vmPowerDriver.SnapshotConfig.Name);
                        _vmPowerDriver.ShutdownGuest();
                        ConsoleOutput.WriteLine("Powering on '{0}:{1}'", _vmPowerDriver.VmConfig.Name,
                                                _vmPowerDriver.SnapshotConfig.Name);
                        _vmPowerDriver.PowerOn();
                    }
                    else if (options.PowerOff)
                    {
                        _vmPowerDriver.PowerOff();
                    }
                    else
                    {
                        ConsoleOutput.WriteLine("Skipping reboot of '{0}:{1}'", _vmPowerDriver.VmConfig.Name,
                                                _vmPowerDriver.SnapshotConfig.Name);
                    }
                }
                else if (options.PowerOff)
                {
                    _vmPowerDriver.PowerOff();
                }

                return(remoteInstallResult.Success);
            }
            catch (Exception ex)
            {
                ConsoleOutput.WriteLine(ex);
                Result result = new Result(installerConfig.Name, installerConfig.SvnRevision);
                result.LastError         = ex.Message;
                result.SuccessfulInstall = result.SuccessfulUnInstall = InstallResult.False;
                _results.Add(result);
                return(false);
            }
            finally
            {
                _vmPowerDriver.CloseVirtualMachine();
                _vmPowerDriver.DisconnectFromHost();
                _vmPowerDriver.PowerOffDependencies();
            }
        }
 public InstallerConfig(string destinationPath, CopyMethod copyMethod)
 {
     _destinationPath = destinationPath;
     CopyMethod       = copyMethod;
 }
 public NoopInstallerConfigProxy(string destinationPath, CopyMethod copyMethod)
     : base(destinationPath, copyMethod)
 {
     _config = new NoopInstallerConfig(destinationPath, copyMethod);
 }
Exemple #9
0
 static extern bool StretchBlt(IntPtr hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, IntPtr hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, CopyMethod dwRop);
 public DniInstallerConfig(string destinationPath, CopyMethod copyMethod)
     : base(destinationPath, copyMethod)
 {
 }
 public NoopInstallerConfig(string destinationPath, CopyMethod copyMethod)
     : base(destinationPath, copyMethod)
 {
     File = string.Empty;
 }
Exemple #12
0
 /// <summary>
 /// Copies the specified percentage of solutions from the current population to the new population
 /// using the specified copy method.
 /// </summary>
 /// <param name="copyPercentage"></param>
 /// <param name="copyMethod"></param>
 public Copy(int copyPercentage, CopyMethod copyMethod)
 {
     _percentageS = copyPercentage;
     _copyMethod  = copyMethod;
     Enabled      = true;
 }
 /// <summary>
 /// Copies the specified percentage of solutions from the current population to the new population
 /// using the specified copy method.
 /// </summary>
 /// <param name="copyPercentage"></param>
 /// <param name="copyMethod"></param>
 public Copy(int copyPercentage, CopyMethod copyMethod)
 {
     _percentageS = copyPercentage;
     _copyMethod  = copyMethod;
 }
 /// <summary>
 /// Fills any spare capaity by copying the solutions from the current population to the new population
 /// using the specified copy method.
 /// </summary>
 /// <param name="copyMethod"></param>
 public Copy(CopyMethod copyMethod)
     : this(100, copyMethod)
 {
 }
 public VirtualMachineConfig(CopyMethod copyMethod)
 {
     CopyMethod = copyMethod;
 }
Exemple #16
0
 public NoopInstallerConfig(string destinationPath, CopyMethod copyMethod)
     : base(destinationPath, copyMethod)
 {
     File = string.Empty;
 }
Exemple #17
0
 private static string GetTransferString(DMLibDataType sourceType, DMLibDataType destType, CopyMethod copyMethod)
 {
     return(sourceType.ToString() + destType.ToString() + copyMethod.ToString());
 }
Exemple #18
0
 public ExeInstallerConfig(string destinationPath, CopyMethod copyMethod)
     : base(destinationPath, copyMethod)
 {
 }
 public VirtualMachineConfig(CopyMethod copyMethod)
 {
     CopyMethod = copyMethod;
 }
        public void MapVirtualMachine(CopyMethod copyMethod)
        {
            ConsoleOutput.WriteLine("Opening '{0}' ({1})", _vmConfig.File, _vmConfig.Type);

            _vm = new VMWareMappedVirtualMachine(
                _vmConfig.Name,
                _simulationOnly ? null : _host.Open(_vmConfig.File),
                _snapshotConfig.Username,
                _snapshotConfig.Password,
                copyMethod,
                _simulationOnly);
        }