| 1 |
// ---------------------------------------------------------------------------- |
| 2 |
// Copyright (C) 2014 |
| 3 |
// David Freese, W1HKJ |
| 4 |
// |
| 5 |
// This file is part of flmsg |
| 6 |
// |
| 7 |
// flrig is free software; you can redistribute it and/or modify |
| 8 |
// it under the terms of the GNU General Public License as published by |
| 9 |
// the Free Software Foundation; either version 3 of the License, or |
| 10 |
// (at your option) any later version. |
| 11 |
// |
| 12 |
// flrig is distributed in the hope that it will be useful, |
| 13 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
// GNU General Public License for more details. |
| 16 |
// |
| 17 |
// You should have received a copy of the GNU General Public License |
| 18 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
// ---------------------------------------------------------------------------- |
| 20 |
|
| 21 |
#include <stdlib.h> |
| 22 |
#include <iostream> |
| 23 |
#include <fstream> |
| 24 |
#include <cstring> |
| 25 |
#include <ctime> |
| 26 |
#include <sys/types.h> |
| 27 |
#include <sys/stat.h> |
| 28 |
#include <stdio.h> |
| 29 |
#include <errno.h> |
| 30 |
|
| 31 |
#include <FL/Fl.H> |
| 32 |
#include <FL/Enumerations.H> |
| 33 |
#include <FL/Fl_Window.H> |
| 34 |
#include <FL/Fl_Button.H> |
| 35 |
#include <FL/Fl_Group.H> |
| 36 |
#include <FL/Fl_Sys_Menu_Bar.H> |
| 37 |
#include <FL/x.H> |
| 38 |
#include <FL/Fl_Help_Dialog.H> |
| 39 |
#include <FL/Fl_Menu_Item.H> |
| 40 |
#include <FL/Fl_File_Icon.H> |
| 41 |
|
| 42 |
#include "config.h" |
| 43 |
#include "flmsg_config.h" |
| 44 |
|
| 45 |
#include "flmsg.h" |
| 46 |
#include "templates.h" |
| 47 |
#include "debug.h" |
| 48 |
#include "util.h" |
| 49 |
#include "gettext.h" |
| 50 |
#include "flmsg_dialog.h" |
| 51 |
#include "flinput2.h" |
| 52 |
#include "date.h" |
| 53 |
#include "calendar.h" |
| 54 |
#include "icons.h" |
| 55 |
#include "fileselect.h" |
| 56 |
#include "wrap.h" |
| 57 |
#include "status.h" |
| 58 |
#include "parse_xml.h" |
| 59 |
|
| 60 |
#ifdef WIN32 |
| 61 |
# include "flmsgrc.h" |
| 62 |
# include "compat.h" |
| 63 |
# define dirent fl_dirent_no_thanks |
| 64 |
#endif |
| 65 |
|
| 66 |
#include <FL/filename.H> |
| 67 |
#include "dirent-check.h" |
| 68 |
|
| 69 |
#include <FL/x.H> |
| 70 |
#include <FL/Fl_Pixmap.H> |
| 71 |
#include <FL/Fl_Image.H> |
| 72 |
|
| 73 |
using namespace std; |
| 74 |
|
| 75 |
const char mars_precedent[] = "RPOZ"; |
| 76 |
const char mars_e_x[] = "EX"; |
| 77 |
|
| 78 |
std::string mars_daily_incident = ":md_inc:"; |
| 79 |
std::string mars_daily_de = ":md_de_:"; |
| 80 |
std::string mars_daily_nbr = ":md_nbr:"; |
| 81 |
std::string mars_daily_prec = ":md_pre:"; |
| 82 |
std::string mars_daily_dtg = ":md_dtg:"; |
| 83 |
std::string mars_daily_fm_name = ":md_fnm:"; |
| 84 |
std::string mars_daily_fm_call = ":md_fcl:"; |
| 85 |
std::string mars_daily_fm_state = ":md_fst:"; |
| 86 |
std::string mars_daily_to_pos = ":md_tps:"; |
| 87 |
std::string mars_daily_to_call = ":md_tcl:"; |
| 88 |
std::string mars_daily_to_state = ":md_tst:"; |
| 89 |
std::string mars_daily_pos1 = ":md_ps1:"; |
| 90 |
std::string mars_daily_call1 = ":md_cl1:"; |
| 91 |
std::string mars_daily_state1 = ":md_st1:"; |
| 92 |
std::string mars_daily_pos2 = ":md_ps2:"; |
| 93 |
std::string mars_daily_call2 = ":md_cl2:"; |
| 94 |
std::string mars_daily_state2 = ":md_st2:"; |
| 95 |
std::string mars_daily_pos3 = ":md_ps3:"; |
| 96 |
std::string mars_daily_call3 = ":md_cl3:"; |
| 97 |
std::string mars_daily_state3 = ":md_st3:"; |
| 98 |
std::string mars_daily_sitrep_id = ":md_sid:"; |
| 99 |
std::string mars_daily_sitrep_loc = ":md_slo:"; |
| 100 |
std::string mars_daily_24hr = ":md_22h:"; |
| 101 |
std::string mars_daily_netcall = ":md_ncl:"; |
| 102 |
std::string mars_daily_e_x = ":md_e_x:"; |
| 103 |
std::string mars_daily_dtg_active = ":md_dta:"; |
| 104 |
std::string mars_daily_dtg_deactive = ":md_dtd:"; |
| 105 |
std::string mars_daily_nbr_stations = ":md_nst:"; |
| 106 |
std::string mars_daily_details = ":md_det:"; |
| 107 |
std::string mars_daily_activations = ":md_acs:"; |
| 108 |
std::string mars_daily_agencies = ":md_agy:"; |
| 109 |
std::string mars_daily_remarks = ":md_rem:"; |
| 110 |
|
| 111 |
std::string s_mars_daily_incident; |
| 112 |
std::string s_mars_daily_de; |
| 113 |
std::string s_mars_daily_nbr; |
| 114 |
std::string s_mars_daily_prec = "R"; |
| 115 |
std::string s_mars_daily_dtg; |
| 116 |
std::string s_mars_daily_fm_name; |
| 117 |
std::string s_mars_daily_fm_call; |
| 118 |
std::string s_mars_daily_fm_state; |
| 119 |
std::string s_mars_daily_to_pos; |
| 120 |
std::string s_mars_daily_to_call; |
| 121 |
std::string s_mars_daily_to_state; |
| 122 |
std::string s_mars_daily_pos1; |
| 123 |
std::string s_mars_daily_call1; |
| 124 |
std::string s_mars_daily_state1; |
| 125 |
std::string s_mars_daily_pos2; |
| 126 |
std::string s_mars_daily_call2; |
| 127 |
std::string s_mars_daily_state2; |
| 128 |
std::string s_mars_daily_pos3; |
| 129 |
std::string s_mars_daily_call3; |
| 130 |
std::string s_mars_daily_state3; |
| 131 |
std::string s_mars_daily_sitrep_id; |
| 132 |
std::string s_mars_daily_sitrep_loc; |
| 133 |
std::string s_mars_daily_24hr; |
| 134 |
std::string s_mars_daily_netcall; |
| 135 |
std::string s_mars_daily_e_x = "X"; |
| 136 |
std::string s_mars_daily_dtg_active; |
| 137 |
std::string s_mars_daily_dtg_deactive; |
| 138 |
std::string s_mars_daily_nbr_stations; |
| 139 |
std::string s_mars_daily_details; |
| 140 |
std::string s_mars_daily_activations; |
| 141 |
std::string s_mars_daily_agencies; |
| 142 |
std::string s_mars_daily_remarks; |
| 143 |
|
| 144 |
std::string buffmars_daily; |
| 145 |
std::string def_mars_daily_filename = ""; |
| 146 |
std::string base_mars_daily_filename = ""; |
| 147 |
std::string def_mars_daily_TemplateName = ""; |
| 148 |
|
| 149 |
bool using_mars_daily_template = false; |
| 150 |
|
| 151 |
void clear_mars_dailyfields() |
| 152 |
{ |
| 153 |
s_mars_daily_incident.clear(); |
| 154 |
s_mars_daily_de.clear(); |
| 155 |
s_mars_daily_nbr.clear(); |
| 156 |
s_mars_daily_prec = "R"; |
| 157 |
s_mars_daily_dtg.clear(); |
| 158 |
s_mars_daily_fm_name.clear(); |
| 159 |
s_mars_daily_fm_call.clear(); |
| 160 |
s_mars_daily_fm_state.clear(); |
| 161 |
s_mars_daily_to_pos.clear(); |
| 162 |
s_mars_daily_to_call.clear(); |
| 163 |
s_mars_daily_to_state.clear(); |
| 164 |
s_mars_daily_pos1.clear(); |
| 165 |
s_mars_daily_call1.clear(); |
| 166 |
s_mars_daily_state1.clear(); |
| 167 |
s_mars_daily_pos2.clear(); |
| 168 |
s_mars_daily_call2.clear(); |
| 169 |
s_mars_daily_state2.clear(); |
| 170 |
s_mars_daily_pos3.clear(); |
| 171 |
s_mars_daily_call3.clear(); |
| 172 |
s_mars_daily_state3.clear(); |
| 173 |
s_mars_daily_sitrep_id.clear(); |
| 174 |
s_mars_daily_sitrep_loc.clear(); |
| 175 |
s_mars_daily_24hr.clear(); |
| 176 |
s_mars_daily_netcall.clear(); |
| 177 |
s_mars_daily_e_x = "X"; |
| 178 |
s_mars_daily_dtg_active.clear(); |
| 179 |
s_mars_daily_dtg_deactive.clear(); |
| 180 |
s_mars_daily_nbr_stations.clear(); |
| 181 |
s_mars_daily_details.clear(); |
| 182 |
s_mars_daily_activations.clear(); |
| 183 |
s_mars_daily_agencies.clear(); |
| 184 |
s_mars_daily_remarks.clear(); |
| 185 |
} |
| 186 |
|
| 187 |
bool check_mars_dailyfields() |
| 188 |
{ |
| 189 |
std::string temp; |
| 190 |
if (s_mars_daily_incident != txt_mars_daily_incident->value()) return true; |
| 191 |
if (s_mars_daily_de != txt_mars_daily_de->value()) return true; |
| 192 |
if (s_mars_daily_nbr != txt_mars_daily_nbr->value()) return true; |
| 193 |
int val = sel_mars_daily_prec->index(); |
| 194 |
temp.clear(); |
| 195 |
temp += mars_precedent[val]; |
| 196 |
if (s_mars_daily_prec != temp) return true; |
| 197 |
if (s_mars_daily_dtg != txt_mars_daily_dtg->value()) return true; |
| 198 |
if (s_mars_daily_fm_name != txt_mars_daily_fm_name->value()) return true; |
| 199 |
if (s_mars_daily_fm_call != txt_mars_daily_fm_call->value()) return true; |
| 200 |
if (s_mars_daily_fm_state != txt_mars_daily_fm_state->value()) return true; |
| 201 |
if (s_mars_daily_to_pos != txt_mars_daily_to_pos->value()) return true; |
| 202 |
if (s_mars_daily_to_call != txt_mars_daily_to_call->value()) return true; |
| 203 |
if (s_mars_daily_to_state != txt_mars_daily_to_state->value()) return true; |
| 204 |
if (s_mars_daily_pos1 != txt_mars_daily_pos1->value()) return true; |
| 205 |
if (s_mars_daily_call1 != txt_mars_daily_call1->value()) return true; |
| 206 |
if (s_mars_daily_state1 != txt_mars_daily_state1->value()) return true; |
| 207 |
if (s_mars_daily_pos2 != txt_mars_daily_pos2->value()) return true; |
| 208 |
if (s_mars_daily_call2 != txt_mars_daily_call2->value()) return true; |
| 209 |
if (s_mars_daily_state2 != txt_mars_daily_state2->value()) return true; |
| 210 |
if (s_mars_daily_pos3 != txt_mars_daily_pos3->value()) return true; |
| 211 |
if (s_mars_daily_call3 != txt_mars_daily_call3->value()) return true; |
| 212 |
if (s_mars_daily_state3 != txt_mars_daily_state3->value()) return true; |
| 213 |
if (s_mars_daily_sitrep_id != txt_mars_daily_sitrep_id->value()) return true; |
| 214 |
if (s_mars_daily_sitrep_loc != txt_mars_daily_sitrep_loc->value()) return true; |
| 215 |
if (s_mars_daily_24hr != txt_mars_daily_dtg_24hr->value()) return true; |
| 216 |
if (s_mars_daily_netcall != txt_mars_daily_netcall->value()) return true; |
| 217 |
temp.clear(); |
| 218 |
temp += mars_e_x[sel_mars_daily_e_x->index()]; |
| 219 |
if (s_mars_daily_e_x != temp) return true; |
| 220 |
if (s_mars_daily_dtg_active != txt_mars_daily_dtg_active->value()) return true; |
| 221 |
if (s_mars_daily_dtg_deactive != txt_mars_daily_dtg_deactive->value()) return true; |
| 222 |
if (s_mars_daily_nbr_stations != txt_mars_daily_nbr_stations->value()) return true; |
| 223 |
if (s_mars_daily_details != txt_mars_daily_details->value()) return true; |
| 224 |
if (s_mars_daily_activations != txt_mars_daily_activations->value()) return true; |
| 225 |
if (s_mars_daily_agencies != txt_mars_daily_agencies->value()) return true; |
| 226 |
if (s_mars_daily_remarks != txt_mars_daily_remarks->value()) return true; |
| 227 |
return false; |
| 228 |
} |
| 229 |
|
| 230 |
void update_mars_dailyfields() |
| 231 |
{ |
| 232 |
s_mars_daily_incident = txt_mars_daily_incident->value(); |
| 233 |
s_mars_daily_de = txt_mars_daily_de->value(); |
| 234 |
s_mars_daily_nbr = txt_mars_daily_nbr->value(); |
| 235 |
size_t n = sel_mars_daily_prec->index(); |
| 236 |
if (n < 0) n = 0; |
| 237 |
if (n >= strlen(mars_precedent)) n = strlen(mars_precedent) - 1; |
| 238 |
s_mars_daily_prec = mars_precedent[n]; |
| 239 |
s_mars_daily_dtg = txt_mars_daily_dtg->value(); |
| 240 |
s_mars_daily_fm_name = txt_mars_daily_fm_name->value(); |
| 241 |
s_mars_daily_fm_call = txt_mars_daily_fm_call->value(); |
| 242 |
s_mars_daily_fm_state = txt_mars_daily_fm_state->value(); |
| 243 |
s_mars_daily_to_pos = txt_mars_daily_to_pos->value(); |
| 244 |
s_mars_daily_to_call = txt_mars_daily_to_call->value(); |
| 245 |
s_mars_daily_to_state = txt_mars_daily_to_state->value(); |
| 246 |
s_mars_daily_pos1 = txt_mars_daily_pos1->value(); |
| 247 |
s_mars_daily_call1 = txt_mars_daily_call1->value(); |
| 248 |
s_mars_daily_state1 = txt_mars_daily_state1->value(); |
| 249 |
s_mars_daily_pos2 = txt_mars_daily_pos2->value(); |
| 250 |
s_mars_daily_call2 = txt_mars_daily_call2->value(); |
| 251 |
s_mars_daily_state2 = txt_mars_daily_state2->value(); |
| 252 |
s_mars_daily_pos3 = txt_mars_daily_pos3->value(); |
| 253 |
s_mars_daily_call3 = txt_mars_daily_call3->value(); |
| 254 |
s_mars_daily_state3 = txt_mars_daily_state3->value(); |
| 255 |
s_mars_daily_sitrep_id = txt_mars_daily_sitrep_id->value(); |
| 256 |
s_mars_daily_sitrep_loc = txt_mars_daily_sitrep_loc->value(); |
| 257 |
s_mars_daily_24hr = txt_mars_daily_dtg_24hr->value(); |
| 258 |
s_mars_daily_netcall = txt_mars_daily_netcall->value(); |
| 259 |
n = sel_mars_daily_e_x->index(); |
| 260 |
if (n < 0) n = 0; |
| 261 |
if (n >= strlen(mars_e_x)) n = strlen(mars_e_x) - 1; |
| 262 |
s_mars_daily_e_x = mars_e_x[n]; |
| 263 |
s_mars_daily_dtg_active = txt_mars_daily_dtg_active->value(); |
| 264 |
s_mars_daily_dtg_deactive = txt_mars_daily_dtg_deactive->value(); |
| 265 |
s_mars_daily_nbr_stations = txt_mars_daily_nbr_stations->value(); |
| 266 |
s_mars_daily_details = txt_mars_daily_details->value(); |
| 267 |
s_mars_daily_activations = txt_mars_daily_activations->value(); |
| 268 |
s_mars_daily_agencies = txt_mars_daily_agencies->value(); |
| 269 |
s_mars_daily_remarks = txt_mars_daily_remarks->value(); |
| 270 |
} |
| 271 |
|
| 272 |
void update_mars_dailyform() |
| 273 |
{ |
| 274 |
txt_mars_daily_incident->value(s_mars_daily_incident.c_str()); |
| 275 |
txt_mars_daily_de->value(s_mars_daily_de.c_str()); |
| 276 |
txt_mars_daily_nbr->value(s_mars_daily_nbr.c_str()); |
| 277 |
|
| 278 |
size_t n = strchr(mars_precedent, s_mars_daily_prec[0]) - mars_precedent; |
| 279 |
if (n < 0) n = 0; |
| 280 |
if (n >= strlen(mars_precedent)) n = strlen(mars_precedent) - 1; |
| 281 |
sel_mars_daily_prec->index(n); |
| 282 |
|
| 283 |
txt_mars_daily_dtg->value(s_mars_daily_dtg.c_str()); |
| 284 |
txt_mars_daily_fm_name->value(s_mars_daily_fm_name.c_str()); |
| 285 |
txt_mars_daily_fm_call->value(s_mars_daily_fm_call.c_str()); |
| 286 |
txt_mars_daily_fm_state->value(s_mars_daily_fm_state.c_str()); |
| 287 |
txt_mars_daily_to_pos->value(s_mars_daily_to_pos.c_str()); |
| 288 |
txt_mars_daily_to_call->value(s_mars_daily_to_call.c_str()); |
| 289 |
txt_mars_daily_to_state->value(s_mars_daily_to_state.c_str()); |
| 290 |
txt_mars_daily_pos1->value(s_mars_daily_pos1.c_str()); |
| 291 |
txt_mars_daily_call1->value(s_mars_daily_call1.c_str()); |
| 292 |
txt_mars_daily_state1->value(s_mars_daily_state1.c_str()); |
| 293 |
txt_mars_daily_pos2->value(s_mars_daily_pos2.c_str()); |
| 294 |
txt_mars_daily_call2->value(s_mars_daily_call2.c_str()); |
| 295 |
txt_mars_daily_state2->value(s_mars_daily_state2.c_str()); |
| 296 |
txt_mars_daily_pos3->value(s_mars_daily_pos3.c_str()); |
| 297 |
txt_mars_daily_call3->value(s_mars_daily_call3.c_str()); |
| 298 |
txt_mars_daily_state3->value(s_mars_daily_state3.c_str()); |
| 299 |
txt_mars_daily_sitrep_id->value(s_mars_daily_sitrep_id.c_str()); |
| 300 |
txt_mars_daily_sitrep_loc->value(s_mars_daily_sitrep_loc.c_str()); |
| 301 |
txt_mars_daily_dtg_24hr->value(s_mars_daily_24hr.c_str()); |
| 302 |
txt_mars_daily_netcall->value(s_mars_daily_netcall.c_str()); |
| 303 |
|
| 304 |
n = strchr(mars_e_x, s_mars_daily_e_x[0]) - mars_e_x; |
| 305 |
if (n < 0) n = 0; |
| 306 |
if (n >= strlen(mars_e_x)) n = strlen(mars_e_x) - 1; |
| 307 |
sel_mars_daily_e_x->index(n); |
| 308 |
|
| 309 |
txt_mars_daily_dtg_active->value(s_mars_daily_dtg_active.c_str()); |
| 310 |
txt_mars_daily_dtg_deactive->value(s_mars_daily_dtg_deactive.c_str()); |
| 311 |
txt_mars_daily_nbr_stations->value(s_mars_daily_nbr_stations.c_str()); |
| 312 |
txt_mars_daily_details->value(s_mars_daily_details.c_str()); |
| 313 |
txt_mars_daily_activations->value(s_mars_daily_activations.c_str()); |
| 314 |
txt_mars_daily_agencies->value(s_mars_daily_agencies.c_str()); |
| 315 |
txt_mars_daily_remarks->value(s_mars_daily_remarks.c_str()); |
| 316 |
} |
| 317 |
|
| 318 |
void clear_mars_daily_form() |
| 319 |
{ |
| 320 |
clear_mars_dailyfields(); |
| 321 |
txt_mars_daily_incident->value(""); |
| 322 |
txt_mars_daily_de->value(""); |
| 323 |
txt_mars_daily_nbr->value(""); |
| 324 |
sel_mars_daily_prec->index(0); |
| 325 |
txt_mars_daily_dtg->value(""); |
| 326 |
txt_mars_daily_fm_name->value(""); |
| 327 |
txt_mars_daily_fm_call->value(""); |
| 328 |
txt_mars_daily_fm_state->value(""); |
| 329 |
txt_mars_daily_to_pos->value(""); |
| 330 |
txt_mars_daily_to_call->value(""); |
| 331 |
txt_mars_daily_to_state->value(""); |
| 332 |
txt_mars_daily_pos1->value(""); |
| 333 |
txt_mars_daily_call1->value(""); |
| 334 |
txt_mars_daily_state1->value(""); |
| 335 |
txt_mars_daily_pos2->value(""); |
| 336 |
txt_mars_daily_call2->value(""); |
| 337 |
txt_mars_daily_state2->value(""); |
| 338 |
txt_mars_daily_pos3->value(""); |
| 339 |
txt_mars_daily_call3->value(""); |
| 340 |
txt_mars_daily_state3->value(""); |
| 341 |
txt_mars_daily_sitrep_id->value(""); |
| 342 |
txt_mars_daily_sitrep_loc->value(""); |
| 343 |
txt_mars_daily_dtg_24hr->value(""); |
| 344 |
txt_mars_daily_netcall->value(""); |
| 345 |
sel_mars_daily_e_x->index(1); |
| 346 |
txt_mars_daily_dtg_active->value(""); |
| 347 |
txt_mars_daily_dtg_deactive->value(""); |
| 348 |
txt_mars_daily_nbr_stations->value(""); |
| 349 |
txt_mars_daily_details->value(""); |
| 350 |
txt_mars_daily_activations->value(""); |
| 351 |
txt_mars_daily_agencies->value(""); |
| 352 |
txt_mars_daily_remarks->value(""); |
| 353 |
} |
| 354 |
|
| 355 |
void make_buffmars_daily(bool compress = false) |
| 356 |
{ |
| 357 |
std::string mbuff; |
| 358 |
mbuff.clear(); |
| 359 |
mbuff.append( lineout( mars_daily_incident, s_mars_daily_incident ) ); |
| 360 |
mbuff.append( lineout( mars_daily_de, s_mars_daily_de ) ); |
| 361 |
mbuff.append( lineout( mars_daily_nbr, s_mars_daily_nbr ) ); |
| 362 |
mbuff.append( lineout( mars_daily_prec, s_mars_daily_prec ) ); |
| 363 |
mbuff.append( lineout( mars_daily_dtg, s_mars_daily_dtg ) ); |
| 364 |
mbuff.append( lineout( mars_daily_fm_name, s_mars_daily_fm_name ) ); |
| 365 |
mbuff.append( lineout( mars_daily_fm_call, s_mars_daily_fm_call ) ); |
| 366 |
mbuff.append( lineout( mars_daily_fm_state, s_mars_daily_fm_state ) ); |
| 367 |
mbuff.append( lineout( mars_daily_to_pos, s_mars_daily_to_pos ) ); |
| 368 |
mbuff.append( lineout( mars_daily_to_call, s_mars_daily_to_call ) ); |
| 369 |
mbuff.append( lineout( mars_daily_to_state, s_mars_daily_to_state ) ); |
| 370 |
mbuff.append( lineout( mars_daily_pos1, s_mars_daily_pos1 ) ); |
| 371 |
mbuff.append( lineout( mars_daily_call1, s_mars_daily_call1 ) ); |
| 372 |
mbuff.append( lineout( mars_daily_state1, s_mars_daily_state1 ) ); |
| 373 |
mbuff.append( lineout( mars_daily_pos2, s_mars_daily_pos2 ) ); |
| 374 |
mbuff.append( lineout( mars_daily_call2, s_mars_daily_call2 ) ); |
| 375 |
mbuff.append( lineout( mars_daily_state2, s_mars_daily_state2 ) ); |
| 376 |
mbuff.append( lineout( mars_daily_pos3, s_mars_daily_pos3 ) ); |
| 377 |
mbuff.append( lineout( mars_daily_call3, s_mars_daily_call3 ) ); |
| 378 |
mbuff.append( lineout( mars_daily_state3, s_mars_daily_state3 ) ); |
| 379 |
mbuff.append( lineout( mars_daily_sitrep_id, s_mars_daily_sitrep_id ) ); |
| 380 |
mbuff.append( lineout( mars_daily_sitrep_loc, s_mars_daily_sitrep_loc ) ); |
| 381 |
mbuff.append( lineout( mars_daily_24hr, s_mars_daily_24hr ) ); |
| 382 |
mbuff.append( lineout( mars_daily_netcall, s_mars_daily_netcall ) ); |
| 383 |
mbuff.append( lineout( mars_daily_e_x, s_mars_daily_e_x ) ); |
| 384 |
mbuff.append( lineout( mars_daily_dtg_active, s_mars_daily_dtg_active ) ); |
| 385 |
mbuff.append( lineout( mars_daily_dtg_deactive,s_mars_daily_dtg_deactive ) ); |
| 386 |
mbuff.append( lineout( mars_daily_nbr_stations,s_mars_daily_nbr_stations ) ); |
| 387 |
mbuff.append( lineout( mars_daily_details, s_mars_daily_details ) ); |
| 388 |
mbuff.append( lineout( mars_daily_activations, s_mars_daily_activations ) ); |
| 389 |
mbuff.append( lineout( mars_daily_agencies, s_mars_daily_agencies ) ); |
| 390 |
mbuff.append( lineout( mars_daily_remarks, s_mars_daily_remarks ) ); |
| 391 |
|
| 392 |
if (compress) compress_maybe(mbuff); |
| 393 |
buffmars_daily.append(mbuff); |
| 394 |
} |
| 395 |
|
| 396 |
void read_mars_daily_buffer(std::string data) |
| 397 |
{ |
| 398 |
clear_mars_dailyfields(); |
| 399 |
|
| 400 |
s_mars_daily_incident = findstr( data, mars_daily_incident ); |
| 401 |
s_mars_daily_de = findstr( data, mars_daily_de ); |
| 402 |
s_mars_daily_nbr = findstr( data, mars_daily_nbr ); |
| 403 |
s_mars_daily_prec = findstr( data, mars_daily_prec ); |
| 404 |
s_mars_daily_dtg = findstr( data, mars_daily_dtg ); |
| 405 |
s_mars_daily_fm_name = findstr( data, mars_daily_fm_name ); |
| 406 |
s_mars_daily_fm_call = findstr( data, mars_daily_fm_call ); |
| 407 |
s_mars_daily_fm_state = findstr( data, mars_daily_fm_state ); |
| 408 |
s_mars_daily_to_pos = findstr( data, mars_daily_to_pos ); |
| 409 |
s_mars_daily_to_call = findstr( data, mars_daily_to_call ); |
| 410 |
s_mars_daily_to_state = findstr( data, mars_daily_to_state ); |
| 411 |
s_mars_daily_pos1 = findstr( data, mars_daily_pos1 ); |
| 412 |
s_mars_daily_call1 = findstr( data, mars_daily_call1 ); |
| 413 |
s_mars_daily_state1 = findstr( data, mars_daily_state1 ); |
| 414 |
s_mars_daily_pos2 = findstr( data, mars_daily_pos2 ); |
| 415 |
s_mars_daily_call2 = findstr( data, mars_daily_call2 ); |
| 416 |
s_mars_daily_state2 = findstr( data, mars_daily_state2 ); |
| 417 |
s_mars_daily_pos3 = findstr( data, mars_daily_pos3 ); |
| 418 |
s_mars_daily_call3 = findstr( data, mars_daily_call3 ); |
| 419 |
s_mars_daily_state3 = findstr( data, mars_daily_state3 ); |
| 420 |
s_mars_daily_sitrep_id = findstr( data, mars_daily_sitrep_id ); |
| 421 |
s_mars_daily_sitrep_loc = findstr( data, mars_daily_sitrep_loc ); |
| 422 |
s_mars_daily_24hr = findstr( data, mars_daily_24hr ); |
| 423 |
s_mars_daily_netcall = findstr( data, mars_daily_netcall ); |
| 424 |
s_mars_daily_e_x = findstr( data, mars_daily_e_x ); |
| 425 |
s_mars_daily_dtg_active = findstr( data, mars_daily_dtg_active ); |
| 426 |
s_mars_daily_dtg_deactive = findstr( data, mars_daily_dtg_deactive ); |
| 427 |
s_mars_daily_nbr_stations = findstr( data, mars_daily_nbr_stations ); |
| 428 |
s_mars_daily_details = findstr( data, mars_daily_details ); |
| 429 |
s_mars_daily_activations = findstr( data, mars_daily_activations ); |
| 430 |
s_mars_daily_agencies = findstr( data, mars_daily_agencies ); |
| 431 |
s_mars_daily_remarks = findstr( data, mars_daily_remarks ); |
| 432 |
|
| 433 |
update_mars_dailyform(); |
| 434 |
} |
| 435 |
|
| 436 |
void cb_mars_daily_new() |
| 437 |
{ |
| 438 |
if (check_mars_dailyfields()) { |
| 439 |
if (fl_choice2("Form modified, save?", "No", "Yes", NULL) == 1) { |
| 440 |
update_header(CHANGED); |
| 441 |
cb_mars_daily_save(); |
| 442 |
} |
| 443 |
} |
| 444 |
clear_mars_daily_form(); |
| 445 |
def_mars_daily_filename = ICS_msg_dir; |
| 446 |
def_mars_daily_filename.append("new").append(FMARSDAILY_EXT); |
| 447 |
show_filename(def_mars_daily_filename); |
| 448 |
using_mars_daily_template = false; |
| 449 |
} |
| 450 |
|
| 451 |
void cb_mars_daily_import() |
| 452 |
{ |
| 453 |
fl_alert2("Not implemented"); |
| 454 |
} |
| 455 |
|
| 456 |
void cb_mars_daily_export() |
| 457 |
{ |
| 458 |
fl_alert2("Not implemented"); |
| 459 |
} |
| 460 |
|
| 461 |
void cb_mars_daily_wrap_import(std::string wrapfilename, std::string inpbuffer) |
| 462 |
{ |
| 463 |
clear_mars_daily_form(); |
| 464 |
read_mars_daily_buffer(inpbuffer); |
| 465 |
def_mars_daily_filename = ICS_msg_dir; |
| 466 |
def_mars_daily_filename.append(wrapfilename); |
| 467 |
show_filename(def_mars_daily_filename); |
| 468 |
using_mars_daily_template = false; |
| 469 |
} |
| 470 |
|
| 471 |
int eval_mars_daily_fsize() |
| 472 |
{ |
| 473 |
Ccrc16 chksum; |
| 474 |
evalstr.assign("[WRAP:beg][WRAP:lf][WRAP:fn "); |
| 475 |
evalstr.append(base_mars_daily_filename).append("]"); |
| 476 |
update_mars_dailyfields(); |
| 477 |
update_header(FROM); |
| 478 |
evalstr.append(header("<mars_daily>")); |
| 479 |
buffmars_daily.clear(); |
| 480 |
make_buffmars_daily(true); |
| 481 |
if (buffmars_daily.empty()) return 0; |
| 482 |
compress_maybe( buffmars_daily ); |
| 483 |
evalstr.append( buffmars_daily ); |
| 484 |
evalstr.append("[WRAP:chksum ").append(chksum.scrc16(evalstr)).append("][WRAP:end]"); |
| 485 |
return evalstr.length(); |
| 486 |
} |
| 487 |
|
| 488 |
void cb_mars_daily_wrap_export() |
| 489 |
{ |
| 490 |
if (check_mars_dailyfields()) { |
| 491 |
if (fl_choice2("Form modified, save?", "No", "Yes", NULL) == 0) |
| 492 |
return; |
| 493 |
update_header(CHANGED); |
| 494 |
} |
| 495 |
update_mars_dailyfields(); |
| 496 |
|
| 497 |
if (base_mars_daily_filename == std::string("new").append(FMARSDAILY_EXT) || |
| 498 |
base_mars_daily_filename == std::string("default").append(FMARSDAILY_EXT) ) |
| 499 |
if (!cb_mars_daily_save_as()) return; |
| 500 |
|
| 501 |
std::string wrapfilename = WRAP_send_dir; |
| 502 |
wrapfilename.append(base_mars_daily_filename); |
| 503 |
wrapfilename.append(".wrap"); |
| 504 |
const char *p = FSEL::saveas( |
| 505 |
"Save as wrap file", |
| 506 |
"Wrap file\t*.{wrap,WRAP}", |
| 507 |
wrapfilename.c_str()); |
| 508 |
if (p) { |
| 509 |
std::string pext = fl_filename_ext(p); |
| 510 |
wrapfilename = p; |
| 511 |
update_header(FROM); |
| 512 |
buffmars_daily.assign(header("<mars_daily>")); |
| 513 |
make_buffmars_daily(true); |
| 514 |
export_wrapfile(base_mars_daily_filename, wrapfilename, buffmars_daily, pext != ".wrap"); |
| 515 |
|
| 516 |
buffmars_daily.assign(header("<mars_daily>")); |
| 517 |
make_buffmars_daily(false); |
| 518 |
write_mars_daily(def_mars_daily_filename); |
| 519 |
} |
| 520 |
} |
| 521 |
|
| 522 |
void cb_mars_daily_wrap_autosend() |
| 523 |
{ |
| 524 |
if (check_mars_dailyfields()) { |
| 525 |
if (fl_choice2("Form modified, save?", "No", "Yes", NULL) == 0) |
| 526 |
return; |
| 527 |
update_header(CHANGED); |
| 528 |
} |
| 529 |
update_mars_dailyfields(); |
| 530 |
|
| 531 |
if (base_mars_daily_filename == std::string("new").append(FMARSDAILY_EXT) || |
| 532 |
base_mars_daily_filename == std::string("default").append(FMARSDAILY_EXT) ) |
| 533 |
if (!cb_mars_daily_save_as()) return; |
| 534 |
|
| 535 |
update_header(FROM); |
| 536 |
buffmars_daily.assign(header("<mars_daily>")); |
| 537 |
make_buffmars_daily(true); |
| 538 |
xfr_via_socket(base_mars_daily_filename, buffmars_daily); |
| 539 |
|
| 540 |
buffmars_daily.assign(header("<mars_daily>")); |
| 541 |
make_buffmars_daily(false); |
| 542 |
write_mars_daily(def_mars_daily_filename); |
| 543 |
} |
| 544 |
|
| 545 |
void cb_mars_daily_load_template() |
| 546 |
{ |
| 547 |
std::string def_mars_daily_filename = def_mars_daily_TemplateName; |
| 548 |
const char *p = FSEL::select( |
| 549 |
"Open template file", |
| 550 |
std::string("Template file\t*").append(TMARSDAILY_EXT).c_str(), |
| 551 |
def_mars_daily_filename.c_str()); |
| 552 |
if (p) { |
| 553 |
clear_mars_daily_form(); |
| 554 |
read_data_file(p); |
| 555 |
def_mars_daily_TemplateName = p; |
| 556 |
show_filename(def_mars_daily_TemplateName); |
| 557 |
using_mars_daily_template = true; |
| 558 |
} |
| 559 |
} |
| 560 |
|
| 561 |
void cb_mars_daily_save_template() |
| 562 |
{ |
| 563 |
if (!using_mars_daily_template) { |
| 564 |
cb_mars_daily_save_as_template(); |
| 565 |
return; |
| 566 |
} |
| 567 |
std::string def_mars_daily_filename = def_mars_daily_TemplateName; |
| 568 |
const char *p = FSEL::saveas( |
| 569 |
"Save template file", |
| 570 |
std::string("Template file\t*").append(TMARSDAILY_EXT).c_str(), |
| 571 |
def_mars_daily_filename.c_str()); |
| 572 |
if (p) { |
| 573 |
update_header(CHANGED); |
| 574 |
update_mars_dailyfields(); |
| 575 |
buffmars_daily.assign(header("<mars_daily>")); |
| 576 |
make_buffmars_daily(); |
| 577 |
write_mars_daily(p); |
| 578 |
} |
| 579 |
} |
| 580 |
|
| 581 |
void cb_mars_daily_save_as_template() |
| 582 |
{ |
| 583 |
std::string def_mars_daily_filename = def_mars_daily_TemplateName; |
| 584 |
const char *p = FSEL::saveas( |
| 585 |
"Save as template file", |
| 586 |
std::string("Template file\t*").append(TMARSDAILY_EXT).c_str(), |
| 587 |
def_mars_daily_filename.c_str()); |
| 588 |
if (p) { |
| 589 |
const char *pext = fl_filename_ext(p); |
| 590 |
def_mars_daily_TemplateName = p; |
| 591 |
if (strlen(pext) == 0) def_mars_daily_TemplateName.append(TMARSDAILY_EXT); |
| 592 |
remove_spaces_from_filename(def_mars_daily_TemplateName); |
| 593 |
|
| 594 |
clear_header(); |
| 595 |
update_header(CHANGED); |
| 596 |
update_mars_dailyfields(); |
| 597 |
buffmars_daily.assign(header("<mars_daily>")); |
| 598 |
make_buffmars_daily(); |
| 599 |
write_mars_daily(def_mars_daily_TemplateName); |
| 600 |
|
| 601 |
show_filename(def_mars_daily_TemplateName); |
| 602 |
using_mars_daily_template = true; |
| 603 |
} |
| 604 |
} |
| 605 |
|
| 606 |
void cb_mars_daily_open() |
| 607 |
{ |
| 608 |
const char *p = FSEL::select( |
| 609 |
_("Open data file"), |
| 610 |
std::string("ICS-mars_daily\t*").append(FMARSDAILY_EXT).c_str(), |
| 611 |
def_mars_daily_filename.c_str()); |
| 612 |
if (!p) return; |
| 613 |
if (strlen(p) == 0) return; |
| 614 |
clear_mars_daily_form(); |
| 615 |
read_data_file(p); |
| 616 |
using_mars_daily_template = false; |
| 617 |
def_mars_daily_filename = p; |
| 618 |
show_filename(def_mars_daily_filename); |
| 619 |
} |
| 620 |
|
| 621 |
void write_mars_daily(std::string s) |
| 622 |
{ |
| 623 |
FILE *filemars_daily = fopen(s.c_str(), "w"); |
| 624 |
if (!filemars_daily) return; |
| 625 |
|
| 626 |
fwrite(buffmars_daily.c_str(), buffmars_daily.length(), 1, filemars_daily); |
| 627 |
fclose(filemars_daily); |
| 628 |
} |
| 629 |
|
| 630 |
bool cb_mars_daily_save_as() |
| 631 |
{ |
| 632 |
const char *p; |
| 633 |
std::string newfilename; |
| 634 |
|
| 635 |
std::string name = named_file(); |
| 636 |
if (!name.empty()) { |
| 637 |
name.append(FMARSDAILY_EXT); |
| 638 |
newfilename = ICS_msg_dir; |
| 639 |
newfilename.append(name); |
| 640 |
} else |
| 641 |
newfilename = def_mars_daily_filename; |
| 642 |
|
| 643 |
p = FSEL::saveas( |
| 644 |
_("Save data file"), |
| 645 |
std::string("ICS-mars_daily\t*").append(FMARSDAILY_EXT).c_str(), |
| 646 |
newfilename.c_str()); |
| 647 |
|
| 648 |
if (!p) return false; |
| 649 |
if (strlen(p) == 0) return false; |
| 650 |
|
| 651 |
if (progStatus.sernbr_fname) update_sernbr(); |
| 652 |
|
| 653 |
const char *pext = fl_filename_ext(p); |
| 654 |
def_mars_daily_filename = p; |
| 655 |
if (strlen(pext) == 0) def_mars_daily_filename.append(FMARSDAILY_EXT); |
| 656 |
|
| 657 |
remove_spaces_from_filename(def_mars_daily_filename); |
| 658 |
|
| 659 |
update_header(NEW); |
| 660 |
update_mars_dailyfields(); |
| 661 |
buffmars_daily.assign(header("<mars_daily>")); |
| 662 |
make_buffmars_daily(); |
| 663 |
write_mars_daily(def_mars_daily_filename); |
| 664 |
|
| 665 |
using_mars_daily_template = false; |
| 666 |
show_filename(def_mars_daily_filename); |
| 667 |
return true; |
| 668 |
} |
| 669 |
|
| 670 |
void cb_mars_daily_save() |
| 671 |
{ |
| 672 |
if (base_mars_daily_filename == std::string("new").append(FMARSDAILY_EXT) || |
| 673 |
base_mars_daily_filename == std::string("default").append(FMARSDAILY_EXT) || |
| 674 |
using_mars_daily_template == true) { |
| 675 |
cb_mars_daily_save_as(); |
| 676 |
return; |
| 677 |
} |
| 678 |
if (check_mars_dailyfields()) update_header(CHANGED); |
| 679 |
update_mars_dailyfields(); |
| 680 |
buffmars_daily.assign(header("<mars_daily>")); |
| 681 |
make_buffmars_daily(); |
| 682 |
write_mars_daily(def_mars_daily_filename); |
| 683 |
|
| 684 |
using_mars_daily_template = false; |
| 685 |
} |
| 686 |
|
| 687 |
void cb_mars_daily_html() |
| 688 |
{ |
| 689 |
std::string fname_name = fl_filename_name(def_mars_daily_filename.c_str()); |
| 690 |
size_t p = fname_name.rfind('.'); |
| 691 |
if (p != std::string::npos) fname_name.erase(p); |
| 692 |
|
| 693 |
std::string mars_daily_fname = ICS_dir; |
| 694 |
mars_daily_fname.append(fname_name); |
| 695 |
mars_daily_fname.append(".html"); |
| 696 |
|
| 697 |
std::string html_text = ""; |
| 698 |
|
| 699 |
update_mars_dailyfields(); |
| 700 |
std::string formmars_daily = mars_daily_html_template; |
| 701 |
|
| 702 |
replacestr(formmars_daily, TITLE, fname_name); |
| 703 |
|
| 704 |
replacestr(formmars_daily, mars_daily_incident, s_mars_daily_incident ); |
| 705 |
replacestr(formmars_daily, mars_daily_incident, s_mars_daily_incident ); |
| 706 |
replacestr(formmars_daily, mars_daily_de, s_mars_daily_de ); |
| 707 |
replacestr(formmars_daily, mars_daily_nbr, s_mars_daily_nbr ); |
| 708 |
replacestr(formmars_daily, mars_daily_prec, s_mars_daily_prec ); |
| 709 |
replacestr(formmars_daily, mars_daily_dtg, s_mars_daily_dtg ); |
| 710 |
replacestr(formmars_daily, mars_daily_fm_name, s_mars_daily_fm_name ); |
| 711 |
replacestr(formmars_daily, mars_daily_fm_call, s_mars_daily_fm_call ); |
| 712 |
replacestr(formmars_daily, mars_daily_fm_state, s_mars_daily_fm_state ); |
| 713 |
replacestr(formmars_daily, mars_daily_to_pos, s_mars_daily_to_pos ); |
| 714 |
replacestr(formmars_daily, mars_daily_to_call, s_mars_daily_to_call ); |
| 715 |
replacestr(formmars_daily, mars_daily_to_state, s_mars_daily_to_state ); |
| 716 |
replacestr(formmars_daily, mars_daily_pos1, s_mars_daily_pos1 ); |
| 717 |
replacestr(formmars_daily, mars_daily_call1, s_mars_daily_call1 ); |
| 718 |
replacestr(formmars_daily, mars_daily_state1, s_mars_daily_state1 ); |
| 719 |
replacestr(formmars_daily, mars_daily_pos2, s_mars_daily_pos2 ); |
| 720 |
replacestr(formmars_daily, mars_daily_call2, s_mars_daily_call2 ); |
| 721 |
replacestr(formmars_daily, mars_daily_state2, s_mars_daily_state2 ); |
| 722 |
replacestr(formmars_daily, mars_daily_pos3, s_mars_daily_pos3 ); |
| 723 |
replacestr(formmars_daily, mars_daily_call3, s_mars_daily_call3 ); |
| 724 |
replacestr(formmars_daily, mars_daily_state3, s_mars_daily_state3 ); |
| 725 |
replacestr(formmars_daily, mars_daily_sitrep_id, s_mars_daily_sitrep_id ); |
| 726 |
replacestr(formmars_daily, mars_daily_sitrep_loc, s_mars_daily_sitrep_loc ); |
| 727 |
replacestr(formmars_daily, mars_daily_24hr, s_mars_daily_24hr ); |
| 728 |
replacestr(formmars_daily, mars_daily_netcall, s_mars_daily_netcall ); |
| 729 |
replacestr(formmars_daily, mars_daily_e_x, s_mars_daily_e_x ); |
| 730 |
replacestr(formmars_daily, mars_daily_dtg_active, s_mars_daily_dtg_active ); |
| 731 |
replacestr(formmars_daily, mars_daily_dtg_deactive, s_mars_daily_dtg_deactive ); |
| 732 |
replacestr(formmars_daily, mars_daily_nbr_stations, s_mars_daily_nbr_stations ); |
| 733 |
replacestr(formmars_daily, mars_daily_details, s_mars_daily_details ); |
| 734 |
replacestr(formmars_daily, mars_daily_activations, s_mars_daily_activations ); |
| 735 |
replacestr(formmars_daily, mars_daily_agencies, s_mars_daily_agencies ); |
| 736 |
replacestr(formmars_daily, mars_daily_remarks, s_mars_daily_remarks ); |
| 737 |
|
| 738 |
FILE *filemars_daily = fopen(mars_daily_fname.c_str(), "w"); |
| 739 |
fprintf(filemars_daily,"%s", formmars_daily.c_str()); |
| 740 |
fclose(filemars_daily); |
| 741 |
|
| 742 |
open_url(mars_daily_fname.c_str()); |
| 743 |
} |
| 744 |
|
| 745 |
void cb_mars_daily_msg_type() |
| 746 |
{ |
| 747 |
if (tabs_msg_type->value() == tab_mars_daily ) { |
| 748 |
show_filename(def_mars_daily_filename); |
| 749 |
} else { |
| 750 |
show_filename(def_rg_filename); |
| 751 |
} |
| 752 |
} |
| 753 |
|
| 754 |
void cb_mars_daily_textout() |
| 755 |
{ |
| 756 |
std::string temp = ""; |
| 757 |
std::string mars_daily_fname = ICS_dir; |
| 758 |
mars_daily_fname.append("mars_daily.txt"); |
| 759 |
|
| 760 |
update_mars_dailyfields(); |
| 761 |
std::string formmars_daily = mars_daily_text_template; |
| 762 |
|
| 763 |
replacestr(formmars_daily, mars_daily_incident, s_mars_daily_incident ); |
| 764 |
replacestr(formmars_daily, mars_daily_incident, s_mars_daily_incident ); |
| 765 |
replacestr(formmars_daily, mars_daily_de, s_mars_daily_de ); |
| 766 |
replacestr(formmars_daily, mars_daily_nbr, s_mars_daily_nbr ); |
| 767 |
replacestr(formmars_daily, mars_daily_prec, s_mars_daily_prec ); |
| 768 |
replacestr(formmars_daily, mars_daily_dtg, s_mars_daily_dtg ); |
| 769 |
replacestr(formmars_daily, mars_daily_fm_name, s_mars_daily_fm_name ); |
| 770 |
replacestr(formmars_daily, mars_daily_fm_call, s_mars_daily_fm_call ); |
| 771 |
replacestr(formmars_daily, mars_daily_fm_state, s_mars_daily_fm_state ); |
| 772 |
replacestr(formmars_daily, mars_daily_to_pos, s_mars_daily_to_pos ); |
| 773 |
replacestr(formmars_daily, mars_daily_to_call, s_mars_daily_to_call ); |
| 774 |
replacestr(formmars_daily, mars_daily_to_state, s_mars_daily_to_state ); |
| 775 |
replacestr(formmars_daily, mars_daily_pos1, s_mars_daily_pos1 ); |
| 776 |
replacestr(formmars_daily, mars_daily_call1, s_mars_daily_call1 ); |
| 777 |
replacestr(formmars_daily, mars_daily_state1, s_mars_daily_state1 ); |
| 778 |
replacestr(formmars_daily, mars_daily_pos2, s_mars_daily_pos2 ); |
| 779 |
replacestr(formmars_daily, mars_daily_call2, s_mars_daily_call2 ); |
| 780 |
replacestr(formmars_daily, mars_daily_state2, s_mars_daily_state2 ); |
| 781 |
replacestr(formmars_daily, mars_daily_pos3, s_mars_daily_pos3 ); |
| 782 |
replacestr(formmars_daily, mars_daily_call3, s_mars_daily_call3 ); |
| 783 |
replacestr(formmars_daily, mars_daily_state3, s_mars_daily_state3 ); |
| 784 |
replacestr(formmars_daily, mars_daily_sitrep_id, s_mars_daily_sitrep_id ); |
| 785 |
replacestr(formmars_daily, mars_daily_sitrep_loc, s_mars_daily_sitrep_loc ); |
| 786 |
replacestr(formmars_daily, mars_daily_24hr, s_mars_daily_24hr ); |
| 787 |
replacestr(formmars_daily, mars_daily_netcall, s_mars_daily_netcall ); |
| 788 |
replacestr(formmars_daily, mars_daily_e_x, s_mars_daily_e_x ); |
| 789 |
replacestr(formmars_daily, mars_daily_dtg_active, s_mars_daily_dtg_active ); |
| 790 |
replacestr(formmars_daily, mars_daily_dtg_deactive, s_mars_daily_dtg_deactive ); |
| 791 |
replacestr(formmars_daily, mars_daily_nbr_stations, s_mars_daily_nbr_stations ); |
| 792 |
replacestr(formmars_daily, mars_daily_details, s_mars_daily_details ); |
| 793 |
replacestr(formmars_daily, mars_daily_activations, s_mars_daily_activations ); |
| 794 |
replacestr(formmars_daily, mars_daily_agencies, s_mars_daily_agencies ); |
| 795 |
replacestr(formmars_daily, mars_daily_remarks, s_mars_daily_remarks ); |
| 796 |
|
| 797 |
FILE *filemars_daily = fopen(mars_daily_fname.c_str(), "w"); |
| 798 |
fprintf(filemars_daily,"%s", formmars_daily.c_str()); |
| 799 |
fclose(filemars_daily); |
| 800 |
|
| 801 |
open_url(mars_daily_fname.c_str()); |
| 802 |
} |
| 803 |
|