Ram Search - implement searching by number of changes
This commit is contained in:
parent
738c633096
commit
da31963df5
|
@ -392,7 +392,7 @@
|
||||||
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||||
this.toolStripButton1.Name = "toolStripButton1";
|
this.toolStripButton1.Name = "toolStripButton1";
|
||||||
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
|
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
|
||||||
this.toolStripButton1.Text = "toolStripButton1";
|
this.toolStripButton1.Text = "Search";
|
||||||
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
|
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
|
||||||
//
|
//
|
||||||
// ClearChangeCountstoolStripButton
|
// ClearChangeCountstoolStripButton
|
||||||
|
|
|
@ -461,11 +461,49 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
private bool DoPreviousValue()
|
private bool DoPreviousValue()
|
||||||
{
|
{
|
||||||
|
switch (GetOperator())
|
||||||
|
{
|
||||||
|
case SOperator.LESS:
|
||||||
|
break;
|
||||||
|
case SOperator.GREATER:
|
||||||
|
break;
|
||||||
|
case SOperator.LESSEQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.GREATEREQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.EQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.NOTEQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.DIFFBY:
|
||||||
|
break;
|
||||||
|
case SOperator.MODULUS:
|
||||||
|
break;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DoSpecificValue()
|
private bool DoSpecificValue()
|
||||||
{
|
{
|
||||||
|
switch (GetOperator())
|
||||||
|
{
|
||||||
|
case SOperator.LESS:
|
||||||
|
break;
|
||||||
|
case SOperator.GREATER:
|
||||||
|
break;
|
||||||
|
case SOperator.LESSEQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.GREATEREQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.EQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.NOTEQUAL:
|
||||||
|
break;
|
||||||
|
case SOperator.DIFFBY:
|
||||||
|
break;
|
||||||
|
case SOperator.MODULUS:
|
||||||
|
break;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,9 +601,87 @@ namespace BizHawk.MultiClient
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int GetSpecificChanges()
|
||||||
|
{
|
||||||
|
bool i = InputValidate.IsValidUnsignedNumber(NumberOfChangesBox.Text);
|
||||||
|
if (!i) return -1;
|
||||||
|
|
||||||
|
return int.Parse(NumberOfChangesBox.Text.ToUpper().Trim());
|
||||||
|
}
|
||||||
|
|
||||||
private bool DoNumberOfChanges()
|
private bool DoNumberOfChanges()
|
||||||
{
|
{
|
||||||
return false;
|
int changes = GetSpecificChanges();
|
||||||
|
if (changes < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Missing or invalid number of changes", "Invalid number", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
NumberOfChangesBox.Focus();
|
||||||
|
NumberOfChangesBox.SelectAll();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
switch (GetOperator())
|
||||||
|
{
|
||||||
|
case SOperator.LESS:
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].changecount < changes)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.GREATER:
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].changecount > changes)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.LESSEQUAL:
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].changecount <= changes)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.GREATEREQUAL:
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].changecount >= changes)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.EQUAL:
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].changecount == changes)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.NOTEQUAL:
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].changecount != changes)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.DIFFBY:
|
||||||
|
int diff = GetDifferentBy();
|
||||||
|
if (diff < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Missing or invalid Different By value", "Invalid value", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
DifferentByBox.Focus();
|
||||||
|
DifferentByBox.SelectAll();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (int x = 0; x < searchList.Count; x++)
|
||||||
|
{
|
||||||
|
if (searchList[x].address == changes + diff || searchList[x].address == changes - diff)
|
||||||
|
weededList.Add(searchList[x]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SOperator.MODULUS:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void signedToolStripMenuItem_Click(object sender, EventArgs e)
|
private void signedToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -171,9 +171,6 @@
|
||||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>259, 17</value>
|
<value>259, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>358, 17</value>
|
|
||||||
</metadata>
|
|
||||||
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
|
@ -205,6 +202,9 @@
|
||||||
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
<metadata name="toolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>358, 17</value>
|
||||||
|
</metadata>
|
||||||
<data name="DataSizetoolStripSplitButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="DataSizetoolStripSplitButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
|
|
Loading…
Reference in New Issue