Skip to content

Commit

Permalink
Fixed Issue #9 where the connection string was not being correctly cr…
Browse files Browse the repository at this point in the history
…eated or displayed.
  • Loading branch information
NameOfTheDragon committed Jun 17, 2018
1 parent f5d698a commit 9d91aff
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 34 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion TA.DigitalDomeworks.Server/CommunicationSettingsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ private void CommunicationSettingsControl_Load(object sender, EventArgs e)
}

private void UseSimulator_CheckedChanged(object sender, EventArgs e)
{
CommPortName.Enabled = !UseSimulator.Checked;
BuildConnectionString();
}

private void BuildConnectionString()
{
var useSimulator = UseSimulator.Checked;
CommPortName.Enabled = !useSimulator;
if (useSimulator)
BuildSimulatorConnectionString();
else
Expand All @@ -64,5 +69,10 @@ private void BuildSerialConnectionString()
var candidate = new SerialDeviceEndpoint(CommPortName.Text);
Settings.Default.ConnectionString = candidate.ToString();
}

private void CommPortName_SelectedIndexChanged(object sender, EventArgs e)
{
BuildConnectionString();
}
}
}
4 changes: 2 additions & 2 deletions TA.DigitalDomeworks.Server/CompositionRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Copyright © 2016-2018 Tigra Astronomy, all rights reserved.
//
// File: CompositionRoot.cs Last modified: 2018-04-21@20:23 by Tim Long
// File: CompositionRoot.cs Last modified: 2018-06-17@17:22 by Tim Long

using System;
using Ninject;
Expand Down Expand Up @@ -65,7 +65,7 @@ public override void Load()
Bind<ICommunicationChannel>()
.ToMethod(BuildCommunicationsChannel)
.InSessionScope();
Bind<ChannelFactory>().ToMethod(BuildChannelFactory).InSingletonScope();
Bind<ChannelFactory>().ToMethod(BuildChannelFactory).InSessionScope();
Bind<IClock>().To<SystemDateTimeUtcClock>().InSingletonScope();
Bind<IControllerActions>().To<RxControllerActions>().InSessionScope();
Bind<DeviceControllerOptions>().ToMethod(BuildDeviceOptions).InSessionScope();
Expand Down
2 changes: 1 addition & 1 deletion TA.DigitalDomeworks.Server/SetupDialogForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ private void SetControlAppearance()
{
IgnoreShutterSensor.ForeColor = IgnoreShutterSensor.Checked ? Color.DarkRed : DefaultForeColor;
}
}
}
}
52 changes: 26 additions & 26 deletions TA.DigitalDomeworks.Server/SetupDialogForm.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions TA.DigitalDomeworks.Server/SetupDialogForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,15 @@ operations to complete. Set this to slightly more
than the worst case time (in seconds)
for a full 360° rotation of your dome.</value>
</data>
<metadata name="ConnectionErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="IgnoreShutterSensor.ToolTip" xml:space="preserve">
<value>This is a potentially unsafe setting and should not be enabled
without careful consideration.

When enabled, the driver ignores the shutter position reported
by Digital Domeworks and uses a heuristic to infer the shutter
position based on the shutter operation history.
position based on the shutter operation history. If the heuristic
has insufficient information, then it falls back to using the
position reported by Digital Domeworks.

The heuristic takes into account the length of time the shutter
was detected as moving and how much current was drawn by
Expand All @@ -182,4 +181,7 @@ option should be used with care.

Default: disabled.</value>
</data>
<metadata name="ConnectionErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

0 comments on commit 9d91aff

Please sign in to comment.