Exemplo n.º 1
0
    private void hlRun(string csvFile)
    {
        Console.CancelKeyPress += cancelHandler;

        entropyControl.updateStatus          = writeLine;
        entropyControl.directProgress        = directProgress;
        entropyControl.clearAbortFlagFunc    = clearAbortFlag;
        entropyControl.abortRunFunc          = abortRun;
        entropyControl.abortRunFuncMT        = abortRunMT;
        entropyControl.updateSimUIFunc       = updateSimUIST;
        entropyControl.updateSimUIMTFunc     = updateSimUIMT;
        entropyControl.updateProgressBarFunc = updateProgress;
        entropyControl.simRunningFunc        = simRunning;
        entropyControl.postSimUIFunc         = summary;

        string tmp;

        if (commonVars.getFriendly())
        {
            tmp = utility.Utils.friendlyNumber(commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.nCases));
        }
        else
        {
            tmp = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.nCases).ToString();
        }
        Console.WriteLine("Starting run for " + tmp + " cases.");
        entropyControl.swTime = 0.0;
        bool threaded = varianceContext.numberOfThreads != 1;

        entropyControl.EntropyRun(commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.nCases), csvFile, threaded, false);
    }
Exemplo n.º 2
0
    private static bool pReadQuiltCSVFile(ref CommonVars commonVars, string fileName)
    {
        bool reading = false;

        try
        {
            using (StreamReader sr = new(fileName))
            {
                reading = true;
                char[] csvSeparators = { ',' };

                // Read in non-CSV data first
                // Pattern line
                string check = sr.ReadLine();
                // ReSharper disable once PossibleNullReferenceException
                if (!check.StartsWith("Quilt"))
                {
                    return(false);
                }
                // Now we have the meat of the data we need.
                string   tempString   = sr.ReadLine();
                string[] parsedString = tempString.Split(csvSeparators);
                if (parsedString.Length >= 6)
                {
                    // We have 6 values to extract from this line.
                    // X-offset, Y-offset, X pitch, Y pitch, rows, cols
                    // Convert from um to nm in the process.
                    // Take the second result of the split which is the numeric value. Convert it to double, multiply by 1000 to convert units. Make int.
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.colOffset, Convert.ToDouble(parsedString[0]));
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.rowOffset, Convert.ToDouble(parsedString[1]));
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.colPitch, Convert.ToDouble(parsedString[2]));
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.rowPitch, Convert.ToDouble(parsedString[3]));
                    commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.rows, Convert.ToInt32(parsedString[4]));
                    commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.cols, Convert.ToInt32(parsedString[5]));
                }
                else
                {
                    // We need to break here.
                    ErrorReporter.showMessage_OK("CSV file doesn't match expectations.", "Aborting.");
                    return(false);
                }
            }
            reading = false;
        }
        catch (Exception)
        {
            return(reading);
        }

        commonVars.getSimulationSettings().getDOESettings().setBool(DOESettings.properties_b.quilt, true);
        commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.uTileList, 0);
        commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.sTile, 0);
        return(reading);
    }
Exemplo n.º 3
0
 private void init(int number, bool previewMode, bool doPASearch, ref CommonVars commonVars)
 {
     dimensions  = ChaosSettings.getDimensions();
     _commonVars = commonVars;
     if (_commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.linkCDU) == 1)
     {
         dimensions -= 3;
     }
     sampleCount = number;
     pMode       = previewMode;
     paSearch    = doPASearch;
 }
