NetSim Source Code Help
Loading...
Searching...
No Matches
Animation.h
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2021 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* This source code is licensed per the NetSim license agreement. *
12* *
13* No portion of this source code may be used as the basis for a derivative work, *
14* or used, for any purpose other than its intended use per the NetSim license *
15* agreement. *
16* *
17* This source code and the algorithms contained within it are confidential trade *
18* secrets of TETCOS and may not be used as the basis for any other software, *
19* hardware, product or service. *
20* *
21* Author: Shashi Kant Suman *
22* *
23* ----------------------------------------------------------------------------------*/
24
25/* ,~~. *
26 * ( 6 )-_, *
27 * (\___ )=='-'
28 * \ . ) )
29 * \ `-' /
30 * ~'`~'`~'`~'`~
31 *
32 * *
33 * ---------------------------------------------------------------------------------*/
34#pragma once
35#ifndef _NETSIM_ANIMATION_H_
36#define _NETSIM_ANIMATION_H_
37#ifdef __cplusplus
38extern "C" {
39#endif
40#ifndef _NETSIM_ANIMATION_CODE_
41#pragma comment (lib,"Animation.lib")
42#endif
43
44#ifndef NETSIM_ID
45 typedef unsigned int NETSIM_ID;
46#endif
47
48#ifndef MAX_PACKET_TYPE_LEN
49#define MAX_PACKET_TYPE_LEN 100
50#endif
51
52 typedef void* ANIM_HANDLE;
53
54 typedef enum enum_anim_flag
55 {
60
61 typedef enum enum_anim_fileType
62 {
70 static char animFileType[][50] = { "generic","table","2dplot","3dplot","graph","battery" };
71
72 typedef enum enum_anim_type
73 {
90 static char animType[][50] = { "EXIT",
91 "MOVENODE",
92 "NODEJOIN",
93 "NODELEAVE",
94 "TRANSMITPACKET",
95 "LABEL",
96 "LINE",
97 "CIRCLE",
98 "REACTANGLE",
99 "GRAPH",
100 "PLOT2D",
101 "PLOT3D",
102 "TABLE",
103 "BATTERY",
104 "" };
105
106 typedef struct stru_move_node
107 {
109 double time;
110 double x;
111 double y;
112 double z;
114
115 typedef struct stru_transmit_packet
116 {
119 double startTime;
120 double endTime;
122 int type;
124
125 typedef struct stru_line
126 {
127 double time;
128 double x1;
129 double y1;
130 double x2;
131 double y2;
133
134 //Animation flag
136 _declspec(dllexport) void anim_set_anim_flag(char* flag);
137
138 //Animation menu
139 /* handle: if not null, then new menu will be sub menu of handle.
140 * name: name of the menu.
141 * isThreadReq: if true, animation engine will create new thread.
142 * isNewScreen: if true, GUI animator will open in new window
143 * isFile: is true, animation engine will create default file to write
144 * maxDatalen: expected max len for char written in file for each entry, default BUFSIZ
145 * filetype: Type of file, Gui animator engine will call jar based on this
146 */
148 char* name,
149 bool isThreadReq,
150 bool isNewScreen,
151 bool isFile,
152 UINT maxDataLen,
153 ANIMFILETYPE fileType);
154
155 //Animation API
156 _declspec(dllexport) void fn_NetSim_Anim_Init(char* ioPath);
158
159 //Animation Table
161 char* heading);
163 double time);
165 char* format, ...);
166
167 //Add new animation entry
169 ANIM_TYPE type,
170 void* format,
171 ...);
172
173 //Change the default file name. Animation won't write anything
174 _declspec(dllexport) void anim_set_file_name(ANIM_HANDLE handle, char* name);
175
176#ifdef __cplusplus
177}
178#endif
179#endif
void animation_add_new_entry(ANIM_HANDLE animHandle, ANIM_TYPE type, void *format,...)
void animation_table_new(ANIM_HANDLE animHandle, char *heading)
static char animFileType[][50]
Definition: Animation.h:70
void fn_NetSim_Anim_Close()
enum_anim_flag
Definition: Animation.h:55
@ ANIMFLAG_DISABLE
Definition: Animation.h:56
@ ANIMFLAG_ONLINE
Definition: Animation.h:58
@ ANIMFLAG_OFFLINE
Definition: Animation.h:57
struct stru_move_node * ptrMOVENODE
void anim_set_anim_flag(char *flag)
#define MAX_PACKET_TYPE_LEN
Definition: Animation.h:49
enum_anim_type
Definition: Animation.h:73
@ ANIM_PLOT2D
Definition: Animation.h:84
@ ANIM_CUSTOM
Definition: Animation.h:88
@ ANIM_PLOT3D
Definition: Animation.h:85
@ ANIM_LINE
Definition: Animation.h:80
@ ANIM_GRAPH
Definition: Animation.h:83
@ ANIM_NODELEAVE
Definition: Animation.h:77
@ ANIM_TABLE
Definition: Animation.h:86
@ ANIM_NODEJOIN
Definition: Animation.h:76
@ ANIM_BATTERY
Definition: Animation.h:87
@ ANIM_EXIT
Definition: Animation.h:74
@ ANIM_REACTANGLE
Definition: Animation.h:82
@ ANIM_MOVENODE
Definition: Animation.h:75
@ ANIM_CIRCLE
Definition: Animation.h:81
@ ANIM_LABEL
Definition: Animation.h:79
@ ANIM_TRANSMITPACKET
Definition: Animation.h:78
struct stru_line LINE
void anim_set_file_name(ANIM_HANDLE handle, char *name)
enum_anim_fileType
Definition: Animation.h:62
@ ANIMFILETYPE_GRAPH
Definition: Animation.h:67
@ ANIMFILETYPE_2DPLOT
Definition: Animation.h:65
@ ANIMFILETYPE_3DPLOT
Definition: Animation.h:66
@ ANIMFILETYPE_BATTERY
Definition: Animation.h:68
@ ANIMFILETYPE_TABLE
Definition: Animation.h:64
@ ANIMFILETYPE_GENERIC
Definition: Animation.h:63
struct stru_transmit_packet * ptrTRANSMITPACKET
enum enum_anim_fileType ANIMFILETYPE
struct stru_transmit_packet TRANSMITPACKET
static char animType[][50]
Definition: Animation.h:90
void * ANIM_HANDLE
Definition: Animation.h:52
ANIM_FLAG anim_get_anim_flag()
void fn_NetSim_Anim_Init(char *ioPath)
unsigned int NETSIM_ID
Definition: Animation.h:45
enum enum_anim_flag ANIM_FLAG
void animation_table_row(ANIM_HANDLE animHandle, char *format,...)
void animation_table_time(ANIM_HANDLE animHandle, double time)
enum enum_anim_type ANIM_TYPE
ANIM_HANDLE anim_add_new_menu(ANIM_HANDLE handle, char *name, bool isThreadReq, bool isNewScreen, bool isFile, UINT maxDataLen, ANIMFILETYPE fileType)
struct stru_line * ptrLINE
struct stru_move_node MOVENODE
static ANIM_HANDLE handle
Definition: BatteryModel.c:197
#define UINT
Definition: Linux.h:38
#define _declspec(dllexport)
This function is used to trigger the update.
Definition: Linux.h:41
ANIM_HANDLE animHandle
Definition: Mobility.c:26
double y2
Definition: Animation.h:131
double y1
Definition: Animation.h:129
double time
Definition: Animation.h:127
double x2
Definition: Animation.h:130
double x1
Definition: Animation.h:128
NETSIM_ID d
Definition: Animation.h:108
char name[MAX_PACKET_TYPE_LEN]
Definition: Animation.h:121