public new Acceptor this[int Index] { get { Acceptor acceptor = this.Find((acc) => acc.number == Index); if (acceptor != null) { AESImhei.ReadAcceptorDetails(acceptor.number, acceptor); } return(acceptor); } set { Acceptor acceptor = this.Find((acc) => acc.number == Index); if (acceptor != null) { this.Remove(acceptor); } if (value != null) { this.Add(value); } } }
public void DisplayCounter(Byte Number) { MHE.Counter counter = Counter[Number]; switch (counter.DisplayMode) { case CounterMeter.CounterDisplayMode.CounterOnly: AESImhei.CounterDisplay((int)counter.Number * 1); break; case CounterMeter.CounterDisplayMode.Both: AESImhei.CounterDisplay((int)counter.Number * -1); break; } }
public CounterMeter() { Counter = new CounterList(); for (byte i = 1; i <= 16; ++i) { Int32 count = AESImhei.CounterRead(i); if (count >= 0) { Counter counter = new Counter(i); Counter[i] = counter; } } }
/// <summary> /// Opens the MHE interface. /// </summary> /// <returns></returns> public int Open() { int retValue = AESImhei.OpenMHE(); if (retValue != 0) { return(retValue); } meter = new CounterMeter(); acceptors = new AcceptorList(); // find out what Acceptors are connected by // attempting to get info on them for (int i = 0; i < 16; ++i) { // look for it and add it if it's there Acceptor acceptor = new Acceptor(i); if (AESImhei.ReadAcceptorDetails(i, acceptor)) { acceptors[i] = acceptor; } } dispensers = new DispenserList(); // get info on all dispensers for (int i = 0; i < 16; ++i) { Dispenser dispenser = new Dispenser(i); if (AESImhei.ReadDispenserDetails(i, dispenser)) { dispensers[i] = dispenser; } } return(retValue); }
public new Dispenser this[int Index] { get { Dispenser dispenser = this.Find((disp) => disp.number == Index); if (dispenser != null) { AESImhei.ReadDispenserDetails(dispenser.number, dispenser); } return(dispenser); } set { Dispenser dispenser = this.Find((disp) => disp.number == Index); if (dispenser != null) { this.Remove(dispenser); } dispenser = value; this.Add(dispenser); } }
public void TicketAccept() { AESImhei.BarcodeAccept(); }
public int TicketsStacked(out string Barcode) { Barcode = String.Empty; return(AESImhei.BarcodeStacked(ref Barcode)); }
public bool TicketInEscrow(out string Barcode) { Barcode = String.Empty; return(AESImhei.BarcodeInEscrow(ref Barcode) != 0); }
public void PayOut(int Amount) { AESImhei.PayOut(Amount); }
public void WriteDetails() { AESImhei.WriteAcceptorDetails(this.number, this); }
public int Increment(int Increment) { AESImhei.CounterIncrement(number, Increment); return(AESImhei.CounterRead(number)); }
public int SwitchOpens(int SwitchNumber) { return(AESImhei.SwitchOpens(SwitchNumber)); }
public void Return() { AESImhei.EscrowReturn(); }
public void Accept() { AESImhei.EscrowAccept(); }
public void ValueNeeded(System.Int32 Amount) { AESImhei.ValueNeeded(Amount); }
public Event.Code NextEvent(MHE.Event EventDetails) { return((Event.Code)AESImhei.NextEvent(EventDetails)); }
public void WriteDetails() { AESImhei.WriteDispenserDetails(this.number, this); }
public bool ReadDetails() { return(AESImhei.ReadDispenserDetails(this.number, this)); }
public void TicketReturn() { AESImhei.BarcodeReturn(); }
public void IndicatorOff(int IndicatorNumber) { AESImhei.IndicatorOff(IndicatorNumber); }
public void USBDriverExit() { AESImhei.USBDriverExit(); }
public int SwitchCloses(int SwitchNumber) { return(AESImhei.SwitchCloses(SwitchNumber)); }
public void LockSet(Byte[] Key) { AESImhei.DESLockSet(Key); }
private void NewCoinPanel(int Index, AESImhei.AcceptorCoin Coin) { System.Windows.Forms.Panel coinPanel = new Panel(); coinPanel.Location = new System.Drawing.Point(8 + 45*Index, 32); coinPanel.Name = "CoinPanel" + Index.ToString(); coinPanel.Size = new System.Drawing.Size(64, 240); coinPanel.TabIndex = 0; this.AcceptorPanel.Controls.Add(coinPanel ); // ValueTextBox System.Windows.Forms.TextBox valueTextBox = new TextBox(); valueTextBox.ReadOnly = true; valueTextBox.Location = new System.Drawing.Point(8, 8); valueTextBox.Name = "ValueTextBox_" + Index.ToString(); valueTextBox.Size = new System.Drawing.Size(40, 22); valueTextBox.TabIndex = 0; valueTextBox.Text = Coin.Value.ToString(); coinPanel.Controls.Add( valueTextBox ); // DescTextBox0 System.Windows.Forms.TextBox descTextBox = new TextBox(); descTextBox.ReadOnly = true; descTextBox.Location = new System.Drawing.Point(8, 32); descTextBox.Name = "DescTextBox_" + Index.ToString(); descTextBox.Size = new System.Drawing.Size(40, 22); descTextBox.Font = new Font("Arial", 8); descTextBox.TabIndex = 1; descTextBox.Text = Coin.Count.ToString(); coinPanel.Controls.Add(descTextBox); // CountTextBox0 System.Windows.Forms.TextBox countTextBox = new TextBox(); countTextBox.ReadOnly = true; countTextBox.Location = new System.Drawing.Point(8, 56); countTextBox.Name = "CountTextBox_" + Index.ToString(); countTextBox.Size = new System.Drawing.Size(40, 22); countTextBox.TabIndex = 2; countTextBox.Text = Coin.Count.ToString(); coinPanel.Controls.Add(countTextBox); // RoutedPathTextBox0 System.Windows.Forms.TextBox routedPathTextBox = new TextBox(); routedPathTextBox.Location = new System.Drawing.Point(8, 80); routedPathTextBox.Name = "RoutedPathTextBox_" + Index.ToString(); routedPathTextBox.Size = new System.Drawing.Size(40, 22); routedPathTextBox.TabIndex = 3; routedPathTextBox.Text = Coin.Path.ToString(); routedPathTextBox.MaxLength = 1; routedPathTextBox.TextChanged += new System.EventHandler(this.CoinControlChanged); coinPanel.Controls.Add( routedPathTextBox ); // // DefaultPathTextBox0 // System.Windows.Forms.TextBox defaultPathTextBox = new TextBox(); defaultPathTextBox.Location = new System.Drawing.Point(8, 104); defaultPathTextBox.Name = "DefaultPathTextBox_" + Index.ToString(); defaultPathTextBox.Size = new System.Drawing.Size(40, 22); defaultPathTextBox.TabIndex = 4; defaultPathTextBox.Text = Coin.DefaultPath.ToString(); defaultPathTextBox.MaxLength = 1; defaultPathTextBox.TextChanged += new System.EventHandler(this.CoinControlChanged); coinPanel.Controls.Add( defaultPathTextBox ); // // NoSentTextBox0 // System.Windows.Forms.TextBox noSentTextBox = new TextBox(); noSentTextBox.ReadOnly = true; noSentTextBox.Location = new System.Drawing.Point(8, 128); noSentTextBox.Name = "NoSentTextBox_" + Index.ToString(); noSentTextBox.Size = new System.Drawing.Size(40, 22); noSentTextBox.TabIndex = 5; noSentTextBox.Text = Coin.PathCount.ToString(); coinPanel.Controls.Add( noSentTextBox ); // // LevelTextBox0 // System.Windows.Forms.TextBox levelTextBox = new TextBox(); levelTextBox.Location = new System.Drawing.Point(8, 152); levelTextBox.Name = "LevelTextBox_" + Index.ToString(); levelTextBox.Size = new System.Drawing.Size(40, 22); levelTextBox.TabIndex = 6; levelTextBox.Text = Coin.PathSwitchLevel.ToString(); levelTextBox.TextChanged += new System.EventHandler(this.CoinControlChanged); coinPanel.Controls.Add( levelTextBox ); // // EscrowTextBox0 // System.Windows.Forms.TextBox escrowTextBox = new TextBox(); escrowTextBox.ReadOnly = true; escrowTextBox.Location = new System.Drawing.Point(8, 184); escrowTextBox.Name = "EscrowTextBox_" + Index.ToString(); escrowTextBox.Size = new System.Drawing.Size(40, 22); escrowTextBox.TabIndex = 7; escrowTextBox.Text = Coin.HeldInEscrow.ToString(); coinPanel.Controls.Add( escrowTextBox ); // // InhibitCheckBox0 // System.Windows.Forms.CheckBox inhibitCheckBox = new CheckBox(); inhibitCheckBox.Location = new System.Drawing.Point(16, 216); inhibitCheckBox.Name = "InhibitCheckBox_" + Index.ToString(); inhibitCheckBox.Size = new System.Drawing.Size(16, 16); inhibitCheckBox.TabIndex = 8; inhibitCheckBox.Checked = (Coin.Inhibit != 0); inhibitCheckBox.CheckedChanged += new System.EventHandler(this.CoinControlChanged); coinPanel.Controls.Add( inhibitCheckBox ); coinPanel.BringToFront(); }
public bool ReadDetails() { return(AESImhei.ReadAcceptorDetails(this.number, this)); }
public void SetKey(Byte[] Key) { AESImhei.DESSetKey(Key); }
public void Print(BarcodeTicket Ticket) { AESImhei.BarcodePrint(Ticket); }
public void LockClear() { AESImhei.DESLockClear(); }
public void Enable() { AESImhei.BarcodeEnable(); }
private void UpdateCoinPanel(int Index, AESImhei.AcceptorCoin Coin) { foreach( System.Windows.Forms.Control coinControl in this.AcceptorPanel.Controls) { if( coinControl.Name == "CoinPanel" + Index.ToString()) { foreach( System.Windows.Forms.Control control in coinControl.Controls) { string[] namePart = control.Name.Split(new char[]{'_'}); switch( namePart[0] ) { case "ValueTextBox": control.Text = Coin.Value.ToString(); break; case "DescTextBox": control.Text = Coin.CoinName; break; case "CountTextBox": control.Text = Coin.Count.ToString(); break; case "RoutedPathTextBox": control.Text = Coin.Path.ToString(); break; case "DefaultPathTextBox": control.Text = Coin.DefaultPath.ToString(); break; case "NoSentTextBox": control.Text = Coin.PathCount.ToString(); break; case "LevelTextBox": control.Text = Coin.PathSwitchLevel.ToString(); break; case "EscrowTextBox": control.Text = Coin.HeldInEscrow.ToString(); break; case "InhibitCheckBox": ((System.Windows.Forms.CheckBox)control).Checked = (Coin.Inhibit != 0); break; } } } } }
public void Disable() { AESImhei.BarcodeDisable(); }