Exemplo n.º 4
0
    private ChaosSettings generateSample()
    {
        ChaosSettings currentJobSettings = new(pMode, _commonVars.getListOfSettings(), _commonVars.getSimulationSettings());

        if (paSearch)
        {
            _commonVars.getPASearch().modifyJobSettings(ref currentJobSettings);
        }

        // Massage our CDUTVar if the simulation settings call for the variation to be linked (default)
        // Tie up the tip variation values as well.
        if (_commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.linkCDU) != 1)
        {
            return(currentJobSettings);
        }

        currentJobSettings.setValues(ChaosSettings.properties.CDUTVar, currentJobSettings.getValues(ChaosSettings.properties.CDUSVar));
        currentJobSettings.setValues(ChaosSettings.properties.hTipBiasVar, currentJobSettings.getValues(ChaosSettings.properties.vTipBiasVar));
        currentJobSettings.setValues(ChaosSettings.properties.hTipBiasType, currentJobSettings.getValues(ChaosSettings.properties.vTipBiasType));

        return(currentJobSettings);
    }
Exemplo n.º 5
0
    private static bool pReadiDRMCSVFile(ref CommonVars commonVars, string fileName)
    {
        bool         reading    = false;
        List <int[]> tilesToRun = new(); // will be col,row

        try
        {
            using (StreamReader sr = new(fileName))
            {
                char[] csvSeparators   = { ',' };
                char[] equalSeparators = { '=' };

                reading = true;
                // Read in non-CSV data first
                // Pattern line
                sr.ReadLine();
                // Now we have the meat of the data we need.
                string tempString = sr.ReadLine();
                // ReSharper disable once PossibleNullReferenceException
                string[] parsedString = tempString.Split(csvSeparators);
                if (parsedString.Length >= 6)
                {
                    // We have 6 values to extract from this line.
                    // X-offset, Y-offset, X pitch, Y pitch, rows, cols
                    // Convert from um to nm in the process.
                    // Take the second result of the split which is the numeric value. Convert it to double, multiply by 1000 to convert units. Make int.
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.colOffset, 1000 * Convert.ToDouble(parsedString[0].Split(equalSeparators)[1]));
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.rowOffset, 1000 * Convert.ToDouble(parsedString[1].Split(equalSeparators)[1]));
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.colPitch, 1000 * Convert.ToDouble(parsedString[2].Split(equalSeparators)[1]));
                    commonVars.getSimulationSettings().getDOESettings().setDouble(DOESettings.properties_d.rowPitch, 1000 * Convert.ToDouble(parsedString[3].Split(equalSeparators)[1]));
                    commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.rows, Convert.ToInt32(Convert.ToDouble(parsedString[4].Split(equalSeparators)[1])));
                    commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.cols, Convert.ToInt32(Convert.ToDouble(parsedString[5].Split(equalSeparators)[1])));
                }
                else
                {
                    // We need to break here.
                    ErrorReporter.showMessage_OK("CSV file doesn't match expectations.", "Aborting.");
                    return(false);
                }

                sr.ReadLine(); // skip a line that we don't need.

                while (!sr.EndOfStream)
                {
                    // Assuming Pass/Fail,Column,Row,Co-ord X,Co-ord Y,,,,,,,,,,,,,
                    tempString   = sr.ReadLine();
                    parsedString = tempString.Split(csvSeparators);
                    if (parsedString[0] == "" || parsedString[0] == "Occupy matrix")
                    {
                        break;
                    }

                    if (Convert.ToInt32(parsedString[0]) == 1)
                    {
                        // Pass case - need to add to list.
                        tilesToRun.Add(new [] { Convert.ToInt32(parsedString[1]), Convert.ToInt32(parsedString[2]) });
                    }
                }
            }

            commonVars.getSimulationSettings().getDOESettings().setBool(DOESettings.properties_b.iDRM, true);
            commonVars.getSimulationSettings().getDOESettings().setTileList_ColRow(tilesToRun);
            commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.uTileList, 1);
            commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.sTile, 0);
        }
        catch (Exception)
        {
            return(reading);
        }

        commonVars.getSimulationSettings().getDOESettings().setBool(DOESettings.properties_b.iDRM, true);
        commonVars.getSimulationSettings().getDOESettings().setTileList_ColRow(tilesToRun);
        commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.uTileList, 1);
        commonVars.getSimulationSettings().getDOESettings().setInt(DOESettings.properties_i.sTile, 0);
        return(reading);
    }