CONFIG LIB 1.5
Configuration Files Library (by TGG 2020)
Loading...
Searching...
No Matches
CONNECT_DATA Class Reference

Structure, which defines connection of two wings. More...

#include <conect_data.h>

Inheritance diagram for CONNECT_DATA:
IOFUN

Public Member Functions

int Read (FILE *f, int typ, int version=2)
 Read connection section (within MS2 file reading)
 
int Write (std::ostream &fout)
 Write connection section (within MS2 file saving)
 

Public Attributes

int iTyp
 Type of connection ( horizontal, vertical, parallel )
 
int iActive
 is connection section active ( 1- active, 2 - not active)
 
int CP1
 number of the 1st wing (vertical in case of horizontal connection)
 
int CP2
 number of the 2nd wing (horizontal in case of vertical connection)
 
int Czeb1
 number of wing 1 rib connected to wing 2

 
int Czeb2
 number of wing 2 rib connected to wing 1
 
int Cstart
 number of wing 2 longeron connected to leading point of wing 1
 
int Cend
 number of wing 2 longeron connected to trailing point of wing 1
 
int Csurf
 surface of wing 2 which will be modified (0-bottom or exterior, 1-top or interior)
 
std::string ConName
 Name of connection.
 

Additional Inherited Members

- Static Public Member Functions inherited from IOFUN
static void Win2Unix (char *s)
 conversion of directory separators - MS Windows to Unix
 
static void Unix2Win (char *s)
 conversion of directory separators - Unix to MS Windows
 
static int ReadComm (FILE *stream)
 Function to read of a comment till the end of line. It returns 0 or EOF if it is performed.
 
static void ReadDummy (FILE *stream)
 Function to read a comment line.
 
static int ReadPar (FILE *stream, const char *Format, void *Par)
 Function to read one variable. The type of variable depends on Format, compatible with stdio library.
 
static int ReadPar (FILE *stream, const char *Format, void *Par1, void *Par2)
 Function to read two variables. The type of variables depends on Format, compatible with stdio library.
 
static int ReadPar (FILE *stream, const char *Format, void *Par1, void *Par2, void *Par3)
 Function to read three variables. The type of variables depends on Format, compatible with stdio library.
 
static int ReadPar (FILE *stream, const char *Format, void *Par1, void *Par2, void *Par3, void *Par4)
 Function to read four variables. The type of variables depends on Format, compatible with stdio library.
 
static int ReadVect3 (FILE *stream, double *Par, double dScal=1.)
 Function to read double vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "dScal".
 
static int ReadVect3 (FILE *stream, float *Par, float fScal=1.)
 Function to read float vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "fScal".
 
static int ReadVect3 (FILE *stream, long *Par, long lScal=1)
 Function to read long vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "lScal".
 
static int ReadVect3 (FILE *stream, int *Par, int iScal=1)
 Function to read int vector "Par" of "3" dimension from FILE "stream". The read values are scaled by multiplier "iScal".
 
static int ReadVect (FILE *stream, double *Par, int n, double dScal=1.)
 Function to read double vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "dScal".
 
static int ReadVect (FILE *stream, float *Par, int n, float fScal=1.)
 Function to read float vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "fScal".
 
static int ReadVect (FILE *stream, long *Par, int n, long lScal=1)
 Function to read long vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "lScal".
 
static int ReadVect (FILE *stream, int *Par, int n, int iScal=1)
 Function to read int vector "Par" of "n" dimension from FILE "stream". The read values are scaled by multiplier "iScal".
 
static int ReadStr (FILE *stream, char *Par)
 Function to read the new line from FILE "stream" and to store it in table of char "Par". The starting and ending blanc charaters are clipped.
 
static void ReadStrL (FILE *stream, char *Par, int *len)
 Function to read the string (Par) from FILE "stream". It reads from current pointer of FILE to the end of line or EOF. Number of read characters is returned in "len".
 
static void ClipString (char *string)
 Clipping of the "string" up to the first blanc character or comment "#" character.
 
static void ClipFileName (char *string)
 Clipping of the ending blanc characters of "string".
 
static bool CompareStrings (char *str1, char *str2)
 Compares two strings (str1 and str2). Returns true if they match, false otherwise.
 
static int file_exist (const char *name)
 Returns true (1) if file "name" does exist, 0 otherwise.
 
static const char * filename_name (const char *name)
 Returns pointer to filename without path.
 
