finished project

This commit is contained in:
test 2019-04-09 19:22:56 +02:00
parent e7b37f8211
commit dd0a823ff7
3 changed files with 53 additions and 25 deletions

View File

@ -32,6 +32,10 @@ namespace VCRlogic
_concreteState = e; _concreteState = e;
} }
public static StateTape getState()
{
return _concreteState;
}
public static void insertTape() public static void insertTape()
{ {
@ -81,7 +85,6 @@ namespace VCRlogic
public class StapeNoTapeIn : StateTape public class StapeNoTapeIn : StateTape
{ {
public StapeNoTapeIn() public StapeNoTapeIn()
{ {
Debug.Print("NoTapeIn\n"); Debug.Print("NoTapeIn\n");
@ -89,6 +92,7 @@ namespace VCRlogic
// sub to event // sub to event
SMtape.evIntape += evIntape; SMtape.evIntape += evIntape;
} }
public override void evIntape() public override void evIntape()
{ {
//unsub //unsub
@ -103,24 +107,22 @@ namespace VCRlogic
public override void evEndtape() public override void evEndtape()
{ {
} }
public override void evNotendtape() public override void evNotendtape()
{ {
} }
} }
public class StapeTapeInNotEnd : StateTape public class StapeTapeInNotEnd : StateTape
{ {
public StapeTapeInNotEnd() public StapeTapeInNotEnd()
{ {
Debug.Print("TapeInNotEnd\n"); Debug.Print("TapeInNotEnd\n");
SMvcr.tapeBeginn();
//sub //sub
SMtape.evOuttape += evOuttape; SMtape.evOuttape += evOuttape;
SMtape.evEndtape += evEndtape; SMtape.evEndtape += evEndtape;
@ -148,28 +150,24 @@ namespace VCRlogic
public override void evNotendtape() public override void evNotendtape()
{ {
} }
} }
public class StapeTapeInEnd : StateTape public class StapeTapeInEnd : StateTape
{ {
public StapeTapeInEnd() public StapeTapeInEnd()
{ {
Debug.Print("TapeInEnd\n"); Debug.Print("TapeInEnd\n");
SMvcr.tapeEnd();
SMtape.evOuttape += evOuttape; SMtape.evOuttape += evOuttape;
SMtape.evNoendtape += evNotendtape; SMtape.evNoendtape += evNotendtape;
} }
public override void evIntape() public override void evIntape()
{ {
} }
public override void evOuttape() public override void evOuttape()
@ -181,7 +179,6 @@ namespace VCRlogic
public override void evEndtape() public override void evEndtape()
{ {
} }
public override void evNotendtape() public override void evNotendtape()

View File

@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VCRlogic;
public static class SMvcr public static class SMvcr
@ -64,36 +65,65 @@ public static class SMvcr
} }
public static void record() public static void record()
{
if (SMtape.getState() is StapeTapeInNotEnd)
{ {
if (evRecordbutton != null) if (evRecordbutton != null)
{ {
evRecordbutton(); evRecordbutton();
} }
} }
}
public static void play() public static void play()
{
if (SMtape.getState() is StapeTapeInNotEnd)
{ {
if (evPlaybutton != null) if (evPlaybutton != null)
{ {
evPlaybutton(); evPlaybutton();
} }
} }
}
public static void rewind() public static void rewind()
{
if (SMtape.getState() is StapeTapeInEnd)
{ {
if (evRewindbutton != null) if (evRewindbutton != null)
{ {
evRewindbutton(); evRewindbutton();
} }
} }
}
public static void fastforward() public static void fastforward()
{
if (SMtape.getState() is StapeTapeInNotEnd)
{ {
if (evFastforwardbutton != null) if (evFastforwardbutton != null)
{ {
evFastforwardbutton(); evFastforwardbutton();
} }
} }
}
public static void tapeEnd()
{
if (evEndtape != null)
{
evEndtape();
}
}
public static void tapeBeginn()
{
if (evBeginningtape != null)
{
evBeginningtape();
}
}
} }

View File

@ -89,12 +89,13 @@
// //
this.statusLabel.AutoSize = true; this.statusLabel.AutoSize = true;
this.statusLabel.Font = new System.Drawing.Font("Arial", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.statusLabel.Font = new System.Drawing.Font("Arial", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.statusLabel.Location = new System.Drawing.Point(242, 230); this.statusLabel.Location = new System.Drawing.Point(267, 223);
this.statusLabel.MinimumSize = new System.Drawing.Size(200, 50); this.statusLabel.MinimumSize = new System.Drawing.Size(200, 50);
this.statusLabel.Name = "statusLabel"; this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(291, 55); this.statusLabel.Size = new System.Drawing.Size(200, 55);
this.statusLabel.TabIndex = 5; this.statusLabel.TabIndex = 5;
this.statusLabel.Text = "Status Label"; this.statusLabel.Text = "Standby";
this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// btnInsertTape // btnInsertTape
// //