コード例 #1
0
ファイル: dataHistory.cs プロジェクト: Cougar/HomeAutomation
        public void createHistory(canMessage cm)
        {
            identHistory ih = (identHistory)allIdents[cm.getIdent()];
            if (ih == null) ih = new identHistory(cm.getIdent());

            ih.addData(cm);
            allIdents[cm.getIdent()] = ih;
        }
コード例 #2
0
 public dataHistoryViewer(main m, canMessage cm)
 {
     InitializeComponent();
     this.cm = cm;
     this.m = m;
     lab_status.Text = "Last 0 data for "+cm.getIdent().ToString("X").PadLeft(8,'0')+"h";
     this.Text = cm.getIdent().ToString("X").PadLeft(8, '0') + "h history";
 }
コード例 #3
0
 private void stamp(canMessage cm)
 {
     messageState ms = (messageState)incommingMessages[cm.getIdent()];
     if (ms == null)
     {
         ms = new messageState();
     }
     ms.stamp();
     incommingMessages[cm.getIdent()] = ms;
 }
コード例 #4
0
        public DateTime getTime(canMessage cm)
        {
            messageState ms = (messageState)incommingMessages[cm.getIdent()];

            if (ms == null) return new DateTime();
            return ms.timestamp;
        }
コード例 #5
0
        public int getCount(canMessage cm)
        {
            messageState ms = (messageState)incommingMessages[cm.getIdent()];

            if (ms == null) return 0;
            return ms.count;
        }
コード例 #6
0
 public long getPeriod(canMessage cm)
 {
     messageState ms = (messageState)incommingMessages[cm.getIdent()];
     if (ms == null) return 0;
     return ms.period;
 }
コード例 #7
0
 public void addMessage(canMessage cm)
 {
     allMessages[cm.getIdent()] = cm;
     stamp(cm);
 }
コード例 #8
0
ファイル: addMessage.cs プロジェクト: Cougar/HomeAutomation
 private void loadCm(canMessage cmEdit)
 {
     chk_extended.Checked = cmEdit.getExtended();
     chk_remote_request.Checked = cmEdit.getRemoteRequest();
     txt_period.Text = m.mtOut.getPeriod(cmEdit).ToString();
     uint ident = cmEdit.getIdent();
     data_length.Value = cmEdit.getDataLength();
     byte[] data = cmEdit.getData();
     for (int i = 0; i < 4; i++)
     {
         uint er = (ident >> (8 * i));
         byte b = ((byte)(er&0x000000FF));
         idBoxes[i].Text = b.ToString("X").PadLeft(2, '0');
     }
     for (int i = 0; i < 8; i++) dataBoxes[i].Text = data[i].ToString("X").PadLeft(2, '0');
 }