Skip to content

Commit

Permalink
Minor Adjustments
Browse files Browse the repository at this point in the history
Enmhaced readabilityy
  • Loading branch information
COMBudda committed Nov 28, 2023
1 parent a531fb4 commit 28ae663
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 84 deletions.
15 changes: 15 additions & 0 deletions CGATest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,19 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

</Project>
83 changes: 0 additions & 83 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,52 +177,6 @@ private async void Form1_Shown(object sender, EventArgs e)

public async Task Main(object sender, EventArgs e)
{
/*
*
* Probably better placed where the data is actuall read
*
*
*
Process sigrok = null;
// readm cmd
string[] args = Environment.GetCommandLineArgs();
if (args.Length == 1) // do we start sigrok on our own?
{
Console.WriteLine("Starting Sigrok");
// Sigrok process start
var startSigrok = new ProcessStartInfo
{
FileName = @"C:\Program Files\sigrok\sigrok-cli\sigrok-cli",
UseShellExecute = false,
RedirectStandardOutput = true,
WorkingDirectory = @"C:\Program Files\sigrok\sigrok-cli\",
Arguments = @"-d fx2lafw -O binary --config ""samplerate=16 MHz"" --continuous",
StandardOutputEncoding = Encoding.Latin1
};
sigrok = Process.Start(startSigrok);
sigrok.PriorityClass = ProcessPriorityClass.High;
processIds.Enqueue(sigrok.Id);
// Attach stdout
vIn = sigrok.StandardOutput;
}
else
if (args[1] == "-")
{
vIn = new StreamReader(Console.OpenStandardInput(), System.Text.Encoding.Latin1, bufferSize: 131072); // or is there a pipe?
}
else
{
Console.WriteLine("Only \"-\" is allowed for standard-in. Exiting.");
Application.Exit();
}
*/

Bitmap newpic = null;

radioButton1.ForeColor = Color.Green;
Expand Down Expand Up @@ -356,43 +310,6 @@ await Task.Run(() =>
else
color = (int)rawdata & 0x3F;

/*
// Generic bit shifting to extract color bits
blue = (byte)(127 * (byte)(color & 1));
color = color >> 1;
green = (byte)(127 * (byte)(color & 1));
color = color >> 1;
red = (byte)(127 * (byte)(color & 1));
switch (colorMode)
{
case 0: //RGB is just one intensity level
red = (byte)(red * 2);
green = (byte)(green * 2);
blue = (byte)(blue * 2);
break;
case 1: // MDA relies on green and intensity on green
color = color >> 1;
green = (byte)(green * ((byte)(color & 1) + 1));
blue = green;
red = green;
break;
case 2: // CGA has intensity as well (on green)
color = color >> 1;
blue = (byte)(blue * ((byte)(color & 1) + 1));
green = (byte)(green * ((byte)(color & 1) + 1));
red = (byte)(red * ((byte)(color & 1) + 1));
break;
case 3: // For EGA
color = color >> 1;
green = (byte)(green * ((byte)(color & 1) + 1));
color = color >> 1;
red = (byte)(red * ((byte)(color & 1) + 1));
color = color >> 1;
blue = (byte)(blue * ((byte)(color & 1) + 1));
break;
}*/

//Low bits
blueL = (byte)(color & 1);
color = color >> 1;
Expand Down
2 changes: 1 addition & 1 deletion Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>85</value>
<value>25</value>
</metadata>
</root>
26 changes: 26 additions & 0 deletions Properties/Settings.Designer.cs

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

6 changes: 6 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

0 comments on commit 28ae663

Please sign in to comment.