| 65 | } |
| 66 | |
| 67 | void Config::readFromConfig(Confparse &obvconfig) { |
| 68 | // Special test here, in case we've already set the dpi from external |
| 69 | // such as command line. |
| 70 | if (getDPI() == 0) dpi = obvconfig.ParseInt("dpi", 100); |
| 71 | if (dpi < 50) dpi = 50; |
| 72 | if (dpi > 400) dpi = 400; |
| 73 | |
| 74 | windowX = obvconfig.ParseInt("windowX", 1100); |
| 75 | windowY = obvconfig.ParseInt("windowY", 700); |
| 76 | |
| 77 | fontSize = obvconfig.ParseDouble("fontSize", 20); |
| 78 | fontName = obvconfig.ParseStr("fontName", ""); |
| 79 | pinSizeThresholdLow = obvconfig.ParseDouble("pinSizeThresholdLow", 0); |
| 80 | pinShapeSquare = obvconfig.ParseBool("pinShapeSquare", false); |
| 81 | pinShapeCircle = obvconfig.ParseBool("pinShapeCircle", true); |
| 82 | |
| 83 | if ((!pinShapeCircle) && (!pinShapeSquare)) { |
| 84 | pinShapeSquare = true; |
| 85 | } |
| 86 | |
| 87 | |
| 88 | pinHalo = obvconfig.ParseBool("pinHalo", true); |
| 89 | pinHaloDiameter = obvconfig.ParseDouble("pinHaloDiameter", 1.25); |
| 90 | pinHaloThickness = obvconfig.ParseDouble("pinHaloThickness", 2.0); |
| 91 | pinSelectMasks = obvconfig.ParseBool("pinSelectMasks", true); |
| 92 | |
| 93 | pinA1threshold = obvconfig.ParseInt("pinA1threshold", 3); |
| 94 | |
| 95 | showFPS = obvconfig.ParseBool("showFPS", false); |
| 96 | showInfoPanel = obvconfig.ParseBool("showInfoPanel", true); |
| 97 | infoPanelSelectPartsOnNet = obvconfig.ParseBool("infoPanelSelectPartsOnNet", true); |
| 98 | infoPanelCenterZoomNets = obvconfig.ParseBool("infoPanelCenterZoomNets", true); |
| 99 | partZoomScaleOutFactor = obvconfig.ParseDouble("partZoomScaleOutFactor", 3.0f); |
| 100 | |
| 101 | infoPanelWidth = obvconfig.ParseInt("infoPanelWidth", 350); |
| 102 | showPins = obvconfig.ParseBool("showPins", true); |
| 103 | showPosition = obvconfig.ParseBool("showPosition", true); |
| 104 | showNetWeb = obvconfig.ParseBool("showNetWeb", true); |
| 105 | showAnnotations = obvconfig.ParseBool("showAnnotations", true); |
| 106 | showBackgroundImage = obvconfig.ParseBool("showBackgroundImage", true); |
| 107 | fillParts = obvconfig.ParseBool("fillParts", true); |
| 108 | showPartName = obvconfig.ParseBool("showPartName", true); |
| 109 | showPinName = obvconfig.ParseBool("showPinName", true); |
| 110 | centerZoomSearchResults = obvconfig.ParseBool("centerZoomSearchResults", true); |
| 111 | flipMode = obvconfig.ParseInt("flipMode", 0); |
| 112 | |
| 113 | boardFill = obvconfig.ParseBool("boardFill", true); |
| 114 | boardFillSpacing = obvconfig.ParseInt("boardFillSpacing", 3); |
| 115 | |
| 116 | zoomFactor = obvconfig.ParseDouble("zoomFactor", 0.5f); |
| 117 | zoomModifier = obvconfig.ParseInt("zoomModifier", 5); |
| 118 | |
| 119 | panFactor = obvconfig.ParseInt("panFactor", 30); |
| 120 | |
| 121 | panModifier = obvconfig.ParseInt("panModifier", 5); |
| 122 | |
| 123 | annotationBoxSize = obvconfig.ParseInt("annotationBoxSize", 15); |
| 124 |
no test coverage detected