<?php

$dt = date("d.m.Y");
$tm = date("H:i:s");
$work_width = 2 * $pcb->MaxPosX; // "30000";
$work_height = 2 * $pcb->MaxPosY; // "20000";

$pcad_pcb  = "  (pcbDesignHeader \r\n";
$pcad_pcb .= "    (workspaceSize $work_width $work_height) ;; MaxX=".$pcb->MaxPosX.", MaxY=".$pcb->MaxPosY."\r\n";
$pcad_pcb .= "    (gridDfns \r\n";
//$pcad_pcb .= "      (grid \"0.05mm\")\r\n";
//$pcad_pcb .= "      (grid \"0.1mm\")\r\n";
$pcad_pcb .= "      (grid \"5.0mil\")\r\n";
$pcad_pcb .= "      (grid \"10.0mil\")\r\n";
$pcad_pcb .= "      (grid \"100.0mil\")\r\n";
$pcad_pcb .= "    )\r\n";
$pcad_pcb .= "    (designInfo \r\n";
$pcad_pcb .= "      (fieldSet \"(Default)\"\r\n";
$pcad_pcb .= "        (fieldDef \"Date\" \"$dt\")\r\n";
$pcad_pcb .= "        (fieldDef \"Time\" \"$tm\")\r\n";
$pcad_pcb .= "        (fieldDef \"Author\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Revision\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Title\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Approved By\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Checked By\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Company Name\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Drawing Number\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Drawn By\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Engineer\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Variant Name\" \"\")\r\n";
$pcad_pcb .= "        (fieldDef \"Variant Description\" \"\")\r\n";
$pcad_pcb .= "      )\r\n";
$pcad_pcb .= "    )\r\n";
$pcad_pcb .= "    (solderSwell 4.0)\r\n";
$pcad_pcb .= "    (pasteSwell 0.0)\r\n";
$pcad_pcb .= "    (planeSwell 20.0)\r\n";
$pcad_pcb .= "    (refPointSize 100.0)\r\n";
$pcad_pcb .= "    (infoPointSize 100.0)\r\n";
$pcad_pcb .= "    (gluePointSize 100.0)\r\n";
$pcad_pcb .= "    (pickPointSize 100.0)\r\n";
$pcad_pcb .= "    (testPointSize 100.0)\r\n";
$pcad_pcb .= "    (refPointSizePrint 100.0)\r\n";
$pcad_pcb .= "    (infoPointSizePrint 100.0)\r\n";
$pcad_pcb .= "    (gluePointSizePrint 100.0)\r\n";
$pcad_pcb .= "    (pickPointSizePrint 100.0)\r\n";
$pcad_pcb .= "    (testPointSizePrint 100.0)\r\n";
$pcad_pcb .= "    (solderFlowDirection solderFlowTopToBottom)\r\n";
$pcad_pcb .= "    (globalCopperPourCutoutBackoffFlag False)\r\n";
$pcad_pcb .= "  )\r\n";

file_put_contents($out_file, $pcad_pcb, FILE_APPEND | LOCK_EX);
