-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from xd15zhn/master
V1.01->V1.02
- Loading branch information
Showing
29 changed files
with
533 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="GroundStation.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||
<section name="GroundStation.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> | ||
</sectionGroup> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/> | ||
</startup> | ||
<userSettings> | ||
<GroundStation.Properties.Settings> | ||
<setting name="tbxTx1Str" serializeAs="String"> | ||
<value /> | ||
<value/> | ||
</setting> | ||
<setting name="tbxTx2Str" serializeAs="String"> | ||
<value /> | ||
<value/> | ||
</setting> | ||
<setting name="tbxTx3Str" serializeAs="String"> | ||
<value /> | ||
<value/> | ||
</setting> | ||
<setting name="cbxBaudRateStr" serializeAs="String"> | ||
<value /> | ||
<value/> | ||
</setting> | ||
<setting name="tbxIntervalStr" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolCName1Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolCName2Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolCName3Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolCName4Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolSName1Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolSName2Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolSName3Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxRolSName4Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitCName1Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitCName2Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitCName3Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitCName4Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitSName1Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitSName2Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitSName3Str" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
<setting name="tbxPitSName4Str" serializeAs="String"> | ||
<value /> | ||
<value/> | ||
</setting> | ||
<setting name="TabIndexInt" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
<setting name="cbxBaudRate2Str" serializeAs="String"> | ||
<value /> | ||
<value/> | ||
</setting> | ||
<setting name="tbxNotepadstr" serializeAs="String"> | ||
<value/> | ||
</setting> | ||
</GroundStation.Properties.Settings> | ||
</userSettings> | ||
</configuration> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.IO; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace GroundStation | ||
{ | ||
class FileWrite | ||
{ | ||
private readonly FileStream fs; | ||
public FileWrite() | ||
{ | ||
if (fs == null) | ||
fs = new FileStream("data.dat", FileMode.OpenOrCreate, FileAccess.Write); | ||
} | ||
public void Write_Double_Pair_Data(double a, double b) | ||
{ | ||
string stra = a.ToString("#0.0000"); | ||
string strb = b.ToString("#0.0000"); | ||
string str = stra + " " + strb + "\r\n"; | ||
byte[] data = Encoding.UTF8.GetBytes(str); | ||
try | ||
{ | ||
fs.Write(data, 0, data.Length); | ||
} | ||
catch (Exception) { } | ||
} | ||
public void Write_File() | ||
{ | ||
try | ||
{ | ||
fs.Flush(); | ||
fs.Close(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
MessageBox.Show(ex.Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace GroundStation | ||
{ | ||
class Filter | ||
{ | ||
private readonly double[] IIRdelay = new double[2]; | ||
private readonly double[] MoveSave = new double[8]; | ||
private double UnitDelay; | ||
public double IIR_LowPassFilter(double DataIn) | ||
{ | ||
IIRdelay[0] = DataIn + 0.76295 * IIRdelay[1] - 0.283438 * IIRdelay[2]; | ||
double DataOut = 0.129 * IIRdelay[0] + 0.258 * IIRdelay[1] + 0.129 * IIRdelay[2]; | ||
IIRdelay[2] = IIRdelay[1]; | ||
IIRdelay[1] = IIRdelay[0]; | ||
return DataOut; | ||
} | ||
public double Moving_Average(double DataIn) | ||
{ | ||
double sum = DataIn; | ||
for (int i = 0; i < 7; i++) | ||
{ | ||
MoveSave[i] = MoveSave[i + 1]; | ||
sum += MoveSave[i]; | ||
} | ||
MoveSave[7] = DataIn; | ||
return sum / 8.0; | ||
} | ||
public double OneOrder_Filter(double DataIn) | ||
{ | ||
double DataOut = DataIn + 0.25 * UnitDelay; | ||
UnitDelay = DataOut; | ||
return DataOut * 0.75; | ||
} | ||
} | ||
} |
Oops, something went wrong.