static const char * filename_ext (const char *buf)
 Returns pointer to filename extension.
 
static char * filename_setext (char *buf, int buflen, const char *ext)
 set/change filename extension
 
static int filename_dir (char *name)
 returns the length of the path in (path)name
 
static const char * filename_date (const char *name)
 Returns pointer to the string that contains the date of last file modification/creation.
 
static FILE * fopen (const char *filename, const char *mode)
 Cross-platform function to fopen function that supports UTF-8 encoded name.
 
static int stat (const char *f, struct stat *b)
 Cross-platform function to stat() a file using a UTF-8 encoded name or value.
 
static size_t strlcpy (char *d, const char *s, size_t bufsize)
 The implementation of nonstandard strlcpy function.
 
static int nLines (FILE *stream)
 Returns number of lines of text file from current pointer to EOF.
 
static int nColumns (FILE *stream, char Par[][32])
 Returns number of columns of text file (number of strings in the first line). Names of columns are stored in Par array.
 
static int isstrblank (char *cc, int iLen)
 Checks if string (cc) is blank (1/0)
 
static void ReadVect3 (FILE *stream, VECTOR_3D *Vec, double dScal=1.)
 Function to read VECTOR_3D Vec components from FILE "stream". The read values are scaled by multiplier "dScal".
 
static int readln (FILE *ff, char *value_x)
 Pascal style "readln" function to read string.
 
static int readln (FILE *ff, int *value_x)
 Pascal style "readln" function to read int.
 
static int readln (FILE *ff, long *value_x)
 Pascal style "readln" function to read long.
 
static int readln (FILE *ff, float *value_x)
 Pascal style "readln" function to read float.
 
static int readln (FILE *ff, double *value_x)
 Pascal style "readln" function to read double.
 
static int readln (FILE *ff, long double *value_x)
 Pascal style "readln" function to read long double.
 
static int readln (FILE *ff)
 Pascal style "readln" function to read comment.
 
static int readln (FILE *ff, VECTOR_3D *vec)
 Pascal style "readln" function to read VECTOR_3D components.
 
static int read (FILE *ff, char *value_x)
 Pascal style "read" function to read string.
 
static int read (FILE *ff, int *value_x)
 Pascal style "read" function to read int.
 
static int read (FILE *ff, long *value_x)
 Pascal style "read" function to read long.
 
static int read (FILE *ff, float *value_x)
 Pascal style "read" function to read float.
 
static int read (FILE *ff, double *value_x)
 Pascal style "read" function to read double.
 
static int read (FILE *ff, long double *value_x)
 Pascal style "read" function to read long double.
 
static int read (FILE *ff, VECTOR_3D *vec)
 Pascal style "read" function to read VECTOR_3D components.
 

Detailed Description

Structure, which defines connection of two wings.

The connection can be vertical, horizontal or parallel. Details are in PANUKL manual.

Definition at line 33 of file conect_data.h.

Constructor & Destructor Documentation

◆ CONNECT_DATA()

CONNECT_DATA::CONNECT_DATA ( void )

Definition at line 24 of file conect_data.cpp.

25{
26 TypeStr[0] = (char*)"Horizontal";
27 TypeStr[1] = (char*)"Vertical";
28 TypeStr[2] = (char*)"Parallel";
29}

◆ ~CONNECT_DATA()

CONNECT_DATA::~CONNECT_DATA ( void )

Definition at line 31 of file conect_data.cpp.

32{
33}

Member Function Documentation

◆ Read()

int CONNECT_DATA::Read ( FILE * f,
int typ,
int version = 2 )

Read connection section (within MS2 file reading)

Definition at line 35 of file conect_data.cpp.

