Skip to content

Commit 7b113b6

Browse files
committed
usgs toolbox dotspatial migration updates
-enable timeseries statistics in dotspatial -template for statusmonitor -additional demo ui components
1 parent 372eb03 commit 7b113b6

15 files changed

+427
-5
lines changed

BASINSDS.sln

+28
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "atcUSGSUtility-DS", "atcUSG
3737
EndProject
3838
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "atcUSGSDF2P-DS", "atcUSGSDF2P\atcUSGSDF2P-DS.vbproj", "{4CDFEB5C-1808-44AD-9206-0049FF26FA2E}"
3939
EndProject
40+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "USGS.Plugins", "USGS.Plugins.Trial\USGS.Plugins.csproj", "{D7926BE4-E79B-4263-AF3B-351DEB860174}"
41+
EndProject
42+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "atcTimeseriesStatistics-DS", "atcTimeseriesStatistics\atcTimeseriesStatistics-DS.vbproj", "{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}"
43+
EndProject
4044
Global
4145
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4246
Debug|Any CPU = Debug|Any CPU
@@ -251,6 +255,30 @@ Global
251255
{4CDFEB5C-1808-44AD-9206-0049FF26FA2E}.Release|x64.Build.0 = Release|Any CPU
252256
{4CDFEB5C-1808-44AD-9206-0049FF26FA2E}.Release|x86.ActiveCfg = Release|x86
253257
{4CDFEB5C-1808-44AD-9206-0049FF26FA2E}.Release|x86.Build.0 = Release|x86
258+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
259+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Debug|Any CPU.Build.0 = Debug|Any CPU
260+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Debug|x64.ActiveCfg = Debug|Any CPU
261+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Debug|x64.Build.0 = Debug|Any CPU
262+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Debug|x86.ActiveCfg = Debug|Any CPU
263+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Debug|x86.Build.0 = Debug|Any CPU
264+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Release|Any CPU.ActiveCfg = Release|Any CPU
265+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Release|Any CPU.Build.0 = Release|Any CPU
266+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Release|x64.ActiveCfg = Release|Any CPU
267+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Release|x64.Build.0 = Release|Any CPU
268+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Release|x86.ActiveCfg = Release|Any CPU
269+
{D7926BE4-E79B-4263-AF3B-351DEB860174}.Release|x86.Build.0 = Release|Any CPU
270+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
271+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
272+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Debug|x64.ActiveCfg = Debug|Any CPU
273+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Debug|x64.Build.0 = Debug|Any CPU
274+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Debug|x86.ActiveCfg = Debug|x86
275+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Debug|x86.Build.0 = Debug|x86
276+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
277+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Release|Any CPU.Build.0 = Release|Any CPU
278+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Release|x64.ActiveCfg = Release|Any CPU
279+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Release|x64.Build.0 = Release|Any CPU
280+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Release|x86.ActiveCfg = Release|x86
281+
{7E40E3E6-BF8E-45B5-99AF-4E11DAF039FD}.Release|x86.Build.0 = Release|x86
254282
EndGlobalSection
255283
GlobalSection(SolutionProperties) = preSolution
256284
HideSolutionNode = FALSE

BASINSDS/BASINSDS.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<Reference Include="System.Xml" />
7777
</ItemGroup>
7878
<ItemGroup>
79+
<Compile Include="clsPluginProperties.cs" />
7980
<Compile Include="MainForm.cs">
8081
<SubType>Form</SubType>
8182
</Compile>

BASINSDS/MainForm.Designer.cs

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BASINSDS/MainForm.resx

+13
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@
128128
AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0
129129
ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAACAAAAAgAAABEDAAAABAAAAAYEAAAAFkFwcGxp
130130
Y2F0aW9uIEV4dGVuc2lvbnMGBQAAAAdQbHVnaW5zDQIL
131+
</value>
132+
</data>
133+
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
134+
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
135+
<value>
136+
AAABAAEAFBQQAAEABACoAQAAFgAAACgAAAAUAAAAKAAAAAEABAAAAAAAAAAAAEcAAABHAAAAEAAAAAAA
137+
AAAzZgAAZmYAAGaZMwCZmTMAzMyZAMDAwABmmQAAmcyZAJmZmQCZmWYAzJmZAGaZZgCZzGYA/8zMAAAA
138+
AAAAAAAAARARARARERAQEAAAEQEQEBEBAQEBEQAAARARAQEBEBEQEAAAEBEBEBERARAjIQAAARARARAQ
139+
ECRVVQAAEQEQEQEBEjERJQAAVhARARAQN1SCEAAAVZEBEBEZo7dVkQAAFFQRAQEiIhEVVAAAEJVZM5VV
140+
VVIRJQAAgRFFV0YRA1XBEQAAVSEQJIVZEBhVIQAANV1VWTJFUxAlWQAAATIyEBAWVXERdQAAQjeQEQEQ
141+
GVUhEgAAVcEBEBEBECVXEQAAARARARARARCVUgAAEQEAEAEAEAECVQAAARERERERERERGAAAEBAQEBAQ
142+
EBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
143+
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
131144
</value>
132145
</data>
133146
</root>

