Beispiel #1
0
 private void bSyncTimeWithPC_Click(object sender, EventArgs e)
 {
     this.lockDateTimePeaker = true;
     this.clockWrite         = true;
     this.engine.AddWriteItem(0, MemoryType.Clock, Relkon4Protocol.ConvertDate(DateTime.Now), "clock_writing", null, new ProceedingCompleetedDelegate(this.ClockWrited));
     dateTimePicker1_Leave(null, null);
 }
Beispiel #2
0
        //private void button1_Click(object sender, EventArgs e)
        //{
        //    this.lockDateTimePeaker = true;
        //    this.clockWrite = true;
        //    this.engine.AddWriteItem(0, MemoryType.Clock, Relkon37SerialPort.ConvertDate(this.dateTimePicker1.Value), "clock_writing", null, new ProceedingCompleetedDelegate(this.ClockWrited));
        //}

        private void dateTimePicker1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                this.lockDateTimePeaker = true;
                this.clockWrite         = true;
                this.engine.AddWriteItem(0, MemoryType.Clock, Relkon4Protocol.ConvertDate(this.dateTimePicker1.Value), "clock_writing", null, new ProceedingCompleetedDelegate(this.ClockWrited));
            }
        }
Beispiel #3
0
        /// <summary>
        /// Функция, вызывающаяся после считывания времени с контролера
        /// </summary>
        public void ClockReaded(object Sender, byte[] Data, bool Error)
        {
            if (Error)
            {
                return;
            }
            DateTime value = (DateTime)Relkon4Protocol.ConvertDate(Data);

            if (!this.lockDateTimePeaker && value != null)
            {
                this.dateTimePicker1.Value = value;
            }
        }