mirror of
https://git.code.sf.net/p/fldigi/flmsg
synced 2026-08-13 17:30:58 -04:00
RAFAC F126
* add RAFAC F126 form
This commit is contained in:
parent
3fc1ac5ae5
commit
1c7a02eee0
10 changed files with 1487 additions and 3 deletions
|
|
@ -145,6 +145,9 @@ flmsg_SOURCES += \
|
|||
cap/cap110.cxx \
|
||||
cap/cap110_tab.cxx \
|
||||
cap/cap_templates.cxx \
|
||||
cap/f126.cxx \
|
||||
cap/f126_tab.cxx \
|
||||
cap/rafac_templates.cxx \
|
||||
csv/csv.cxx \
|
||||
csv/csv_tab.cxx \
|
||||
csv/csv_templates.cxx \
|
||||
|
|
|
|||
692
src/cap/f126.cxx
Normal file
692
src/cap/f126.cxx
Normal file
|
|
@ -0,0 +1,692 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014
|
||||
// David Freese, W1HKJ
|
||||
//
|
||||
// This file is part of flmsg
|
||||
//
|
||||
// flrig is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// flrig is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Enumerations.H>
|
||||
#include <FL/Fl_Window.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Group.H>
|
||||
#include <FL/Fl_Sys_Menu_Bar.H>
|
||||
#include <FL/x.H>
|
||||
#include <FL/Fl_Help_Dialog.H>
|
||||
#include <FL/Fl_Menu_Item.H>
|
||||
#include <FL/Fl_File_Icon.H>
|
||||
|
||||
#include "config.h"
|
||||
#include "flmsg_config.h"
|
||||
|
||||
#include "flmsg.h"
|
||||
#include "templates.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "gettext.h"
|
||||
#include "flmsg_dialog.h"
|
||||
#include "flinput2.h"
|
||||
#include "date.h"
|
||||
#include "calendar.h"
|
||||
#include "icons.h"
|
||||
#include "fileselect.h"
|
||||
#include "wrap.h"
|
||||
#include "status.h"
|
||||
#include "parse_xml.h"
|
||||
#include "flmsg_strings.h"
|
||||
|
||||
#ifdef WIN32
|
||||
# include "flmsgrc.h"
|
||||
# include "compat.h"
|
||||
# define dirent fl_dirent_no_thanks
|
||||
#endif
|
||||
|
||||
#include <FL/filename.H>
|
||||
#include "dirent-check.h"
|
||||
|
||||
#include <FL/x.H>
|
||||
#include <FL/Fl_Pixmap.H>
|
||||
#include <FL/Fl_Image.H>
|
||||
|
||||
std::string f126_base_filename = "";
|
||||
std::string f126_def_filename = "";
|
||||
std::string f126_def_template_name = "";
|
||||
|
||||
static std::string f126_buffer;
|
||||
|
||||
// f126_fields
|
||||
|
||||
const char *f126_s_prec[] = {"ROUTINE","PRIORITY","IMMEDIATE","FLASH"};
|
||||
const char f126_prec_items[] = "ROUTINE|PRIORITY|IMMEDIATE|FLASH";
|
||||
|
||||
std::string f126_nbr = ":msg nbr:";
|
||||
std::string f126_prec = ":prec:";
|
||||
std::string f126_dtm = ":dtm:";
|
||||
std::string f126_from = ":from:";
|
||||
std::string f126_to = ":to:";
|
||||
std::string f126_info = ":info:";
|
||||
std::string f126_subj = ":subj:";
|
||||
std::string f126_grpcnt = ":grpcnt:";
|
||||
std::string f126_msg = ":msgtxt:";
|
||||
std::string f126_rcvd_fm = ":rcvd_fm:";
|
||||
std::string f126_sent_to = ":sent_to:";
|
||||
std::string f126_rcvd_dtm = ":rcvd_dtm:";
|
||||
std::string f126_sent_dtm = ":sent_dtm:";
|
||||
std::string f126_rcvop = ":rcvop:";
|
||||
std::string f126_sendop = ":sendop:";
|
||||
|
||||
//struct FIELD { std::string f_type; std::string f_data; void **w; char w_type; };
|
||||
FIELD f126_fields[] = {
|
||||
{ f126_nbr, "", (void **)&f126_txt_nbr, 't' }, // 0
|
||||
{ f126_prec, "", (void **)&f126_sel_prec, 's' }, // 1
|
||||
{ f126_dtm, "", (void **)&f126_txt_dtm, 't' }, // 2
|
||||
{ f126_from, "", (void **)&f126_txt_from, 't' }, // 3
|
||||
{ f126_to, "", (void **)&f126_txt_to, 't' }, // 4
|
||||
{ f126_info, "", (void **)&f126_txt_info, 't' }, // 5
|
||||
{ f126_subj, "", (void **)&f126_txt_subj, 't' }, // 6
|
||||
{ f126_grpcnt, "", (void **)&f126_txt_grpcnt, 't' }, // 7
|
||||
{ f126_msg, "", (void **)&f126_txt_msg, 'e' }, // 8
|
||||
{ f126_rcvd_fm, "", (void **)&f126_txt_rcvd_fm, 't' }, // 9
|
||||
{ f126_sent_to, "", (void **)&f126_txt_sent_to, 't' }, // 10
|
||||
{ f126_rcvd_dtm, "", (void **)&f126_txt_rcvd_dtm, 't' }, // 11
|
||||
{ f126_sent_dtm, "", (void **)&f126_txt_sent_dtm, 't' }, // 12
|
||||
{ f126_rcvop, "", (void **)&f126_txt_rcvop, 't' }, // 13
|
||||
{ f126_sendop, "", (void **)&f126_txt_sendop, 't' }, // 14
|
||||
};
|
||||
|
||||
bool f126_using_template = false;
|
||||
|
||||
int f126_num_fields = sizeof(f126_fields) / sizeof(FIELD);
|
||||
|
||||
//======================================================================
|
||||
|
||||
void f126_cb_set_dtm()
|
||||
{
|
||||
f126_txt_dtm->value(szCAPDateTime());
|
||||
}
|
||||
|
||||
void f126_cb_set_rcvd_dtm()
|
||||
{
|
||||
f126_txt_rcvd_dtm->value(szCAPDateTime());
|
||||
}
|
||||
|
||||
void f126_cb_set_sent_dtm()
|
||||
{
|
||||
f126_txt_sent_dtm->value(szCAPDateTime());
|
||||
}
|
||||
|
||||
void f126_cb_nbr(Fl_Widget *wdg)
|
||||
{
|
||||
Fl_Input2 *inp = (Fl_Input2 *)wdg;
|
||||
std::string s = inp->value();
|
||||
for (size_t n = 0; n < s.length(); n++)
|
||||
if (!isdigit(s[n])) s.erase(n,1);
|
||||
strip_leading_zeros(s);
|
||||
inp->value(s.c_str());
|
||||
}
|
||||
|
||||
static char valid_input[] = "0123456789/,; ABCDEFGHIJKLMNOPQRSTUVWXYZ\n";
|
||||
|
||||
void f126_cb_filter_input(Fl_Widget *wdg)
|
||||
{
|
||||
Fl_Input2 *inp = (Fl_Input2 *)wdg;
|
||||
std::string s = inp->value();
|
||||
ucase(s);
|
||||
for (size_t n = 0; n < s.length(); n++)
|
||||
if (strchr(valid_input, s[n]) == NULL)
|
||||
s.erase(n,1);
|
||||
inp->value(s.c_str());
|
||||
}
|
||||
|
||||
void f126_clear_fields()
|
||||
{
|
||||
for (int i = 0; i < f126_num_fields; i++)
|
||||
f126_fields[i].f_data.clear();
|
||||
}
|
||||
|
||||
static std::string numeric(int n)
|
||||
{
|
||||
static char snum[12];
|
||||
snprintf(snum, sizeof(snum), "%d", n);
|
||||
return snum;
|
||||
}
|
||||
|
||||
void f126_set_choices() {
|
||||
f126_sel_prec->clear();
|
||||
f126_sel_prec->add(f126_prec_items);
|
||||
f126_sel_prec->index(0);
|
||||
}
|
||||
|
||||
bool f126_check_fields()
|
||||
{
|
||||
for (int i = 0; i < f126_num_fields; i++) {
|
||||
if (f126_fields[i].w_type == 'd') {
|
||||
if (f126_fields[i].f_data != ((Fl_DateInput *)(*f126_fields[i].w))->value())
|
||||
return true;
|
||||
} else if (f126_fields[i].w_type == 't') {
|
||||
if (f126_fields[i].f_data != ((Fl_Input2 *)(*f126_fields[i].w))->value())
|
||||
return true;
|
||||
} else if (f126_fields[i].w_type == 's') {
|
||||
int choice = ((Fl_ListBox *)(*f126_fields[i].w))->index();
|
||||
if (choice >= 0) {
|
||||
if (f126_fields[i].f_data != numeric(choice))
|
||||
return true;
|
||||
}
|
||||
} else if (f126_fields[i].w_type == 'e') {
|
||||
if (f126_fields[i].f_data != ((FTextEdit *)(*f126_fields[i].w))->buffer()->text())
|
||||
return true;
|
||||
} else if (f126_fields[i].w_type == 'b') {
|
||||
std::string val = ((Fl_Button *)(*f126_fields[i].w))->value() ? "T" : "F";
|
||||
if (f126_fields[i].f_data != val)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void f126_update_fields()
|
||||
{
|
||||
for (int i = 0; i < f126_num_fields; i++) {
|
||||
if (f126_fields[i].w_type == 'd') {
|
||||
f126_fields[i].f_data = ((Fl_DateInput *)(*f126_fields[i].w))->value();
|
||||
} else if (f126_fields[i].w_type == 't') {
|
||||
f126_fields[i].f_data = ((Fl_Input2 *)(*f126_fields[i].w))->value();
|
||||
} else if (f126_fields[i].w_type == 's') {
|
||||
int choice = ((Fl_ListBox *)(*f126_fields[i].w))->index();
|
||||
if (choice >= 0) {
|
||||
f126_fields[i].f_data = numeric(choice);
|
||||
}
|
||||
} else if (f126_fields[i].w_type == 'e') {
|
||||
f126_fields[i].f_data = ((FTextEdit *)(*f126_fields[i].w))->buffer()->text();
|
||||
} else if (f126_fields[i].w_type == 'b') {
|
||||
std::string val = ((Fl_Button *)(*f126_fields[i].w))->value() ? "T" : "F";
|
||||
f126_fields[i].f_data = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void f126_clear_form()
|
||||
{
|
||||
f126_clear_fields();
|
||||
|
||||
if (progStatus.rgnbr_fname)
|
||||
f126_txt_nbr->value(progStatus.rgnbr.c_str());
|
||||
else
|
||||
f126_txt_nbr->value("");
|
||||
|
||||
for (int i = 1; i < f126_num_fields; i++)
|
||||
if (f126_fields[i].w_type == 'd')
|
||||
((Fl_DateInput *)(*f126_fields[i].w))->value("");
|
||||
else if (f126_fields[i].w_type == 't')
|
||||
((Fl_Input2 *)(*f126_fields[i].w))->value("");
|
||||
else if (f126_fields[i].w_type == 's')
|
||||
((Fl_ListBox *)(*f126_fields[i].w))->index(0);
|
||||
else if (f126_fields[i].w_type == 'e')
|
||||
((FTextEdit *)(*f126_fields[i].w))->clear();
|
||||
else if (f126_fields[i].w_type == 'b')
|
||||
((Fl_Button *)(*f126_fields[i].w))->value(0);
|
||||
f126_update_fields();
|
||||
}
|
||||
|
||||
void f126_update_form()
|
||||
{
|
||||
for (int i = 0; i < f126_num_fields; i++) {
|
||||
if (f126_fields[i].w_type == 'd')
|
||||
((Fl_DateInput *)(*f126_fields[i].w))->value(f126_fields[i].f_data.c_str());
|
||||
else if (f126_fields[i].w_type == 't')
|
||||
((Fl_Input2 *)(*f126_fields[i].w))->value(f126_fields[i].f_data.c_str());
|
||||
else if (f126_fields[i].w_type == 's')
|
||||
((Fl_ListBox *)(*f126_fields[i].w))->index(atoi(f126_fields[i].f_data.c_str()));
|
||||
else if (f126_fields[i].w_type == 'e') {
|
||||
((FTextEdit *)(*f126_fields[i].w))->clear();
|
||||
((FTextEdit *)(*f126_fields[i].w))->add(f126_fields[i].f_data.c_str());
|
||||
} else if (f126_fields[i].w_type == 'b')
|
||||
((Fl_Button *)(*f126_fields[i].w))->value(f126_fields[i].f_data == "T" ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
void f126_make_buffer(bool compress)
|
||||
{
|
||||
std::string mbuff;
|
||||
mbuff.clear();
|
||||
for (int i = 0; i < f126_num_fields; i++)
|
||||
mbuff.append( lineout( f126_fields[i].f_type, f126_fields[i].f_data ) );
|
||||
if (compress) compress_maybe(mbuff);
|
||||
f126_buffer.append(mbuff);
|
||||
}
|
||||
|
||||
void f126_read_buffer(std::string data)
|
||||
{
|
||||
clear_fields();
|
||||
read_header(data);
|
||||
|
||||
for (int i = 0; i < f126_num_fields; i++)
|
||||
f126_fields[i].f_data = findstr(data, f126_fields[i].f_type);
|
||||
|
||||
f126_update_form();
|
||||
}
|
||||
|
||||
void f126_cb_new()
|
||||
{
|
||||
if (f126_check_fields()) {
|
||||
if (fl_choice2(xMODIFIED, xNO, xYES, NULL) == 1) {
|
||||
update_header(CHANGED);
|
||||
f126_cb_save();
|
||||
}
|
||||
}
|
||||
f126_update_fields();
|
||||
f126_clear_form();
|
||||
clear_header();
|
||||
f126_def_filename = ICS_msg_dir;
|
||||
f126_def_filename.append(xNEW).append(F126_FILE_EXT);
|
||||
f126_using_template = false;
|
||||
show_filename(f126_def_filename);
|
||||
}
|
||||
|
||||
void f126_cb_import()
|
||||
{
|
||||
fl_alert2(xNOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
void f126_cb_export()
|
||||
{
|
||||
fl_alert2(xNOTIMPLEMENTED);
|
||||
}
|
||||
|
||||
void f126_cb_wrap_import(std::string wrapfilename, std::string inpbuffer)
|
||||
{
|
||||
f126_clear_form();
|
||||
f126_read_buffer(inpbuffer);
|
||||
f126_def_filename = ICS_msg_dir;
|
||||
f126_def_filename.append(wrapfilename);
|
||||
show_filename(f126_def_filename);
|
||||
f126_using_template = false;
|
||||
}
|
||||
|
||||
int eval_f126_fsize()
|
||||
{
|
||||
Ccrc16 chksum;
|
||||
evalstr.assign("[WRAP:beg][WRAP:lf][WRAP:fn ");
|
||||
evalstr.append(f126_base_filename).append("]");
|
||||
f126_update_fields();
|
||||
update_header(FROM);
|
||||
evalstr.append(header("<f126>"));
|
||||
f126_buffer.clear();
|
||||
f126_make_buffer(true);
|
||||
if (f126_buffer.empty()) return 0;
|
||||
evalstr.append( f126_buffer );
|
||||
evalstr.append("[WRAP:chksum ").append(chksum.scrc16(evalstr)).append("][WRAP:end]");
|
||||
return evalstr.length();
|
||||
}
|
||||
|
||||
void f126_cb_wrap_export()
|
||||
{
|
||||
if (f126_check_fields()) {
|
||||
if (fl_choice2(xMODIFIED, xNO, xYES, NULL) == 0)
|
||||
return;
|
||||
update_header(CHANGED);
|
||||
}
|
||||
f126_update_fields();
|
||||
|
||||
if (f126_base_filename == std::string(xNEW).append(F126_FILE_EXT) ||
|
||||
f126_base_filename == std::string(xDEFAULT).append(F126_FILE_EXT) )
|
||||
if (!f126_cb_save_as()) return;
|
||||
|
||||
std::string wrapfilename = WRAP_send_dir;
|
||||
wrapfilename.append(f126_base_filename);
|
||||
wrapfilename.append(WRAP_EXT);
|
||||
const char *p = FSEL::saveas(
|
||||
xSAVEASWRAP,
|
||||
xWRAPFILE,
|
||||
wrapfilename.c_str());
|
||||
if (p) {
|
||||
std::string pext = fl_filename_ext(p);
|
||||
wrapfilename = p;
|
||||
|
||||
update_header(FROM);
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer(true);
|
||||
export_wrapfile(f126_base_filename, wrapfilename, f126_buffer, pext != WRAP_EXT);
|
||||
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer(false);
|
||||
f126_write(f126_def_filename);
|
||||
}
|
||||
}
|
||||
|
||||
void f126_cb_wrap_autosend()
|
||||
{
|
||||
if (f126_check_fields()) {
|
||||
if (fl_choice2(xMODIFIED, xNO, xYES, NULL) == 0)
|
||||
return;
|
||||
update_header(CHANGED);
|
||||
}
|
||||
f126_update_fields();
|
||||
|
||||
if (f126_base_filename == std::string(xNEW).append(F126_FILE_EXT) ||
|
||||
f126_base_filename == std::string(xDEFAULT).append(F126_FILE_EXT) )
|
||||
if (!f126_cb_save_as()) return;
|
||||
|
||||
update_header(FROM);
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer(true);
|
||||
xfr_via_socket(f126_base_filename, f126_buffer);
|
||||
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer(false);
|
||||
f126_write(f126_def_filename);
|
||||
}
|
||||
|
||||
void f126_cb_load_template()
|
||||
{
|
||||
std::string f126_def_filename = f126_def_template_name;
|
||||
const char *p = FSEL::select(
|
||||
xOPENTEMPLATE,
|
||||
std::string(xTEMPLATEFILE).append(F126_TEMP_EXT).c_str(),
|
||||
f126_def_filename.c_str());
|
||||
if (p) {
|
||||
f126_clear_form();
|
||||
read_data_file(p);
|
||||
f126_def_template_name = p;
|
||||
show_filename(f126_def_template_name);
|
||||
f126_using_template = true;
|
||||
}
|
||||
}
|
||||
|
||||
void f126_cb_save_template()
|
||||
{
|
||||
if (!f126_using_template) {
|
||||
f126_cb_save_as_template();
|
||||
return;
|
||||
}
|
||||
std::string f126_def_filename = f126_def_template_name;
|
||||
const char *p = FSEL::saveas(
|
||||
xSAVEASTEMPLATE,
|
||||
std::string(xTEMPLATEFILE).append(F126_TEMP_EXT).c_str(),
|
||||
f126_def_filename.c_str());
|
||||
if (p) {
|
||||
update_header(CHANGED);
|
||||
f126_update_fields();
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer();
|
||||
f126_write(p);
|
||||
}
|
||||
}
|
||||
|
||||
void f126_cb_save_as_template()
|
||||
{
|
||||
std::string f126_def_filename = f126_def_template_name;
|
||||
const char *p = FSEL::saveas(
|
||||
xSAVEASTEMPLATE,
|
||||
std::string(xTEMPLATEFILE).append(F126_TEMP_EXT).c_str(),
|
||||
f126_def_filename.c_str());
|
||||
if (p) {
|
||||
const char *pext = fl_filename_ext(p);
|
||||
f126_def_template_name = p;
|
||||
if (strlen(pext) == 0) f126_def_template_name.append(F126_TEMP_EXT);
|
||||
remove_spaces_from_filename(f126_def_template_name);
|
||||
|
||||
clear_header();
|
||||
update_header(CHANGED);
|
||||
f126_update_fields();
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer();
|
||||
f126_write(f126_def_template_name);
|
||||
|
||||
show_filename(f126_def_template_name);
|
||||
f126_using_template = true;
|
||||
}
|
||||
}
|
||||
|
||||
void f126_cb_open()
|
||||
{
|
||||
const char *p = FSEL::select(
|
||||
_(xOPENDATAFILE),
|
||||
std::string("f126\t*").append(F126_FILE_EXT).c_str(),
|
||||
f126_def_filename.c_str());
|
||||
if (!p) return;
|
||||
if (strlen(p) == 0) return;
|
||||
f126_clear_form();
|
||||
read_data_file(p);
|
||||
f126_using_template = false;
|
||||
f126_def_filename = p;
|
||||
show_filename(f126_def_filename);
|
||||
}
|
||||
|
||||
void f126_write(std::string s)
|
||||
{
|
||||
FILE *f126_file = fopen(s.c_str(), "w");
|
||||
if (!f126_file) return;
|
||||
|
||||
fwrite(f126_buffer.c_str(), f126_buffer.length(), 1, f126_file);
|
||||
fclose(f126_file);
|
||||
}
|
||||
|
||||
bool f126_cb_save_as()
|
||||
{
|
||||
const char *p;
|
||||
std::string newfilename;
|
||||
|
||||
std::string name = named_file();
|
||||
if (!name.empty()) {
|
||||
name.append(F126_FILE_EXT);
|
||||
newfilename = ICS_msg_dir;
|
||||
newfilename.append(name);
|
||||
} else
|
||||
newfilename = f126_def_filename;
|
||||
|
||||
p = FSEL::saveas(_(xSAVEDATAFILE),
|
||||
std::string("f126\t*").append(F126_FILE_EXT).c_str(),
|
||||
newfilename.c_str());
|
||||
|
||||
if (!p) return false;
|
||||
if (strlen(p) == 0) return false;
|
||||
|
||||
if (progStatus.rgnbr_fname) {
|
||||
int n = atoi(progStatus.rgnbr.c_str());
|
||||
n++;
|
||||
char szn[12];
|
||||
snprintf(szn, sizeof(szn), "%d", n);
|
||||
progStatus.rgnbr = szn;
|
||||
txt_rgnbr->value(szn);
|
||||
txt_rgnbr->redraw();
|
||||
} else if (progStatus.sernbr_fname)
|
||||
update_sernbr();
|
||||
|
||||
const char *pext = fl_filename_ext(p);
|
||||
f126_def_filename = p;
|
||||
if (strlen(pext) == 0) f126_def_filename.append(F126_FILE_EXT);
|
||||
|
||||
remove_spaces_from_filename(f126_def_filename);
|
||||
|
||||
update_header(NEW);
|
||||
f126_update_fields();
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer();
|
||||
f126_write(f126_def_filename);
|
||||
|
||||
f126_using_template = false;
|
||||
show_filename(f126_def_filename);
|
||||
return true;
|
||||
}
|
||||
|
||||
void f126_cb_save()
|
||||
{
|
||||
if (f126_base_filename == std::string(xNEW).append(F126_FILE_EXT) ||
|
||||
f126_base_filename == std::string(xDEFAULT).append(F126_FILE_EXT) ||
|
||||
f126_using_template == true) {
|
||||
f126_cb_save_as();
|
||||
return;
|
||||
}
|
||||
|
||||
if (f126_check_fields()) update_header(CHANGED);
|
||||
f126_update_fields();
|
||||
f126_buffer.assign(header("<f126>"));
|
||||
f126_make_buffer();
|
||||
f126_write(f126_def_filename);
|
||||
|
||||
f126_using_template = false;
|
||||
}
|
||||
|
||||
void f126_cb_check()
|
||||
{
|
||||
std::string temp = f126_txt_msg->buffer()->text();
|
||||
if (temp.empty()) {
|
||||
f126_txt_grpcnt->value("");
|
||||
f126_btn_check->labelcolor(FL_BLACK);
|
||||
f126_btn_check->redraw_label();
|
||||
return;
|
||||
}
|
||||
|
||||
// convert to uppercase
|
||||
for (size_t n = 0; n < temp.length(); n++)
|
||||
temp[n] = toupper(temp[n]);
|
||||
// convert tabs to 5 spaces
|
||||
size_t pos = std::string::npos;
|
||||
while ((pos = temp.find("\t")) != std::string::npos)
|
||||
temp.replace(pos, 1, " ");
|
||||
// return converted text to editor
|
||||
f126_txt_msg->clear();
|
||||
f126_txt_msg->addstr(temp.c_str());
|
||||
|
||||
// compute word count
|
||||
// remove any user inserted end-of-lines
|
||||
while ((pos = temp.find('\n')) != std::string::npos) temp[pos] = ' ';
|
||||
// only single spaces no trailing spaces, no leading spaces
|
||||
while ((pos = temp.find(" ")) != std::string::npos) temp.erase(pos,1);
|
||||
while (temp[temp.length() -1] == ' ') temp.erase(temp.length()-1, 1);
|
||||
if (temp[0] == ' ') temp.erase(0,1);
|
||||
// count number of words in textf126_def_filename
|
||||
int numwords = 0;
|
||||
if (temp.length()) {
|
||||
pos = 0;
|
||||
numwords = 1;
|
||||
while ((pos = temp.find(" ", pos + 1)) != std::string::npos) numwords++;
|
||||
}
|
||||
|
||||
char snum[15];
|
||||
snprintf(snum, sizeof(snum), "%d", numwords);
|
||||
f126_grpcnt = snum;
|
||||
f126_txt_grpcnt->value(snum);
|
||||
f126_update_fields();
|
||||
f126_btn_check->labelcolor(FL_BLACK);
|
||||
f126_btn_check->redraw_label();
|
||||
}
|
||||
|
||||
void f126_cb_html()
|
||||
{
|
||||
std::string f126_name;
|
||||
std::string html_text;
|
||||
unsigned int nbr;
|
||||
f126_name = ICS_dir;
|
||||
f126_name.append("f126.html");
|
||||
|
||||
f126_update_fields();
|
||||
f126_cb_check();
|
||||
std::string form = f126_html_template;
|
||||
|
||||
std::string pg = ":pg:";
|
||||
std::string pgnr = ":npgs:";
|
||||
std::string pgone = "1";
|
||||
replacestr( form, pg, pgone);
|
||||
replacestr( form, pgnr, pgone);
|
||||
for (int i = 0; i < f126_num_fields; i++) {
|
||||
if (f126_fields[i].f_type == f126_prec) {
|
||||
sscanf(f126_fields[i].f_data.c_str(), "%u", &nbr);
|
||||
if (nbr >= 0 && nbr < (sizeof(f126_s_prec) / sizeof(*f126_s_prec)))
|
||||
html_text = f126_s_prec[nbr];
|
||||
else
|
||||
html_text = "";
|
||||
replacestr( form, f126_fields[i].f_type, html_text );
|
||||
} else if (f126_fields[i].w_type == 'b') {
|
||||
replacestr( form, f126_fields[i].f_type, f126_fields[i].f_data == "T" ? yes : no);
|
||||
} else if (f126_fields[i].w_type == 'e') {
|
||||
std::string temp = f126_fields[i].f_data;
|
||||
size_t p = 0;
|
||||
while ( (p = temp.find("\n")) != std::string::npos)
|
||||
temp.replace(p, 1, "<br>");
|
||||
replacestr( form, f126_fields[i].f_type, temp);
|
||||
} else
|
||||
replacestr( form, f126_fields[i].f_type, f126_fields[i].f_data );
|
||||
}
|
||||
|
||||
std::string rxstr = "";
|
||||
rxstr.append(progStatus.my_call).append(" ").append(progStatus.my_tel);
|
||||
rxstr.append("<br>").append(progStatus.my_name);
|
||||
rxstr.append("<br>").append(progStatus.my_addr);
|
||||
rxstr.append("<br>").append(progStatus.my_city);
|
||||
html_text = ":rx:";
|
||||
replacestr( form, html_text, rxstr);
|
||||
|
||||
html_text = ":exp:";
|
||||
std::string arlmsgs = "";
|
||||
if (progStatus.arl_desc)
|
||||
arlmsgs = expand_arl(f126_fields[10].f_data);
|
||||
replacestr( form, html_text, arlmsgs);
|
||||
|
||||
FILE *f126_file = fopen(f126_name.c_str(), "w");
|
||||
fprintf(f126_file,"%s", form.c_str());
|
||||
fclose(f126_file);
|
||||
|
||||
open_url(f126_name.c_str());
|
||||
}
|
||||
|
||||
void f126_cb_textout()
|
||||
{
|
||||
std::string f126_name;
|
||||
std::string lines;
|
||||
std::string str;
|
||||
int nbr = 0;
|
||||
f126_name = ICS_dir;
|
||||
f126_name.append("f126.txt");
|
||||
|
||||
f126_update_fields();
|
||||
f126_cb_check();
|
||||
|
||||
std::string form = f126_txt_template;
|
||||
|
||||
for (int i = 0; i < f126_num_fields; i++) {
|
||||
str.clear();
|
||||
if (f126_fields[i].f_type == f126_prec) {
|
||||
sscanf(f126_fields[i].f_data.c_str(), "%d", &nbr);
|
||||
str = f126_s_prec[nbr];
|
||||
if (str.find("EMERGENCY") == std::string::npos)
|
||||
str = str[0];
|
||||
replacestr( form, f126_fields[i].f_type, str);
|
||||
} else {
|
||||
str = f126_fields[i].f_data;
|
||||
// strip_lfs(str);
|
||||
replacestr( form, f126_fields[i].f_type, str);
|
||||
}
|
||||
}
|
||||
|
||||
FILE *f126_file = fopen(f126_name.c_str(), "w");
|
||||
fprintf(f126_file,"%s", form.c_str());
|
||||
fclose(f126_file);
|
||||
open_url(f126_name.c_str());
|
||||
}
|
||||
|
||||
365
src/cap/f126_tab.cxx
Normal file
365
src/cap/f126_tab.cxx
Normal file
|
|
@ -0,0 +1,365 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014
|
||||
// David Freese, W1HKJ
|
||||
//
|
||||
// This file is part of flmsg
|
||||
//
|
||||
// flrig is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// flrig is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "gettext.h"
|
||||
#include "status.h"
|
||||
#include "util.h"
|
||||
|
||||
#include "flmsg_dialog.h"
|
||||
#include "flmsg.h"
|
||||
#include "combo.h"
|
||||
|
||||
Fl_Group *tab_f126 = (Fl_Group *)0;
|
||||
Fl_Tabs *tabs_f126 = (Fl_Tabs *)0;
|
||||
Fl_Group *tab_f126_message = (Fl_Group *)0;
|
||||
Fl_Group *tab_f126_information = (Fl_Group *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_nbr = (Fl_Input2 *)0;
|
||||
Fl_ListBox *f126_sel_prec = (Fl_ListBox *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_dtm = (Fl_Input2 *)0;
|
||||
Fl_Button *f126_btn_dtm = (Fl_Button *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_from = (Fl_Input2 *)0;
|
||||
Fl_Input2 *f126_txt_to = (Fl_Input2 *)0;
|
||||
Fl_Input2 *f126_txt_info = (Fl_Input2 *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_subj = (Fl_Input2 *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_grpcnt = (Fl_Input2 *)0;
|
||||
Fl_Button *f126_btn_check = (Fl_Button *)0;
|
||||
|
||||
FTextEdit *f126_txt_msg = (FTextEdit *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_rcvd_fm = (Fl_Input2 *)0;
|
||||
Fl_Input2 *f126_txt_rcvd_dtm = (Fl_Input2 *)0;
|
||||
Fl_Button *f126_btn_rcvd_dtm = (Fl_Button *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_sent_to = (Fl_Input2 *)0;
|
||||
Fl_Input2 *f126_txt_sent_dtm = (Fl_Input2 *)0;
|
||||
Fl_Button *f126_btn_sent_dtm = (Fl_Button *)0;
|
||||
|
||||
Fl_Input2 *f126_txt_rcvop = (Fl_Input2 *)0;
|
||||
Fl_Input2 *f126_txt_sendop = (Fl_Input2 *)0;
|
||||
|
||||
static void cb_f126_txt_nbr(Fl_Input2*, void*) {
|
||||
f126_cb_nbr(f126_txt_nbr);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_from(Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_from);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_to(Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_to);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_info(Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_info);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_subj(Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_subj);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_rcvop(Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_rcvop);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_sendop(Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_sendop);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_rcvd_fm (Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_rcvd_fm);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_sent_to (Fl_Input2*, void*) {
|
||||
f126_cb_filter_input(f126_txt_sent_to);
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_btn_dtm(Fl_Button*, void*) {
|
||||
f126_cb_set_dtm();
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_btn_rcvd_dtm(Fl_Button*, void*) {
|
||||
f126_cb_set_rcvd_dtm();
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_btn_sent_dtm(Fl_Button*, void*) {
|
||||
f126_cb_set_sent_dtm();
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_txt_msg(FTextEdit*, void*) {
|
||||
f126_btn_check->labelcolor(FL_RED);
|
||||
f126_btn_check->redraw_label();
|
||||
estimate();
|
||||
}
|
||||
|
||||
static void cb_f126_btn_check(Fl_Button*, void*) {
|
||||
f126_cb_check();
|
||||
}
|
||||
|
||||
void f126_changed(Fl_Widget *, void *)
|
||||
{
|
||||
estimate();
|
||||
}
|
||||
|
||||
void create_f126_tab()
|
||||
{
|
||||
int Y = tab_top;
|
||||
tab_f126 = new Fl_Group(0, Y, 570, 380);
|
||||
tab_f126->align(FL_ALIGN_TOP);
|
||||
|
||||
Y += 4;
|
||||
f126_txt_nbr = new Fl_Input2(80, Y, 80, 22, _("MSG NR:"));
|
||||
f126_txt_nbr->tooltip(_("* Optional Field\nMessage number at station of origin"));
|
||||
f126_txt_nbr->box(FL_DOWN_BOX);
|
||||
f126_txt_nbr->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_nbr->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_nbr->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_nbr->labelfont(0);
|
||||
f126_txt_nbr->labelsize(14);
|
||||
f126_txt_nbr->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_nbr->callback((Fl_Callback*)cb_f126_txt_nbr);
|
||||
f126_txt_nbr->align(FL_ALIGN_LEFT);
|
||||
f126_txt_nbr->callback(f126_changed);
|
||||
f126_txt_nbr->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 24;
|
||||
f126_sel_prec = new Fl_ListBox(80, Y, 120, 22, _("PREC"));
|
||||
f126_sel_prec->tooltip(_("Message Precedence"));
|
||||
f126_sel_prec->align(FL_ALIGN_LEFT);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_dtm = new Fl_Input2(80, Y, 160, 22, _("DTG:"));
|
||||
f126_txt_dtm->tooltip(_("Date of filing"));
|
||||
f126_txt_dtm->box(FL_DOWN_BOX);
|
||||
f126_txt_dtm->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_dtm->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_dtm->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_dtm->labelfont(0);
|
||||
f126_txt_dtm->labelsize(14);
|
||||
f126_txt_dtm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_dtm->align(FL_ALIGN_LEFT);
|
||||
f126_txt_dtm->callback(f126_changed);
|
||||
f126_txt_dtm->when(FL_WHEN_CHANGED);
|
||||
|
||||
f126_btn_dtm = new Fl_Button(244, Y, 20, 20, _("..."));
|
||||
f126_btn_dtm->tooltip(_("Today's date time group"));
|
||||
f126_btn_dtm->callback((Fl_Callback*)cb_f126_btn_dtm);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_from = new Fl_Input2(80, Y, 250, 22, _("FROM:"));
|
||||
f126_txt_from->tooltip(_("Station call sign / name"));
|
||||
f126_txt_from->box(FL_DOWN_BOX);
|
||||
f126_txt_from->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_from->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_from->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_from->labelfont(0);
|
||||
f126_txt_from->labelsize(14);
|
||||
f126_txt_from->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_from->callback((Fl_Callback*)cb_f126_txt_from);
|
||||
f126_txt_from->align(FL_ALIGN_LEFT);
|
||||
f126_txt_from->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_to = new Fl_Input2(80, Y, 486, 22, _("TO"));
|
||||
f126_txt_to->tooltip(_("Addressee"));
|
||||
f126_txt_to->type(4);
|
||||
f126_txt_to->box(FL_DOWN_BOX);
|
||||
f126_txt_to->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_to->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_to->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_to->labelfont(0);
|
||||
f126_txt_to->labelsize(14);
|
||||
f126_txt_to->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_to->callback((Fl_Callback*)cb_f126_txt_to);
|
||||
f126_txt_to->align(FL_ALIGN_LEFT);
|
||||
f126_txt_to->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_info = new Fl_Input2(80, Y, 486, 22, _("INFO:"));
|
||||
f126_txt_info->tooltip(_("* Optional Field\nInfo addressee(s)"));
|
||||
f126_txt_info->type(4);
|
||||
f126_txt_info->box(FL_DOWN_BOX);
|
||||
f126_txt_info->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_info->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_info->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_info->labelfont(0);
|
||||
f126_txt_info->labelsize(14);
|
||||
f126_txt_info->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_info->callback((Fl_Callback*)cb_f126_txt_info);
|
||||
f126_txt_info->align(FL_ALIGN_LEFT);
|
||||
f126_txt_info->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_subj = new Fl_Input2(80, Y, 486, 22, _("SUBJ:"));
|
||||
f126_txt_subj->tooltip(_("* Optional Field\nMessage subject"));
|
||||
f126_txt_subj->type(4);
|
||||
f126_txt_subj->box(FL_DOWN_BOX);
|
||||
f126_txt_subj->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_subj->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_subj->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_subj->labelfont(0);
|
||||
f126_txt_subj->labelsize(14);
|
||||
f126_txt_subj->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_subj->callback((Fl_Callback*)cb_f126_txt_subj);
|
||||
f126_txt_subj->align(FL_ALIGN_LEFT);
|
||||
f126_txt_subj->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_grpcnt = new Fl_Input2(488, Y, 50, 22, _("GROUP COUNT"));
|
||||
f126_txt_grpcnt->tooltip(_("* Optional Field\n# words in message"));
|
||||
f126_txt_grpcnt->box(FL_DOWN_BOX);
|
||||
f126_txt_grpcnt->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_grpcnt->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_grpcnt->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_grpcnt->labelfont(0);
|
||||
f126_txt_grpcnt->labelsize(14);
|
||||
f126_txt_grpcnt->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_grpcnt->align(FL_ALIGN_LEFT);
|
||||
f126_txt_grpcnt->callback(f126_changed);
|
||||
f126_txt_grpcnt->when(FL_WHEN_CHANGED);
|
||||
|
||||
f126_btn_check = new Fl_Button(544, Y, 22, 22, _("ck"));
|
||||
f126_btn_check->tooltip(_("* Optional Field\nCompute group count"));
|
||||
f126_btn_check->callback((Fl_Callback*)cb_f126_btn_check);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_msg = new FTextEdit(4, Y, 562, 118, _("MESSAGE"));
|
||||
f126_txt_msg->tooltip(_("Message contents"));
|
||||
f126_txt_msg->box(FL_DOWN_BOX);
|
||||
f126_txt_msg->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_msg->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_msg->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_msg->labelfont(0);
|
||||
f126_txt_msg->labelsize(14);
|
||||
f126_txt_msg->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_msg->callback((Fl_Callback*)cb_f126_txt_msg);
|
||||
f126_txt_msg->align(FL_ALIGN_TOP_LEFT);
|
||||
f126_txt_msg->callback(f126_changed);
|
||||
f126_txt_msg->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 122;
|
||||
f126_txt_rcvd_fm = new Fl_Input2(60, Y, 220, 22, _("FROM:"));
|
||||
f126_txt_rcvd_fm->tooltip(_("Call sign of sender"));
|
||||
f126_txt_rcvd_fm->box(FL_DOWN_BOX);
|
||||
f126_txt_rcvd_fm->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_rcvd_fm->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_rcvd_fm->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_rcvd_fm->labelfont(0);
|
||||
f126_txt_rcvd_fm->labelsize(14);
|
||||
f126_txt_rcvd_fm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_rcvd_fm->align(FL_ALIGN_LEFT);
|
||||
f126_txt_rcvd_fm->callback((Fl_Callback*)cb_f126_txt_rcvd_fm);
|
||||
f126_txt_rcvd_fm->when(FL_WHEN_CHANGED);
|
||||
|
||||
f126_txt_sent_to = new Fl_Input2(336, Y, 220, 22, _("TO:"));
|
||||
f126_txt_sent_to->tooltip(_("Call sign of sender"));
|
||||
f126_txt_sent_to->box(FL_DOWN_BOX);
|
||||
f126_txt_sent_to->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_sent_to->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_sent_to->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_sent_to->labelfont(0);
|
||||
f126_txt_sent_to->labelsize(14);
|
||||
f126_txt_sent_to->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_sent_to->align(FL_ALIGN_LEFT);
|
||||
f126_txt_sent_to->callback((Fl_Callback*)cb_f126_txt_sent_to);
|
||||
f126_txt_sent_to->when(FL_WHEN_CHANGED);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_rcvd_dtm = new Fl_Input2(60, Y, 160, 22, _("DTG:"));
|
||||
f126_txt_rcvd_dtm->tooltip(_("date of receipt"));
|
||||
f126_txt_rcvd_dtm->box(FL_DOWN_BOX);
|
||||
f126_txt_rcvd_dtm->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_rcvd_dtm->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_rcvd_dtm->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_rcvd_dtm->labelfont(0);
|
||||
f126_txt_rcvd_dtm->labelsize(14);
|
||||
f126_txt_rcvd_dtm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_rcvd_dtm->align(FL_ALIGN_LEFT);
|
||||
f126_txt_rcvd_dtm->callback(f126_changed);
|
||||
f126_txt_rcvd_dtm->when(FL_WHEN_CHANGED);
|
||||
|
||||
f126_btn_rcvd_dtm = new Fl_Button(224, Y, 20, 20, _("..."));
|
||||
f126_btn_rcvd_dtm->tooltip(_("Today's date time group"));
|
||||
f126_btn_rcvd_dtm->callback((Fl_Callback*)cb_f126_btn_rcvd_dtm);
|
||||
|
||||
f126_txt_sent_dtm = new Fl_Input2(336, Y, 160, 22, _("DTG:"));
|
||||
f126_txt_sent_dtm->tooltip(_("date of receipt"));
|
||||
f126_txt_sent_dtm->box(FL_DOWN_BOX);
|
||||
f126_txt_sent_dtm->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_sent_dtm->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_sent_dtm->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_sent_dtm->labelfont(0);
|
||||
f126_txt_sent_dtm->labelsize(14);
|
||||
f126_txt_sent_dtm->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_sent_dtm->align(FL_ALIGN_LEFT);
|
||||
f126_txt_sent_dtm->callback(f126_changed);
|
||||
f126_txt_sent_dtm->when(FL_WHEN_CHANGED);
|
||||
|
||||
f126_btn_sent_dtm = new Fl_Button(500, Y, 20, 20, _("..."));
|
||||
f126_btn_sent_dtm->tooltip(_("Today's date time group"));
|
||||
f126_btn_sent_dtm->callback((Fl_Callback*)cb_f126_btn_sent_dtm);
|
||||
|
||||
Y += 24;
|
||||
f126_txt_rcvop = new Fl_Input2(200, Y, 80, 22, _("RCVG OPERATOR INIT'S:"));
|
||||
f126_txt_rcvop->tooltip(_(""));
|
||||
f126_txt_rcvop->box(FL_DOWN_BOX);
|
||||
f126_txt_rcvop->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_rcvop->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_rcvop->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_rcvop->labelfont(0);
|
||||
f126_txt_rcvop->labelsize(14);
|
||||
f126_txt_rcvop->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_rcvop->align(FL_ALIGN_LEFT);
|
||||
f126_txt_rcvop->callback((Fl_Callback*)cb_f126_txt_rcvop);
|
||||
f126_txt_rcvop->when(FL_WHEN_CHANGED);
|
||||
|
||||
f126_txt_sendop = new Fl_Input2(476, Y, 80, 22, _("SNDG OPERATOR INIT'S:"));
|
||||
f126_txt_sendop->tooltip(_(""));
|
||||
f126_txt_sendop->box(FL_DOWN_BOX);
|
||||
f126_txt_sendop->color((Fl_Color)FL_BACKGROUND2_COLOR);
|
||||
f126_txt_sendop->selection_color((Fl_Color)FL_SELECTION_COLOR);
|
||||
f126_txt_sendop->labeltype(FL_NORMAL_LABEL);
|
||||
f126_txt_sendop->labelfont(0);
|
||||
f126_txt_sendop->labelsize(14);
|
||||
f126_txt_sendop->labelcolor((Fl_Color)FL_FOREGROUND_COLOR);
|
||||
f126_txt_sendop->align(FL_ALIGN_LEFT);
|
||||
f126_txt_sendop->callback((Fl_Callback*)cb_f126_txt_sendop);
|
||||
f126_txt_sendop->when(FL_WHEN_CHANGED);
|
||||
|
||||
tab_f126->end();
|
||||
tab_f126->hide();
|
||||
}
|
||||
|
||||
291
src/cap/rafac_templates.cxx
Normal file
291
src/cap/rafac_templates.cxx
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2014
|
||||
// David Freese, W1HKJ
|
||||
//
|
||||
// This file is part of flmsg
|
||||
//
|
||||
// flrig is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// flrig is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "templates.h"
|
||||
|
||||
const char f126_html_template[] =
|
||||
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\
|
||||
<html>\n\
|
||||
<head><meta content=\"text/html; charset=UTF-8\" http-equiv=\"content-type\">\n\
|
||||
<title>:TITLE:</title>\n\
|
||||
</head>\n\
|
||||
<body>\n\
|
||||
<table cellpadding=\"0\" cellspacing=\"0\" width=\"800\">\n\
|
||||
<col width=\"90\"><col width=\"10\"><col width=\"250\">\n\
|
||||
<col width=\"90\"><col width=\"10\"><col width=\"250\">\n\
|
||||
<tbody>\n\
|
||||
<tr>\n\
|
||||
<td colspan=\"6\" style=\"border-style: solid solid none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px; padding: 0in 0.08in;\" valign=\"top\">\n\
|
||||
<p align=\"center\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
<b>RAFAC F126</b>\n\
|
||||
</font></font>\n\
|
||||
</p>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr>\n\
|
||||
<td colspan=\"6\" align= \"right\" style=\"border-style: solid solid none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px; padding: 0in 0.08in;\" valign=\"top\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
Page :pg: of :npgs: Pages\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
<tbody>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: solid none none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
MSG NUMBER: \n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: solid none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: solid solid none none; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:msg nbr:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
PRECEDENCE:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:prec:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
DTG:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:dtm:</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
FROM:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:from:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
TO:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:to:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
INFO: \n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:info:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
SUBJ: \n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:subj:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr><td colspan=\"6\" style=\"border-style: none solid none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 1px 1pt; padding: 0in 0in 0in 0.08in;\"><br></td>\n\
|
||||
</tr>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td align=\"right\" style=\"border-style: none none none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 0px 1px; padding: 0in 0in 0in 0in;\" >\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
GROUP COUNT: \n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding-bottom: 0in; padding-left: 0in; padding-right: 0in;\"></td>\n\
|
||||
<td align=\"left\" colspan=\"4\" style=\"border-style: none solid solid none; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 0px 1px 0px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:grpcnt:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
<tbody>\n\
|
||||
<tr>\n\
|
||||
<td colspan=\"6\" style=\"border-style: solid solid none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 1px 1pt; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
BREAK\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
<tbody>\n\
|
||||
<tr valign=\"top\">\n\
|
||||
<td colspan=\"2\" valign=\"top\" height=\"600px\" style=\"border-style: solid none none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\"></td>\n\
|
||||
<td align=\"justify\" colspan=\"4\" style=\"border-style: solid solid none none; border-color: rgb(0, 0, 10) rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:msgtxt:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
<tbody>\n\
|
||||
<tr>\n\
|
||||
<td colspan=\"6\" style=\"border-style: solid solid none solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
BREAK\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
<tbody>\n\
|
||||
<tr>\n\
|
||||
<td colspan=\"3\" style=\"border-style: solid solid solid solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in;\" bgcolor=\"#bfbfbf\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
MESSAGE RECEIVED\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td colspan=\"3\" style=\"border-style: solid solid solid none; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\" bgcolor=\"#bfbfbf\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
MESSAGE SENT\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr>\n\
|
||||
<td style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
FROM:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td colspan=\"2\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:rcvd_fm:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
TO:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td colspan=\"2\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:sent_to:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr>\n\
|
||||
<td style=\"border-style: none none none solid; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
DTG:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td colspan=\"2\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:rcvd_dtm:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td style=\"border-style: none none none none; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
DTG:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td colspan=\"2\" style=\"border-style: none solid none none; border-color: rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0.08in 0in 0in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
:sent_dtm:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
<tr>\n\
|
||||
<td colspan=\"3\" style=\"border-style: none solid solid solid; border-color: rgb(0, 0, 10) rgb(0, 0, 10); border-width: 1px 1px 1px 1px; padding: 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
RECEIVING OPERATOR INITIALS: :rcvop:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
<td colspan=\"3\" style=\"border-style: none solid solid none; border-color: rgb(0, 0, 10) rgb(0, 0, 10) -moz-use-text-color; border-width: 1px 1px 1px 1px; padding: 0in 0in 0in 0.08in;\">\n\
|
||||
<font face=\"Arial, serif\"><font style=\"font-size: 11pt;\">\n\
|
||||
SENDING OPERATOR INITIALS: :sendop:\n\
|
||||
</font></font>\n\
|
||||
</td>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
</table>\n\
|
||||
<table cellpadding=\"0\" cellspacing=\"0\" width=\"800\">\n\
|
||||
<col width=\"450\"><col width=\"450\">\n\
|
||||
<tbody>\n\
|
||||
<tr>\n\
|
||||
<font face=\"Arial, serif\">\n\
|
||||
<td align=\"left\"><b>Flmsg RAFAC F126 FORM</b></td>\n\
|
||||
</font>\n\
|
||||
</tr>\n\
|
||||
</tbody>\n\
|
||||
</table>\n\
|
||||
</body>\n\
|
||||
</html>\n\
|
||||
";
|
||||
|
||||
const char f126_txt_template[] =
|
||||
"Flmsg RAFAC F126 FORM\n\n\
|
||||
MSG NUMBER: :msg nbr:\n\
|
||||
PRECEDENCE: :prec:\n\
|
||||
DTG: :dtm:\n\
|
||||
FROM: :from:\n\
|
||||
TO: :to:\n\
|
||||
INFO: :info:\n\
|
||||
SUBJ: :subj:\n\
|
||||
\n\
|
||||
GROUP COUNT: :grpcnt:\n\
|
||||
\n\
|
||||
BREAK\n\n\
|
||||
:msgtxt:\n\n\
|
||||
BREAK\n\n\
|
||||
MESSAGE RECEIVED MESSAGE SENT\n\
|
||||
FROM: :rcvd_fm: TO: :sent_to:\n\
|
||||
DTG: :rcvd_dtm: DTG::sent_dtm:\n\
|
||||
RECEIVING OPERATOR INITIALS: :rcvop: SENDING OPERATOR INITIALS: :sendop:\n\
|
||||
";
|
||||
|
||||
|
|
@ -651,6 +651,11 @@ void extract_text(string &buffer, const char *fname)
|
|||
read_c110_buffer(buffer);
|
||||
if (fname) cap110_def_filename = fname;
|
||||
select_form(selected_form);
|
||||
} else if (buffer.find("<f126>") != string::npos) {
|
||||
selected_form = F126;
|
||||
f126_read_buffer(buffer);
|
||||
if (fname) f126_def_filename = fname;
|
||||
select_form(selected_form);
|
||||
} else if (buffer.find("<mars_daily>") != string::npos) {
|
||||
selected_form = MARSDAILY;
|
||||
read_mars_daily_buffer(buffer);
|
||||
|
|
@ -843,6 +848,7 @@ int eval_transfer_size()
|
|||
case IARU: return eval_iaru_fsize();
|
||||
case CAP105: return eval_cap105_fsize();
|
||||
case CAP110: return eval_cap110_fsize();
|
||||
case F126: return eval_f126_fsize();
|
||||
case PLAINTEXT: return eval_pt_fsize();
|
||||
case BLANK: return eval_blank_fsize();
|
||||
case CSV: return eval_csv_fsize();
|
||||
|
|
@ -882,6 +888,7 @@ void cb_new()
|
|||
case IARU: iaru_cb_new(); break;
|
||||
case CAP105: cap105_cb_new(); break;
|
||||
case CAP110: cap110_cb_new(); break;
|
||||
case F126: f126_cb_new(); break;
|
||||
case PLAINTEXT: cb_pt_new(); break;
|
||||
case BLANK: cb_blank_new(); break;
|
||||
case TRANSFER: cb_transfer_new(); break;
|
||||
|
|
@ -920,6 +927,7 @@ void cb_import()
|
|||
case IARU: iaru_cb_import(); break;
|
||||
case CAP105: cap105_cb_import(); break;
|
||||
case CAP110: cap110_cb_import(); break;
|
||||
case F126: f126_cb_import(); break;
|
||||
case PLAINTEXT:
|
||||
case BLANK:
|
||||
case CSV:
|
||||
|
|
@ -957,6 +965,7 @@ void cb_export()
|
|||
case IARU: iaru_cb_export(); break;
|
||||
case CAP105: cap105_cb_export(); break;
|
||||
case CAP110: cap110_cb_export(); break;
|
||||
case F126: f126_cb_export(); break;
|
||||
case PLAINTEXT:
|
||||
case BLANK:
|
||||
case CSV:
|
||||
|
|
@ -1046,6 +1055,9 @@ void wrap_import(const char *fname)
|
|||
} else if (inpbuffer.find("<cap110>") != string::npos) {
|
||||
selected_form = CAP110;
|
||||
cap110_cb_wrap_import(filename, inpbuffer);
|
||||
} else if (inpbuffer.find("<f126>") != string::npos) {
|
||||
selected_form = F126;
|
||||
f126_cb_wrap_import(filename, inpbuffer);
|
||||
} else if (inpbuffer.find("<plaintext>") != string::npos) {
|
||||
selected_form = PLAINTEXT;
|
||||
cb_pt_wrap_import(filename, inpbuffer);
|
||||
|
|
@ -1179,6 +1191,7 @@ void cb_wrap_export()
|
|||
case IARU: iaru_cb_wrap_export(); break;
|
||||
case CAP105: cap105_cb_wrap_export(); break;
|
||||
case CAP110: cap110_cb_wrap_export(); break;
|
||||
case F126: f126_cb_wrap_export(); break;
|
||||
case PLAINTEXT: cb_pt_wrap_export(); break;
|
||||
case BLANK: cb_blank_wrap_export(); break;
|
||||
case CSV: cb_csv_wrap_export(); break;
|
||||
|
|
@ -1227,6 +1240,7 @@ void cb_wrap_autosend()
|
|||
case IARU: iaru_cb_wrap_autosend(); break;
|
||||
case CAP105: cap105_cb_wrap_autosend(); break;
|
||||
case CAP110: cap110_cb_wrap_autosend(); break;
|
||||
case F126: f126_cb_wrap_autosend(); break;
|
||||
case PLAINTEXT: cb_pt_wrap_autosend(); break;
|
||||
case BLANK: cb_blank_wrap_autosend(); break;
|
||||
case CSV: cb_csv_wrap_autosend(); break;
|
||||
|
|
@ -1265,6 +1279,7 @@ void cb_load_template()
|
|||
case IARU: iaru_cb_load_template(); break;
|
||||
case CAP105: cap105_cb_load_template(); break;
|
||||
case CAP110: cap110_cb_load_template(); break;
|
||||
case F126: f126_cb_load_template(); break;
|
||||
case PLAINTEXT: cb_pt_load_template(); break;
|
||||
case BLANK: cb_blank_load_template(); break;
|
||||
case CSV: cb_csv_load_template(); break;
|
||||
|
|
@ -1302,6 +1317,7 @@ void cb_save_template()
|
|||
case IARU: iaru_cb_save_template(); break;
|
||||
case CAP105: cap105_cb_save_template(); break;
|
||||
case CAP110: cap110_cb_save_template(); break;
|
||||
case F126: f126_cb_save_template(); break;
|
||||
case PLAINTEXT: cb_pt_save_template(); break;
|
||||
case BLANK: cb_blank_save_template(); break;
|
||||
case CSV: cb_csv_save_template(); break;
|
||||
|
|
@ -1338,6 +1354,7 @@ void cb_save_as_template()
|
|||
case IARU: iaru_cb_save_as_template(); break;
|
||||
case CAP105: cap105_cb_save_as_template(); break;
|
||||
case CAP110: cap110_cb_save_as_template(); break;
|
||||
case F126: f126_cb_save_as_template(); break;
|
||||
case PLAINTEXT: cb_pt_save_as_template(); break;
|
||||
case BLANK: cb_blank_save_as_template(); break;
|
||||
case CSV: cb_csv_save_as_template(); break;
|
||||
|
|
@ -1374,6 +1391,7 @@ void cb_open()
|
|||
case IARU: iaru_cb_open(); break;
|
||||
case CAP105: cap105_cb_open(); break;
|
||||
case CAP110: cap110_cb_open(); break;
|
||||
case F126: f126_cb_open(); break;
|
||||
case PLAINTEXT: cb_pt_open(); break;
|
||||
case BLANK: cb_blank_open(); break;
|
||||
case CSV: cb_csv_open(); break;
|
||||
|
|
@ -1411,6 +1429,7 @@ void cb_save_as()
|
|||
case IARU: iaru_cb_save_as(); break;
|
||||
case CAP105: cap105_cb_save_as(); break;
|
||||
case CAP110: cap110_cb_save_as(); break;
|
||||
case F126: f126_cb_save_as(); break;
|
||||
case PLAINTEXT: cb_pt_save_as(); break;
|
||||
case MARSDAILY: cb_mars_daily_save_as(); break;
|
||||
case MARSINEEI: cb_mars_ineei_save_as(); break;
|
||||
|
|
@ -1447,6 +1466,7 @@ void cb_save()
|
|||
case IARU: iaru_cb_save(); break;
|
||||
case CAP105: cap105_cb_save(); break;
|
||||
case CAP110: cap110_cb_save(); break;
|
||||
case F126: f126_cb_save(); break;
|
||||
case PLAINTEXT: cb_pt_save(); break;
|
||||
case MARSDAILY: cb_mars_daily_save(); break;
|
||||
case MARSINEEI: cb_mars_ineei_save(); break;
|
||||
|
|
@ -1483,6 +1503,7 @@ void cb_html()
|
|||
case IARU : iaru_cb_html(); break;
|
||||
case CAP105: cap105_cb_html(); break;
|
||||
case CAP110: cap110_cb_html(); break;
|
||||
case F126: f126_cb_html(); break;
|
||||
case PLAINTEXT: cb_pt_html(); break;
|
||||
case MARSDAILY: cb_mars_daily_html(); break;
|
||||
case MARSINEEI: cb_mars_ineei_html(); break;
|
||||
|
|
@ -1541,6 +1562,7 @@ void cb_text()
|
|||
case IARU: iaru_cb_textout(); break;
|
||||
case CAP105: cap105_cb_textout(); break;
|
||||
case CAP110: cap110_cb_textout(); break;
|
||||
case F126: f126_cb_textout(); break;
|
||||
case PLAINTEXT: cb_pt_textout(); break;
|
||||
case MARSDAILY: cb_mars_daily_textout(); break;
|
||||
case MARSINEEI: cb_mars_ineei_textout(); break;
|
||||
|
|
@ -1652,6 +1674,9 @@ void show_filename(string p)
|
|||
case CAP110:
|
||||
cap110_base_filename = fl_filename_name(p.c_str());
|
||||
break;
|
||||
case F126:
|
||||
f126_base_filename = fl_filename_name(p.c_str());
|
||||
break;
|
||||
case PLAINTEXT:
|
||||
base_pt_filename = fl_filename_name(p.c_str());
|
||||
break;
|
||||
|
|
@ -1850,6 +1875,12 @@ void after_start(void *)
|
|||
cap110_def_template_name = ICS_tmp_dir;
|
||||
cap110_def_template_name.append("default").append(CAP105_TEMP_EXT);
|
||||
|
||||
f126_def_filename = ICS_msg_dir;
|
||||
f126_def_filename.append("default").append(F126_FILE_EXT);
|
||||
f126_def_template_name = ICS_tmp_dir;
|
||||
f126_def_template_name.append("default").append(F126_TEMP_EXT);
|
||||
f126_set_choices();
|
||||
|
||||
def_pt_filename = ICS_msg_dir;
|
||||
def_pt_filename.append("default").append(PTFILE_EXT);
|
||||
def_pt_TemplateName = ICS_tmp_dir;
|
||||
|
|
@ -2688,6 +2719,9 @@ int parse_args(int argc, char **argv, int& idx)
|
|||
fname.find(CAP110_FILE_EXT) != string::npos ||
|
||||
fname.find(CAP110_TEMP_EXT) != string::npos ||
|
||||
|
||||
fname.find(F126_FILE_EXT) != string::npos ||
|
||||
fname.find(F126_TEMP_EXT) != string::npos ||
|
||||
|
||||
fname.find(TRANSFER_EXT) != string::npos ||
|
||||
|
||||
fname.find(WRAP_EXT) != string::npos ) {
|
||||
|
|
|
|||
|
|
@ -389,6 +389,7 @@ int mSEVEREWX = SEVEREWX;
|
|||
int mSTORMREP = STORMREP;
|
||||
int mCAP105 = CAP105;
|
||||
int mCAP110 = CAP110;
|
||||
int mF126 = F126;
|
||||
int mTRANSFER = TRANSFER;
|
||||
|
||||
Fl_Group *oldtab = (Fl_Group *)0;
|
||||
|
|
@ -611,6 +612,14 @@ static void select_cap110()
|
|||
show_filename(cap110_def_filename);
|
||||
}
|
||||
|
||||
static void select_f126()
|
||||
{
|
||||
oldtab = tab_f126;
|
||||
tab_f126->show();
|
||||
txt_formname->value(_("RAFAC F126"));
|
||||
show_filename(f126_def_filename);
|
||||
}
|
||||
|
||||
static void select_csv()
|
||||
{
|
||||
oldtab = tab_csv;
|
||||
|
|
@ -728,6 +737,9 @@ void select_form(int form)
|
|||
case CAP110:
|
||||
select_cap110();
|
||||
break;
|
||||
case F126:
|
||||
select_f126();
|
||||
break;
|
||||
case CSV:
|
||||
select_csv();
|
||||
break;
|
||||
|
|
@ -820,9 +832,10 @@ Fl_Menu_Item menu_[] = {
|
|||
{_("Drag-n-Drop"), 0, (Fl_Callback*)cb_mnuDragAndDrop, 0, FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{_("Blank"), 0, (Fl_Callback*)cb_mnuFormSelect, &mBLANK, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
|
||||
{_("CAP"), 0, 0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{_("CAP/RAFAC"), 0, 0, 0, 64, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{_("Form 105"), 0, (Fl_Callback*)cb_mnuFormSelect, &mCAP105, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{_("Form 110"), 0, (Fl_Callback*)cb_mnuFormSelect, &mCAP110, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{_("Form F126"), 0, (Fl_Callback*)cb_mnuFormSelect, &mF126, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
{0,0,0,0,0,0,0,0,0},
|
||||
|
||||
{_("CSV"), 0, (Fl_Callback*)cb_mnuFormSelect, &mCSV, 0, FL_NORMAL_LABEL, 0, 14, 0},
|
||||
|
|
@ -1166,6 +1179,7 @@ Fl_Double_Window* flmsg_dialog() {
|
|||
create_mars_tab();
|
||||
create_cap105_tab();
|
||||
create_cap110_tab();
|
||||
create_f126_tab();
|
||||
create_iaru_tab();
|
||||
create_radiogram_tab();
|
||||
create_plaintext_tab();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ ICS203, ICS205, ICS205A, ICS206, ICS213, ICS214, ICS216, ICS309, NETLOG,
|
|||
HICS203, HICS206, HICS213, HICS214, IARU,
|
||||
RADIOGRAM, PLAINTEXT, BLANK, CSV, CUSTOM,
|
||||
MARSDAILY, MARSINEEI, MARSNET, MARSARMY, MARSMSG,
|
||||
WXHC, SEVEREWX, STORMREP, CAP105, CAP110, TRANSFER, CUSTOM_TRANSFER };
|
||||
WXHC, SEVEREWX, STORMREP, CAP105, CAP110, F126, TRANSFER, CUSTOM_TRANSFER };
|
||||
|
||||
struct FIELD { std::string f_type; std::string f_data; void **w; char w_type; };
|
||||
extern FIELD fields[];
|
||||
|
|
@ -1199,7 +1199,7 @@ extern void cap105_cb_html();
|
|||
extern void cap105_cb_textout();
|
||||
|
||||
//=====================================================================
|
||||
// CAP 105
|
||||
// CAP 110
|
||||
//=====================================================================
|
||||
|
||||
extern std::string cap110_def_filename;
|
||||
|
|
@ -1233,4 +1233,43 @@ extern void cap110_cb_html();
|
|||
extern void cap110_cb_msg_type();
|
||||
extern void cap110_cb_textout();
|
||||
|
||||
//=====================================================================
|
||||
// RAFAC ACP126 / F126
|
||||
//=====================================================================
|
||||
|
||||
extern std::string f126_base_filename;
|
||||
extern std::string f126_def_filename;
|
||||
extern std::string f126_def_template_name;
|
||||
|
||||
extern void f126_cb_set_dtm();
|
||||
extern void f126_cb_set_rcvd_dtm();
|
||||
extern void f126_cb_set_sent_dtm();
|
||||
extern void f126_cb_nbr(Fl_Widget *wdg);
|
||||
extern void f126_cb_filter_input(Fl_Widget *wdg);
|
||||
extern void f126_clear_fields();
|
||||
extern void f126_set_choices();
|
||||
extern bool f126_check_fields();
|
||||
extern void f126_update_fields();
|
||||
extern void f126_clear_form();
|
||||
extern void f126_update_form();
|
||||
extern void f126_make_buffer(bool compress = false);
|
||||
extern void f126_read_buffer(std::string data);
|
||||
extern void f126_cb_new();
|
||||
extern void f126_cb_import();
|
||||
extern void f126_cb_export();
|
||||
extern void f126_cb_wrap_import(std::string wrapfilename, std::string inpbuffer);
|
||||
extern int eval_f126_fsize();
|
||||
extern void f126_cb_wrap_export();
|
||||
extern void f126_cb_wrap_autosend();
|
||||
extern void f126_cb_load_template();
|
||||
extern void f126_cb_save_template();
|
||||
extern void f126_cb_save_as_template();
|
||||
extern void f126_cb_open();
|
||||
extern void f126_write(std::string s);
|
||||
extern bool f126_cb_save_as();
|
||||
extern void f126_cb_save();
|
||||
extern void f126_cb_check();
|
||||
extern void f126_cb_html();
|
||||
extern void f126_cb_textout();
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -123,6 +123,9 @@
|
|||
#define CAP110_FILE_EXT ".c110F"
|
||||
#define CAP110_TEMP_EXT ".c110T"
|
||||
|
||||
#define F126_FILE_EXT ".f126F"
|
||||
#define F126_TEMP_EXT ".f126T"
|
||||
|
||||
#define TRANSFER_EXT ".xfr"
|
||||
|
||||
#define WRAP_EXT ".wrap"
|
||||
|
|
|
|||
|
|
@ -1297,6 +1297,46 @@ extern Fl_Input2 *txt_110_comm_rem[23];
|
|||
|
||||
extern void create_cap110_tab();
|
||||
|
||||
//======================================================================
|
||||
// RAFAC (F) forms
|
||||
//======================================================================
|
||||
// F126, Radio Message
|
||||
|
||||
extern Fl_Group *tab_f126;
|
||||
extern Fl_Tabs *tabs_f126;
|
||||
extern Fl_Group *tab_f126_message;
|
||||
extern Fl_Group *tab_f126_information;
|
||||
|
||||
extern Fl_Input2 *f126_txt_nbr;
|
||||
extern Fl_ListBox *f126_sel_prec;
|
||||
|
||||
extern Fl_Input2 *f126_txt_dtm;
|
||||
extern Fl_Button *f126_btn_dtm;
|
||||
|
||||
extern Fl_Input2 *f126_txt_from;
|
||||
extern Fl_Input2 *f126_txt_to;
|
||||
extern Fl_Input2 *f126_txt_info;
|
||||
|
||||
extern Fl_Input2 *f126_txt_subj;
|
||||
|
||||
extern Fl_Input2 *f126_txt_grpcnt;
|
||||
extern Fl_Button *f126_btn_check;
|
||||
|
||||
extern FTextEdit *f126_txt_msg;
|
||||
|
||||
extern Fl_Input2 *f126_txt_rcvd_fm;
|
||||
extern Fl_Input2 *f126_txt_rcvd_dtm;
|
||||
extern Fl_Button *f126_btn_rcvd_dtm;
|
||||
|
||||
extern Fl_Input2 *f126_txt_sent_to;
|
||||
extern Fl_Input2 *f126_txt_sent_dtm;
|
||||
extern Fl_Button *f126_btn_sent_dtm;
|
||||
|
||||
extern Fl_Input2 *f126_txt_rcvop;
|
||||
extern Fl_Input2 *f126_txt_sendop;
|
||||
|
||||
extern void create_f126_tab();
|
||||
|
||||
//======================================================================
|
||||
// external std::string arrays
|
||||
//
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ extern const char cap105_txt_template[];
|
|||
extern const char cap110_html_template[];
|
||||
extern const char cap110_text_template[];
|
||||
|
||||
extern const char f126_html_template[];
|
||||
extern const char f126_txt_template[];
|
||||
|
||||
extern const char ics203_html_template[];
|
||||
extern const char ics203_text_template[];
|
||||
extern const char ics205_html_template[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue