summaryrefslogtreecommitdiff
path: root/map65
diff options
context:
space:
mode:
Diffstat (limited to 'map65')
-rw-r--r--map65/libm65/mapsim.f902
-rw-r--r--map65/main.cpp2
-rw-r--r--map65/mainwindow.cpp83
3 files changed, 46 insertions, 41 deletions
diff --git a/map65/libm65/mapsim.f90 b/map65/libm65/mapsim.f90
index 2290e066..e58485f6 100644
--- a/map65/libm65/mapsim.f90
+++ b/map65/libm65/mapsim.f90
@@ -135,7 +135,7 @@ program mapsim
dphi=twopi*f*dt + 0.5*twopi
snrdbx=snrdb
- if(snrdb.ge.-1.0) snrdbx=-15.0 - 15.0*(isig-1.0)/nsigs
+ if(snrdb.eq.0.0) snrdbx=-15.0 - 15.0*(isig-1.0)/nsigs
sig=sqrt(2.2*2500.0/96000.0) * 10.0**(0.05*snrdbx)
write(*,1020) ifile,isig,mode,dt0,0.001*f,nint(pol),fDop,snrdbx,msgsent
1020 format(i3,i3,2x,a2,f6.2,f8.3,i5,2f7.1,2x,a22)
diff --git a/map65/main.cpp b/map65/main.cpp
index e95bb2cf..07e1d4c0 100644
--- a/map65/main.cpp
+++ b/map65/main.cpp
@@ -19,7 +19,7 @@ int main(int argc, char *argv[])
QApplication a {argc, argv};
// Override programs executable basename as application name.
a.setApplicationName ("MAP65");
- a.setApplicationVersion ("3.0.0-rc6");
+ a.setApplicationVersion ("3.0.0");
// switch off as we share an Info.plist file with WSJT-X
a.setAttribute (Qt::AA_DontUseNativeMenuBar);
MainWindow w;
diff --git a/map65/mainwindow.cpp b/map65/mainwindow.cpp
index 48eaf946..5814dca2 100644
--- a/map65/mainwindow.cpp
+++ b/map65/mainwindow.cpp
@@ -1864,6 +1864,8 @@ void MainWindow::doubleClickOnMessages(QString hiscall, QString t2, bool ctrl)
void MainWindow::genStdMsgs(QString rpt) //genStdMsgs()
{
+ if(rpt.left(2)==" -") rpt="-0"+rpt.mid(2,1);
+ if(rpt.left(2)==" +") rpt="+0"+rpt.mid(2,1);
QString hiscall=ui->dxCallEntry->text().toUpper().trimmed();
ui->dxCallEntry->setText(hiscall);
QString t0=hiscall + " " + m_myCall + " ";
@@ -1968,58 +1970,61 @@ void MainWindow::on_addButton_clicked() //Add button
<< endl
#endif
;
- f1.close();
- f1.open(QIODevice::ReadOnly | QIODevice::Text);
+ f1.seek (0);
}
QString tmpFile = m_appDir + "/CALL3.TMP";
QFile f2(tmpFile);
- if(!f2.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ if(!f2.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) {
msgBox("Cannot open " + tmpFile);
return;
}
- QTextStream in(&f1);
- QTextStream out(&f2);
- QString hc=hiscall;
- QString hc1="";
- QString hc2="000000";
- QString s;
- do {
- s=in.readLine();
- hc1=hc2;
- if(s.mid(0,2)=="//") {
- out << s + "\n";
- } else {
- int i1=s.indexOf(",");
- hc2=s.mid(0,i1);
- if(hc>hc1 && hc<hc2) {
- out << newEntry + "\n";
+ {
+ QTextStream in(&f1);
+ QTextStream out(&f2);
+ QString hc=hiscall;
+ QString hc1="";
+ QString hc2="000000";
+ QString s;
+ do {
+ s=in.readLine();
+ hc1=hc2;
+ if(s.mid(0,2)=="//") {
out << s + "\n";
- m_call3Modified=true;
- } else if(hc==hc2) {
- QString t=s + "\n\n is already in CALL3.TXT\n" +
- "Do you wish to replace it?";
- int ret = QMessageBox::warning(this, "Add",t,
- QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
- if(ret==QMessageBox::Yes) {
+ } else {
+ int i1=s.indexOf(",");
+ hc2=s.mid(0,i1);
+ if(hc>hc1 && hc<hc2) {
out << newEntry + "\n";
+ out << s + "\n";
m_call3Modified=true;
+ } else if(hc==hc2) {
+ QString t=s + "\n\n is already in CALL3.TXT\n" +
+ "Do you wish to replace it?";
+ int ret = QMessageBox::warning(this, "Add",t,
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
+ if(ret==QMessageBox::Yes) {
+ out << newEntry + "\n";
+ m_call3Modified=true;
+ }
+ } else {
+ if(s!="") out << s + "\n";
}
- } else {
- if(s!="") out << s + "\n";
}
- }
- } while(!s.isNull());
-
- f1.close();
- if(hc>hc1 && !m_call3Modified) out << newEntry + "\n";
+ } while(!s.isNull());
+ if(hc>hc1 && !m_call3Modified) out << newEntry + "\n";
+ }
+
if(m_call3Modified) {
- QFile f0(m_appDir + "/CALL3.OLD");
- if(f0.exists()) f0.remove();
- QFile f1(m_appDir + "/CALL3.TXT");
- f1.rename(m_appDir + "/CALL3.OLD");
- f2.rename(m_appDir + "/CALL3.TXT");
- f2.close();
+ auto const& old_path = m_appDir + "/CALL3.OLD";
+ QFile f0 {old_path};
+ if (f0.exists ()) f0.remove ();
+ f1.copy (old_path); // copying as we want to preserve
+ // symlinks
+ f1.open (QFile::WriteOnly | QFile::Text); // truncates
+ f2.seek (0);
+ f1.write (f2.readAll ()); // copy contents
+ f2.remove ();
}
}