{

  "logging": {
    "logFileComment": "Filename for the log. Log is written to /var/log/icebear. If running multiple instances, use a separate log file for each.",
    "logFile": "",
    "logLevelComment": "1-full debug, 2-info (probably best), 3-only warnings and errors, 4-only errors",
    "logLevel":2
  },

  "iceBear":{
    "urlComment":"Set 'url' to be your IceBear homepage.",
    "url":"http://icebear.ejd",
    "apiKeyComment": "Log into IceBear as an administrator, select Configuration from the menu. On the API Keys tab, generate a key with scope 'RigakuImport'.",
    "apiKey": "406109d9932e2e5dec827dd4a0ee013b3b7dc4224c244b2c75979d83f4fd"
  },

  "imagers": [
    {
      "name": "My other Rigaku imager",
      "nominalTemperature": 4,
      "plateCapacity": 200,
      "micronsPerPixel": 2.098,
      "platesDirectory": "C:/Rigaku example plate/Plates",
      "imagesDirectory": "C:/Rigaku example plate/Pub/Images",
      "thumbnailsDirectory": "C:/Rigaku example plate/Pub/Thumbnails"
    }
  ],

  "imagingTypesComment":[
    "Mapping of image type code (found in filenames) to name and light path.",
    "Where multiple images are taken of a drop, the inspection will be split into several IceBear inspections.",
    "The order of those inspections is the reverse of this array. If adding to this, keep the default 00/Visible FIRST.",
    "THE IMPORTER WILL STOP IF AN IMAGING TYPE NOT IN THIS LIST IS ENCOUNTERED!"
  ],
  "imagingTypes":{
    "00": { "label":"00", "name":"Normal", "light":"Visible" },
    "E0": { "label":"E0", "name":"Enhanced", "light":"Visible" },
    "HF": { "label":"HF", "name":"High Frequency", "light":"Visible" },
    "U0": { "label":"U0", "name":"UV", "light":"UV" }
  },

  "scoringSystemComment":[
    "By default, IceBear will create a scoring system called 'Rigaku' with the CrystalTrak scores and colours.",
    "To define a custom scoring system, rename 'scoringSystemExample' below to 'scoringSystem' and edit it.",
    "Scores have 'color' (HTML colour code), 'index' (lower numbers worse), 'hotkey'(should be 0-9), 'name' (human-friendly label)"
  ],
  "scoringSystemExample": {
    "name": "Example",
    "scores": [
      {"color":"ffffff", "index":"0", "hotkey":"0", "name":"Nothing"},
      {"color":"666666", "index":"1", "hotkey":"9", "name":"Rubbish"},
      {"color":"ff0000", "index":"9", "hotkey":"1", "name":"Crystals"}
    ]
  },

  "platesStopOnFirstExistingComment": [
    "We process plate XML files in order of create time, newest first. This setting defines what happens when we reach ",
    "the first XML describing a plate that already exists in IceBear. In normal operation, we want to stop when we ",
    "reach a plate that exists, and assume that all earlier XML files have been processed. On commissioning, we assume ",
    "that none of the plates described in XML exist in IceBear, so this setting can be left at true. We only want to ",
    "set this false if there is a problem on the commissioning run and need to get past newly-created plates to finish."
  ],
  "platesStopOnFirstExisting":true,

  "inspectionsStopAfterThisManyFoundCompletedComment": [
    "The importer finds the newest inspection and works backward from there. It should stop after encountering this many",
    "completed inspections (already exist in IceBear and image count matches). A small value like 2 or 3 is sensible. If",
    "zero, the importer WILL NOT STOP, and will re-import all inspections back to the importFromDate specified below."
  ],
  "inspectionsStopAfterThisManyFoundCompleted": 3,

  "importFromDateComment": "Start from this date if no Rigaku plates found in IceBear",
  "importFromDate": "2020-01-01",

  "inspectionMinimumAgeMinutesComment":"Don't import any inspections younger than this, because they may not be complete",
  "inspectionMinimumAgeMinutes": 30,

  "lockfileMaximumAgeMinutesComment": "If a lockfile from a previous run exists, don't delete it and continue until it is this old",
  "lockfileMaximumAgeMinutes": 60,

  "duplicateInspectionBufferMinutesComment":[
    "The older 'pull' importer (rigakuimporter/import.php in IceBear) calculated the inspection time differently. Running this",
    "newer 'push' importer against an IceBear that previously used the 'pull' importer could cause duplicate inspections because",
    "no inspection exists with exactly the same datetime. The difference could be in the order of 10-15 minutes, depending on",
    "number of subpositions, whether UV imaging was also carried out, etc. If non-zero, this setting allows the importer to",
    "assume that any inspection on the plate within N minutes is the same as the one in the Rigaku filesystem. For IceBears that",
    "have never had plates imported by the 'pull' importer, or where those plates are so old that the importer will never get",
    "confused by them, this can be set to zero."
  ],
  "duplicateInspectionBufferMinutes": 25,

  "imagesPerPushComment":[
    "How many images to batch together into a single creation request. Higher numbers reduce HTTP overhead, but may ",
    "cause failures due to encountering IceBear's PHP limitation on request size. 12 is a good starting point."
  ],
  "imagesPerPush": 12,

  "errorHandlingComment": [
    "Defines how certain error conditions should be handled. Should be one of:",
    " 'stop' - throw an exception and stop the importer",
    " 'warn' - write a warning to the log file but continue",
    " 'ignore' - write info to the log and continue"
  ],
  "errorHandling":{
    "plateXmlNotAPlate":"warn",
    "imagerPlateTemperatureMismatch":"warn",
    "xmlIceBearScreenConditionsMismatch":"stop"
  }

}