CHDK_DE Vorschauversion  Trunk Rev. 5715
 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 109 der Datei console.c.

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

Definiert in Zeile 66 der Datei console.c.

67 {
69 
72 }
void console_close ( )

Definiert in Zeile 60 der Datei console.c.

61 {
64 }
void console_draw ( int  force_redraw)

Definiert in Zeile 74 der Datei console.c.

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

Definiert in Zeile 183 der Datei console.c.

184 {
186  console_displayed = 0;
188 }
void console_set_autoredraw ( int  val)

Definiert in Zeile 178 der Datei console.c.

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

Definiert in Zeile 144 der Datei console.c.

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

Variablen-Dokumentation

int console_displayed

Definiert in Zeile 25 der Datei console.c.