/*
 AurelALS300data
 Copyright (C) 2010 Martin Štrympl
 
 This library 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 library 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 library.
 
 Martin Štrympl
 xstrym00@stud.feec.vutbr.cz
 */

/*
 *  data.h
 *  AurelALS300data
 *
 *  Created by Martin Štrympl on 11/10/10.
 *  Copyright 2010 School. All rights reserved.
 *
 */

#ifndef DATA_H_INCLUDED
#define DATA_H_INCLUDED

#include "Headers.h"
#include "Module.h"

struct sData_Header
{
  uint32_t u4_lasReferenceX, u4_lasReferenceY;
  
  int32_t i4_masterRefXProbeA, i4_masterRefYProbeA;
  int32_t i4_masterRefXProbeB, i4_masterRefYProbeB;
  
  double do_current, do_freq, do_speed;
  
  uint32_t u4_cuts;
  
  bool b_transformate, b_transToArea, b_transToZero;
  
  uint32_t u4_transOffsetX, u4_transOffsetY;
};

struct sData_Element;

struct sData
{
  int32_t i4_debuglevel;
  
  char *t_data;
  char *t_command;
  
  struct sData_Header s_header;
  
  struct sData_Element *as_elements;
  uint32_t u4_elements;
  
  int32_t i4_width, i4_height;
};

bool Data_Add_Element(struct sData *ps_data,
                      long double ld_startX, long double ld_startY, long double ld_stopX, long double ld_stopY,
                      uint8_t u1_cutType);

bool Data_Transformate(struct sData *ps_data);

bool Data_Save(struct sData *ps_data);


#endif //DATA_H_INCLUDED