BASINSDS/USGS/USGSPlugin.cs

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
using System;
2+
using System.Windows.Forms;
3+
using DotSpatial.Controls;
4+
using DotSpatial.Controls.Docking;
5+
using DotSpatial.Controls.Header;
6+
7+
namespace HydrologicToolbox.USGS
8+
{
9+
public class USGSPlugin : Extension
10+
{
11+
private const string UniqueKeyPluginStoredValueDate = "UniqueKey-PluginStoredValueDate";
12+
private const string AboutPanelKey = "kUSGS";
13+
private DateTime _storedValue;
14+
15+
public override void Activate()
16+
{
17+
// add some menu items...
18+
AddMenuItems(App.HeaderControl);
19+
20+
// code for saving plugin settings...
21+
App.SerializationManager.Serializing += ManagerSerializing;
22+
App.SerializationManager.Deserializing += ManagerDeserializing;
23+
24+
//AddDockingPane();
25+
26+
base.Activate();
27+
}
28+
29+
public override void Deactivate()
30+
{
31+
// Do not forget to unsubscribe event handlers
32+
App.SerializationManager.Serializing -= ManagerSerializing;
33+
App.SerializationManager.Deserializing -= ManagerDeserializing;
34+
35+
// Remove all GUI components which were added by plugin
36+
App.DockManager.Remove(AboutPanelKey);
37+
App.HeaderControl.RemoveAll();
38+
39+
base.Deactivate();
40+
}
41+
42+
private void AddMenuItems(IHeaderControl header)
43+
{
44+
const string SampleMenuKey = "kSample1";
45+
46+
// Root menu
47+
header.Add(new RootItem(SampleMenuKey, "USGS"));
48+
49+
// Add some child menus
50+
header.Add(new SimpleActionItem(SampleMenuKey, "Baseflow", null) { Enabled = true });
51+
header.Add(new SimpleActionItem(SampleMenuKey, "RECESS", OnMenuClickEventHandler));
52+
header.Add(new SimpleActionItem(SampleMenuKey, "RORA", OnMenuClickEventHandler));
53+
54+
// Add sub menus
55+
header.Add(new MenuContainerItem(SampleMenuKey, "submenu1", "SWSTAT"));
56+
header.Add(new SimpleActionItem(SampleMenuKey, "submenu1", "Integrated Design Flow", OnMenuClickEventHandler));
57+
header.Add(new SimpleActionItem(SampleMenuKey, "submenu1", "Frequency", OnMenuClickEventHandler));
58+
}
59+
60+
private void OnMenuClickEventHandler(object sender, EventArgs e)
61+
{
62+
var act = ((SimpleActionItem) sender).Caption;
63+
//MessageBox.Show("Clicked " + act);
64+
switch (act)
65+
{
66+
case "Alpha":
67+
case "Bravo":
68+
var frmAbout = new frmTest();
69+
frmAbout.ShowDialog();
70+
break;
71+
}
72+
}
73+
74+
private void AddDockingPane()
75+
{
76+
/*
77+
var form = new frmTest();
78+
form.okButton.Click += (o, args) => App.DockManager.HidePanel(AboutPanelKey);
79+
80+
var aboutPanel = new DockablePanel(AboutPanelKey, "About", form.tableLayoutPanel, DockStyle.Right);
81+
App.DockManager.Add(aboutPanel);
82+
*/
83+
}
84+
85+
private void ManagerDeserializing(object sender, SerializingEventArgs e)
86+
{
87+
var manager = (SerializationManager)sender;
88+
_storedValue = manager.GetCustomSetting(UniqueKeyPluginStoredValueDate, DateTime.Now);
89+
}
90+
91+
private void ManagerSerializing(object sender, SerializingEventArgs e)
92+
{
93+
var manager = (SerializationManager)sender;
94+
manager.SetCustomSetting(UniqueKeyPluginStoredValueDate, _storedValue);
95+
}
96+
}
97+
}

BASINSDS/USGS/frmTest.Designer.cs

+39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BASINSDS/USGS/frmTest.cs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows.Forms;
10+
11+
namespace HydrologicToolbox.USGS
12+
{
13+
public partial class frmTest : Form
14+
{
15+
public frmTest()
16+
{
17+
InitializeComponent();
18+
}
19+
}
20+
}

BASINSDS/clsPluginProperties.cs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace BASINSDS
8+
{
9+
public class clsPluginProperties
10+
{
11+
public const string g_CacheDir = @"C:\BASINSDS\Cache\";
12+
public const string g_PathChar = @"\";
13+
public const string g_AppNameShort = @"Hydro Toolbox";
14+
//Logger.Icon = g_MapWin.ApplicationInfo.FormIcon
15+
}
16+
}

0 commit comments

Comments
 (0)