atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
workinfo.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'workinfo.c'
24*
25* Contains:
26*
27
28 - Functions to display project information in GtkTextBuffer
29
30*
31* List of functions:
32
33 void workinfo (project * this_proj, int i);
34
35*/
36
37#include "global.h"
38#include "interface.h"
39#include "project.h"
40
41extern void update_rdf_view (project * this_proj, int rdf);
42extern void update_sq_view (project * this_proj, int sqk);
43extern void update_angle_view (project * this_proj);
44extern void update_rings_view (project * this_proj, int c);
45extern void update_chains_view (project * this_proj);
46extern void update_spherical_view (project * this_proj);
47extern void update_msd_view (project * this_proj);
48extern void model_info (project * this_proj, GtkTextBuffer * buf);
49extern void opengl_info (project * this_proj, GtkTextBuffer * buf);
50
59void workinfo (project * this_proj, int i)
60{
61 gchar * str;
62 int j;
64 switch (i)
65 {
66 case 0:
67 this_proj -> text_buffer[i] = add_buffer (NULL, NULL, NULL);
68 print_info ("\n\nWorkspace information\n\n\n", "heading", this_proj -> text_buffer[0]);
69 if (g_strcmp0(workspacefile, "(null)") == 0) workspacefile = NULL;
70 if (workspacefile != NULL)
71 {
72 print_info ("\tWorkspace file: ", "italic", this_proj -> text_buffer[0]);
73 print_info (workspacefile, NULL, this_proj -> text_buffer[0]);
74 }
75 str = g_strdup_printf ("\n\n\t%d", nprojects);
76 print_info (str, "bold_red", this_proj -> text_buffer[0]);
77 g_free (str);
78 print_info (" project(s) in workspace: ", NULL, this_proj -> text_buffer[0]);
80 for (j=0; j<nprojects; j++)
81 {
82 print_info ("\n\n\t\t- ", NULL, this_proj -> text_buffer[0]);
83 print_info (prepare_for_title(tmp_proj -> name), "italic", this_proj -> text_buffer[0]);
84 if (tmp_proj -> next != NULL) tmp_proj = tmp_proj -> next;
85 }
86 print_info ("\n\n\tActive project: ", NULL, this_proj -> text_buffer[0]);
87 print_info (prepare_for_title(active_project -> name), "bold_green", this_proj -> text_buffer[0]);
88 break;
89 case 1:
90 this_proj -> text_buffer[i] = add_buffer (NULL, NULL, NULL);
91 model_info (this_proj, this_proj -> text_buffer[1]);
92 break;
93 case 2:
94 this_proj -> text_buffer[i] = add_buffer (NULL, NULL, NULL);
95 opengl_info (this_proj, this_proj -> text_buffer[i]);
96 break;
97 case GR+OT:
98 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[GR]) update_rdf_view (this_proj, GR);
99 break;
100 case SQ+OT:
101 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[SQ]) update_sq_view (this_proj, SQ);
102 break;
103 case SK+OT:
104 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[SK]) update_sq_view (this_proj, SK);
105 break;
106 case GK+OT:
107 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[GK]) update_rdf_view (this_proj, GK);
108 break;
109 case AN+OT:
110 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[AN]) update_angle_view (this_proj);
111 break;
112 case RI+OT:
113 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[RI])
114 {
115 for (j=0; j<5; j++) if (this_proj -> rsparam[j][5]) update_rings_view (this_proj, j);
116 }
117 break;
118 case CH+OT:
119 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[CH]) update_chains_view (this_proj);
120 break;
121 case SP+OT:
122 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[SP]) update_spherical_view (this_proj);
123 break;
124 case MS+OT:
125 if (this_proj -> text_buffer[i] == NULL && this_proj -> visok[MS]) update_msd_view (this_proj);
126 break;
127 }
128 if (this_proj -> text_buffer[i] == NULL) this_proj -> text_buffer[i] = add_buffer (NULL, NULL, NULL);
129 view_buffer (this_proj -> text_buffer[i]);
130}
project * tmp_proj
Definition dlp_field.c:953
gchar * workspacefile
Definition global.c:156
int nprojects
Definition global.c:158
Global variable declarations Global convenience function declarations Global data structure defin...
workspace workzone
Definition project.c:46
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
Definition gtk-misc.c:1151
#define GR
Definition global.h:294
#define OT
Definition global.h:293
#define SQ
Definition global.h:295
#define RI
Definition global.h:300
#define AN
Definition global.h:299
#define MS
Definition global.h:303
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
#define SK
Definition global.h:296
#define GK
Definition global.h:297
#define SP
Definition global.h:302
project * active_project
Definition project.c:47
#define CH
Definition global.h:301
void view_buffer(GtkTextBuffer *buffer)
set a text buffer in the main window or an image
Definition gui.c:182
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Definition interface.c:738
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
project * first
Definition global.h:992
int c
Definition tab-1.c:95
void update_chains_view(project *this_proj)
update the chains statistics text view after the calculation
Definition chainscall.c:108
void update_rdf_view(project *this_proj, int rdf)
update the project text view for the g(r)/g(k) calculation
Definition grcall.c:128
void update_sq_view(project *this_proj, int sqk)
update the text view for s(q) / s(k) calculation
Definition sqcall.c:123
void update_rings_view(project *this_proj, int c)
update the text view for ring statistics
Definition ringscall.c:149
void opengl_info(project *this_proj, GtkTextBuffer *buf)
display OpenGL information in a GtkTextBuffer
Definition modelinfo.c:355
void model_info(project *this_proj, GtkTextBuffer *buf)
display model information in GtkTexBuffer
Definition modelinfo.c:113
void workinfo(project *this_proj, int i)
display information about a workspace menu item for a project
Definition workinfo.c:59
void update_angle_view(project *this_proj)
update angle calculation information text buffer
Definition bdcall.c:868
void update_msd_view(project *this_proj)
update the project text view for the MSD calculation
Definition msdcall.c:121
void update_spherical_view(project *this_proj)
update the text view for spherical harmonics
Definition spcall.c:101