mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Some Date fixes
This commit is contained in:
parent
2cdd9ab333
commit
4766da616f
@ -22,7 +22,7 @@ class gBarChart:public gLayer
|
|||||||
|
|
||||||
// d.Set(i+2400000.5+.000001); // JDN vs MJD vs Rounding errors
|
// d.Set(i+2400000.5+.000001); // JDN vs MJD vs Rounding errors
|
||||||
|
|
||||||
virtual const QString & FormatX(double v) { static QString t; QDateTime d; d=d.fromMSecsSinceEpoch(v*86400000.0); t=d.toString("dd MMM"); return t; };
|
virtual const QString & FormatX(double v) { static QString t; QDateTime d; d=d.fromMSecsSinceEpoch(v*86400000.0); t=d.toString("MMM dd"); return t; };
|
||||||
//virtual const wxString & FormatX(double v) { static wxString t; wxDateTime d; d.Set(vi*86400000.0); t=d.Format(wxT("HH:mm")); return t; };
|
//virtual const wxString & FormatX(double v) { static wxString t; wxDateTime d; d.Set(vi*86400000.0); t=d.Format(wxT("HH:mm")); return t; };
|
||||||
//virtual const wxString & FormatX(double v) { static wxString t; t=wxString::Format(wxT("%.1f"),v); return t; };
|
//virtual const wxString & FormatX(double v) { static wxString t; t=wxString::Format(wxT("%.1f"),v); return t; };
|
||||||
virtual const QString & FormatY(double v) { static QString t; t.sprintf("%.1f",v); return t; };
|
virtual const QString & FormatY(double v) { static QString t; t.sprintf("%.1f",v); return t; };
|
||||||
|
@ -31,7 +31,7 @@ class gSessionTime:public gLayer
|
|||||||
protected:
|
protected:
|
||||||
Qt::Orientation m_orientation;
|
Qt::Orientation m_orientation;
|
||||||
|
|
||||||
virtual const QString & FormatX(double v) { static QString t; QDateTime d; d=d.fromMSecsSinceEpoch(v*86400000.0); t=d.toString("dd MMM"); return t; };
|
virtual const QString & FormatX(double v) { static QString t; QDateTime d; d=d.fromMSecsSinceEpoch(v*86400000.0); t=d.toString("MMM dd"); return t; };
|
||||||
//virtual const wxString & FormatX(double v) { static wxString t; wxDateTime d; d.Set(vi*86400000.0); t=d.Format(wxT("HH:mm")); return t; };
|
//virtual const wxString & FormatX(double v) { static wxString t; wxDateTime d; d.Set(vi*86400000.0); t=d.Format(wxT("HH:mm")); return t; };
|
||||||
//virtual const wxString & FormatX(double v) { static wxString t; t=wxString::Format(wxT("%.1f"),v); return t; };
|
//virtual const wxString & FormatX(double v) { static wxString t; t=wxString::Format(wxT("%.1f"),v); return t; };
|
||||||
virtual const QString & FormatY(double v) { static QString t; t.sprintf("%.1f",v); return t; };
|
virtual const QString & FormatY(double v) { static QString t; t.sprintf("%.1f",v); return t; };
|
||||||
|
@ -150,7 +150,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
fd.sprintf("%02i:%02i",hour,minute);
|
fd.sprintf("%02i:%02i",hour,minute);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fd=d.toString("dd MMM");
|
fd=d.toString("MMM dd");
|
||||||
}
|
}
|
||||||
|
|
||||||
px=(i-minx)*xmult+w.GetLeftMargin();
|
px=(i-minx)*xmult+w.GetLeftMargin();
|
||||||
|
@ -690,7 +690,7 @@ void Daily::Load(QDate date)
|
|||||||
for (vector<Session *>::iterator s=cpap->begin();s!=cpap->end();s++) {
|
for (vector<Session *>::iterator s=cpap->begin();s!=cpap->end();s++) {
|
||||||
fd=QDateTime::fromMSecsSinceEpoch((*s)->first());
|
fd=QDateTime::fromMSecsSinceEpoch((*s)->first());
|
||||||
ld=QDateTime::fromMSecsSinceEpoch((*s)->last());
|
ld=QDateTime::fromMSecsSinceEpoch((*s)->last());
|
||||||
tmp.sprintf(("<tr><td align=center>%08x</td><td align=center>"+fd.toString("yyyy-MM-dd")+"</td><td align=center>"+fd.toString("HH:mm ")+"</td><td align=center>"+ld.toString("HH:mm")+"</td></tr>").toLatin1(),(*s)->session());
|
tmp.sprintf(("<tr><td align=center>%08x</td><td align=center>"+fd.date().toString(Qt::SystemLocaleShortDate)+"</td><td align=center>"+fd.toString("HH:mm ")+"</td><td align=center>"+ld.toString("HH:mm")+"</td></tr>").toLatin1(),(*s)->session());
|
||||||
html+=tmp;
|
html+=tmp;
|
||||||
}
|
}
|
||||||
html+="</table>";
|
html+="</table>";
|
||||||
|
26
overview.ui
26
overview.ui
@ -90,7 +90,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>282</height>
|
<height>276</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
@ -126,19 +126,7 @@
|
|||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="spacing">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -202,10 +190,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDateEdit" name="drEnd">
|
<widget class="QDateEdit" name="drStart">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="locale">
|
||||||
|
<locale language="C" country="AnyCountry"/>
|
||||||
|
</property>
|
||||||
<property name="displayFormat">
|
<property name="displayFormat">
|
||||||
<string>dd/MM/yyyy</string>
|
<string>dd/MM/yyyy</string>
|
||||||
</property>
|
</property>
|
||||||
@ -225,10 +216,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDateEdit" name="drStart">
|
<widget class="QDateEdit" name="drEnd">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="locale">
|
||||||
|
<locale language="C" country="AnyCountry"/>
|
||||||
|
</property>
|
||||||
<property name="displayFormat">
|
<property name="displayFormat">
|
||||||
<string>dd/MM/yyyy</string>
|
<string>dd/MM/yyyy</string>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
Reference in New Issue
Block a user