# HG changeset patch # User StephaneLenclud # Date 1423171707 -3600 # Node ID 7dd1d881c1423d6d86ad079d7fd8f15212f69981 # Parent db9769597834a046a9603e3420390642d5279108 Server: Adding icon support Client: Adding button to switch layout to single text field for testing MDM166AA diff -r db9769597834 -r 7dd1d881c142 Client/MainForm.Designer.cs --- a/Client/MainForm.Designer.cs Thu Feb 05 17:16:44 2015 +0100 +++ b/Client/MainForm.Designer.cs Thu Feb 05 22:28:27 2015 +0100 @@ -28,157 +28,169 @@ /// private void InitializeComponent() { - this.buttonSetText = new System.Windows.Forms.Button(); - this.textBoxTop = new System.Windows.Forms.TextBox(); - this.textBoxBottom = new System.Windows.Forms.TextBox(); - this.buttonAlignRight = new System.Windows.Forms.Button(); - this.buttonAlignCenter = new System.Windows.Forms.Button(); - this.buttonAlignLeft = new System.Windows.Forms.Button(); - this.buttonSetTopText = new System.Windows.Forms.Button(); - this.buttonLayoutUpdate = new System.Windows.Forms.Button(); - this.buttonSetBitmap = new System.Windows.Forms.Button(); - this.buttonBitmapLayout = new System.Windows.Forms.Button(); - this.buttonIndicatorsLayout = new System.Windows.Forms.Button(); - this.buttonUpdateTexts = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // buttonSetText - // - this.buttonSetText.Location = new System.Drawing.Point(13, 132); - this.buttonSetText.Name = "buttonSetText"; - this.buttonSetText.Size = new System.Drawing.Size(75, 23); - this.buttonSetText.TabIndex = 0; - this.buttonSetText.Text = "Set Text"; - this.buttonSetText.UseVisualStyleBackColor = true; - this.buttonSetText.Click += new System.EventHandler(this.buttonSetText_Click); - // - // textBoxTop - // - this.textBoxTop.Location = new System.Drawing.Point(12, 31); - this.textBoxTop.Name = "textBoxTop"; - this.textBoxTop.Size = new System.Drawing.Size(419, 20); - this.textBoxTop.TabIndex = 1; - // - // textBoxBottom - // - this.textBoxBottom.Location = new System.Drawing.Point(12, 57); - this.textBoxBottom.Name = "textBoxBottom"; - this.textBoxBottom.Size = new System.Drawing.Size(419, 20); - this.textBoxBottom.TabIndex = 2; - // - // buttonAlignRight - // - this.buttonAlignRight.Location = new System.Drawing.Point(176, 160); - this.buttonAlignRight.Name = "buttonAlignRight"; - this.buttonAlignRight.Size = new System.Drawing.Size(75, 23); - this.buttonAlignRight.TabIndex = 23; - this.buttonAlignRight.Text = "Align Right"; - this.buttonAlignRight.UseVisualStyleBackColor = true; - this.buttonAlignRight.Click += new System.EventHandler(this.buttonAlignRight_Click); - // - // buttonAlignCenter - // - this.buttonAlignCenter.Location = new System.Drawing.Point(94, 161); - this.buttonAlignCenter.Name = "buttonAlignCenter"; - this.buttonAlignCenter.Size = new System.Drawing.Size(75, 23); - this.buttonAlignCenter.TabIndex = 22; - this.buttonAlignCenter.Text = "Align Center"; - this.buttonAlignCenter.UseVisualStyleBackColor = true; - this.buttonAlignCenter.Click += new System.EventHandler(this.buttonAlignCenter_Click); - // - // buttonAlignLeft - // - this.buttonAlignLeft.Location = new System.Drawing.Point(12, 161); - this.buttonAlignLeft.Name = "buttonAlignLeft"; - this.buttonAlignLeft.Size = new System.Drawing.Size(75, 23); - this.buttonAlignLeft.TabIndex = 21; - this.buttonAlignLeft.Text = "Align Left"; - this.buttonAlignLeft.UseVisualStyleBackColor = true; - this.buttonAlignLeft.Click += new System.EventHandler(this.buttonAlignLeft_Click); - // - // buttonSetTopText - // - this.buttonSetTopText.Location = new System.Drawing.Point(94, 132); - this.buttonSetTopText.Name = "buttonSetTopText"; - this.buttonSetTopText.Size = new System.Drawing.Size(75, 23); - this.buttonSetTopText.TabIndex = 24; - this.buttonSetTopText.Text = "Set Top Text"; - this.buttonSetTopText.UseVisualStyleBackColor = true; - this.buttonSetTopText.Click += new System.EventHandler(this.buttonSetTopText_Click); - // - // buttonLayoutUpdate - // - this.buttonLayoutUpdate.Location = new System.Drawing.Point(176, 131); - this.buttonLayoutUpdate.Name = "buttonLayoutUpdate"; - this.buttonLayoutUpdate.Size = new System.Drawing.Size(75, 23); - this.buttonLayoutUpdate.TabIndex = 25; - this.buttonLayoutUpdate.Text = "Layout 2x2"; - this.buttonLayoutUpdate.UseVisualStyleBackColor = true; - this.buttonLayoutUpdate.Click += new System.EventHandler(this.buttonLayoutUpdate_Click); - // - // buttonSetBitmap - // - this.buttonSetBitmap.Location = new System.Drawing.Point(12, 190); - this.buttonSetBitmap.Name = "buttonSetBitmap"; - this.buttonSetBitmap.Size = new System.Drawing.Size(75, 23); - this.buttonSetBitmap.TabIndex = 26; - this.buttonSetBitmap.Text = "Set Bitmap"; - this.buttonSetBitmap.UseVisualStyleBackColor = true; - this.buttonSetBitmap.Click += new System.EventHandler(this.buttonSetBitmap_Click); - // - // buttonBitmapLayout - // - this.buttonBitmapLayout.Location = new System.Drawing.Point(176, 189); - this.buttonBitmapLayout.Name = "buttonBitmapLayout"; - this.buttonBitmapLayout.Size = new System.Drawing.Size(75, 35); - this.buttonBitmapLayout.TabIndex = 27; - this.buttonBitmapLayout.Text = "Bitmap Layout"; - this.buttonBitmapLayout.UseVisualStyleBackColor = true; - this.buttonBitmapLayout.Click += new System.EventHandler(this.buttonBitmapLayout_Click); - // - // buttonIndicatorsLayout - // - this.buttonIndicatorsLayout.Location = new System.Drawing.Point(94, 189); - this.buttonIndicatorsLayout.Name = "buttonIndicatorsLayout"; - this.buttonIndicatorsLayout.Size = new System.Drawing.Size(75, 35); - this.buttonIndicatorsLayout.TabIndex = 28; - this.buttonIndicatorsLayout.Text = "Indicators Layout "; - this.buttonIndicatorsLayout.UseVisualStyleBackColor = true; - this.buttonIndicatorsLayout.Click += new System.EventHandler(this.buttonIndicatorsLayout_Click); - // - // buttonUpdateTexts - // - this.buttonUpdateTexts.Location = new System.Drawing.Point(257, 189); - this.buttonUpdateTexts.Name = "buttonUpdateTexts"; - this.buttonUpdateTexts.Size = new System.Drawing.Size(75, 35); - this.buttonUpdateTexts.TabIndex = 29; - this.buttonUpdateTexts.Text = "Update Texts"; - this.buttonUpdateTexts.UseVisualStyleBackColor = true; - this.buttonUpdateTexts.Click += new System.EventHandler(this.buttonUpdateTexts_Click); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(443, 252); - this.Controls.Add(this.buttonUpdateTexts); - this.Controls.Add(this.buttonIndicatorsLayout); - this.Controls.Add(this.buttonBitmapLayout); - this.Controls.Add(this.buttonSetBitmap); - this.Controls.Add(this.buttonLayoutUpdate); - this.Controls.Add(this.buttonSetTopText); - this.Controls.Add(this.buttonAlignRight); - this.Controls.Add(this.buttonAlignCenter); - this.Controls.Add(this.buttonAlignLeft); - this.Controls.Add(this.textBoxBottom); - this.Controls.Add(this.textBoxTop); - this.Controls.Add(this.buttonSetText); - this.Name = "MainForm"; - this.Text = "Client"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); - this.Load += new System.EventHandler(this.MainForm_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.buttonSetText = new System.Windows.Forms.Button(); + this.textBoxTop = new System.Windows.Forms.TextBox(); + this.textBoxBottom = new System.Windows.Forms.TextBox(); + this.buttonAlignRight = new System.Windows.Forms.Button(); + this.buttonAlignCenter = new System.Windows.Forms.Button(); + this.buttonAlignLeft = new System.Windows.Forms.Button(); + this.buttonSetTopText = new System.Windows.Forms.Button(); + this.buttonLayoutUpdate = new System.Windows.Forms.Button(); + this.buttonSetBitmap = new System.Windows.Forms.Button(); + this.buttonBitmapLayout = new System.Windows.Forms.Button(); + this.buttonIndicatorsLayout = new System.Windows.Forms.Button(); + this.buttonUpdateTexts = new System.Windows.Forms.Button(); + this.buttonLayoutOneTextField = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonSetText + // + this.buttonSetText.Location = new System.Drawing.Point(13, 132); + this.buttonSetText.Name = "buttonSetText"; + this.buttonSetText.Size = new System.Drawing.Size(75, 23); + this.buttonSetText.TabIndex = 0; + this.buttonSetText.Text = "Set Text"; + this.buttonSetText.UseVisualStyleBackColor = true; + this.buttonSetText.Click += new System.EventHandler(this.buttonSetText_Click); + // + // textBoxTop + // + this.textBoxTop.Location = new System.Drawing.Point(12, 31); + this.textBoxTop.Name = "textBoxTop"; + this.textBoxTop.Size = new System.Drawing.Size(419, 20); + this.textBoxTop.TabIndex = 1; + // + // textBoxBottom + // + this.textBoxBottom.Location = new System.Drawing.Point(12, 57); + this.textBoxBottom.Name = "textBoxBottom"; + this.textBoxBottom.Size = new System.Drawing.Size(419, 20); + this.textBoxBottom.TabIndex = 2; + // + // buttonAlignRight + // + this.buttonAlignRight.Location = new System.Drawing.Point(176, 160); + this.buttonAlignRight.Name = "buttonAlignRight"; + this.buttonAlignRight.Size = new System.Drawing.Size(75, 23); + this.buttonAlignRight.TabIndex = 23; + this.buttonAlignRight.Text = "Align Right"; + this.buttonAlignRight.UseVisualStyleBackColor = true; + this.buttonAlignRight.Click += new System.EventHandler(this.buttonAlignRight_Click); + // + // buttonAlignCenter + // + this.buttonAlignCenter.Location = new System.Drawing.Point(94, 161); + this.buttonAlignCenter.Name = "buttonAlignCenter"; + this.buttonAlignCenter.Size = new System.Drawing.Size(75, 23); + this.buttonAlignCenter.TabIndex = 22; + this.buttonAlignCenter.Text = "Align Center"; + this.buttonAlignCenter.UseVisualStyleBackColor = true; + this.buttonAlignCenter.Click += new System.EventHandler(this.buttonAlignCenter_Click); + // + // buttonAlignLeft + // + this.buttonAlignLeft.Location = new System.Drawing.Point(12, 161); + this.buttonAlignLeft.Name = "buttonAlignLeft"; + this.buttonAlignLeft.Size = new System.Drawing.Size(75, 23); + this.buttonAlignLeft.TabIndex = 21; + this.buttonAlignLeft.Text = "Align Left"; + this.buttonAlignLeft.UseVisualStyleBackColor = true; + this.buttonAlignLeft.Click += new System.EventHandler(this.buttonAlignLeft_Click); + // + // buttonSetTopText + // + this.buttonSetTopText.Location = new System.Drawing.Point(94, 132); + this.buttonSetTopText.Name = "buttonSetTopText"; + this.buttonSetTopText.Size = new System.Drawing.Size(75, 23); + this.buttonSetTopText.TabIndex = 24; + this.buttonSetTopText.Text = "Set Top Text"; + this.buttonSetTopText.UseVisualStyleBackColor = true; + this.buttonSetTopText.Click += new System.EventHandler(this.buttonSetTopText_Click); + // + // buttonLayoutUpdate + // + this.buttonLayoutUpdate.Location = new System.Drawing.Point(176, 131); + this.buttonLayoutUpdate.Name = "buttonLayoutUpdate"; + this.buttonLayoutUpdate.Size = new System.Drawing.Size(75, 23); + this.buttonLayoutUpdate.TabIndex = 25; + this.buttonLayoutUpdate.Text = "Layout 2x2"; + this.buttonLayoutUpdate.UseVisualStyleBackColor = true; + this.buttonLayoutUpdate.Click += new System.EventHandler(this.buttonLayoutUpdate_Click); + // + // buttonSetBitmap + // + this.buttonSetBitmap.Location = new System.Drawing.Point(12, 190); + this.buttonSetBitmap.Name = "buttonSetBitmap"; + this.buttonSetBitmap.Size = new System.Drawing.Size(75, 23); + this.buttonSetBitmap.TabIndex = 26; + this.buttonSetBitmap.Text = "Set Bitmap"; + this.buttonSetBitmap.UseVisualStyleBackColor = true; + this.buttonSetBitmap.Click += new System.EventHandler(this.buttonSetBitmap_Click); + // + // buttonBitmapLayout + // + this.buttonBitmapLayout.Location = new System.Drawing.Point(176, 189); + this.buttonBitmapLayout.Name = "buttonBitmapLayout"; + this.buttonBitmapLayout.Size = new System.Drawing.Size(75, 35); + this.buttonBitmapLayout.TabIndex = 27; + this.buttonBitmapLayout.Text = "Bitmap Layout"; + this.buttonBitmapLayout.UseVisualStyleBackColor = true; + this.buttonBitmapLayout.Click += new System.EventHandler(this.buttonBitmapLayout_Click); + // + // buttonIndicatorsLayout + // + this.buttonIndicatorsLayout.Location = new System.Drawing.Point(94, 189); + this.buttonIndicatorsLayout.Name = "buttonIndicatorsLayout"; + this.buttonIndicatorsLayout.Size = new System.Drawing.Size(75, 35); + this.buttonIndicatorsLayout.TabIndex = 28; + this.buttonIndicatorsLayout.Text = "Indicators Layout "; + this.buttonIndicatorsLayout.UseVisualStyleBackColor = true; + this.buttonIndicatorsLayout.Click += new System.EventHandler(this.buttonIndicatorsLayout_Click); + // + // buttonUpdateTexts + // + this.buttonUpdateTexts.Location = new System.Drawing.Point(257, 189); + this.buttonUpdateTexts.Name = "buttonUpdateTexts"; + this.buttonUpdateTexts.Size = new System.Drawing.Size(75, 35); + this.buttonUpdateTexts.TabIndex = 29; + this.buttonUpdateTexts.Text = "Update Texts"; + this.buttonUpdateTexts.UseVisualStyleBackColor = true; + this.buttonUpdateTexts.Click += new System.EventHandler(this.buttonUpdateTexts_Click); + // + // buttonLayoutOneTextField + // + this.buttonLayoutOneTextField.Location = new System.Drawing.Point(257, 131); + this.buttonLayoutOneTextField.Name = "buttonLayoutOneTextField"; + this.buttonLayoutOneTextField.Size = new System.Drawing.Size(75, 23); + this.buttonLayoutOneTextField.TabIndex = 30; + this.buttonLayoutOneTextField.Text = "Layout 1x1"; + this.buttonLayoutOneTextField.UseVisualStyleBackColor = true; + this.buttonLayoutOneTextField.Click += new System.EventHandler(this.buttonLayoutOneTextField_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(443, 252); + this.Controls.Add(this.buttonLayoutOneTextField); + this.Controls.Add(this.buttonUpdateTexts); + this.Controls.Add(this.buttonIndicatorsLayout); + this.Controls.Add(this.buttonBitmapLayout); + this.Controls.Add(this.buttonSetBitmap); + this.Controls.Add(this.buttonLayoutUpdate); + this.Controls.Add(this.buttonSetTopText); + this.Controls.Add(this.buttonAlignRight); + this.Controls.Add(this.buttonAlignCenter); + this.Controls.Add(this.buttonAlignLeft); + this.Controls.Add(this.textBoxBottom); + this.Controls.Add(this.textBoxTop); + this.Controls.Add(this.buttonSetText); + this.Name = "MainForm"; + this.Text = "Client"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -196,6 +208,7 @@ private System.Windows.Forms.Button buttonBitmapLayout; private System.Windows.Forms.Button buttonIndicatorsLayout; private System.Windows.Forms.Button buttonUpdateTexts; + private System.Windows.Forms.Button buttonLayoutOneTextField; } } diff -r db9769597834 -r 7dd1d881c142 Client/MainForm.cs --- a/Client/MainForm.cs Thu Feb 05 17:16:44 2015 +0100 +++ b/Client/MainForm.cs Thu Feb 05 22:28:27 2015 +0100 @@ -347,5 +347,18 @@ } } + + private void buttonLayoutOneTextField_Click(object sender, EventArgs e) + { + //Set one column two lines layout + TableLayout layout = new TableLayout(1, 1); + iClient.SetLayout(layout); + + //Set our fields + iClient.CreateFields(new DataField[] + { + new DataField(0, textBoxTop.Text, Alignment) + }); + } } } diff -r db9769597834 -r 7dd1d881c142 Server/Display.cs --- a/Server/Display.cs Thu Feb 05 17:16:44 2015 +0100 +++ b/Server/Display.cs Thu Feb 05 22:28:27 2015 +0100 @@ -202,6 +202,76 @@ return CurrentRequest() != TMiniDisplayRequest.EMiniDisplayRequestNone; } + // + public int IconEmailCount() + { + return MiniDisplayIconEmailCount(iDevice); + } + + public void SetIconEmail(int aIndex, int aStatus) + { + MiniDisplaySetIconEmail(iDevice, aIndex, aStatus); + } + + public int IconNetworkCount() + { + return MiniDisplayIconNetworkCount(iDevice); + } + + public void SetIconNetwork(int aIndex, int aStatus) + { + MiniDisplaySetIconNetwork(iDevice, aIndex, aStatus); + } + + public int IconVolumeCount() + { + return MiniDisplayIconVolumeCount(iDevice); + } + + public void SetIconVolume(int aIndex, int aStatus) + { + MiniDisplaySetIconVolume(iDevice, aIndex, aStatus); + } + + public int IconPlayCount() + { + return MiniDisplayIconPlayCount(iDevice); + } + + public void SetIconPlay(int aIndex, int aStatus) + { + MiniDisplaySetIconPlay(iDevice, aIndex, aStatus); + } + + public int IconPauseCount() + { + return MiniDisplayIconPauseCount(iDevice); + } + + public void SetIconPause(int aIndex, int aStatus) + { + MiniDisplaySetIconPause(iDevice, aIndex, aStatus); + } + + public int IconRecordingCount() + { + return MiniDisplayIconRecordingCount(iDevice); + } + + public void SetIconRecording(int aIndex, int aStatus) + { + MiniDisplaySetIconRecording(iDevice, aIndex, aStatus); + } + + public int IconMuteCount() + { + return MiniDisplayIconMuteCount(iDevice); + } + + public void SetIconMute(int aIndex, int aStatus) + { + MiniDisplaySetIconMute(iDevice, aIndex, aStatus); + } public string Vendor() { @@ -347,6 +417,47 @@ [return: MarshalAs(UnmanagedType.I1)] public static extern bool MiniDisplaySupportClock(IntPtr aDevice); + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconNetworkCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconEmailCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconMuteCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconVolumeCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconPlayCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconPauseCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern int MiniDisplayIconRecordingCount(IntPtr aDevice); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconNetwork(IntPtr aDevice, int aIndex, int aStatus); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconEmail(IntPtr aDevice, int aIndex, int aStatus); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconMute(IntPtr aDevice, int aIndex, int aStatus); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconVolume(IntPtr aDevice, int aIndex, int aStatus); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconPlay(IntPtr aDevice, int aIndex, int aStatus); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconPause(IntPtr aDevice, int aIndex, int aStatus); + + [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void MiniDisplaySetIconRecording(IntPtr aDevice, int aIndex, int aStatus); } } diff -r db9769597834 -r 7dd1d881c142 Server/MainForm.cs --- a/Server/MainForm.cs Thu Feb 05 17:16:44 2015 +0100 +++ b/Server/MainForm.cs Thu Feb 05 22:28:27 2015 +0100 @@ -166,6 +166,12 @@ UpdateStatus(); //Initiate asynchronous request iDisplay.RequestFirmwareRevision(); + +#if DEBUG + //Testing icon in debug, no arm done if icon not supported + iDisplay.SetIconRecording(0, 1); +#endif + } /// diff -r db9769597834 -r 7dd1d881c142 Server/SharpDisplayManager.csproj --- a/Server/SharpDisplayManager.csproj Thu Feb 05 17:16:44 2015 +0100 +++ b/Server/SharpDisplayManager.csproj Thu Feb 05 22:28:27 2015 +0100 @@ -31,7 +31,7 @@ true index.htm false - 0 + 1 0.1.2.%2a false true