Als bekennender Fan der My Field Notes von GC habe ich etwas programmiert:
Was mich gestört hat:
Sinn und Zweck der Sache: Wenn ich unterwegs einen Cache gefunden habe, kann ich direkt den Logtext in den Cachwolf eintippen und den entsprechenden Logtyp auswählen. Habe ich z.B. einen zerfledderten Cache gefunden, kann ich z.B. "Needs Maintenance" wählen und den Logtext im Notizfeld abspeichern.
Alle anderen Logtypen funktionieren natürlich auch (bis auf "Update Coordinates"). Die zu loggenden Caches werden dann über ein Template exportiert, welches eine Textdatei erzeugt. Diese Datei wird zu GC hochgeladen.
Frage: Währe soetwas auch für andere Benutzer interessant, oder bin ich der einzige Freak, der My Field Notes benutzt?
Gruß, maierkurt
Die Template-Datei:
Die Codeänderungen:
Was mich gestört hat:
- Im Cache DetailPanel kann man z.B. "Gefunden", "Nicht gefunden" usw. auswählen, jetzt gibt es auch die restlichen von GC, wie z.B. "Write note", "Will attend"..
Den Datumsauswähler gab es nur zusammen mit dem Logtyp "Gefunden". Er ist jetzt auch für die anderen Typen verfügbar. Dazu zuerst den Typ aus der Liste auswählen, dann auf den Datumswähler klicken.
Sinn und Zweck der Sache: Wenn ich unterwegs einen Cache gefunden habe, kann ich direkt den Logtext in den Cachwolf eintippen und den entsprechenden Logtyp auswählen. Habe ich z.B. einen zerfledderten Cache gefunden, kann ich z.B. "Needs Maintenance" wählen und den Logtext im Notizfeld abspeichern.
Alle anderen Logtypen funktionieren natürlich auch (bis auf "Update Coordinates"). Die zu loggenden Caches werden dann über ein Template exportiert, welches eine Textdatei erzeugt. Diese Datei wird zu GC hochgeladen.
Frage: Währe soetwas auch für andere Benutzer interessant, oder bin ich der einzige Freak, der My Field Notes benutzt?
Gruß, maierkurt
Die Template-Datei:
Code:
<#-- My Field Notes -->
<#-- Codecs: UTF8 -->
<tmpl_par name="charset" value="UTF8">
<#-- newline: CR, LF, CRLF -->
<tmpl_par name="newline" value="CRLF">
<tmpl_loop cache_index><tmpl_var name=WAYPOINT>,<tmpl_var name=STATUS_DATE>T<tmpl_var name=STATUS_TIME>Z,<tmpl_var name=GC_LOGTYPE>,"<tmpl_var name=NOTES>"<br>
</tmpl_loop>
Code:
Index: J:/Eclipse Workspace/Cachewolf/src/CacheWolf/CacheHolder.java
===================================================================
--- J:/Eclipse Workspace/Cachewolf/src/CacheWolf/CacheHolder.java (revision 1445)
+++ J:/Eclipse Workspace/Cachewolf/src/CacheWolf/CacheHolder.java (working copy)
@@ -545,12 +545,12 @@
public String GetStatusDate() {
String statusDate = "";
- if (is_found) {
+
Regex rexDate=new Regex("([0-9]{4}-[0-9]{2}-[0-9]{2})");
rexDate.search(CacheStatus);
if (rexDate.stringMatched(1)!= null) {
statusDate = rexDate.stringMatched(1);
- }
+
}
return statusDate;
@@ -559,7 +559,7 @@
public String GetStatusTime() {
String statusTime = "";
- if (is_found) {
+
Regex rexTime=new Regex("([0-9]{1,2}:[0-9]{2})");
rexTime.search(CacheStatus);
if (rexTime.stringMatched(1)!= null) {
@@ -572,8 +572,29 @@
statusTime = "00:00";
}
}
- }
+
return statusTime;
}
+
+
+ /** Returns the GC Logtype, e.g "Found it" or "Write note" */
+
+ public String GetGCLogType() {
+ String gcLogType = "";
+
+ if (CacheStatus.startsWith(MyLocale.getMsg(318, "Found it"))) gcLogType = "Found it";
+ if (CacheStatus.startsWith(MyLocale.getMsg(319, "Didn't find it"))) gcLogType = "Didn't find it";
+ if (CacheStatus.startsWith("Write note")) gcLogType = "Write note";
+ if (CacheStatus.startsWith("Needs Archived")) gcLogType = "Needs Archived";
+ if (CacheStatus.startsWith("Needs Maintenance")) gcLogType = "Needs Maintenance";
+ if (CacheStatus.startsWith("Will Attend")) gcLogType = "Will Attend";
+ if (CacheStatus.startsWith("Attended")) gcLogType = "Attended";
+ if (CacheStatus.startsWith("Temporarily Disable Listing")) gcLogType = "Temporarily Disable Listing";
+ if (CacheStatus.startsWith("Owner Maintenance")) gcLogType = "Owner Maintenance";
+ if (CacheStatus.startsWith("Enable Listing")) gcLogType = "Enable Listing";
+ if (CacheStatus.startsWith("Post Reviewer Note")) gcLogType = "Post Reviewer Note";
+
+ return gcLogType;
+ }
}
\ No newline at end of file
Code:
Index: J:/Eclipse Workspace/Cachewolf/src/CacheWolf/DetailsPanel.java
===================================================================
--- J:/Eclipse Workspace/Cachewolf/src/CacheWolf/DetailsPanel.java (revision 1445)
+++ J:/Eclipse Workspace/Cachewolf/src/CacheWolf/DetailsPanel.java (working copy)
@@ -20,7 +20,7 @@
mButton btnDelete,btnCenter, btnAddDateTime;
mChoice chcType = new mChoice(new String[]{"Custom", "Traditional", "Multi", "Virtual", "Letterbox", "Event", "Mega Event", "Mystery", "Webcam", "Locationless", "CITO", "Earthcache", "wherIGo", "Addi: Parking", "Addi: Stage", "Addi: Question", "Addi: Final","Addi: Trailhead","Addi: Reference"},0);
mChoice chcSize = new mChoice(new String[]{"", "Micro", "Small", "Regular", "Large","Other","Very Large","None"},0);
- mComboBox chcStatus = new mComboBox(new String[]{"", MyLocale.getMsg(313,"Flag 1"), MyLocale.getMsg(314,"Flag 2"), MyLocale.getMsg(315,"Flag 3"), MyLocale.getMsg(316,"Flag 4"), MyLocale.getMsg(317,"Search"), MyLocale.getMsg(318,"Found"), MyLocale.getMsg(319,"Not Found"), MyLocale.getMsg(320,"Owner")},0);
+ mComboBox chcStatus = new mComboBox(new String[]{"", MyLocale.getMsg(313,"Flag 1"), MyLocale.getMsg(314,"Flag 2"), MyLocale.getMsg(315,"Flag 3"), MyLocale.getMsg(316,"Flag 4"), MyLocale.getMsg(317,"Search"), MyLocale.getMsg(318,"Found"), MyLocale.getMsg(319,"Not Found"), "Write note", "Will Attend", "Attended", MyLocale.getMsg(320,"Owner"), "Needs Archived", "Needs Maintenance", "Owner Maintenance", "Enable Listing", "Temporarily Disable Listing", "Post Reviewer Note"},0);
mButton btnNewWpt, btnShowBug, btnShowMap, btnGoto, btnAddPicture, btnBlack, btnNotes, btnSave, btnCancel;
mButton btnFoundDate,btnHiddenDate;
Vector cacheDB;
@@ -419,11 +419,22 @@
}
else if (ev.target==btnFoundDate) {
//DateChooser.dayFirst=true;
+ String logType = MyLocale.getMsg(318, "Found"); // estimated logtype if not yet set but user pressed btnFoundDate
DateTimeChooser dc=new DateTimeChooser(Vm.getLocale());
- dc.title=MyLocale.getMsg(328,"Date found");
- dc.setPreferredSize(240,240);
+ //dc.title=MyLocale.getMsg(328,"Date found");
+ //dc.setPreferredSize(240,240);
String foundDate=chcStatus.getText();
- if (foundDate.startsWith(MyLocale.getMsg(318,"Found")+" ")) foundDate=foundDate.substring(MyLocale.getMsg(318,"Found").length()+1);
+ if (foundDate.startsWith(MyLocale.getMsg(318,"Found")+" ")) { foundDate=foundDate.substring(MyLocale.getMsg(318,"Found").length()+1); logType = MyLocale.getMsg(318, "Found");}
+ if (foundDate.startsWith(MyLocale.getMsg(319,"Didn't find it"))) logType = MyLocale.getMsg(319, "Didn't find it");
+ if (foundDate.startsWith("Write note")) logType = "Write note";
+ if (foundDate.startsWith("Needs Archived")) logType = "Needs Archived";
+ if (foundDate.startsWith("Needs Maintenance")) logType = "Needs Maintenance";
+ if (foundDate.startsWith("Will Attend")) logType = "Will Attend";
+ if (foundDate.startsWith("Attended")) logType = "Attended";
+ if (foundDate.startsWith("Temporarily Disable Listing")) logType = "Temporarily Disable Listing";
+ if (foundDate.startsWith("Owner Maintenance")) logType = "Owner Maintenance";
+ if (foundDate.startsWith("Post Reviewer Note")) logType = "Post Reviewer Note";
+ if (foundDate.startsWith("Enable Listing")) logType = "Enable Listing";
Time t=new Time();
try {
t.parse(foundDate,"y-M-d H:m");
@@ -432,9 +443,21 @@
t.parse(foundDate,"y-M-d");
} catch(IllegalArgumentException e1) {}
};
+ if (logType == MyLocale.getMsg(318, "Found")) dc.title=MyLocale.getMsg(328,"Date found");
+ if (logType == MyLocale.getMsg(319, "Didn't find it")) dc.title=MyLocale.getMsg(319, "Didn't find");
+ if (logType == "Write note") dc.title = "Write note";
+ if (logType == "Needs Archived") dc.title = "Needs Archived";
+ if (logType == "Needs Maintenance") dc.title = "Needs Maintenance";
+ if (logType == "Will Attend") dc.title = "Will Attend";
+ if (logType == "Attended") dc.title = "Attended";
+ if (logType == "Temporarily Disable Listing") dc.title = "Temporarily Disable Listing";
+ if (logType == "Owner Maintenance") dc.title = "Owner Maintenance";
+ if (logType == "Post Reviewer Note") dc.title = "Post Reviewer Note";
+ if (logType == "Enable Listing") dc.title = "Enable Listing";
+ dc.setPreferredSize(240,240);
dc.reset(t);
if (dc.execute()==ewe.ui.FormBase.IDOK) {
- chcStatus.setText(MyLocale.getMsg(318,"Found")+" "+Convert.toString(dc.year)+"-"+MyLocale.formatLong(dc.month,"00")+"-"+MyLocale.formatLong(dc.day,"00")+" "+dc.time);
+ chcStatus.setText(logType +" "+Convert.toString(dc.year)+"-"+MyLocale.formatLong(dc.month,"00")+"-"+MyLocale.formatLong(dc.day,"00")+" "+dc.time);
dirty_details=true;
profile.hasUnsavedChanges=true;
}
@@ -492,7 +515,7 @@
//Don't allow single letter names=> Problems in updateBearingDistance
// This is a hack but faster than slowing down the loop in updateBearingDistance
if (thisCache.wayPoint.length()<2) thisCache.wayPoint+=" ";
- thisCache.CacheName = inpName.getText().trim();
+ thisCache.CacheName = inpName.getText().toUpperCase().trim();
thisCache.LatLon = thisCache.pos.toString();
thisCache.DateHidden = inpHidden.getText().trim();
String oldType=thisCache.type;
Code:
Index: J:/Eclipse Workspace/Cachewolf/src/exp/TPLExporter.java
===================================================================
--- J:/Eclipse Workspace/Cachewolf/src/exp/TPLExporter.java (revision 1384)
+++ J:/Eclipse Workspace/Cachewolf/src/exp/TPLExporter.java (working copy)
@@ -218,6 +218,7 @@
varParams.put("STATUS", holder.CacheStatus);
varParams.put("STATUS_DATE", holder.GetStatusDate());
varParams.put("STATUS_TIME", holder.GetStatusTime());
+ varParams.put("GC_LOGTYPE", holder.GetGCLogType());
varParams.put("DATE", holder.DateHidden);
varParams.put("URL", holder.URL);
varParams.put("NOTES", holder.CacheNotes);