36{
37 if( version == 2 )
38 {
39 iTyp = typ;
40 iActive = 1;
41 }
42 else
43 {
44 char sTyp[256];
45 ReadStr( t, sTyp );
46
47 if( CompareStrings( sTyp, TypeStr[CON_H]) == true )
48 iTyp = CON_H;
49 else if( CompareStrings( sTyp, TypeStr[CON_V]) == true )
50 iTyp = CON_V;
51 else if( CompareStrings( sTyp, TypeStr[CON_P]) == true )
52 iTyp = CON_P;
53 else
54 {
55 iTyp = -1;
56 return -1;
57 }
58 //fprintf(stdout,"Conn : type %s\n", sTyp);
59 }
60
61 char name[255];
62 ReadStr ( t, name ); // description
63 ConName = string( name );
64 if( version != 2 )fscanf ( t, "%d", &iActive );
65 fscanf ( t, "%d", &CP1 );
66 fscanf ( t, "%d", &CP2 );
67 fscanf ( t, "%d", &Czeb1 );
68 fscanf ( t, "%d", &Czeb2 );
69 fscanf ( t, "%d", &Cstart );
70 fscanf ( t, "%d", &Cend );
71 ReadPar ( t, "%d", &Csurf );
72
73 return 0;
74}
int Czeb1
number of wing 1 rib connected to wing 2
Definition conect_data.h:47
int Cend
number of wing 2 longeron connected to trailing point of wing 1
Definition conect_data.h:50
int Czeb2
number of wing 2 rib connected to wing 1
Definition conect_data.h:48
int CP2
number of the 2nd wing (horizontal in case of vertical connection)
Definition conect_data.h:46
int iActive
is connection section active ( 1- active, 2 - not active)
Definition conect_data.h:44
int iTyp
Type of connection ( horizontal, vertical, parallel )
Definition conect_data.h:43
std::string ConName
Name of connection.
Definition conect_data.h:54
int Csurf
surface of wing 2 which will be modified (0-bottom or exterior, 1-top or interior)
Definition conect_data.h:51
int CP1
number of the 1st wing (vertical in case of horizontal connection)
Definition conect_data.h:45
int Cstart
number of wing 2 longeron connected to leading point of wing 1
Definition conect_data.h:49
static int ReadStr(FILE *stream, char *Par)
Function to read the new line from FILE "stream" and to store it in table of char "Par"....
Definition iofun.cpp:163
static int ReadPar(FILE *stream, const char *Format, void *Par)
Function to read one variable. The type of variable depends on Format, compatible with stdio library.
Definition iofun.cpp:67
static bool CompareStrings(char *str1, char *str2)
Compares two strings (str1 and str2). Returns true if they match, false otherwise.
Definition iofun.cpp:270
@ CON_H
horizontal (e.g. T tail)
@ CON_V
vertical (e.g. winglets)
@ CON_P
parallel

Referenced by MS2_Data::Read().

◆ Write()

int CONNECT_DATA::Write ( std::ostream & fout)

Write connection section (within MS2 file saving)

Definition at line 76 of file conect_data.cpp.

77{
78 fout << TypeStr[iTyp] << endl;
79 fout << ConName << endl;
80 fout << iActive << " ";
81 fout << CP1 << " ";
82 fout << CP2 << " ";
83 fout << Czeb1 << " ";
84 fout << Czeb2 << " ";
85 fout << Cstart << " ";
86 fout << Cend << " ";
87 fout << Csurf << endl;
88 return 0;
89}

Referenced by MS2_Data::WriteConns().

Member Data Documentation

◆ Cend

int CONNECT_DATA::Cend

number of wing 2 longeron connected to trailing point of wing 1

Definition at line 50 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ ConName

std::string CONNECT_DATA::ConName

Name of connection.

Definition at line 54 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ CP1

int CONNECT_DATA::CP1

number of the 1st wing (vertical in case of horizontal connection)

Definition at line 45 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ CP2

int CONNECT_DATA::CP2

number of the 2nd wing (horizontal in case of vertical connection)

Definition at line 46 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ Cstart

int CONNECT_DATA::Cstart

number of wing 2 longeron connected to leading point of wing 1

Definition at line 49 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ Csurf

int CONNECT_DATA::Csurf

surface of wing 2 which will be modified (0-bottom or exterior, 1-top or interior)

Definition at line 51 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ Czeb1

int CONNECT_DATA::Czeb1

number of wing 1 rib connected to wing 2

Definition at line 47 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ Czeb2

int CONNECT_DATA::Czeb2

number of wing 2 rib connected to wing 1

Definition at line 48 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ iActive

int CONNECT_DATA::iActive

is connection section active ( 1- active, 2 - not active)

Definition at line 44 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().

◆ iTyp

int CONNECT_DATA::iTyp

Type of connection ( horizontal, vertical, parallel )

Definition at line 43 of file conect_data.h.

Referenced by MS2_Data::CONNECT2MS2_Conn(), MS2_Data::MS2_Conn2CONNECT(), Read(), and Write().


The documentation for this class was generated from the following files: