Jump to content

Kin How Chong

Seeq International Teams
  • Posts

    5
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Kin How Chong

  1. A few weeks ago in Office Hours, a Seeq user asked how to perform iterative calculation in which the next value of the calculation relies on its previous values. This functionality is currently logged as a feature request. In the meantime, users can utilize Seeq Data Lab and push the calculated result from Seeq Data Lab to Seeq Workbench. Let's check out the example below: There are a total of 4 signals, Signal G, Signal H, Signal J, and Signal Y added to Seeq workbench. The aim is to calculate the value of Signal Y, under the selected period. Step 1: Set the start date and end date of the calculation. #Set the start date and end date of calculation startdate = '2023-01-01' enddate = '2023-01-09' Step 2: Set the workbook URL and workbook ID. #Set the workbook URL and workbook ID workbook_url = 'workbook_url' workbook_id = 'workbook_id' Step 3: Retrieve all raw data points for the time interval specified in Step 1 using spy.pull(). #Retrieve all raw data points for the time internal specified in Step 1: data = spy.pull(workbook_url, start = startdate, end = enddate, grid = None) data Step 4: Calculate the value of Signal Y, (Yi = Gi * Y(i-1) + Hi * Ji) #Calculate the value of Signal Y (Yi = Gi * Y(i-1) + Hi * Ji) for n in range(len(data)-1): data['Signal Y'][n+1] = data['Signal G'][n+1] * data['Signal Y'][n] + data['Signal H'][n+1] * data['Signal J'][n+1] data Step 5: Push the calculated value of Signal Y to the source workbook using spy.push(). #Push the calculated result of Signal Y to the source workbook spy.push(data = data[['Signal Y']], workbook = workbook_id)
  2. Hi Javad, It is not possible to update a scalar value directly from the organizer topic. My suggestion is to create an link (for example "Update Scaler") in the organizer topic which will bring the user to the workbench to update the scalar.
  3. There is a typo on the second item to the forth item of the workstep.display_items. The correct way to specify them is self.Signal() instead of self.self.Signal()
  4. Hi Sivaji, You can supply the workbook ID instead of the workbook name in the spy.push() command. The pushed items will be scoped to the supplied workbook ID and no new workbook will be created. For example: spy.push(data,metadata,workbook='workbook ID of Test_Workbook', worksheet='test') I have also replied to your SUP ticket about this same question. Regards, Kin How
  5. While building an asset tree using spy.assets, the display items of a worksheet can be defined under @Asset.Display(). The list below shows the options that can be set for each parameter of the display pane: Color: str = any valid color hex for example #4055a3, #068c45, #9d248f. Line Style: str = {'Solid', 'Short Dash', 'Short Dash-Dot', 'Short Dash-Dot-Dot', 'Dot', 'Long Dash', 'Dash-Dot', 'Long Dash-Dot', 'Long Dash-Dot-Dot'} Line Width: float = {1, 1.5, 2, 2.5, ...9.5, 10} Lane: int = {1, 2, ...} Samples Display: str = {'Line', 'Line and Sample', 'Samples', 'Bars'} Axis Auto Scale: bool Axis Align: str = {'Left', 'Right'} Axis Group: str = {'A', 'B', ...} Axis Max: float Axis Min: float One example of display items set using @Asset.Display(): @Asset.Display() def Bar_Graph (self, metadata, analysis): worksheet = analysis.worksheet('BarGraph') workstep = worksheet.workstep('BarGraph') workstep.display_items = [{ "Item": self.Signal_1(), "Axis Group": "A", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 10, "Samples Display": "Bars", "Color": "#4055A3" }, { "Item": self.self.Signal_2(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Short Dash", "Line Width": 1, "Samples Display": "Line", "Color": "#9D248F" }, { "Item": self.self.Signal_3(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Line and Sample", "Color": "#CE561B" }, { "Item": self.self.Signal_4(), "Axis Group": "C", "Axis Auto Scale": False, "Axis Align": "Right", "Axis Max": 100.5, "Axis Min": 10, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Samples", "Color": "#00A2DD" }] workstep.display_range = {'Start': '2020-06-11T00:00:00', 'End': '2020-07-12T00:00:00'} workstep.view = 'Trend' return workstep
×
×
  • Create New...