CHDK_DE Vorschauversion  Trunk Rev. 5273
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
console.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Funktionen

void console_close ()
 
void console_clear ()
 
void console_add_line (const char *str)
 
void console_draw (int force_redraw)
 
void console_set_layout (int x1, int y1, int x2, int y2)
 
void console_redraw ()
 
void console_set_autoredraw (int val)
 

Variablen

int console_displayed
 

Dokumentation der Funktionen

void console_add_line ( const char *  str)

Definiert in Zeile 110 der Datei console.c.

111 {
112  // Set console_autoredraw to -1 to stop script print statements from being displayed on screen
113  // Can be used to send script output to a file (using print_screen function); but not have it displayed
114  // on the LCD.
115  if (console_autoredraw == -1)
116  return;
117 
120 
121  do
122  {
123  char *cur = console_buf[console_cur_line];
124  int curlen = strlen(cur);
125  int left = console_line_length - curlen;
126  if (strlen(str) > left)
127  {
128  strncpy(cur + curlen, str, left);
129  cur[console_line_length] = 0;
131  str += left;
132  }
133  else
134  {
135  strcat(cur, str);
136  break;
137  }
138  } while(1);
139 
140  // ToDo: this should probably only be done if console_autoredraw == 0; but that breaks existing scripts (e.g. EDI.lua)
141  console_displayed = 0;
143 }
void console_clear ( )

Definiert in Zeile 67 der Datei console.c.

68 {
70 
73 }
void console_close ( )

Definiert in Zeile 61 der Datei console.c.

62 {
65 }
void console_draw ( int  force_redraw)

Definiert in Zeile 75 der Datei console.c.

76 {
78 
80 
82 
83  long t = get_tick_count();
84  if (t <= console_last_modified + (conf.console_timeout*1000)) // Redraw if changed
85  {
86  if ((console_displayed == 0) || force_redraw)
87  {
88  int y = (console_y + console_max_lines - 1) * FONT_HEIGHT;
90 
91  int c, i;
92  for (c = 0, i = console_cur_line; c < console_num_lines; ++c, --i)
93  {
94  if (i < 0) i = MAX_CONSOLE_HISTORY-1;
96  buf[console_line_length] = 0;
98 
100  }
101  }
102  }
103  else if (console_displayed && !camera_info.state.state_kbd_script_run) // Erase if drawn and script not running
104  {
106  console_displayed = 0;
107  }
108 }
void console_redraw ( )

Definiert in Zeile 184 der Datei console.c.

185 {
187  console_displayed = 0;
189 }
void console_set_autoredraw ( int  val)

Definiert in Zeile 179 der Datei console.c.

180 {
181  console_autoredraw = val;
182 }
void console_set_layout ( int  x1,
int  y1,
int  x2,
int  y2 
)

Definiert in Zeile 145 der Datei console.c.

146 {
147  int i;
148 
149  // Swap co-ords so x1 < x2 & y1 < y2
150  if (x1 > x2) { i = x1; x1 = x2; x2 = i; }
151  if (y1 > y2) { i = y1; y1 = y2; y2 = i; }
152 
153  // Limit values to screen range (TODO: add error message if out of range)
154  if (x1 < 0) x1 = 0;
156  if (x2 < 0) x2 = 0;
158 
159  if (y1 < 0) y1 = 0;
160  if (y1 > MAX_CONSOLE_LINES) y1 = MAX_CONSOLE_LINES;
161  if (y2 < 0) y2 = 0;
162  if (y2 > MAX_CONSOLE_LINES) y2 = MAX_CONSOLE_LINES;
163 
164  //Adjust for new size if needed
165  console_line_length = x2 - x1;
166  console_max_lines = y2 - y1;
167 
168  // If number of lines in console has reduced and old console has too many lines
171 
172  console_x = x1;
174 
175  if (console_autoredraw)
176  console_redraw();
177 }

Variablen-Dokumentation

int console_displayed

Definiert in Zeile 26 der Datei console.c.