I have written an application similar to the Maestro Control Center, but I have hard coded limitations under the Channel Settings and other features that are not necessary for my product. This design is to make it easy for a novice to set and control the servos. I am having trouble understanding the Sequencer and in what order functions should be called i.e. saving, playing back, compiling etc… I can retrieve the script and frames from the registry and load them into a TextBox and ListView.
I understand creating a new Sequence
Private Sub NewSequence(ByVal name As String) If usc IsNot Nothing Then Dim seq As New Sequencer.Sequence(name) end if End Sub
And adding a new Frame
Private Sub AddFrame(ByVal seqIndex As Integer) If usc IsNot Nothing Then Dim targetStr As String = "" Dim f As New Sequencer.Frame Dim us As UscSettings = usc.getUscSettings Dim sStatus(usc.servoCount) As ServoStatus usc.getVariables(sStatus) For i As Integer = 0 To usc.servoCount - 1 Dim p As Integer = sStatus(i).position targetStr = targetStr & p & " " Next f.name = "New Frame" f.length_ms = 500 f.setTargetsFromString(targetStr, usc.servoCount) us.sequences(0).frames.Add(f) Dim itm As New ListViewItem itm.Text = f.name itm.SubItems.Add(f.length_ms) itm.SubItems.Add(f.getTargetsString) lv.Items.Add(itm) End If End Sub
But what do I do next? I would like to be able to save the new Sequence and play it back and send it to the Maestro.
Do you have any sample code that demonstrates the features similar to the Sequence Tab in the Maestro Control Center?
Your help is appreciated.
Thanks, Randy Moore