/*
 GerberConversion
 Copyright (C) 2010 Martin Štrympl
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public
 License as published by the Free Software Foundation; either
 version 3.0 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.
 
 You should have received a copy of the GNU General Public
 License along with this program.
 
 Martin Štrympl
 xstrym00@stud.feec.vutbr.cz
 */

/*
 *  Settings.h
 *  GerberConversion
 *
 *  Created by Martin Štrympl on 11/2/10.
 *  Copyright 2010 School. All rights reserved.
 *
 */
 
#include "Headers.h"
 
#ifndef SETTINGS_H_INCLUDED
#define SETTINGS_H_INCLUDED

#include "Draw.h"

struct sGerber_Gerber_Actual;

struct sGerber_Gerber_Actual_Behavior
{
  bool b_ignore_badcodes;
  bool b_ignore_badsets;
};

struct sGerber_Gerber_Actual_XY
{
  struct sGerber_Point s_old, s_new;
  struct sGerber_Point s_offset;
};

struct sGerber_Gerber_Actual_AS // Axis select
{
  bool b_A, b_B;
};
struct sGerber_Gerber_Actual_FS
{
  bool b_LT, b_AI;
  uint8_t u1_N, u1_G, u1_D, u1_M;
  uint8_t u1_X_integer, u1_Y_integer;
  uint8_t u1_X_decimal, u1_Y_decimal;
};
struct sGerber_Gerber_Actual_IO // Image Offset
{
  long double ld_A, ld_B;
};
struct sGerber_Gerber_Actual_IP // Image Polarity
{
  bool b_positive;
};
struct sGerber_Gerber_Actual_IR // Image Rotation
{
  uint16_t u2_rot;
};
struct sGerber_Gerber_Actual_LP // Layer Polarity
{
  bool b_positive;
};
struct sGerber_Gerber_Actual_MI // Mirror Image
{
  bool b_A, b_B;
};
struct sGerber_Gerber_Actual_MO // Mode, Inch or millimeters
{
  bool b_inch;
};
struct sGerber_Gerber_Actual_OF // Offset
{
  long double ld_A, ld_B;
};
struct sGerber_Gerber_Actual_SF // Scale factor
{
  long double ld_A, ld_B;
};

#define PRIORITY_LIMIT 16
struct sGerber_Gerber_Actual_Sets // Settings
{
  char at_pointnumeringpriority[PRIORITY_LIMIT];
  bool b_millimeters;
  
  int i4_debug;
};
// any functions

bool RealPoint(struct sGerber_Gerber_Actual *ps_actual, struct sGerber_Point *ps_new, struct sGerber_Point *ps_old);
long double RealDimension(struct sGerber_Gerber_Actual *ps_actual, long double ld_dimension);

#endif //SETTINGS_H_INCLUDED
